From nobody Fri Jun 26 18:14:25 2026 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 F1262C433EF for ; Sun, 20 Feb 2022 22:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245218AbiBTWud convert rfc822-to-8bit (ORCPT ); Sun, 20 Feb 2022 17:50:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbiBTWub (ORCPT ); Sun, 20 Feb 2022 17:50:31 -0500 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 125B6517F8 for ; Sun, 20 Feb 2022 14:50:08 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-81-s1SOI3yWMl6Ze2hN9qQ27Q-1; Sun, 20 Feb 2022 17:50:03 -0500 X-MC-Unique: s1SOI3yWMl6Ze2hN9qQ27Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 026F6801ADB; Sun, 20 Feb 2022 22:50:02 +0000 (UTC) Received: from x1.com (unknown [10.22.16.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id A27961038AC7; Sun, 20 Feb 2022 22:50:00 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, Ingo Molnar , Tom Zanussi Subject: [PATCH] tracing: Dump stacktrace trigger to the corresponding instance Date: Sun, 20 Feb 2022 23:49:57 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi --- 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_event= s_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 =3D data->private_data; + + if (file) + __trace_stack(file->tr, tracing_gen_ctx(), STACK_SKIP); + else + trace_dump_stack(STACK_SKIP); } =20 static void --=20 2.34.1