diff --git a/tools/perf/Documentation/perf-kwork.txt b/tools/perf/Documentation/perf-kwork.txt index 57bd5fa7d5c9..abfdeca2ad39 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 (irq, etc) + List of kwork to profile (irq, softirq, etc) -v:: --verbose:: diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index 2cff7d1fff20..7c00a8fef858 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -37,8 +37,22 @@ static struct kwork_class kwork_irq = { .tp_handlers = irq_tp_handlers, }; +const struct evsel_str_handler softirq_tp_handlers[] = { + { "irq:softirq_raise", NULL, }, + { "irq:softirq_entry", NULL, }, + { "irq:softirq_exit", NULL, }, +}; + +static struct kwork_class kwork_softirq = { + .name = "softirq", + .type = KWORK_CLASS_SOFTIRQ, + .nr_tracepoints = 3, + .tp_handlers = softirq_tp_handlers, +}; + static struct kwork_class *kwork_class_supported_list[KWORK_CLASS_MAX] = { [KWORK_CLASS_IRQ] = &kwork_irq, + [KWORK_CLASS_SOFTIRQ] = &kwork_softirq, }; static void setup_event_list(struct perf_kwork *kwork, @@ -146,7 +160,7 @@ int cmd_kwork(int argc, const char **argv) OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, "dump raw trace in ASCII"), OPT_STRING('k', "kwork", &kwork.event_list_str, "kwork", - "list of kwork to profile (irq, etc)"), + "list of kwork to profile (irq, softirq, etc)"), OPT_BOOLEAN('f', "force", &kwork.force, "don't complain, do it"), OPT_END() }; diff --git a/tools/perf/util/kwork.h b/tools/perf/util/kwork.h index f1d89cb058fc..669a81626cb4 100644 --- a/tools/perf/util/kwork.h +++ b/tools/perf/util/kwork.h @@ -14,6 +14,7 @@ enum kwork_class_type { KWORK_CLASS_IRQ, + KWORK_CLASS_SOFTIRQ, KWORK_CLASS_MAX, };