diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2016-03-14 15:32:43 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-03-14 15:32:43 -0400 |
commit | 1fb72b9b91fb537c32705b2c505c3b2540f9aab2 (patch) | |
tree | c05f0532d63ed4acc5f7cb09e75c0ff80d383704 | |
parent | 77bdcb9b291e6842de79b1d421aacff74283ba02 (diff) | |
download | trace-cmd-1fb72b9b91fb537c32705b2c505c3b2540f9aab2.tar.gz |
kernelshark: Have irq event arrays point to other than NULL
If there are no irq events, the task plots will crash as it will try to
dereference the irq array, which would still be NULL.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-graph.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/trace-graph.c b/trace-graph.c index 0711efdb..745142fc 100644 --- a/trace-graph.c +++ b/trace-graph.c @@ -190,6 +190,8 @@ static void print_time(unsigned long long time) printf("%lu.%06lu", sec, usec); } +static int null_int_array[] = { -1 }; + static void init_event_cache(struct graph_info *ginfo) { ginfo->ftrace_sched_switch_id = -1; @@ -1177,24 +1179,32 @@ trace_graph_check_irq(struct graph_info *ginfo, if (event) enter_id(&ginfo->hard_irq_exit_ids, event->id, &hard_irq_exit_len); + else + ginfo->hard_irq_exit_ids = null_int_array; event = pevent_find_event_by_name(ginfo->pevent, NULL, "irq_handler_entry"); if (event) enter_id(&ginfo->hard_irq_entry_ids, event->id, &hard_irq_entry_len); + else + ginfo->hard_irq_entry_ids = null_int_array; event = pevent_find_event_by_name(ginfo->pevent, NULL, "softirq_exit"); if (event) enter_id(&ginfo->soft_irq_exit_ids, event->id, &soft_irq_exit_len); + else + ginfo->soft_irq_exit_ids = null_int_array; event = pevent_find_event_by_name(ginfo->pevent, NULL, "softirq_entry"); if (event) enter_id(&ginfo->soft_irq_entry_ids, event->id, &soft_irq_entry_len); + else + ginfo->soft_irq_entry_ids = null_int_array; events = pevent_list_events(ginfo->pevent, EVENT_SORT_SYSTEM); |