Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3115268pxm; Mon, 28 Feb 2022 12:20:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzue7jc4ApRmnFCyJrvVLBq6T12Ju+rzMrpfNtSb5bEgFbx+jVtHLFXvD0PDbtsiRgSRaFB X-Received: by 2002:a05:6a00:a10:b0:4c1:8ad1:81c5 with SMTP id p16-20020a056a000a1000b004c18ad181c5mr23654752pfh.42.1646079610521; Mon, 28 Feb 2022 12:20:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079610; cv=none; d=google.com; s=arc-20160816; b=Ni+8N3wmi5lFoWQcixjVpFskJ0TFFiQKiwN42T50gTpcTh19ACl1vjbQy/9MWO0TM1 KJWHvckTf1KvoC0NTvTc+JbRYIWNBm4SgF3hMYtTaO8KxsLHZopifvuXuHUPeLPDiC1N Emcy9OkuXmDblvz8XUmWoPGurZVi1mOCXfBWqX5IkE05DwSTXpgPAvAadutx5xwG3fW2 bi4OHYwjT3+vAOfGjxm/qVj1X2UjKmTcIGLwSRGZF4qfQ9UeC8lfsPvBKbdKj1TCv7Mq YPa4lxAF+rnv1uRmScwNvwZHaUX3mbFL1dOnBOMC0aL36yiGL+F/89JWUTjdbcdgFoWs U3xg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f3OIncfLrBryZXnpBtPjry1h8lI1pZ7M35ZsmcjgtZE=; b=ZedWiUGi7K0svYLdSxocBW6t1PITdpalf+lZk5R70YZ3oW7L9VSVC+zkgtHwNZjR+Y q/14G2GeLmJDHk+jT8mZnbSmUWDDl26aLVZSqq9oV9K53hDFC74Tr4r5dpFAloSxA/Oo bs9cwqp6XQxXT363+y9ZuE8FMXKQmSPO+tZTi7daILiTrpAwBPh35gkx3AQbrp/2+Sk6 YrRXteoht5Jwq373IprsSfTm/nJPH3jSum7KLmR5XOVvqRpNwtX4tD3u3RM1TPHe+VlU PBbhKVgI2h6r4iewL0rRWO/X2Ns8el15Dst0BC/YtoVod4APecjlpeQSB0fk4XL/5V38 dECg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zq6UhOJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a13-20020a62d40d000000b004e19bd62d8asi10747981pfh.269.2022.02.28.12.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:20:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zq6UhOJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 77A446FA17; Mon, 28 Feb 2022 11:40:24 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241117AbiB1SJa (ORCPT + 99 others); Mon, 28 Feb 2022 13:09:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240742AbiB1SD5 (ORCPT ); Mon, 28 Feb 2022 13:03:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C534D2D1C0; Mon, 28 Feb 2022 09:47:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id ACA4DB815C8; Mon, 28 Feb 2022 17:47:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1423EC340F0; Mon, 28 Feb 2022 17:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070445; bh=yGsnh7E9L/fH8YmBeB2NY1p2xZReP1YIkd/qtKneqIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zq6UhOJpjxJ8gS/17YyphxC7iHXJT0wbZJfJREUMsFRid+jzqA9ivoud2Vnov/S+c jImkXKMKWfvbCrD5UfPzI+F/A23AaXQkCz3rULwnysXRwu1vXz5bEkoKozqOcZSTae NlVPfIB2dvyHyID10g3WUS6nDT8ur5XM0VN81zOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Zanussi , Daniel Bristot de Oliveira , "Steven Rostedt (Google)" Subject: [PATCH 5.16 112/164] tracing: Dump stacktrace trigger to the corresponding instance Date: Mon, 28 Feb 2022 18:24:34 +0100 Message-Id: <20220228172410.556772624@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 From: Daniel Bristot de Oliveira commit ce33c845b030c9cf768370c951bc699470b09fa7 upstream. The stacktrace event trigger is not 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. Link: https://lkml.kernel.org/r/afbb0b4f18ba92c276865bc97204d438473f4ebc.1645396236.git.bristot@kernel.org Cc: stable@vger.kernel.org Fixes: ae63b31e4d0e2 ("tracing: Separate out trace events from global variables") Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events_trigger.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -1200,7 +1200,12 @@ stacktrace_trigger(struct event_trigger_ 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