Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf kwork: Add irq kwork record support

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>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220709015033.38326-3-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Yang Jihong and committed by
Arnaldo Carvalho de Melo
4f8ae962 0f70d8e9

+16 -2
+1 -1
tools/perf/Documentation/perf-kwork.txt
··· 32 32 33 33 -k:: 34 34 --kwork:: 35 - List of kwork to profile 35 + List of kwork to profile (irq, etc) 36 36 37 37 -v:: 38 38 --verbose::
+14 -1
tools/perf/builtin-kwork.c
··· 25 25 #include <linux/time64.h> 26 26 #include <linux/zalloc.h> 27 27 28 + const struct evsel_str_handler irq_tp_handlers[] = { 29 + { "irq:irq_handler_entry", NULL, }, 30 + { "irq:irq_handler_exit", NULL, }, 31 + }; 32 + 33 + static struct kwork_class kwork_irq = { 34 + .name = "irq", 35 + .type = KWORK_CLASS_IRQ, 36 + .nr_tracepoints = 2, 37 + .tp_handlers = irq_tp_handlers, 38 + }; 39 + 28 40 static struct kwork_class *kwork_class_supported_list[KWORK_CLASS_MAX] = { 41 + [KWORK_CLASS_IRQ] = &kwork_irq, 29 42 }; 30 43 31 44 static void setup_event_list(struct perf_kwork *kwork, ··· 146 133 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 147 134 "dump raw trace in ASCII"), 148 135 OPT_STRING('k', "kwork", &kwork.event_list_str, "kwork", 149 - "list of kwork to profile"), 136 + "list of kwork to profile (irq, etc)"), 150 137 OPT_BOOLEAN('f', "force", &kwork.force, "don't complain, do it"), 151 138 OPT_END() 152 139 };
+1
tools/perf/util/kwork.h
··· 13 13 #include <linux/bitmap.h> 14 14 15 15 enum kwork_class_type { 16 + KWORK_CLASS_IRQ, 16 17 KWORK_CLASS_MAX, 17 18 }; 18 19