From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABECBC433EF for ; Mon, 4 Jul 2022 12:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233879AbiGDMcW (ORCPT ); Mon, 4 Jul 2022 08:32:22 -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 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