diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-01-08 12:56:31 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-01-08 12:56:31 -0500 |
| commit | c841456417127e8cc40b088b90b65ac4a6a6769e (patch) | |
| tree | 5d9f7e88add355ab3a089b2413c9d21cdd502b97 | |
| parent | 69624fcc599f5f92960d0f2132df26542b92878e (diff) | |
trace-graph: Fix start and end event info box
The event info box was showing the wrong task if the pointer was before
the first record or after the last.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | trace-graph.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/trace-graph.c b/trace-graph.c index 8204fc9..8676d6a 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
| @@ -901,8 +901,10 @@ static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y) | |||
| 901 | trace_seq_putc(&s, '\n'); | 901 | trace_seq_putc(&s, '\n'); |
| 902 | } else | 902 | } else |
| 903 | trace_seq_printf(&s, "UNKNOW EVENT %d\n", type); | 903 | trace_seq_printf(&s, "UNKNOW EVENT %d\n", type); |
| 904 | } else | 904 | } else { |
| 905 | check_sched_switch(ginfo, record, &pid, &comm); | 905 | if (record->ts < time) |
| 906 | check_sched_switch(ginfo, record, &pid, &comm); | ||
| 907 | } | ||
| 906 | 908 | ||
| 907 | trace_seq_printf(&s, "%lu.%06lu", sec, usec); | 909 | trace_seq_printf(&s, "%lu.%06lu", sec, usec); |
| 908 | if (pid) | 910 | if (pid) |
| @@ -912,8 +914,24 @@ static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y) | |||
| 912 | 914 | ||
| 913 | free_record(record); | 915 | free_record(record); |
| 914 | 916 | ||
| 915 | } else | 917 | } else { |
| 916 | trace_seq_printf(&s, "%lu.%06lu", sec, usec); | 918 | record = tracecmd_read_cpu_last(ginfo->handle, cpu); |
| 919 | if (record->ts < time) { | ||
| 920 | if (!check_sched_switch(ginfo, record, &pid, &comm)) { | ||
| 921 | pid = pevent_data_pid(ginfo->pevent, record); | ||
| 922 | comm = pevent_data_comm_from_pid(ginfo->pevent, pid); | ||
| 923 | } | ||
| 924 | |||
| 925 | trace_seq_printf(&s, "%lu.%06lu", sec, usec); | ||
| 926 | if (pid) | ||
| 927 | trace_seq_printf(&s, " %s-%d", comm, pid); | ||
| 928 | else | ||
| 929 | trace_seq_puts(&s, " <idle>"); | ||
| 930 | |||
| 931 | } else | ||
| 932 | trace_seq_printf(&s, "%lu.%06lu", sec, usec); | ||
| 933 | free_record(record); | ||
| 934 | } | ||
| 917 | 935 | ||
| 918 | trace_seq_putc(&s, 0); | 936 | trace_seq_putc(&s, 0); |
| 919 | 937 | ||
