Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp583794rwe; Thu, 1 Sep 2022 04:49:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5C1BjEb3o1EQ01a6gmf0wkbQg9WtI9ifmBn901HyM9hEN+Rs4tjMjpf05Zch3i5HosEMeW X-Received: by 2002:a17:902:8603:b0:175:5d74:757f with SMTP id f3-20020a170902860300b001755d74757fmr2681581plo.99.1662032983777; Thu, 01 Sep 2022 04:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662032983; cv=none; d=google.com; s=arc-20160816; b=hDXdAtUEsi4F63vEo4VDEQ/U6qZhjNWRGQj6DPRoyEpwykTwByVciV5FgwJdC2cLNV Vg+lXHFfvo3y47Z8p4iFQ/mqtM04Q2/fAv/24VSrEAc44i0+hWM9vm3ggDcF7PyTbIiY HlMtit1t0r3CtSyerkAyMkXmEb1sK6418aOKb7440F/+WLaT2dRSrW4HWI7ZWbuwEHBT RJC6M6JB+2gmp4mqMDOQNskY5x2zGCtJcMsvi1e8zksx2rqzBzZjESj5J/aZ15pyXWHB GKX6F6F6mPvHWZD9YpyA91MlgLE6euMuIjYl7/7ATFwisEbo0tab+A3w2tFy+WbxC0cF BZ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=oGGG0JZbFqpaE7Kp9cMapTezsb1tP3HuObRriBkn3mU=; b=o1gQ9lyRqEsKjLs8HquDX+zdEH40KS1nRtHK39TJKj2KEEVeXCQZpHiIL6nspnQO2o hVr7LmjkDr+mevf1JH803+K5ltmHnRfbZ7L69WTjPnxwbkhTAwUhJgzlhQOT3QSWeuWi VaOJA6cn7ojxDeRWyasuZP3tV8PqkwJ5/7R2GahG+GJJ5ItdxYgqRFvrfvN1l2HEDetz qvQ3O890WeQqs4ggJxGd5VXoTyYfifeu4q/Z9sMDCnye0OA+gaUb8lEH3I0Cuv7FT//G k6P2ih/5i6GlwBJN9QOoYNFbewA8HpBYLoF94z7OjyMgz5w9DNILuzb/Tq6G88HGigTZ K3Dg== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a63600c000000b0041c26cf5db7si1878417pgb.689.2022.09.01.04.49.32; Thu, 01 Sep 2022 04:49:43 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbiIAKtU (ORCPT + 99 others); Thu, 1 Sep 2022 06:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbiIAKtN (ORCPT ); Thu, 1 Sep 2022 06:49:13 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34B8D11EB7F for ; Thu, 1 Sep 2022 03:49:12 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MJHjn4GCFzYcys; Thu, 1 Sep 2022 18:44:45 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 1 Sep 2022 18:49:10 +0800 Received: from huawei.com (10.67.175.41) by dggpemm500016.china.huawei.com (7.185.36.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 1 Sep 2022 18:49:10 +0800 From: Yipeng Zou To: , , , , , , CC: , , Subject: [PATCH 2/2] riscv: tracing: Improve hardirq tracing message Date: Thu, 1 Sep 2022 18:45:15 +0800 Message-ID: <20220901104515.135162-3-zouyipeng@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220901104515.135162-1-zouyipeng@huawei.com> References: <20220901104515.135162-1-zouyipeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.41] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 Use trace_hardirqs_on_caller to improve irq_tracing message. lockdep log in riscv showing the last {enabled,disabled} at __trace_hardirqs_{on,off} all the time(if called by). But that's not what we want to see, the caller is what we want. Before this commit: [ 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 this commit [ 53.781428] hardirqs last enabled at (2595): restore_all+0xe/0x66 [ 53.782185] hardirqs last disabled at (2596): ret_from_exception+0xa/0x10 Signed-off-by: Yipeng Zou --- arch/riscv/kernel/trace_irq.c | 4 ++-- include/linux/irqflags.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/trace_irq.c b/arch/riscv/kernel/trace_irq.c index 095ac976d7da..7ca24b26e19f 100644 --- a/arch/riscv/kernel/trace_irq.c +++ b/arch/riscv/kernel/trace_irq.c @@ -16,12 +16,12 @@ void __trace_hardirqs_on(void) { - trace_hardirqs_on(); + trace_hardirqs_on_caller(CALLER_ADDR0); } NOKPROBE_SYMBOL(__trace_hardirqs_on); void __trace_hardirqs_off(void) { - trace_hardirqs_off(); + trace_hardirqs_off_caller(CALLER_ADDR0); } NOKPROBE_SYMBOL(__trace_hardirqs_off); diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index 5ec0fa71399e..46774fa85cde 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h @@ -53,6 +53,8 @@ extern void trace_hardirqs_on_prepare(void); extern void trace_hardirqs_off_finish(void); extern void trace_hardirqs_on(void); extern void trace_hardirqs_off(void); +extern void trace_hardirqs_on_caller(unsigned long caller_addr); +extern void trace_hardirqs_off_caller(unsigned long caller_addr); # define lockdep_hardirq_context() (raw_cpu_read(hardirq_context)) # define lockdep_softirq_context(p) ((p)->softirq_context) -- 2.17.1