aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-17 22:38:35 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-17 22:38:35 -0500
commit0b9d85ae412ab92c2690523e1ef4314bc7931a68 (patch)
treebc982e16f60192648d01150d4d6da31df5c18b75
parent845c4b74c8ee72771819c4735df6ff5f5f229e8e (diff)
trace-cmd: Rename struct event to struct event_format
Calling the event format parser "struct event" may lead to confusion about if the struct actually represents an instance of an event instead of what it really is: a format descriptor. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--parse-events.c98
-rw-r--r--parse-events.h30
-rw-r--r--plugin_hrtimer.c8
-rw-r--r--plugin_mac80211.c14
-rw-r--r--plugin_sched_switch.c6
-rw-r--r--trace-ftrace.c18
-rw-r--r--trace-read.c4
7 files changed, 89 insertions, 89 deletions
diff --git a/parse-events.c b/parse-events.c
index 818be40..49cde00 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -503,9 +503,9 @@ void pevent_print_printk(struct pevent *pevent)
503 } 503 }
504} 504}
505 505
506static struct event *alloc_event(void) 506static struct event_format *alloc_event(void)
507{ 507{
508 struct event *event; 508 struct event_format *event;
509 509
510 event = malloc_or_die(sizeof(*event)); 510 event = malloc_or_die(sizeof(*event));
511 memset(event, 0, sizeof(*event)); 511 memset(event, 0, sizeof(*event));
@@ -525,7 +525,7 @@ enum event_type {
525 EVENT_SQUOTE, 525 EVENT_SQUOTE,
526}; 526};
527 527
528static void add_event(struct pevent *pevent, struct event *event) 528static void add_event(struct pevent *pevent, struct event_format *event)
529{ 529{
530 event->next = pevent->event_list; 530 event->next = pevent->event_list;
531 pevent->event_list = event; 531 pevent->event_list = event;
@@ -966,7 +966,7 @@ static int field_is_dynamic(struct format_field *field)
966 return 0; 966 return 0;
967} 967}
968 968
969static int event_read_fields(struct event *event, struct format_field **fields) 969static int event_read_fields(struct event_format *event, struct format_field **fields)
970{ 970{
971 struct format_field *field = NULL; 971 struct format_field *field = NULL;
972 enum event_type type; 972 enum event_type type;
@@ -1190,7 +1190,7 @@ fail_expect:
1190 return -1; 1190 return -1;
1191} 1191}
1192 1192
1193static int event_read_format(struct event *event) 1193static int event_read_format(struct event_format *event)
1194{ 1194{
1195 char *token; 1195 char *token;
1196 int ret; 1196 int ret;
@@ -1223,11 +1223,11 @@ static int event_read_format(struct event *event)
1223} 1223}
1224 1224
1225static enum event_type 1225static enum event_type
1226process_arg_token(struct event *event, struct print_arg *arg, 1226process_arg_token(struct event_format *event, struct print_arg *arg,
1227 char **tok, enum event_type type); 1227 char **tok, enum event_type type);
1228 1228
1229static enum event_type 1229static enum event_type
1230process_arg(struct event *event, struct print_arg *arg, char **tok) 1230process_arg(struct event_format *event, struct print_arg *arg, char **tok)
1231{ 1231{
1232 enum event_type type; 1232 enum event_type type;
1233 char *token; 1233 char *token;
@@ -1239,7 +1239,7 @@ process_arg(struct event *event, struct print_arg *arg, char **tok)
1239} 1239}
1240 1240
1241static enum event_type 1241static enum event_type
1242process_cond(struct event *event, struct print_arg *top, char **tok) 1242process_cond(struct event_format *event, struct print_arg *top, char **tok)
1243{ 1243{
1244 struct print_arg *arg, *left, *right; 1244 struct print_arg *arg, *left, *right;
1245 enum event_type type; 1245 enum event_type type;
@@ -1279,7 +1279,7 @@ out_free:
1279} 1279}
1280 1280
1281static enum event_type 1281static enum event_type
1282process_array(struct event *event, struct print_arg *top, char **tok) 1282process_array(struct event_format *event, struct print_arg *top, char **tok)
1283{ 1283{
1284 struct print_arg *arg; 1284 struct print_arg *arg;
1285 enum event_type type; 1285 enum event_type type;
@@ -1372,7 +1372,7 @@ static void set_op_prio(struct print_arg *arg)
1372} 1372}
1373 1373
1374static enum event_type 1374static enum event_type
1375process_op(struct event *event, struct print_arg *arg, char **tok) 1375process_op(struct event_format *event, struct print_arg *arg, char **tok)
1376{ 1376{
1377 struct print_arg *left, *right = NULL; 1377 struct print_arg *left, *right = NULL;
1378 enum event_type type; 1378 enum event_type type;
@@ -1505,7 +1505,7 @@ process_op(struct event *event, struct print_arg *arg, char **tok)
1505} 1505}
1506 1506
1507static enum event_type 1507static enum event_type
1508process_entry(struct event *event __unused, struct print_arg *arg, 1508process_entry(struct event_format *event __unused, struct print_arg *arg,
1509 char **tok) 1509 char **tok)
1510{ 1510{
1511 enum event_type type; 1511 enum event_type type;
@@ -1770,7 +1770,7 @@ static char *arg_eval (struct print_arg *arg)
1770} 1770}
1771 1771
1772static enum event_type 1772static enum event_type
1773process_fields(struct event *event, struct print_flag_sym **list, char **tok) 1773process_fields(struct event_format *event, struct print_flag_sym **list, char **tok)
1774{ 1774{
1775 enum event_type type; 1775 enum event_type type;
1776 struct print_arg *arg = NULL; 1776 struct print_arg *arg = NULL;
@@ -1825,7 +1825,7 @@ out_free:
1825} 1825}
1826 1826
1827static enum event_type 1827static enum event_type
1828process_flags(struct event *event, struct print_arg *arg, char **tok) 1828process_flags(struct event_format *event, struct print_arg *arg, char **tok)
1829{ 1829{
1830 struct print_arg *field; 1830 struct print_arg *field;
1831 enum event_type type; 1831 enum event_type type;
@@ -1868,7 +1868,7 @@ out_free:
1868} 1868}
1869 1869
1870static enum event_type 1870static enum event_type
1871process_symbols(struct event *event, struct print_arg *arg, char **tok) 1871process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
1872{ 1872{
1873 struct print_arg *field; 1873 struct print_arg *field;
1874 enum event_type type; 1874 enum event_type type;
@@ -1902,7 +1902,7 @@ out_free:
1902} 1902}
1903 1903
1904static enum event_type 1904static enum event_type
1905process_dynamic_array(struct event *event, struct print_arg *arg, char **tok) 1905process_dynamic_array(struct event_format *event, struct print_arg *arg, char **tok)
1906{ 1906{
1907 struct format_field *field; 1907 struct format_field *field;
1908 enum event_type type; 1908 enum event_type type;
@@ -1959,7 +1959,7 @@ out_free:
1959} 1959}
1960 1960
1961static enum event_type 1961static enum event_type
1962process_paren(struct event *event, struct print_arg *arg, char **tok) 1962process_paren(struct event_format *event, struct print_arg *arg, char **tok)
1963{ 1963{
1964 struct print_arg *item_arg; 1964 struct print_arg *item_arg;
1965 enum event_type type; 1965 enum event_type type;
@@ -2012,7 +2012,7 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
2012 2012
2013 2013
2014static enum event_type 2014static enum event_type
2015process_str(struct event *event __unused, struct print_arg *arg, char **tok) 2015process_str(struct event_format *event __unused, struct print_arg *arg, char **tok)
2016{ 2016{
2017 enum event_type type; 2017 enum event_type type;
2018 char *token; 2018 char *token;
@@ -2040,7 +2040,7 @@ fail:
2040} 2040}
2041 2041
2042static enum event_type 2042static enum event_type
2043process_arg_token(struct event *event, struct print_arg *arg, 2043process_arg_token(struct event_format *event, struct print_arg *arg,
2044 char **tok, enum event_type type) 2044 char **tok, enum event_type type)
2045{ 2045{
2046 char *token; 2046 char *token;
@@ -2117,7 +2117,7 @@ process_arg_token(struct event *event, struct print_arg *arg,
2117 return type; 2117 return type;
2118} 2118}
2119 2119
2120static int event_read_print_args(struct event *event, struct print_arg **list) 2120static int event_read_print_args(struct event_format *event, struct print_arg **list)
2121{ 2121{
2122 enum event_type type = EVENT_ERROR; 2122 enum event_type type = EVENT_ERROR;
2123 struct print_arg *arg; 2123 struct print_arg *arg;
@@ -2165,7 +2165,7 @@ static int event_read_print_args(struct event *event, struct print_arg **list)
2165 return args; 2165 return args;
2166} 2166}
2167 2167
2168static int event_read_print(struct event *event) 2168static int event_read_print(struct event_format *event)
2169{ 2169{
2170 enum event_type type; 2170 enum event_type type;
2171 char *token; 2171 char *token;
@@ -2233,7 +2233,7 @@ static int event_read_print(struct event *event)
2233 * This only searchs the common fields and not all field. 2233 * This only searchs the common fields and not all field.
2234 */ 2234 */
2235struct format_field * 2235struct format_field *
2236pevent_find_common_field(struct event *event, const char *name) 2236pevent_find_common_field(struct event_format *event, const char *name)
2237{ 2237{
2238 struct format_field *format; 2238 struct format_field *format;
2239 2239
@@ -2255,7 +2255,7 @@ pevent_find_common_field(struct event *event, const char *name)
2255 * This does not search common fields. 2255 * This does not search common fields.
2256 */ 2256 */
2257struct format_field * 2257struct format_field *
2258pevent_find_field(struct event *event, const char *name) 2258pevent_find_field(struct event_format *event, const char *name)
2259{ 2259{
2260 struct format_field *format; 2260 struct format_field *format;
2261 2261
@@ -2278,7 +2278,7 @@ pevent_find_field(struct event *event, const char *name)
2278 * the non-common ones if a common one was not found. 2278 * the non-common ones if a common one was not found.
2279 */ 2279 */
2280struct format_field * 2280struct format_field *
2281pevent_find_any_field(struct event *event, const char *name) 2281pevent_find_any_field(struct event_format *event, const char *name)
2282{ 2282{
2283 struct format_field *format; 2283 struct format_field *format;
2284 2284
@@ -2345,7 +2345,7 @@ int pevent_read_number_field(struct format_field *field, const void *data,
2345static int get_common_info(struct pevent *pevent, 2345static int get_common_info(struct pevent *pevent,
2346 const char *type, int *offset, int *size) 2346 const char *type, int *offset, int *size)
2347{ 2347{
2348 struct event *event; 2348 struct event_format *event;
2349 struct format_field *field; 2349 struct format_field *field;
2350 2350
2351 /* 2351 /*
@@ -2427,9 +2427,9 @@ static int parse_common_lock_depth(struct pevent *pevent, void *data)
2427 * 2427 *
2428 * Returns an event that has a given @id. 2428 * Returns an event that has a given @id.
2429 */ 2429 */
2430struct event *pevent_find_event(struct pevent *pevent, int id) 2430struct event_format *pevent_find_event(struct pevent *pevent, int id)
2431{ 2431{
2432 struct event *event; 2432 struct event_format *event;
2433 2433
2434 for (event = pevent->event_list; event; event = event->next) { 2434 for (event = pevent->event_list; event; event = event->next) {
2435 if (event->id == id) 2435 if (event->id == id)
@@ -2447,11 +2447,11 @@ struct event *pevent_find_event(struct pevent *pevent, int id)
2447 * This returns an event with a given @name and under the system 2447 * This returns an event with a given @name and under the system
2448 * @sys. If @sys is NULL the first event with @name is returned. 2448 * @sys. If @sys is NULL the first event with @name is returned.
2449 */ 2449 */
2450struct event * 2450struct event_format *
2451pevent_find_event_by_name(struct pevent *pevent, 2451pevent_find_event_by_name(struct pevent *pevent,
2452 const char *sys, const char *name) 2452 const char *sys, const char *name)
2453{ 2453{
2454 struct event *event; 2454 struct event_format *event;
2455 2455
2456 for (event = pevent->event_list; event; event = event->next) { 2456 for (event = pevent->event_list; event; event = event->next) {
2457 if (strcmp(event->name, name) == 0) { 2457 if (strcmp(event->name, name) == 0) {
@@ -2465,7 +2465,7 @@ pevent_find_event_by_name(struct pevent *pevent,
2465} 2465}
2466 2466
2467static unsigned long long 2467static unsigned long long
2468eval_num_arg(void *data, int size, struct event *event, struct print_arg *arg) 2468eval_num_arg(void *data, int size, struct event_format *event, struct print_arg *arg)
2469{ 2469{
2470 struct pevent *pevent = event->pevent; 2470 struct pevent *pevent = event->pevent;
2471 unsigned long long val = 0; 2471 unsigned long long val = 0;
@@ -2655,7 +2655,7 @@ static unsigned long long eval_flag(const char *flag)
2655} 2655}
2656 2656
2657static void print_str_arg(struct trace_seq *s, void *data, int size, 2657static void print_str_arg(struct trace_seq *s, void *data, int size,
2658 struct event *event, struct print_arg *arg) 2658 struct event_format *event, struct print_arg *arg)
2659{ 2659{
2660 struct pevent *pevent = event->pevent; 2660 struct pevent *pevent = event->pevent;
2661 struct print_flag_sym *flag; 2661 struct print_flag_sym *flag;
@@ -2761,7 +2761,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
2761 } 2761 }
2762} 2762}
2763 2763
2764static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct event *event) 2764static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct event_format *event)
2765{ 2765{
2766 struct pevent *pevent = event->pevent; 2766 struct pevent *pevent = event->pevent;
2767 struct format_field *field, *ip_field; 2767 struct format_field *field, *ip_field;
@@ -2881,7 +2881,7 @@ static void free_args(struct print_arg *args)
2881} 2881}
2882 2882
2883static char * 2883static char *
2884get_bprint_format(void *data, int size __unused, struct event *event) 2884get_bprint_format(void *data, int size __unused, struct event_format *event)
2885{ 2885{
2886 struct pevent *pevent = event->pevent; 2886 struct pevent *pevent = event->pevent;
2887 unsigned long long addr; 2887 unsigned long long addr;
@@ -2928,7 +2928,7 @@ get_bprint_format(void *data, int size __unused, struct event *event)
2928 return format; 2928 return format;
2929} 2929}
2930 2930
2931static void pretty_print(struct trace_seq *s, void *data, int size, struct event *event) 2931static void pretty_print(struct trace_seq *s, void *data, int size, struct event_format *event)
2932{ 2932{
2933 struct pevent *pevent = event->pevent; 2933 struct pevent *pevent = event->pevent;
2934 struct print_fmt *print_fmt = &event->print_fmt; 2934 struct print_fmt *print_fmt = &event->print_fmt;
@@ -3169,7 +3169,7 @@ int pevent_data_type(struct pevent *pevent, struct record *rec)
3169 * 3169 *
3170 * This returns the event form a given @type; 3170 * This returns the event form a given @type;
3171 */ 3171 */
3172struct event *pevent_data_event_from_type(struct pevent *pevent, int type) 3172struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type)
3173{ 3173{
3174 return pevent_find_event(pevent, type); 3174 return pevent_find_event(pevent, type);
3175} 3175}
@@ -3214,7 +3214,7 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid)
3214 * This parses the raw @data using the given @event information and 3214 * This parses the raw @data using the given @event information and
3215 * writes the print format into the trace_seq. 3215 * writes the print format into the trace_seq.
3216 */ 3216 */
3217void pevent_event_info(struct trace_seq *s, struct event *event, 3217void pevent_event_info(struct trace_seq *s, struct event_format *event,
3218 int cpu, void *data, int size, unsigned long long nsecs) 3218 int cpu, void *data, int size, unsigned long long nsecs)
3219{ 3219{
3220 if (event->handler) 3220 if (event->handler)
@@ -3229,7 +3229,7 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
3229 int cpu, void *data, int size, unsigned long long nsecs) 3229 int cpu, void *data, int size, unsigned long long nsecs)
3230{ 3230{
3231 static char *spaces = " "; /* 20 spaces */ 3231 static char *spaces = " "; /* 20 spaces */
3232 struct event *event; 3232 struct event_format *event;
3233 unsigned long secs; 3233 unsigned long secs;
3234 unsigned long usecs; 3234 unsigned long usecs;
3235 const char *comm; 3235 const char *comm;
@@ -3276,8 +3276,8 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
3276 3276
3277static int events_id_cmp(const void *a, const void *b) 3277static int events_id_cmp(const void *a, const void *b)
3278{ 3278{
3279 struct event * const * ea = a; 3279 struct event_format * const * ea = a;
3280 struct event * const * eb = b; 3280 struct event_format * const * eb = b;
3281 3281
3282 if ((*ea)->id < (*eb)->id) 3282 if ((*ea)->id < (*eb)->id)
3283 return -1; 3283 return -1;
@@ -3290,8 +3290,8 @@ static int events_id_cmp(const void *a, const void *b)
3290 3290
3291static int events_name_cmp(const void *a, const void *b) 3291static int events_name_cmp(const void *a, const void *b)
3292{ 3292{
3293 struct event * const * ea = a; 3293 struct event_format * const * ea = a;
3294 struct event * const * eb = b; 3294 struct event_format * const * eb = b;
3295 int res; 3295 int res;
3296 3296
3297 res = strcmp((*ea)->name, (*eb)->name); 3297 res = strcmp((*ea)->name, (*eb)->name);
@@ -3307,8 +3307,8 @@ static int events_name_cmp(const void *a, const void *b)
3307 3307
3308static int events_system_cmp(const void *a, const void *b) 3308static int events_system_cmp(const void *a, const void *b)
3309{ 3309{
3310 struct event * const * ea = a; 3310 struct event_format * const * ea = a;
3311 struct event * const * eb = b; 3311 struct event_format * const * eb = b;
3312 int res; 3312 int res;
3313 3313
3314 res = strcmp((*ea)->system, (*eb)->system); 3314 res = strcmp((*ea)->system, (*eb)->system);
@@ -3322,10 +3322,10 @@ static int events_system_cmp(const void *a, const void *b)
3322 return events_id_cmp(a, b); 3322 return events_id_cmp(a, b);
3323} 3323}
3324 3324
3325struct event **pevent_list_events(struct pevent *pevent, enum event_sort_type sort_type) 3325struct event_format **pevent_list_events(struct pevent *pevent, enum event_sort_type sort_type)
3326{ 3326{
3327 struct event **events; 3327 struct event_format **events;
3328 struct event *event; 3328 struct event_format *event;
3329 int (*sort)(const void *a, const void *b); 3329 int (*sort)(const void *a, const void *b);
3330 int i = 0; 3330 int i = 0;
3331 3331
@@ -3564,7 +3564,7 @@ int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long siz
3564int pevent_parse_event(struct pevent *pevent, 3564int pevent_parse_event(struct pevent *pevent,
3565 char *buf, unsigned long size, char *sys) 3565 char *buf, unsigned long size, char *sys)
3566{ 3566{
3567 struct event *event; 3567 struct event_format *event;
3568 int ret; 3568 int ret;
3569 3569
3570 init_input_buf(buf, size); 3570 init_input_buf(buf, size);
@@ -3657,7 +3657,7 @@ int pevent_register_event_handler(struct pevent *pevent,
3657 int id, char *sys_name, char *event_name, 3657 int id, char *sys_name, char *event_name,
3658 pevent_event_handler_func func) 3658 pevent_event_handler_func func)
3659{ 3659{
3660 struct event *event; 3660 struct event_format *event;
3661 3661
3662 if (id >= 0) { 3662 if (id >= 0) {
3663 /* search by id */ 3663 /* search by id */
@@ -3701,7 +3701,7 @@ static void free_formats(struct format *format)
3701 /* IMPLEMENT ME */ 3701 /* IMPLEMENT ME */
3702} 3702}
3703 3703
3704static void free_event(struct event *event) 3704static void free_event(struct event_format *event)
3705{ 3705{
3706 free(event->name); 3706 free(event->name);
3707 free(event->system); 3707 free(event->system);
@@ -3718,7 +3718,7 @@ static void free_event(struct event *event)
3718 */ 3718 */
3719void pevent_free(struct pevent *pevent) 3719void pevent_free(struct pevent *pevent)
3720{ 3720{
3721 struct event *event, *next_event; 3721 struct event_format *event, *next_event;
3722 3722
3723 free(pevent->cmdlines); 3723 free(pevent->cmdlines);
3724 free(pevent->cmdlist); 3724 free(pevent->cmdlist);
diff --git a/parse-events.h b/parse-events.h
index 6a2c86c..9b64b9d 100644
--- a/parse-events.h
+++ b/parse-events.h
@@ -58,11 +58,11 @@ extern int trace_seq_do_printf(struct trace_seq *s);
58/* ----------------------- pevent ----------------------- */ 58/* ----------------------- pevent ----------------------- */
59 59
60struct pevent; 60struct pevent;
61struct event; 61struct event_format;
62 62
63typedef int (*pevent_event_handler_func)(struct trace_seq *s, 63typedef int (*pevent_event_handler_func)(struct trace_seq *s,
64 void *data, int size, 64 void *data, int size,
65 struct event *event, int cpu, 65 struct event_format *event, int cpu,
66 unsigned long long nsecs); 66 unsigned long long nsecs);
67 67
68typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 68typedef int (*pevent_plugin_load_func)(struct pevent *pevent);
@@ -84,7 +84,7 @@ enum format_flags {
84 84
85struct format_field { 85struct format_field {
86 struct format_field *next; 86 struct format_field *next;
87 struct event *event; 87 struct event_format *event;
88 char *type; 88 char *type;
89 char *name; 89 char *name;
90 int offset; 90 int offset;
@@ -187,8 +187,8 @@ struct print_fmt {
187 struct print_arg *args; 187 struct print_arg *args;
188}; 188};
189 189
190struct event { 190struct event_format {
191 struct event *next; 191 struct event_format *next;
192 struct pevent *pevent; 192 struct pevent *pevent;
193 char *name; 193 char *name;
194 int id; 194 int id;
@@ -250,9 +250,9 @@ struct pevent {
250 struct printk_list *printklist; 250 struct printk_list *printklist;
251 unsigned int printk_count; 251 unsigned int printk_count;
252 252
253 struct event *event_list; 253 struct event_format *event_list;
254 int nr_events; 254 int nr_events;
255 struct event **events; 255 struct event_format **events;
256 enum event_sort_type last_type; 256 enum event_sort_type last_type;
257 257
258 int type_offset; 258 int type_offset;
@@ -359,30 +359,30 @@ int pevent_parse_event(struct pevent *pevent, char *buf, unsigned long size, cha
359int pevent_register_event_handler(struct pevent *pevent, int id, char *sys_name, char *event_name, 359int pevent_register_event_handler(struct pevent *pevent, int id, char *sys_name, char *event_name,
360 pevent_event_handler_func func); 360 pevent_event_handler_func func);
361 361
362struct format_field *pevent_find_common_field(struct event *event, const char *name); 362struct format_field *pevent_find_common_field(struct event_format *event, const char *name);
363struct format_field *pevent_find_field(struct event *event, const char *name); 363struct format_field *pevent_find_field(struct event_format *event, const char *name);
364struct format_field *pevent_find_any_field(struct event *event, const char *name); 364struct format_field *pevent_find_any_field(struct event_format *event, const char *name);
365 365
366const char *pevent_find_function(struct pevent *pevent, unsigned long long addr); 366const char *pevent_find_function(struct pevent *pevent, unsigned long long addr);
367unsigned long long pevent_read_number(struct pevent *pevent, const void *ptr, int size); 367unsigned long long pevent_read_number(struct pevent *pevent, const void *ptr, int size);
368int pevent_read_number_field(struct format_field *field, const void *data, 368int pevent_read_number_field(struct format_field *field, const void *data,
369 unsigned long long *value); 369 unsigned long long *value);
370 370
371struct event *pevent_find_event(struct pevent *pevent, int id); 371struct event_format *pevent_find_event(struct pevent *pevent, int id);
372 372
373struct event * 373struct event_format *
374pevent_find_event_by_name(struct pevent *pevent, const char *sys, const char *name); 374pevent_find_event_by_name(struct pevent *pevent, const char *sys, const char *name);
375 375
376void pevent_data_lat_fmt(struct pevent *pevent, 376void pevent_data_lat_fmt(struct pevent *pevent,
377 struct trace_seq *s, void *data, int size __unused); 377 struct trace_seq *s, void *data, int size __unused);
378int pevent_data_type(struct pevent *pevent, struct record *rec); 378int pevent_data_type(struct pevent *pevent, struct record *rec);
379struct event *pevent_data_event_from_type(struct pevent *pevent, int type); 379struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type);
380int pevent_data_pid(struct pevent *pevent, struct record *rec); 380int pevent_data_pid(struct pevent *pevent, struct record *rec);
381const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid); 381const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid);
382void pevent_event_info(struct trace_seq *s, struct event *event, 382void pevent_event_info(struct trace_seq *s, struct event_format *event,
383 int cpu, void *data, int size, unsigned long long nsecs); 383 int cpu, void *data, int size, unsigned long long nsecs);
384 384
385struct event **pevent_list_events(struct pevent *pevent, enum event_sort_type); 385struct event_format **pevent_list_events(struct pevent *pevent, enum event_sort_type);
386 386
387static inline int pevent_get_cpus(struct pevent *pevent) 387static inline int pevent_get_cpus(struct pevent *pevent)
388{ 388{
diff --git a/plugin_hrtimer.c b/plugin_hrtimer.c
index 69529c6..01f8ff3 100644
--- a/plugin_hrtimer.c
+++ b/plugin_hrtimer.c
@@ -6,7 +6,7 @@
6 6
7/* return -1 (field not found/not valid number), 0 (ok), 1 (buffer full) */ 7/* return -1 (field not found/not valid number), 0 (ok), 1 (buffer full) */
8static int _print_field(struct trace_seq *s, const char *fmt, 8static int _print_field(struct trace_seq *s, const char *fmt,
9 struct event *event, const char *name, const void *data) 9 struct event_format *event, const char *name, const void *data)
10{ 10{
11 struct format_field *f = pevent_find_field(event, name); 11 struct format_field *f = pevent_find_field(event, name);
12 unsigned long long val; 12 unsigned long long val;
@@ -22,7 +22,7 @@ static int _print_field(struct trace_seq *s, const char *fmt,
22 22
23/* return 0 (ok), 1 (buffer full) */ 23/* return 0 (ok), 1 (buffer full) */
24static void print_field(struct trace_seq *s, const char *fmt, 24static void print_field(struct trace_seq *s, const char *fmt,
25 struct event *event, const char *name, const void *data) 25 struct event_format *event, const char *name, const void *data)
26{ 26{
27 int ret = _print_field(s, fmt, event, name, data); 27 int ret = _print_field(s, fmt, event, name, data);
28 28
@@ -31,7 +31,7 @@ static void print_field(struct trace_seq *s, const char *fmt,
31} 31}
32 32
33static int timer_expire_handler(struct trace_seq *s, void *data, int size, 33static int timer_expire_handler(struct trace_seq *s, void *data, int size,
34 struct event *event, int cpu, 34 struct event_format *event, int cpu,
35 unsigned long long nsecs) 35 unsigned long long nsecs)
36{ 36{
37 trace_seq_printf(s, "hrtimer="); 37 trace_seq_printf(s, "hrtimer=");
@@ -47,7 +47,7 @@ static int timer_expire_handler(struct trace_seq *s, void *data, int size,
47} 47}
48 48
49static int timer_start_handler(struct trace_seq *s, void *data, int size, 49static int timer_start_handler(struct trace_seq *s, void *data, int size,
50 struct event *event, int cpu, 50 struct event_format *event, int cpu,
51 unsigned long long nsecs) 51 unsigned long long nsecs)
52{ 52{
53 struct pevent *pevent = event->pevent; 53 struct pevent *pevent = event->pevent;
diff --git a/plugin_mac80211.c b/plugin_mac80211.c
index 7758b58..766d9ce 100644
--- a/plugin_mac80211.c
+++ b/plugin_mac80211.c
@@ -8,7 +8,7 @@
8 8
9/* return -1 (field not found/not valid number), 0 (ok), 1 (buffer full) */ 9/* return -1 (field not found/not valid number), 0 (ok), 1 (buffer full) */
10static int _print_field(struct trace_seq *s, const char *fmt, 10static int _print_field(struct trace_seq *s, const char *fmt,
11 struct event *event, const char *name, const void *data) 11 struct event_format *event, const char *name, const void *data)
12{ 12{
13 struct format_field *f = pevent_find_field(event, name); 13 struct format_field *f = pevent_find_field(event, name);
14 unsigned long long val; 14 unsigned long long val;
@@ -24,7 +24,7 @@ static int _print_field(struct trace_seq *s, const char *fmt,
24 24
25/* return 0 (ok), 1 (buffer full) */ 25/* return 0 (ok), 1 (buffer full) */
26static void print_field(struct trace_seq *s, const char *fmt, 26static void print_field(struct trace_seq *s, const char *fmt,
27 struct event *event, const char *name, const void *data) 27 struct event_format *event, const char *name, const void *data)
28{ 28{
29 int ret = _print_field(s, fmt, event, name, data); 29 int ret = _print_field(s, fmt, event, name, data);
30 30
@@ -32,7 +32,7 @@ static void print_field(struct trace_seq *s, const char *fmt,
32 trace_seq_printf(s, "NOTFOUND:%s", name); 32 trace_seq_printf(s, "NOTFOUND:%s", name);
33} 33}
34 34
35static void print_string(struct trace_seq *s, struct event *event, 35static void print_string(struct trace_seq *s, struct event_format *event,
36 const char *name, const void *data) 36 const char *name, const void *data)
37{ 37{
38 struct format_field *f = pevent_find_field(event, name); 38 struct format_field *f = pevent_find_field(event, name);
@@ -65,7 +65,7 @@ struct value_name {
65 const char *name; 65 const char *name;
66}; 66};
67 67
68static void _print_enum(struct trace_seq *s, struct event *event, 68static void _print_enum(struct trace_seq *s, struct event_format *event,
69 const char *name, const void *data, 69 const char *name, const void *data,
70 const struct value_name *names, int n_names) 70 const struct value_name *names, int n_names)
71{ 71{
@@ -98,7 +98,7 @@ static void _print_enum(struct trace_seq *s, struct event *event,
98 _print_enum(s, ev, name, data, __n, sizeof(__n)/sizeof(__n[0])); \ 98 _print_enum(s, ev, name, data, __n, sizeof(__n)/sizeof(__n[0])); \
99 }) 99 })
100 100
101static void _print_flag(struct trace_seq *s, struct event *event, 101static void _print_flag(struct trace_seq *s, struct event_format *event,
102 const char *name, const void *data, 102 const char *name, const void *data,
103 const struct value_name *names, int n_names) 103 const struct value_name *names, int n_names)
104{ 104{
@@ -146,7 +146,7 @@ static void _print_flag(struct trace_seq *s, struct event *event,
146#define SP() trace_seq_putc(s, ' ') 146#define SP() trace_seq_putc(s, ' ')
147 147
148static int drv_bss_info_changed(struct trace_seq *s, void *data, int size, 148static int drv_bss_info_changed(struct trace_seq *s, void *data, int size,
149 struct event *event, int cpu, 149 struct event_format *event, int cpu,
150 unsigned long long nsecs) 150 unsigned long long nsecs)
151{ 151{
152 print_string(s, event, "wiphy_name", data); 152 print_string(s, event, "wiphy_name", data);
@@ -173,7 +173,7 @@ static int drv_bss_info_changed(struct trace_seq *s, void *data, int size,
173} 173}
174 174
175static int drv_config(struct trace_seq *s, void *data, 175static int drv_config(struct trace_seq *s, void *data,
176 int size, struct event *event, int cpu, 176 int size, struct event_format *event, int cpu,
177 unsigned long long nsecs) 177 unsigned long long nsecs)
178{ 178{
179 print_string(s, event, "wiphy_name", data); 179 print_string(s, event, "wiphy_name", data);
diff --git a/plugin_sched_switch.c b/plugin_sched_switch.c
index b85a12a..4690f2f 100644
--- a/plugin_sched_switch.c
+++ b/plugin_sched_switch.c
@@ -5,7 +5,7 @@
5#include "trace-cmd.h" 5#include "trace-cmd.h"
6 6
7static int get_field_val(struct trace_seq *s, void *data, 7static int get_field_val(struct trace_seq *s, void *data,
8 struct event *event, const char *name, 8 struct event_format *event, const char *name,
9 unsigned long long *val, int fail) 9 unsigned long long *val, int fail)
10{ 10{
11 struct format_field *field; 11 struct format_field *field;
@@ -48,7 +48,7 @@ static void write_state(struct trace_seq *s, int val)
48} 48}
49 49
50static int sched_wakeup_handler(struct trace_seq *s, void *data, int size, 50static int sched_wakeup_handler(struct trace_seq *s, void *data, int size,
51 struct event *event, int cpu, 51 struct event_format *event, int cpu,
52 unsigned long long nsecs) 52 unsigned long long nsecs)
53{ 53{
54 struct format_field *field; 54 struct format_field *field;
@@ -103,7 +103,7 @@ static int sched_wakeup_handler(struct trace_seq *s, void *data, int size,
103} 103}
104 104
105static int sched_switch_handler(struct trace_seq *s, void *data, int size, 105static int sched_switch_handler(struct trace_seq *s, void *data, int size,
106 struct event *event, int cpu, 106 struct event_format *event, int cpu,
107 unsigned long long nsecs) 107 unsigned long long nsecs)
108{ 108{
109 struct format_field *field; 109 struct format_field *field;
diff --git a/trace-ftrace.c b/trace-ftrace.c
index b1d420d..9dfe04d 100644
--- a/trace-ftrace.c
+++ b/trace-ftrace.c
@@ -4,12 +4,12 @@
4 4
5#include "trace-cmd.h" 5#include "trace-cmd.h"
6 6
7static struct event *fgraph_ret_event; 7static struct event_format *fgraph_ret_event;
8static int fgraph_ret_id; 8static int fgraph_ret_id;
9static int long_size; 9static int long_size;
10 10
11static int get_field_val(struct trace_seq *s, void *data, 11static int get_field_val(struct trace_seq *s, void *data,
12 struct event *event, const char *name, 12 struct event_format *event, const char *name,
13 unsigned long long *val) 13 unsigned long long *val)
14{ 14{
15 struct format_field *field; 15 struct format_field *field;
@@ -29,7 +29,7 @@ static int get_field_val(struct trace_seq *s, void *data,
29} 29}
30 30
31static int function_handler(struct trace_seq *s, void *data, int size, 31static int function_handler(struct trace_seq *s, void *data, int size,
32 struct event *event, int cpu, 32 struct event_format *event, int cpu,
33 unsigned long long nsecs) 33 unsigned long long nsecs)
34{ 34{
35 struct pevent *pevent = event->pevent; 35 struct pevent *pevent = event->pevent;
@@ -145,7 +145,7 @@ static void print_graph_duration(struct trace_seq *s, unsigned long long duratio
145 145
146static int 146static int
147print_graph_entry_leaf(struct trace_seq *s, 147print_graph_entry_leaf(struct trace_seq *s,
148 struct event *event, void *data, struct record *ret_rec) 148 struct event_format *event, void *data, struct record *ret_rec)
149{ 149{
150 struct pevent *pevent = event->pevent; 150 struct pevent *pevent = event->pevent;
151 unsigned long long rettime, calltime; 151 unsigned long long rettime, calltime;
@@ -187,7 +187,7 @@ print_graph_entry_leaf(struct trace_seq *s,
187} 187}
188 188
189static int print_graph_nested(struct trace_seq *s, 189static int print_graph_nested(struct trace_seq *s,
190 struct event *event, void *data) 190 struct event_format *event, void *data)
191{ 191{
192 struct pevent *pevent = event->pevent; 192 struct pevent *pevent = event->pevent;
193 unsigned long long depth; 193 unsigned long long depth;
@@ -221,7 +221,7 @@ static int print_graph_nested(struct trace_seq *s,
221 221
222static int 222static int
223fgraph_ent_handler(struct trace_seq *s, void *data, int size, 223fgraph_ent_handler(struct trace_seq *s, void *data, int size,
224 struct event *event, int cpu, 224 struct event_format *event, int cpu,
225 unsigned long long nsecs) 225 unsigned long long nsecs)
226{ 226{
227 struct record *rec; 227 struct record *rec;
@@ -259,7 +259,7 @@ fgraph_ent_handler(struct trace_seq *s, void *data, int size,
259 259
260static int 260static int
261fgraph_ret_handler(struct trace_seq *s, void *data, int size, 261fgraph_ret_handler(struct trace_seq *s, void *data, int size,
262 struct event *event, int cpu, 262 struct event_format *event, int cpu,
263 unsigned long long nsecs) 263 unsigned long long nsecs)
264{ 264{
265 unsigned long long rettime, calltime; 265 unsigned long long rettime, calltime;
@@ -292,7 +292,7 @@ fgraph_ret_handler(struct trace_seq *s, void *data, int size,
292 292
293static int 293static int
294trace_stack_handler(struct trace_seq *s, void *data, int size, 294trace_stack_handler(struct trace_seq *s, void *data, int size,
295 struct event *event, int cpu, 295 struct event_format *event, int cpu,
296 unsigned long long nsecs) 296 unsigned long long nsecs)
297{ 297{
298 struct format_field *field; 298 struct format_field *field;
@@ -330,7 +330,7 @@ trace_stack_handler(struct trace_seq *s, void *data, int size,
330int tracecmd_ftrace_overrides(struct tracecmd_input *handle) 330int tracecmd_ftrace_overrides(struct tracecmd_input *handle)
331{ 331{
332 struct pevent *pevent; 332 struct pevent *pevent;
333 struct event *event; 333 struct event_format *event;
334 334
335 pevent = tracecmd_get_pevent(handle); 335 pevent = tracecmd_get_pevent(handle);
336 336
diff --git a/trace-read.c b/trace-read.c
index e875189..5a5d4df 100644
--- a/trace-read.c
+++ b/trace-read.c
@@ -393,8 +393,8 @@ void trace_report (int argc, char **argv)
393 } 393 }
394 394
395 if (show_events) { 395 if (show_events) {
396 struct event **events; 396 struct event_format **events;
397 struct event *event; 397 struct event_format *event;
398 int i; 398 int i;
399 399
400 events = pevent_list_events(pevent, EVENT_SORT_SYSTEM); 400 events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);