diff options
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-python.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 0b2a48783172..acb9795286c4 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <string.h> | 26 | #include <string.h> |
27 | #include <ctype.h> | ||
28 | #include <errno.h> | 27 | #include <errno.h> |
29 | 28 | ||
30 | #include "../../perf.h" | 29 | #include "../../perf.h" |
@@ -38,7 +37,7 @@ PyMODINIT_FUNC initperf_trace_context(void); | |||
38 | #define FTRACE_MAX_EVENT \ | 37 | #define FTRACE_MAX_EVENT \ |
39 | ((1 << (sizeof(unsigned short) * 8)) - 1) | 38 | ((1 << (sizeof(unsigned short) * 8)) - 1) |
40 | 39 | ||
41 | struct event *events[FTRACE_MAX_EVENT]; | 40 | struct event_format *events[FTRACE_MAX_EVENT]; |
42 | 41 | ||
43 | #define MAX_FIELDS 64 | 42 | #define MAX_FIELDS 64 |
44 | #define N_COMMON_FIELDS 7 | 43 | #define N_COMMON_FIELDS 7 |
@@ -137,7 +136,7 @@ static void define_field(enum print_arg_type field_type, | |||
137 | Py_DECREF(t); | 136 | Py_DECREF(t); |
138 | } | 137 | } |
139 | 138 | ||
140 | static void define_event_symbols(struct event *event, | 139 | static void define_event_symbols(struct event_format *event, |
141 | const char *ev_name, | 140 | const char *ev_name, |
142 | struct print_arg *args) | 141 | struct print_arg *args) |
143 | { | 142 | { |
@@ -179,6 +178,10 @@ static void define_event_symbols(struct event *event, | |||
179 | define_event_symbols(event, ev_name, args->op.right); | 178 | define_event_symbols(event, ev_name, args->op.right); |
180 | break; | 179 | break; |
181 | default: | 180 | default: |
181 | /* gcc warns for these? */ | ||
182 | case PRINT_BSTRING: | ||
183 | case PRINT_DYNAMIC_ARRAY: | ||
184 | case PRINT_FUNC: | ||
182 | /* we should warn... */ | 185 | /* we should warn... */ |
183 | return; | 186 | return; |
184 | } | 187 | } |
@@ -187,10 +190,10 @@ static void define_event_symbols(struct event *event, | |||
187 | define_event_symbols(event, ev_name, args->next); | 190 | define_event_symbols(event, ev_name, args->next); |
188 | } | 191 | } |
189 | 192 | ||
190 | static inline struct event *find_cache_event(int type) | 193 | static inline struct event_format *find_cache_event(int type) |
191 | { | 194 | { |
192 | static char ev_name[256]; | 195 | static char ev_name[256]; |
193 | struct event *event; | 196 | struct event_format *event; |
194 | 197 | ||
195 | if (events[type]) | 198 | if (events[type]) |
196 | return events[type]; | 199 | return events[type]; |
@@ -217,7 +220,7 @@ static void python_process_event(union perf_event *pevent __unused, | |||
217 | struct format_field *field; | 220 | struct format_field *field; |
218 | unsigned long long val; | 221 | unsigned long long val; |
219 | unsigned long s, ns; | 222 | unsigned long s, ns; |
220 | struct event *event; | 223 | struct event_format *event; |
221 | unsigned n = 0; | 224 | unsigned n = 0; |
222 | int type; | 225 | int type; |
223 | int pid; | 226 | int pid; |
@@ -437,7 +440,7 @@ out: | |||
437 | 440 | ||
438 | static int python_generate_script(const char *outfile) | 441 | static int python_generate_script(const char *outfile) |
439 | { | 442 | { |
440 | struct event *event = NULL; | 443 | struct event_format *event = NULL; |
441 | struct format_field *f; | 444 | struct format_field *f; |
442 | char fname[PATH_MAX]; | 445 | char fname[PATH_MAX]; |
443 | int not_first, count; | 446 | int not_first, count; |