Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp89137imw; Mon, 4 Jul 2022 05:48:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1srWlC3PM9ponWm57n3wgLJpRUmZ45NGlVBJY760rUgn/oik9IEMdCGzS2kLFHnQy9a4K8Q X-Received: by 2002:a05:6402:1e93:b0:435:7f3f:407f with SMTP id f19-20020a0564021e9300b004357f3f407fmr39330050edf.173.1656938932373; Mon, 04 Jul 2022 05:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656938932; cv=none; d=google.com; s=arc-20160816; b=V1MZqUsBebNRL7GBF+piqReH2whd2K7m1TiIcXCRq4QrJRJroLrrDDQfCo9JRTQbzx ybNY61Bv3zvm1ZytS6W0nYBNEy0exydDWrLJo5eHznWf3JEOMv/yBHnHHLZM/Ob010tn hhQ2tBRZDAJSYGYECWtcvLOaC9cmtgjSNHLjd8YXAktDaPvrr1GdxSYqrgYVQguIy7IF AaYTDnkjfsKhAx5x+KenI6i1IcMRgIDL9WXFUAN23aYDdBybPtsVU1caUfmmdscQqK2t wJNjHjefp8af1kwf26tdcmGuBvmKRhp/DHHbnwvUdRyVUL/alnOFHCl+UIrVLqsu0oL8 FTQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=/aVghKThxC7vfkel6f6HP8hmWL3YbTk112OS+7ozMbQ=; b=lNP/Q5LjJXPKPEZh7elSkj1pKozstvOwhqJGvJ3iedpUk0Uxo+DrobsTtQzm1czX/O a72gwd69LEGaYsW6Wr5oDKbqInVlHypUrUsRuXrzOAdycVX9e9KO0pLGzHf2uaG+0Uy7 MjGD9EwE9a7pnxjQuQ1WVWt4JDGLGEyH8dRx5Wu/pI0/fwaGaHATF6vwoBEj6xEtBGkx Lplua2py0op2lUhvu2bCUr8tNp7jm4Rg3zYRnKCkYz6L0YYDd8gPPEZ5KyjcPaTbFH7B B5QMmJAQHCoHRjYfl1HXQR7sXMgvKxROfNiJ9QpCFQQ4w6lJZmJnFGWTd2fsyaj+p6Sl 6Rug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iKJ2klxw; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wl17-20020a170907311100b006fef872f3c4si17649203ejb.182.2022.07.04.05.48.26; Mon, 04 Jul 2022 05:48:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iKJ2klxw; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233494AbiGDMcU (ORCPT + 99 others); Mon, 4 Jul 2022 08:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233220AbiGDMcS (ORCPT ); Mon, 4 Jul 2022 08:32:18 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B567C26CF for ; Mon, 4 Jul 2022 05:32:17 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 757871FA15; Mon, 4 Jul 2022 12:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1656937936; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/aVghKThxC7vfkel6f6HP8hmWL3YbTk112OS+7ozMbQ=; b=iKJ2klxw3Jcj6S9I7USNrwcYmy95tLEMl3LcNZtppLLsAj7WWD48cdzBao/96v06Wlro66 yj2+nV+uqPu1HqYxjnPy3rzF9D84XZX6HoBNNmjCdUdcW3C2ecG8NdaO177CTbXhcW0LzM yNtVSWKTOR/+qMHpO/pEUpD9hVP+zxA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1656937936; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/aVghKThxC7vfkel6f6HP8hmWL3YbTk112OS+7ozMbQ=; b=vqCqFERLIKu7iz/PlKLUpIFui45QK4wbJceCv60MIsHBoV5DytmD6XwH1dixKCqGR70IGF HMXbrPYqVrY7UIAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4D0A31342C; Mon, 4 Jul 2022 12:32:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ku0JEtDdwmL1LQAAMHmgww (envelope-from ); Mon, 04 Jul 2022 12:32:16 +0000 Date: Mon, 04 Jul 2022 14:32:15 +0200 Message-ID: <871qv1ys6o.wl-tiwai@suse.de> From: Takashi Iwai To: Steven Rostedt Cc: LKML , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Subject: Re: PATCH] tracing: ALSA: hda: Remove string manipulation out of the fast path In-Reply-To: <20220703110605.07a86fb2@rorschach.local.home> References: <20220703110605.07a86fb2@rorschach.local.home> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 03 Jul 2022 17:06:05 +0200, Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > The TRACE_EVENT() macro is broken up into various parts to be efficient. > The TP_fast_assign() is just to record the event into the ring buffer, and > is to be done as fast as possible as this occurs during the actual running > of the code. The slower this is, the slower the code that is being traced > becomes. > > The TP_printk() is processed when reading the tracing buffer. This is > considered the slow path. Any processing that can be moved from the > TP_fast_assign() to the TP_printk() should do so. > > For some reason, the entire string processing of the trace events > hda_send_cmd, hda_get_response, and hda_unsol_event was moved from the > TP_printk() into the TP_fast_assign(). On top of that, the > __dynamic_array() was used with a fixed size of HDAC_MSG_MAX, which is > useless as a dynamic_array as it will always allocate HDAC_MSG_MAX bytes > on the ring buffer and even save that amount into the event (as it expects > the size to be dynamic, which using a fixed size defeats that purpose). > > Instead, just save the necessary elements in the TP_fast_assign() and do > the string manipulation in the slow path. > > The output should be the same. > > Cc: Jaroslav Kysela > Cc: Takashi Iwai > Cc: alsa-devel@alsa-project.org > Signed-off-by: Steven Rostedt (Google) Thanks, applied now to for-next branch. Takashi