diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-12-02 22:28:47 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-02 22:28:47 -0500 |
commit | 7b556d9f717b8bba337e6772d5530547278a1a6f (patch) | |
tree | 461b9596a39b8b73b97b4af69d695a42ce09dc21 | |
parent | aed1ae46b1db28c5b4e8054b5c55c281f7ea426e (diff) |
Space out events more evenly
The data for the events in the output looks better if most of them
are lined up in a column.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | parse-events.c | 7 | ||||
-rw-r--r-- | trace-ftrace.c | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/parse-events.c b/parse-events.c index 7fad6eb..8a59433 100644 --- a/parse-events.c +++ b/parse-events.c | |||
@@ -2921,12 +2921,14 @@ void pevent_event_info(struct trace_seq *s, struct event *event, | |||
2921 | void pevent_print_event(struct trace_seq *s, | 2921 | void pevent_print_event(struct trace_seq *s, |
2922 | int cpu, void *data, int size, unsigned long long nsecs) | 2922 | int cpu, void *data, int size, unsigned long long nsecs) |
2923 | { | 2923 | { |
2924 | static char *spaces = " "; /* 20 spaces */ | ||
2924 | struct event *event; | 2925 | struct event *event; |
2925 | unsigned long secs; | 2926 | unsigned long secs; |
2926 | unsigned long usecs; | 2927 | unsigned long usecs; |
2927 | const char *comm; | 2928 | const char *comm; |
2928 | int type; | 2929 | int type; |
2929 | int pid; | 2930 | int pid; |
2931 | int len; | ||
2930 | 2932 | ||
2931 | secs = nsecs / NSECS_PER_SEC; | 2933 | secs = nsecs / NSECS_PER_SEC; |
2932 | usecs = nsecs - secs * NSECS_PER_SEC; | 2934 | usecs = nsecs - secs * NSECS_PER_SEC; |
@@ -2952,6 +2954,11 @@ void pevent_print_event(struct trace_seq *s, | |||
2952 | 2954 | ||
2953 | trace_seq_printf(s, " %5lu.%06lu: %s: ", secs, usecs, event->name); | 2955 | trace_seq_printf(s, " %5lu.%06lu: %s: ", secs, usecs, event->name); |
2954 | 2956 | ||
2957 | /* Space out the event names evenly. */ | ||
2958 | len = strlen(event->name); | ||
2959 | if (len < 20) | ||
2960 | trace_seq_printf(s, "%.*s", 20 - len, spaces); | ||
2961 | |||
2955 | if (event->handler) | 2962 | if (event->handler) |
2956 | event->handler(s, data, size, event, cpu, nsecs); | 2963 | event->handler(s, data, size, event, cpu, nsecs); |
2957 | else | 2964 | else |
diff --git a/trace-ftrace.c b/trace-ftrace.c index 2a6c227..e6f7aa5 100644 --- a/trace-ftrace.c +++ b/trace-ftrace.c | |||
@@ -262,9 +262,6 @@ fgraph_ret_handler(struct trace_seq *s, void *data, int size, | |||
262 | unsigned long long duration, depth; | 262 | unsigned long long duration, depth; |
263 | int i; | 263 | int i; |
264 | 264 | ||
265 | /* Compensate that exit is one char less than entry */ | ||
266 | trace_seq_putc(s, ' '); | ||
267 | |||
268 | if (get_field_val(s, data, event, "rettime", &rettime)) | 265 | if (get_field_val(s, data, event, "rettime", &rettime)) |
269 | return trace_seq_putc(s, '!'); | 266 | return trace_seq_putc(s, '!'); |
270 | 267 | ||