diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-06-22 19:43:13 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-06-22 19:43:13 -0400 |
commit | bda864171078cc6c0165367bc8355ffefc898788 (patch) | |
tree | 8d8f3e3d835dddbcdbcf27995662e62b04948268 | |
parent | a22bfe2431912c8c3a9c839397a600caa4cac115 (diff) |
trace-graph: Test for comm field before using it
The ftrace_comm_field may not be set. Do not use it if
it has not been initialized.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-graph.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trace-graph.c b/trace-graph.c index 04e2439..edd106f 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -1111,7 +1111,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo, | |||
1111 | 1111 | ||
1112 | if (id == ginfo->ftrace_sched_switch_id) { | 1112 | if (id == ginfo->ftrace_sched_switch_id) { |
1113 | pevent_read_number_field(ginfo->ftrace_pid_field, record->data, &val); | 1113 | pevent_read_number_field(ginfo->ftrace_pid_field, record->data, &val); |
1114 | if (comm) | 1114 | if (comm && ginfo->ftrace_comm_field) |
1115 | *comm = record->data + ginfo->ftrace_comm_field->offset; | 1115 | *comm = record->data + ginfo->ftrace_comm_field->offset; |
1116 | if (pid) | 1116 | if (pid) |
1117 | *pid = val; | 1117 | *pid = val; |