Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1707997rwn; Fri, 9 Sep 2022 02:51:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR7X2EoOZLQq3A2elrX4j0BKLxCIe2aF1kwdiuVoqnMFZNB2D/Yh/nJMBZLx5uS2kwNI9fXZ X-Received: by 2002:a17:903:2d1:b0:171:3773:b95 with SMTP id s17-20020a17090302d100b0017137730b95mr12503132plk.173.1662717068686; Fri, 09 Sep 2022 02:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662717068; cv=none; d=google.com; s=arc-20160816; b=sDd2d0WHcJY/MrYEuQ1gRYYvKePHcE/ATJFs14ecA4oZ10FbSBYOCQUEqRX7Ju8YYp wdxAt4PqxInG7ulDfXbURrxwvedIV+2+gO+F9UaT/goIJXNjXt1UdMKH8XVPdeZyyBW0 1knELDdla1MH3BEvkTBThmmmDvChkZcR/2pMQalUv+l4JaoZfvgCFuaLjAFyk4PUzTad ltEZ+rveWcJofF8kWVOPrBdO6QvBO5H5hrKazZzpNJ0bWSfuLXnBuIaytEh4Hw7VFNUT FdztCvSh+8dfSs1icgSuvUcTaR+/rcIUynd6dOHSNcpunQn7VtHlBTJXM2asDnt7yWTY m6hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=TT2y+Y2wbcXrGzN/xqTirQTjyIgr/ezKyUDDB/spOu0=; b=g9ma7OG5ucEcACLHssvJMTyt/neYD+fJIVgY7g1ECTEe3sPDOguHpB+jP4rJBd0NdL byEADQq4c/Ua35sFm+EYOLLFzZ5RTgEpjwaxiNIZJMHnaojBqPdQvb8d4qHzY7Bk8n2p kh3ppR+tVxuyWfgoanfVUX5wUNom+TRTjZLy3XM+9RH3Thj1ooxc1TrPXHfgW+TI+8bH SfuA+ceBgoeesr1KAHgqj5heA4ojwsrh/X/yMy9OC1tR/+yMPqDG1vcfqG2mERhkPZCq OnrGeXoe0EilJiHmJAy1xjiuO1hbZrTk4VdvvqAc8yRu119IlO/jrZ3Cwl36sx/cJAQ1 K07Q== 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 i3-20020a631303000000b0041c033e9f54si37968pgl.848.2022.09.09.02.50.56; Fri, 09 Sep 2022 02:51:08 -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 S231474AbiIIJk1 (ORCPT + 99 others); Fri, 9 Sep 2022 05:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231626AbiIIJkN (ORCPT ); Fri, 9 Sep 2022 05:40:13 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A751F7B797 for ; Fri, 9 Sep 2022 02:40:10 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9rX5PpWznV9y; Fri, 9 Sep 2022 17:37:32 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:40:08 +0800 Received: from [10.67.111.115] (10.67.111.115) 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; Fri, 9 Sep 2022 17:40:08 +0800 Message-ID: <9d070742-8a82-3cb0-cea0-8ecce01c06b6@huawei.com> Date: Fri, 9 Sep 2022 17:40:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH 2/2] riscv: tracing: Improve hardirq tracing message To: , , , , , , CC: , References: <20220901104515.135162-1-zouyipeng@huawei.com> <20220901104515.135162-3-zouyipeng@huawei.com> From: Yipeng Zou In-Reply-To: <20220901104515.135162-3-zouyipeng@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.111.115] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Ping. 在 2022/9/1 18:45, Yipeng Zou 写道: > 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) -- Regards, Yipeng Zou