trace-cmd: Print relate stacktrace at once
PATCH 1/1 trace-cmd: Print relate stacktrace at once
From: Namhyung Kim <[email protected]>
Currently trace-cmd prints ring buffer events in a strict time order. But it sometimes annoying that stacktrace from the same cpu can be intermixed with events from other cpu. This patch looks next event when print last record and prints it also if it's a stacktrace (from the same cpu).
--- trace-read.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
trace-read.c +11 -0
@@ -1155,9 +1155,20 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype } }if (last_record) { +int last_cpu = last_record->cpu; +print_handle_file (last_handle);trace_show_data (last_handle->handle, last_record, profile);free_handle_record (last_handle); + +/* print related stacktrace at once */ + record =tracecmd_peek_data (last_handle->handle, last_cpu); +if (record &&pevent_data_type (pevent, record) == stacktrace_id && +test_stacktrace (last_handle, record,1 )) { +print_handle_file (last_handle); +trace_show_data (last_handle->handle, record, profile); +tracecmd_read_data (last_handle->handle, last_cpu); + } } }while (last_record);
Signature · 1 line
2.6.4
2015-12-21 16:54 GMT+09:00 Namhyung Kim <[email protected]>:
Quoted 10 lines
From: Namhyung Kim <[email protected]>
Currently trace-cmd prints ring buffer events in a strict time order. But it sometimes annoying that stacktrace from the same cpu can be intermixed with events from other cpu. This patch looks next event when print last record and prints it also if it's a stacktrace (from the same cpu).
Requested-by Joonsoo Kim <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
Good Job!
I tested it and it seems that it works well for me.
Thanks!!!