Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1715150pxm; Thu, 24 Feb 2022 08:06:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsfdzMiaJ4hnWtniqlthDDYzIafy7OG4WlwIB29BazM3x1Lwj/j0Hd/CTZtnYAvWjCOeUP X-Received: by 2002:a63:2004:0:b0:375:ed63:ab4c with SMTP id g4-20020a632004000000b00375ed63ab4cmr982447pgg.255.1645718810157; Thu, 24 Feb 2022 08:06:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645718810; cv=none; d=google.com; s=arc-20160816; b=B52KgNIEMwUS2Hv1TPSYUf/cMAVW/jLSlKqMOfumRoeJa5I8rvKsRx8/Fe6EXod+oI l2svCAuVeUppGUyN7jd8TIhc4qt0ybveTZ0lH+tUT/13oe54TB+m3L/bz84NFcY/yuLw GqfpaNTlnbGaQW1GooBm9cqdhNItgw3rpHexy09FXe5OdF0HG5jZkzpjySXSMO/cf3fu cI/Ak4itcF823RBOgSDVO9hMdbC4YOfRWJHw3vo4LaiPA7N2bBzDEDUV2efPnjdK8M7Y +kSKTPZtEz2KMmdAetFgJiehTe0wbYEO02smem578adpR+mWyiXDx4cb+TKCyx5SZ4YE lJTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=FrXrkSxK26LLXmMxgVyhCfE9bBawcUAuzlgNzsVQhYc=; b=XOndol5D9/754TIUW9u3VsdVCm6gnpVGMEM+aJGpvun8ftT+jTqWVx/LcC05gHc1KN uHbh6vU8LdIg5Zs9Ss5QVVPcupmQAFOf6+iY9S21QDJuV387Rcr9jUe9YDSeAQTmXhV0 gBAx9kyXDTX7xM1paiKAwI0blVAjRJbNvO9IgwLIKQWDnZTrnEonSl6GW+ENhuM4Lyn/ LrxmTJYDiudoK049BC1GZNUpMMWRl2KB4ItuRiGKsHqz7ByjTnJwkWeko5OQzsNk/1o8 +bcVFvAQO0z0gLd7IjpBotZnn4KpLLjgZsrvEz2jjLJ00haWPfwVFnsNfpedS91h6nYh gQyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gE4y7mnX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q1si2562616pln.67.2022.02.24.08.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:06:50 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gE4y7mnX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A10C0177747; Thu, 24 Feb 2022 08:03:06 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232717AbiBXPmJ (ORCPT + 99 others); Thu, 24 Feb 2022 10:42:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235022AbiBXPmH (ORCPT ); Thu, 24 Feb 2022 10:42:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E881811A3D for ; Thu, 24 Feb 2022 07:41:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9895A6166E for ; Thu, 24 Feb 2022 15:41:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BA92C340E9; Thu, 24 Feb 2022 15:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645717295; bh=i1VbX+3UHp78QF22K/i1FXekm2wijy/n94jgRTzywT4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=gE4y7mnXWB9mJwph9MNVnivBonLk66Rrr2RS8QVCfdqngOmY65GSLZyIwPF2DcOSF N1AB6gGbLkGyAM3aAySMasgKe3YUoWDNFYcD1u1SyiDQoTXlc4iOpFxR1c0vJOfxmj gUsIKztrxJXcrwq+3d3HAzEhH4k9t/8/yXcJfzYQBVnnr+og4qaqy7bLDkNX12X/kg IoRG2FFGd4Wu5j/sKdVpzIXvKt54WfbPedffMs7ODoObMg6dZATWpmk2YuXj1GLrQU sWk/b6rcjYmmKKsOf66VUAFtJdQmcp+tahXzZX07P5NTTcg4zURtP++uLIJXFyrQz1 TJJRo3xw7a4OA== Message-ID: Subject: Re: [PATCH] tracing: Dump stacktrace trigger to the corresponding instance From: Tom Zanussi To: Daniel Bristot de Oliveira , Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar Date: Thu, 24 Feb 2022 09:41:33 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi Daniel, On Sun, 2022-02-20 at 23:49 +0100, Daniel Bristot de Oliveira wrote: > The stacktrace event trigger is dumping the stacktrace to the > instance > where it was enabled, but to the global "instance." > > Use the private_data, pointing to the trigger file, to figure out the > corresponding trace instance, and use it in the trigger action, like > snapshot_trigger does. > > Cc: Steven Rostedt > Cc: Ingo Molnar > Cc: Tom Zanussi > Signed-off-by: Daniel Bristot de Oliveira > --- > kernel/trace/trace_events_trigger.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_events_trigger.c > b/kernel/trace/trace_events_trigger.c > index d00fee705f9c..e0d50c9577f3 100644 > --- a/kernel/trace/trace_events_trigger.c > +++ b/kernel/trace/trace_events_trigger.c > @@ -1540,7 +1540,12 @@ stacktrace_trigger(struct event_trigger_data > *data, > struct trace_buffer *buffer, void *rec, > struct ring_buffer_event *event) > { > - trace_dump_stack(STACK_SKIP); > + struct trace_event_file *file = data->private_data; > + > + if (file) > + __trace_stack(file->tr, tracing_gen_ctx(), STACK_SKIP); > + else > + trace_dump_stack(STACK_SKIP); > } > > static void Looks good to me. Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Thanks, Tom