lkml.org 
[lkml]   [2022]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v3 02/17] perf kwork: Add irq kwork record support
From
Date
Hello Namhyung,

On 2022/7/28 7:42, Namhyung Kim wrote:
> On Fri, Jul 8, 2022 at 6:53 PM Yang Jihong <yangjihong1@huawei.com> 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 <yangjihong1@huawei.com>
>> ---
>> 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 <linux/time64.h>
>> #include <linux/zalloc.h>
>>
>> +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

\
 
 \ /
  Last update: 2022-07-28 13:52    [W:0.216 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site