Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5079418rwb; Tue, 6 Sep 2022 18:29:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR5yTsdOlmvw9T6euHieCWGm6d4VWzZbS6dHGXoLWflmXv+FxpoJUozFEl95QuZM++/2BSQT X-Received: by 2002:aa7:dd0a:0:b0:44e:a27b:fec with SMTP id i10-20020aa7dd0a000000b0044ea27b0fecmr1050516edv.168.1662514194531; Tue, 06 Sep 2022 18:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662514194; cv=none; d=google.com; s=arc-20160816; b=TULtgqF/KMi0OSFxJroOMkua6f4vE4trlJKcz3RlvMEcYLH5ybLZIrecDxBoykxJtu 1tUJSNpNH3dfe94fxu4kwqNK6jaJbqM95FEtLqC1npE/enfhqZVfFXJaVaW49fp2NOJx j6hSkaucU/tIe0p5MX9/uyukBxmkWXMSa/DMGoXELsIh9f+n8aN5NhJvWaomCQ3xTvGr 4GhzDoZ2y9D8vi1uX6z2ohzwAJmDoTasAIPxYBgmbWMXrrR4WF7ycyFBXkDxudh+dGPI A75xtaAEv0bPV5P5a4F2x02UACSMe1KI2L3g91jPmkmBsOpp0zwTvaCLbnMxQLs/ZC9m 7SHA== 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:message-id:subject:cc:to:from:date; bh=at+349AXdqGIV39eGBOEGME369SPUardmNxhTuGl6/I=; b=yGPVzie30ycQXr6gaRCpHPbrN1OhqBIi2rK3EZAvST10utjYvJNavIIiNtzf66xL00 VdhQVhz/9JQpJaejnuC0Ipqbd+C2LVldFnvTn8Y9jaXgSS0f5lE85QgDLluKuAYY01+v 5y984MGkKIjq8nd6h9lp6613SbgMLRoLVHSbhsCge/XHgfYZQf9jLpQegscEZ77ACCT5 xnQiqJp7eUxgXtINZKoU54qFgOJeSy9rpIV/3SYLbmANTLpeCtZKaREyQ6TzkfdoKEgA PtIPHIbi9kuZfxt2nSwGk6kDw0KifoHrYI29bxJC2mM85eHK35Y8siEq7SjfTzJBFYml n/dg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc8-20020a056402204800b0044e86bdc80dsi5264349edb.171.2022.09.06.18.29.29; Tue, 06 Sep 2022 18:29:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbiIGBLl (ORCPT + 99 others); Tue, 6 Sep 2022 21:11:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbiIGBLj (ORCPT ); Tue, 6 Sep 2022 21:11:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A2F17CAB3 for ; Tue, 6 Sep 2022 18:11:38 -0700 (PDT) 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 E7D3A6173D for ; Wed, 7 Sep 2022 01:11:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 530BFC433D6; Wed, 7 Sep 2022 01:11:36 +0000 (UTC) Date: Tue, 6 Sep 2022 21:12:15 -0400 From: Steven Rostedt To: Yipeng Zou Cc: , , , , , , , , Joel Fernandes Subject: Re: [PATCH 1/2] tracing: hold caller_addr to hardirq_{enable,disable}_ip Message-ID: <20220906211215.0fe6183a@gandalf.local.home> In-Reply-To: <20220901104515.135162-2-zouyipeng@huawei.com> References: <20220901104515.135162-1-zouyipeng@huawei.com> <20220901104515.135162-2-zouyipeng@huawei.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 Thu, 1 Sep 2022 18:45:14 +0800 Yipeng Zou wrote: > Currently, The arguments passing to lockdep_hardirqs_{on,off} was fixed > in CALLER_ADDR0. > The function trace_hardirqs_on_caller should have been intended to use > caller_addr to represent the address that caller wants to be traced. > > For example, lockdep log in riscv showing the last {enabled,disabled} at > __trace_hardirqs_{on,off} all the time(if called by): > [ 57.853175] hardirqs last enabled at (2519): __trace_hardirqs_on+0xc/0x14 > [ 57.853848] hardirqs last disabled at (2520): __trace_hardirqs_off+0xc/0x14 > > After use trace_hardirqs_xx_caller, we can get more effective information: > [ 53.781428] hardirqs last enabled at (2595): restore_all+0xe/0x66 > [ 53.782185] hardirqs last disabled at (2596): ret_from_exception+0xa/0x10 I'm going to mark this as stable and send it in my next push to Linus. I'll also add: Fixes: c3bc8fd637a96 ("tracing: Centralize preemptirq tracepoints and unify their usage") The code was copied from functions that were originally called directly, but now that they are called indirectly, CALLER_ADDR0 is not the right thing to use. Thanks! -- Steve > > Signed-off-by: Yipeng Zou > --- > kernel/trace/trace_preemptirq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/trace_preemptirq.c b/kernel/trace/trace_preemptirq.c > index 95b58bd757ce..1e130da1b742 100644 > --- a/kernel/trace/trace_preemptirq.c > +++ b/kernel/trace/trace_preemptirq.c > @@ -95,14 +95,14 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr) > } > > lockdep_hardirqs_on_prepare(); > - lockdep_hardirqs_on(CALLER_ADDR0); > + lockdep_hardirqs_on(caller_addr); > } > EXPORT_SYMBOL(trace_hardirqs_on_caller); > NOKPROBE_SYMBOL(trace_hardirqs_on_caller); > > __visible void trace_hardirqs_off_caller(unsigned long caller_addr) > { > - lockdep_hardirqs_off(CALLER_ADDR0); > + lockdep_hardirqs_off(caller_addr); > > if (!this_cpu_read(tracing_irq_cpu)) { > this_cpu_write(tracing_irq_cpu, 1);