diff options
Diffstat (limited to 'tools/lib/traceevent/plugin_function.c')
-rw-r--r-- | tools/lib/traceevent/plugin_function.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c index 8deb22e69361..87acf9c77948 100644 --- a/tools/lib/traceevent/plugin_function.c +++ b/tools/lib/traceevent/plugin_function.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include "event-utils.h" | 25 | #include "event-utils.h" |
26 | 26 | ||
27 | static struct func_stack { | 27 | static struct func_stack { |
28 | int index; | ||
29 | int size; | 28 | int size; |
30 | char **stack; | 29 | char **stack; |
31 | } *fstack; | 30 | } *fstack; |
@@ -57,7 +56,7 @@ static void add_child(struct func_stack *stack, const char *child, int pos) | |||
57 | stack->stack[pos] = strdup(child); | 56 | stack->stack[pos] = strdup(child); |
58 | } | 57 | } |
59 | 58 | ||
60 | static int get_index(const char *parent, const char *child, int cpu) | 59 | static int add_and_get_index(const char *parent, const char *child, int cpu) |
61 | { | 60 | { |
62 | int i; | 61 | int i; |
63 | 62 | ||
@@ -97,7 +96,7 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record, | |||
97 | unsigned long long pfunction; | 96 | unsigned long long pfunction; |
98 | const char *func; | 97 | const char *func; |
99 | const char *parent; | 98 | const char *parent; |
100 | int i, index; | 99 | int index; |
101 | 100 | ||
102 | if (pevent_get_field_val(s, event, "ip", record, &function, 1)) | 101 | if (pevent_get_field_val(s, event, "ip", record, &function, 1)) |
103 | return trace_seq_putc(s, '!'); | 102 | return trace_seq_putc(s, '!'); |
@@ -109,10 +108,9 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record, | |||
109 | 108 | ||
110 | parent = pevent_find_function(pevent, pfunction); | 109 | parent = pevent_find_function(pevent, pfunction); |
111 | 110 | ||
112 | index = get_index(parent, func, record->cpu); | 111 | index = add_and_get_index(parent, func, record->cpu); |
113 | 112 | ||
114 | for (i = 0; i < index; i++) | 113 | trace_seq_printf(s, "%*s", index*3, ""); |
115 | trace_seq_printf(s, " "); | ||
116 | 114 | ||
117 | if (func) | 115 | if (func) |
118 | trace_seq_printf(s, "%s", func); | 116 | trace_seq_printf(s, "%s", func); |