Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp432797imn; Thu, 28 Jul 2022 05:21:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6wiSpIduR/ENolgMDi7fHwyUWuRofgMAG+j/Mbe9oKQKSQG4Kwnof1bDclj29qQugQ19Y X-Received: by 2002:a05:6402:248f:b0:43a:b89c:20e3 with SMTP id q15-20020a056402248f00b0043ab89c20e3mr27666190eda.335.1659010907025; Thu, 28 Jul 2022 05:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659010907; cv=none; d=google.com; s=arc-20160816; b=uU7jAkgeo2zcQwsMRjJ2ZVuk4bXOPnWgyzGFOdERCjO7Asci5IswrfnnSwBYmSKbav gxM3sEzbzffD+o0ojiB3fKbT0/CX8h0+zTWABvaIhPk+dYPQZjWpU/j+A2XBq4XvaZMD FWwXv/XiCd2RTfhSVctbSNaeX0hDX6IfARi9krBYxps9fEfY8S4ZbE1aX0Jvkym37gJz O+ZyvOJ423NLE9ww/TFglhKZBPU60wyNM8wJLEuyH2h+qNIco4FmIpLN1p1QkYQwh5Ls gLcDLhLJV/d6xj5quynrir4Y/8dzhKv+xC7+q+Y9/6TTiGYc/L4UYRbRxqMqlL4HYEAS KSuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=BxfHFIhTUvHN7Kxw/dEKgOYJ/i8H2EfNaP5Bpvbg500=; b=pyqNaZ2z9bqthDNe4MO0qfaX62AbIFpJRnC3EFBa+4d7CZrxXyW/kYAkRJWxOCc2An gUteP9mlwXF4O4eg0PPM+jSPTUfWkX4ReKbvemq6SfiWFuRxQTST9QhOSBKVC1nYxzUC 7lPXvgpaBObWA0xHbHG4blG5p7pwkeYm3HuFAoFVpPr6vR87kWCKYKnPfvWXrBY6i2PB uW1bli7LNA+A0amT6gCncWk3aHbOK3qhp7G3sJgEI8lfG0y4HwLkyrvl4DNBbogQ4DpI PukU7EJ7ppACYBohZihIkQHE+YGRfGLAlA6xWb7b/dLiDQ3uXi1JdEMDRHU3sbpH82/C DF/Q== 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 z6-20020a17090665c600b007101a8a5b89si453617ejn.943.2022.07.28.05.21.20; Thu, 28 Jul 2022 05:21:47 -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 S232335AbiG1LvK (ORCPT + 99 others); Thu, 28 Jul 2022 07:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236572AbiG1Luu (ORCPT ); Thu, 28 Jul 2022 07:50:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F5F7422E9; Thu, 28 Jul 2022 04:50:48 -0700 (PDT) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LtplZ2ws8zWf1Q; Thu, 28 Jul 2022 19:46:50 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Jul 2022 19:50:45 +0800 Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Jul 2022 19:50:44 +0800 Subject: Re: [RFC v3 02/17] perf kwork: Add irq kwork record support To: Namhyung Kim CC: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , "Paul Clarke" , linux-kernel , linux-perf-users References: <20220709015033.38326-1-yangjihong1@huawei.com> <20220709015033.38326-3-yangjihong1@huawei.com> From: Yang Jihong Message-ID: Date: Thu, 28 Jul 2022 19:50:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 Hello Namhyung, On 2022/7/28 7:42, Namhyung Kim wrote: > On Fri, Jul 8, 2022 at 6:53 PM Yang Jihong wrote: >> >> Record interrupt events irq:irq_handler_entry & irq_handler_exit >> >> Test cases: >> >> # perf kwork record -o perf_kwork.date -- sleep 1 >> [ perf record: Woken up 0 times to write data ] >> [ perf record: Captured and wrote 0.556 MB perf_kwork.date ] >> # >> # perf evlist -i perf_kwork.date >> irq:irq_handler_entry >> irq:irq_handler_exit >> dummy:HG >> # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events >> # >> >> Signed-off-by: Yang Jihong >> --- >> tools/perf/Documentation/perf-kwork.txt | 2 +- >> tools/perf/builtin-kwork.c | 15 ++++++++++++++- >> tools/perf/util/kwork.h | 1 + >> 3 files changed, 16 insertions(+), 2 deletions(-) >> >> diff --git a/tools/perf/Documentation/perf-kwork.txt b/tools/perf/Documentation/perf-kwork.txt >> index dc1e36da57bb..57bd5fa7d5c9 100644 >> --- a/tools/perf/Documentation/perf-kwork.txt >> +++ b/tools/perf/Documentation/perf-kwork.txt >> @@ -32,7 +32,7 @@ OPTIONS >> >> -k:: >> --kwork:: >> - List of kwork to profile >> + List of kwork to profile (irq, etc) >> >> -v:: >> --verbose:: >> diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c >> index f3552c56ede3..a26b7fde1e38 100644 >> --- a/tools/perf/builtin-kwork.c >> +++ b/tools/perf/builtin-kwork.c >> @@ -25,7 +25,20 @@ >> #include >> #include >> >> +const struct evsel_str_handler irq_tp_handlers[] = { >> + { "irq:irq_handler_entry", NULL, }, >> + { "irq:irq_handler_exit", NULL, }, >> +}; >> + >> +static struct kwork_class kwork_irq = { >> + .name = "irq", >> + .type = KWORK_CLASS_IRQ, >> + .nr_tracepoints = 2, > > Nit: I don't think it's gonna change frequently but > it'd be better to use ARRAY_SIZE(irq_tp_handlers) > for future changes. > OK, I'll fix in next patch,thanks for your review. Regards, Jihong