@@ -44,6 +44,7 @@ struct perf_ftrace {
44
44
unsigned long percpu_buffer_size ;
45
45
bool inherit ;
46
46
int func_stack_trace ;
47
+ int func_irq_info ;
47
48
int graph_nosleep_time ;
48
49
int graph_noirqs ;
49
50
};
@@ -209,6 +210,7 @@ static void reset_tracing_options(struct perf_ftrace *ftrace __maybe_unused)
209
210
write_tracing_option_file ("func_stack_trace" , "0" );
210
211
write_tracing_option_file ("sleep-time" , "1" );
211
212
write_tracing_option_file ("funcgraph-irqs" , "1" );
213
+ write_tracing_option_file ("irq-info" , "0" );
212
214
}
213
215
214
216
static int reset_tracing_files (struct perf_ftrace * ftrace __maybe_unused )
@@ -296,6 +298,17 @@ static int set_tracing_func_stack_trace(struct perf_ftrace *ftrace)
296
298
return 0 ;
297
299
}
298
300
301
+ static int set_tracing_func_irqinfo (struct perf_ftrace * ftrace )
302
+ {
303
+ if (!ftrace -> func_irq_info )
304
+ return 0 ;
305
+
306
+ if (write_tracing_option_file ("irq-info" , "1" ) < 0 )
307
+ return -1 ;
308
+
309
+ return 0 ;
310
+ }
311
+
299
312
static int reset_tracing_cpu (void )
300
313
{
301
314
struct perf_cpu_map * cpumap = perf_cpu_map__new (NULL );
@@ -471,6 +484,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
471
484
goto out_reset ;
472
485
}
473
486
487
+ if (set_tracing_func_irqinfo (ftrace ) < 0 ) {
488
+ pr_err ("failed to set tracing option irq-info\n" );
489
+ goto out_reset ;
490
+ }
491
+
474
492
if (set_tracing_filters (ftrace ) < 0 ) {
475
493
pr_err ("failed to set tracing filters\n" );
476
494
goto out_reset ;
@@ -660,6 +678,7 @@ static int parse_func_tracer_opts(const struct option *opt,
660
678
struct perf_ftrace * ftrace = (struct perf_ftrace * ) opt -> value ;
661
679
struct sublevel_option func_tracer_opts [] = {
662
680
{ .name = "call-graph" , .value_ptr = & ftrace -> func_stack_trace },
681
+ { .name = "irq-info" , .value_ptr = & ftrace -> func_irq_info },
663
682
{ .name = NULL , }
664
683
};
665
684
@@ -742,7 +761,7 @@ int cmd_ftrace(int argc, const char **argv)
742
761
OPT_CALLBACK ('N' , "notrace-funcs" , & ftrace .notrace , "func" ,
743
762
"do not trace given functions" , parse_filter_func ),
744
763
OPT_CALLBACK (0 , "func-opts" , & ftrace , "options" ,
745
- "function tracer options, available options: call-graph" ,
764
+ "function tracer options, available options: call-graph,irq-info " ,
746
765
parse_func_tracer_opts ),
747
766
OPT_CALLBACK ('G' , "graph-funcs" , & ftrace .graph_funcs , "func" ,
748
767
"trace given functions using function_graph tracer" ,
0 commit comments