Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_" and not "pevent_". This changes
the struct pevent to struct tep_handle.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180808180659.706175783@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Tzvetomir Stoyanov (VMware) and committed by
Arnaldo Carvalho de Melo
096177a8 354b064b

+215 -215
+74 -74
tools/lib/traceevent/event-parse.c
··· 160 160 int pid; 161 161 }; 162 162 163 - static int cmdline_init(struct pevent *pevent) 163 + static int cmdline_init(struct tep_handle *pevent) 164 164 { 165 165 struct cmdline_list *cmdlist = pevent->cmdlist; 166 166 struct cmdline_list *item; ··· 189 189 return 0; 190 190 } 191 191 192 - static const char *find_cmdline(struct pevent *pevent, int pid) 192 + static const char *find_cmdline(struct tep_handle *pevent, int pid) 193 193 { 194 194 const struct cmdline *comm; 195 195 struct cmdline key; ··· 218 218 * Returns 1 if the pid has a cmdline mapped to it 219 219 * 0 otherwise. 220 220 */ 221 - int pevent_pid_is_registered(struct pevent *pevent, int pid) 221 + int pevent_pid_is_registered(struct tep_handle *pevent, int pid) 222 222 { 223 223 const struct cmdline *comm; 224 224 struct cmdline key; ··· 244 244 * we must add this pid. This is much slower than when cmdlines 245 245 * are added before the array is initialized. 246 246 */ 247 - static int add_new_comm(struct pevent *pevent, const char *comm, int pid) 247 + static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) 248 248 { 249 249 struct cmdline *cmdlines = pevent->cmdlines; 250 250 const struct cmdline *cmdline; ··· 296 296 * This adds a mapping to search for command line names with 297 297 * a given pid. The comm is duplicated. 298 298 */ 299 - int pevent_register_comm(struct pevent *pevent, const char *comm, int pid) 299 + int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid) 300 300 { 301 301 struct cmdline_list *item; 302 302 ··· 324 324 return 0; 325 325 } 326 326 327 - int pevent_register_trace_clock(struct pevent *pevent, const char *trace_clock) 327 + int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock) 328 328 { 329 329 pevent->trace_clock = strdup(trace_clock); 330 330 if (!pevent->trace_clock) { ··· 381 381 return 1; 382 382 } 383 383 384 - static int func_map_init(struct pevent *pevent) 384 + static int func_map_init(struct tep_handle *pevent) 385 385 { 386 386 struct func_list *funclist; 387 387 struct func_list *item; ··· 421 421 } 422 422 423 423 static struct func_map * 424 - __find_func(struct pevent *pevent, unsigned long long addr) 424 + __find_func(struct tep_handle *pevent, unsigned long long addr) 425 425 { 426 426 struct func_map *func; 427 427 struct func_map key; ··· 453 453 * keep using it instead of duplicating all the entries inside 454 454 * pevent->funclist. 455 455 */ 456 - int pevent_set_function_resolver(struct pevent *pevent, 456 + int pevent_set_function_resolver(struct tep_handle *pevent, 457 457 pevent_func_resolver_t *func, void *priv) 458 458 { 459 459 struct func_resolver *resolver = malloc(sizeof(*resolver)); ··· 477 477 * Stop using whatever alternative resolver was set, use the default 478 478 * one instead. 479 479 */ 480 - void pevent_reset_function_resolver(struct pevent *pevent) 480 + void pevent_reset_function_resolver(struct tep_handle *pevent) 481 481 { 482 482 free(pevent->func_resolver); 483 483 pevent->func_resolver = NULL; 484 484 } 485 485 486 486 static struct func_map * 487 - find_func(struct pevent *pevent, unsigned long long addr) 487 + find_func(struct tep_handle *pevent, unsigned long long addr) 488 488 { 489 489 struct func_map *map; 490 490 ··· 511 511 * address. Note, the address does not have to be exact, it 512 512 * will select the function that would contain the address. 513 513 */ 514 - const char *pevent_find_function(struct pevent *pevent, unsigned long long addr) 514 + const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr) 515 515 { 516 516 struct func_map *map; 517 517 ··· 532 532 * name and the function offset. 533 533 */ 534 534 unsigned long long 535 - pevent_find_function_address(struct pevent *pevent, unsigned long long addr) 535 + pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr) 536 536 { 537 537 struct func_map *map; 538 538 ··· 553 553 * This registers a function name with an address and module. 554 554 * The @func passed in is duplicated. 555 555 */ 556 - int pevent_register_function(struct pevent *pevent, char *func, 556 + int pevent_register_function(struct tep_handle *pevent, char *func, 557 557 unsigned long long addr, char *mod) 558 558 { 559 559 struct func_list *item = malloc(sizeof(*item)); ··· 594 594 * 595 595 * This prints out the stored functions. 596 596 */ 597 - void pevent_print_funcs(struct pevent *pevent) 597 + void pevent_print_funcs(struct tep_handle *pevent) 598 598 { 599 599 int i; 600 600 ··· 636 636 return 0; 637 637 } 638 638 639 - static int printk_map_init(struct pevent *pevent) 639 + static int printk_map_init(struct tep_handle *pevent) 640 640 { 641 641 struct printk_list *printklist; 642 642 struct printk_list *item; ··· 668 668 } 669 669 670 670 static struct printk_map * 671 - find_printk(struct pevent *pevent, unsigned long long addr) 671 + find_printk(struct tep_handle *pevent, unsigned long long addr) 672 672 { 673 673 struct printk_map *printk; 674 674 struct printk_map key; ··· 693 693 * This registers a string by the address it was stored in the kernel. 694 694 * The @fmt passed in is duplicated. 695 695 */ 696 - int pevent_register_print_string(struct pevent *pevent, const char *fmt, 696 + int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, 697 697 unsigned long long addr) 698 698 { 699 699 struct printk_list *item = malloc(sizeof(*item)); ··· 737 737 * 738 738 * This prints the string formats that were stored. 739 739 */ 740 - void pevent_print_printk(struct pevent *pevent) 740 + void pevent_print_printk(struct tep_handle *pevent) 741 741 { 742 742 int i; 743 743 ··· 756 756 return calloc(1, sizeof(struct event_format)); 757 757 } 758 758 759 - static int add_event(struct pevent *pevent, struct event_format *event) 759 + static int add_event(struct tep_handle *pevent, struct event_format *event) 760 760 { 761 761 int i; 762 762 struct event_format **events = realloc(pevent->events, sizeof(event) * ··· 2915 2915 } 2916 2916 2917 2917 static struct pevent_function_handler * 2918 - find_func_handler(struct pevent *pevent, char *func_name) 2918 + find_func_handler(struct tep_handle *pevent, char *func_name) 2919 2919 { 2920 2920 struct pevent_function_handler *func; 2921 2921 ··· 2930 2930 return func; 2931 2931 } 2932 2932 2933 - static void remove_func_handler(struct pevent *pevent, char *func_name) 2933 + static void remove_func_handler(struct tep_handle *pevent, char *func_name) 2934 2934 { 2935 2935 struct pevent_function_handler *func; 2936 2936 struct pevent_function_handler **next; ··· 3337 3337 * Returns the number (converted to host) from the 3338 3338 * raw data. 3339 3339 */ 3340 - unsigned long long pevent_read_number(struct pevent *pevent, 3340 + unsigned long long pevent_read_number(struct tep_handle *pevent, 3341 3341 const void *ptr, int size) 3342 3342 { 3343 3343 switch (size) { ··· 3384 3384 } 3385 3385 } 3386 3386 3387 - static int get_common_info(struct pevent *pevent, 3387 + static int get_common_info(struct tep_handle *pevent, 3388 3388 const char *type, int *offset, int *size) 3389 3389 { 3390 3390 struct event_format *event; ··· 3410 3410 return 0; 3411 3411 } 3412 3412 3413 - static int __parse_common(struct pevent *pevent, void *data, 3413 + static int __parse_common(struct tep_handle *pevent, void *data, 3414 3414 int *size, int *offset, const char *name) 3415 3415 { 3416 3416 int ret; ··· 3423 3423 return pevent_read_number(pevent, data + *offset, *size); 3424 3424 } 3425 3425 3426 - static int trace_parse_common_type(struct pevent *pevent, void *data) 3426 + static int trace_parse_common_type(struct tep_handle *pevent, void *data) 3427 3427 { 3428 3428 return __parse_common(pevent, data, 3429 3429 &pevent->type_size, &pevent->type_offset, 3430 3430 "common_type"); 3431 3431 } 3432 3432 3433 - static int parse_common_pid(struct pevent *pevent, void *data) 3433 + static int parse_common_pid(struct tep_handle *pevent, void *data) 3434 3434 { 3435 3435 return __parse_common(pevent, data, 3436 3436 &pevent->pid_size, &pevent->pid_offset, 3437 3437 "common_pid"); 3438 3438 } 3439 3439 3440 - static int parse_common_pc(struct pevent *pevent, void *data) 3440 + static int parse_common_pc(struct tep_handle *pevent, void *data) 3441 3441 { 3442 3442 return __parse_common(pevent, data, 3443 3443 &pevent->pc_size, &pevent->pc_offset, 3444 3444 "common_preempt_count"); 3445 3445 } 3446 3446 3447 - static int parse_common_flags(struct pevent *pevent, void *data) 3447 + static int parse_common_flags(struct tep_handle *pevent, void *data) 3448 3448 { 3449 3449 return __parse_common(pevent, data, 3450 3450 &pevent->flags_size, &pevent->flags_offset, 3451 3451 "common_flags"); 3452 3452 } 3453 3453 3454 - static int parse_common_lock_depth(struct pevent *pevent, void *data) 3454 + static int parse_common_lock_depth(struct tep_handle *pevent, void *data) 3455 3455 { 3456 3456 return __parse_common(pevent, data, 3457 3457 &pevent->ld_size, &pevent->ld_offset, 3458 3458 "common_lock_depth"); 3459 3459 } 3460 3460 3461 - static int parse_common_migrate_disable(struct pevent *pevent, void *data) 3461 + static int parse_common_migrate_disable(struct tep_handle *pevent, void *data) 3462 3462 { 3463 3463 return __parse_common(pevent, data, 3464 3464 &pevent->ld_size, &pevent->ld_offset, ··· 3474 3474 * 3475 3475 * Returns an event that has a given @id. 3476 3476 */ 3477 - struct event_format *pevent_find_event(struct pevent *pevent, int id) 3477 + struct event_format *pevent_find_event(struct tep_handle *pevent, int id) 3478 3478 { 3479 3479 struct event_format **eventptr; 3480 3480 struct event_format key; ··· 3507 3507 * @sys. If @sys is NULL the first event with @name is returned. 3508 3508 */ 3509 3509 struct event_format * 3510 - pevent_find_event_by_name(struct pevent *pevent, 3510 + pevent_find_event_by_name(struct tep_handle *pevent, 3511 3511 const char *sys, const char *name) 3512 3512 { 3513 3513 struct event_format *event; ··· 3537 3537 static unsigned long long 3538 3538 eval_num_arg(void *data, int size, struct event_format *event, struct print_arg *arg) 3539 3539 { 3540 - struct pevent *pevent = event->pevent; 3540 + struct tep_handle *pevent = event->pevent; 3541 3541 unsigned long long val = 0; 3542 3542 unsigned long long left, right; 3543 3543 struct print_arg *typearg = NULL; ··· 3820 3820 trace_seq_printf(s, format, str); 3821 3821 } 3822 3822 3823 - static void print_bitmask_to_seq(struct pevent *pevent, 3823 + static void print_bitmask_to_seq(struct tep_handle *pevent, 3824 3824 struct trace_seq *s, const char *format, 3825 3825 int len_arg, const void *data, int size) 3826 3826 { ··· 3878 3878 struct event_format *event, const char *format, 3879 3879 int len_arg, struct print_arg *arg) 3880 3880 { 3881 - struct pevent *pevent = event->pevent; 3881 + struct tep_handle *pevent = event->pevent; 3882 3882 struct print_flag_sym *flag; 3883 3883 struct format_field *field; 3884 3884 struct printk_map *printk; ··· 4227 4227 4228 4228 static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct event_format *event) 4229 4229 { 4230 - struct pevent *pevent = event->pevent; 4230 + struct tep_handle *pevent = event->pevent; 4231 4231 struct format_field *field, *ip_field; 4232 4232 struct print_arg *args, *arg, **next; 4233 4233 unsigned long long ip, val; ··· 4404 4404 get_bprint_format(void *data, int size __maybe_unused, 4405 4405 struct event_format *event) 4406 4406 { 4407 - struct pevent *pevent = event->pevent; 4407 + struct tep_handle *pevent = event->pevent; 4408 4408 unsigned long long addr; 4409 4409 struct format_field *field; 4410 4410 struct printk_map *printk; ··· 4805 4805 { 4806 4806 unsigned long long val; 4807 4807 unsigned int offset, len, i; 4808 - struct pevent *pevent = field->event->pevent; 4808 + struct tep_handle *pevent = field->event->pevent; 4809 4809 4810 4810 if (field->flags & FIELD_IS_ARRAY) { 4811 4811 offset = field->offset; ··· 4880 4880 4881 4881 static void pretty_print(struct trace_seq *s, void *data, int size, struct event_format *event) 4882 4882 { 4883 - struct pevent *pevent = event->pevent; 4883 + struct tep_handle *pevent = event->pevent; 4884 4884 struct print_fmt *print_fmt = &event->print_fmt; 4885 4885 struct print_arg *arg = print_fmt->args; 4886 4886 struct print_arg *args = NULL; ··· 5149 5149 * need rescheduling, in hard/soft interrupt, preempt count 5150 5150 * and lock depth) and places it into the trace_seq. 5151 5151 */ 5152 - void pevent_data_lat_fmt(struct pevent *pevent, 5152 + void pevent_data_lat_fmt(struct tep_handle *pevent, 5153 5153 struct trace_seq *s, struct pevent_record *record) 5154 5154 { 5155 5155 static int check_lock_depth = 1; ··· 5229 5229 * 5230 5230 * This returns the event id from the @rec. 5231 5231 */ 5232 - int pevent_data_type(struct pevent *pevent, struct pevent_record *rec) 5232 + int pevent_data_type(struct tep_handle *pevent, struct pevent_record *rec) 5233 5233 { 5234 5234 return trace_parse_common_type(pevent, rec->data); 5235 5235 } ··· 5241 5241 * 5242 5242 * This returns the event form a given @type; 5243 5243 */ 5244 - struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type) 5244 + struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type) 5245 5245 { 5246 5246 return pevent_find_event(pevent, type); 5247 5247 } ··· 5253 5253 * 5254 5254 * This returns the PID from a record. 5255 5255 */ 5256 - int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec) 5256 + int pevent_data_pid(struct tep_handle *pevent, struct pevent_record *rec) 5257 5257 { 5258 5258 return parse_common_pid(pevent, rec->data); 5259 5259 } ··· 5265 5265 * 5266 5266 * This returns the preempt count from a record. 5267 5267 */ 5268 - int pevent_data_preempt_count(struct pevent *pevent, struct pevent_record *rec) 5268 + int pevent_data_preempt_count(struct tep_handle *pevent, struct pevent_record *rec) 5269 5269 { 5270 5270 return parse_common_pc(pevent, rec->data); 5271 5271 } ··· 5279 5279 * 5280 5280 * Use trace_flag_type enum for the flags (see event-parse.h). 5281 5281 */ 5282 - int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec) 5282 + int pevent_data_flags(struct tep_handle *pevent, struct pevent_record *rec) 5283 5283 { 5284 5284 return parse_common_flags(pevent, rec->data); 5285 5285 } ··· 5292 5292 * This returns a pointer to the command line that has the given 5293 5293 * @pid. 5294 5294 */ 5295 - const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid) 5295 + const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid) 5296 5296 { 5297 5297 const char *comm; 5298 5298 ··· 5301 5301 } 5302 5302 5303 5303 static struct cmdline * 5304 - pid_from_cmdlist(struct pevent *pevent, const char *comm, struct cmdline *next) 5304 + pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *next) 5305 5305 { 5306 5306 struct cmdline_list *cmdlist = (struct cmdline_list *)next; 5307 5307 ··· 5329 5329 * next pid. 5330 5330 * Also, it does a linear seach, so it may be slow. 5331 5331 */ 5332 - struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *comm, 5332 + struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm, 5333 5333 struct cmdline *next) 5334 5334 { 5335 5335 struct cmdline *cmdline; ··· 5371 5371 * Returns the pid for a give cmdline. If @cmdline is NULL, then 5372 5372 * -1 is returned. 5373 5373 */ 5374 - int pevent_cmdline_pid(struct pevent *pevent, struct cmdline *cmdline) 5374 + int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) 5375 5375 { 5376 5376 struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline; 5377 5377 ··· 5441 5441 * is found. 5442 5442 */ 5443 5443 struct event_format * 5444 - pevent_find_event_by_record(struct pevent *pevent, struct pevent_record *record) 5444 + pevent_find_event_by_record(struct tep_handle *pevent, struct pevent_record *record) 5445 5445 { 5446 5446 int type; 5447 5447 ··· 5464 5464 * 5465 5465 * Writes the tasks comm, pid and CPU to @s. 5466 5466 */ 5467 - void pevent_print_event_task(struct pevent *pevent, struct trace_seq *s, 5467 + void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 5468 5468 struct event_format *event, 5469 5469 struct pevent_record *record) 5470 5470 { ··· 5492 5492 * 5493 5493 * Writes the timestamp of the record into @s. 5494 5494 */ 5495 - void pevent_print_event_time(struct pevent *pevent, struct trace_seq *s, 5495 + void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s, 5496 5496 struct event_format *event, 5497 5497 struct pevent_record *record, 5498 5498 bool use_trace_clock) ··· 5542 5542 * 5543 5543 * Writes the parsing of the record's data to @s. 5544 5544 */ 5545 - void pevent_print_event_data(struct pevent *pevent, struct trace_seq *s, 5545 + void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s, 5546 5546 struct event_format *event, 5547 5547 struct pevent_record *record) 5548 5548 { ··· 5559 5559 pevent_event_info(s, event, record); 5560 5560 } 5561 5561 5562 - void pevent_print_event(struct pevent *pevent, struct trace_seq *s, 5562 + void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s, 5563 5563 struct pevent_record *record, bool use_trace_clock) 5564 5564 { 5565 5565 struct event_format *event; ··· 5630 5630 return events_id_cmp(a, b); 5631 5631 } 5632 5632 5633 - struct event_format **pevent_list_events(struct pevent *pevent, enum event_sort_type sort_type) 5633 + struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sort_type sort_type) 5634 5634 { 5635 5635 struct event_format **events; 5636 5636 int (*sort)(const void *a, const void *b); ··· 5941 5941 * 5942 5942 * /sys/kernel/debug/tracing/events/header_page 5943 5943 */ 5944 - int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size, 5944 + int pevent_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size, 5945 5945 int long_size) 5946 5946 { 5947 5947 int ignore; ··· 5994 5994 free(handle); 5995 5995 } 5996 5996 5997 - static int find_event_handle(struct pevent *pevent, struct event_format *event) 5997 + static int find_event_handle(struct tep_handle *pevent, struct event_format *event) 5998 5998 { 5999 5999 struct event_handler *handle, **next; 6000 6000 ··· 6036 6036 * /sys/kernel/debug/tracing/events/.../.../format 6037 6037 */ 6038 6038 enum pevent_errno __pevent_parse_format(struct event_format **eventp, 6039 - struct pevent *pevent, const char *buf, 6039 + struct tep_handle *pevent, const char *buf, 6040 6040 unsigned long size, const char *sys) 6041 6041 { 6042 6042 struct event_format *event; ··· 6143 6143 } 6144 6144 6145 6145 static enum pevent_errno 6146 - __pevent_parse_event(struct pevent *pevent, 6146 + __pevent_parse_event(struct tep_handle *pevent, 6147 6147 struct event_format **eventp, 6148 6148 const char *buf, unsigned long size, 6149 6149 const char *sys) ··· 6185 6185 * 6186 6186 * /sys/kernel/debug/tracing/events/.../.../format 6187 6187 */ 6188 - enum pevent_errno pevent_parse_format(struct pevent *pevent, 6188 + enum pevent_errno pevent_parse_format(struct tep_handle *pevent, 6189 6189 struct event_format **eventp, 6190 6190 const char *buf, 6191 6191 unsigned long size, const char *sys) ··· 6207 6207 * 6208 6208 * /sys/kernel/debug/tracing/events/.../.../format 6209 6209 */ 6210 - enum pevent_errno pevent_parse_event(struct pevent *pevent, const char *buf, 6210 + enum pevent_errno pevent_parse_event(struct tep_handle *pevent, const char *buf, 6211 6211 unsigned long size, const char *sys) 6212 6212 { 6213 6213 struct event_format *event = NULL; ··· 6221 6221 }; 6222 6222 #undef _PE 6223 6223 6224 - int pevent_strerror(struct pevent *pevent __maybe_unused, 6224 + int pevent_strerror(struct tep_handle *pevent __maybe_unused, 6225 6225 enum pevent_errno errnum, char *buf, size_t buflen) 6226 6226 { 6227 6227 int idx; ··· 6435 6435 struct pevent_record *record, int err) 6436 6436 { 6437 6437 struct format_field *field = pevent_find_field(event, name); 6438 - struct pevent *pevent = event->pevent; 6438 + struct tep_handle *pevent = event->pevent; 6439 6439 unsigned long long val; 6440 6440 struct func_map *func; 6441 6441 char tmp[128]; ··· 6491 6491 * The @parameters is a variable list of pevent_func_arg_type enums that 6492 6492 * must end with PEVENT_FUNC_ARG_VOID. 6493 6493 */ 6494 - int pevent_register_print_function(struct pevent *pevent, 6494 + int pevent_register_print_function(struct tep_handle *pevent, 6495 6495 pevent_func_handler func, 6496 6496 enum pevent_func_arg_type ret_type, 6497 6497 char *name, ...) ··· 6578 6578 * 6579 6579 * Returns 0 if the handler was removed successully, -1 otherwise. 6580 6580 */ 6581 - int pevent_unregister_print_function(struct pevent *pevent, 6581 + int pevent_unregister_print_function(struct tep_handle *pevent, 6582 6582 pevent_func_handler func, char *name) 6583 6583 { 6584 6584 struct pevent_function_handler *func_handle; ··· 6591 6591 return -1; 6592 6592 } 6593 6593 6594 - static struct event_format *pevent_search_event(struct pevent *pevent, int id, 6594 + static struct event_format *pevent_search_event(struct tep_handle *pevent, int id, 6595 6595 const char *sys_name, 6596 6596 const char *event_name) 6597 6597 { ··· 6631 6631 * If @id is >= 0, then it is used to find the event. 6632 6632 * else @sys_name and @event_name are used. 6633 6633 */ 6634 - int pevent_register_event_handler(struct pevent *pevent, int id, 6634 + int pevent_register_event_handler(struct tep_handle *pevent, int id, 6635 6635 const char *sys_name, const char *event_name, 6636 6636 pevent_event_handler_func func, void *context) 6637 6637 { ··· 6715 6715 * 6716 6716 * Returns 0 if handler was removed successfully, -1 if event was not found. 6717 6717 */ 6718 - int pevent_unregister_event_handler(struct pevent *pevent, int id, 6718 + int pevent_unregister_event_handler(struct tep_handle *pevent, int id, 6719 6719 const char *sys_name, const char *event_name, 6720 6720 pevent_event_handler_func func, void *context) 6721 6721 { ··· 6756 6756 /** 6757 6757 * pevent_alloc - create a pevent handle 6758 6758 */ 6759 - struct pevent *pevent_alloc(void) 6759 + struct tep_handle *pevent_alloc(void) 6760 6760 { 6761 - struct pevent *pevent = calloc(1, sizeof(*pevent)); 6761 + struct tep_handle *pevent = calloc(1, sizeof(*pevent)); 6762 6762 6763 6763 if (pevent) 6764 6764 pevent->ref_count = 1; ··· 6766 6766 return pevent; 6767 6767 } 6768 6768 6769 - void pevent_ref(struct pevent *pevent) 6769 + void pevent_ref(struct tep_handle *pevent) 6770 6770 { 6771 6771 pevent->ref_count++; 6772 6772 } ··· 6814 6814 * pevent_free - free a pevent handle 6815 6815 * @pevent: the pevent handle to free 6816 6816 */ 6817 - void pevent_free(struct pevent *pevent) 6817 + void pevent_free(struct tep_handle *pevent) 6818 6818 { 6819 6819 struct cmdline_list *cmdlist, *cmdnext; 6820 6820 struct func_list *funclist, *funcnext; ··· 6899 6899 free(pevent); 6900 6900 } 6901 6901 6902 - void pevent_unref(struct pevent *pevent) 6902 + void pevent_unref(struct tep_handle *pevent) 6903 6903 { 6904 6904 pevent_free(pevent); 6905 6905 }
+68 -68
tools/lib/traceevent/event-parse.h
··· 98 98 99 99 /* ----------------------- pevent ----------------------- */ 100 100 101 - struct pevent; 101 + struct tep_handle; 102 102 struct event_format; 103 103 104 104 typedef int (*pevent_event_handler_func)(struct trace_seq *s, ··· 106 106 struct event_format *event, 107 107 void *context); 108 108 109 - typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 110 - typedef int (*pevent_plugin_unload_func)(struct pevent *pevent); 109 + typedef int (*pevent_plugin_load_func)(struct tep_handle *pevent); 110 + typedef int (*pevent_plugin_unload_func)(struct tep_handle *pevent); 111 111 112 112 struct pevent_plugin_option { 113 113 struct pevent_plugin_option *next; ··· 127 127 * PEVENT_PLUGIN_LOADER: (required) 128 128 * The function name to initialized the plugin. 129 129 * 130 - * int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 130 + * int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 131 131 * 132 132 * PEVENT_PLUGIN_UNLOADER: (optional) 133 133 * The function called just before unloading 134 134 * 135 - * int PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 135 + * int PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 136 136 * 137 137 * PEVENT_PLUGIN_OPTIONS: (optional) 138 138 * Plugin options that can be set before loading ··· 320 320 }; 321 321 322 322 struct event_format { 323 - struct pevent *pevent; 323 + struct tep_handle *pevent; 324 324 char *name; 325 325 int id; 326 326 int flags; ··· 435 435 436 436 #define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) 437 437 438 - struct plugin_list *traceevent_load_plugins(struct pevent *pevent); 438 + struct plugin_list *traceevent_load_plugins(struct tep_handle *pevent); 439 439 void traceevent_unload_plugins(struct plugin_list *plugin_list, 440 - struct pevent *pevent); 440 + struct tep_handle *pevent); 441 441 char **traceevent_plugin_list_options(void); 442 442 void traceevent_plugin_free_options_list(char **list); 443 443 int traceevent_plugin_add_options(const char *name, ··· 457 457 typedef char *(pevent_func_resolver_t)(void *priv, 458 458 unsigned long long *addrp, char **modp); 459 459 460 - struct pevent { 460 + struct tep_handle { 461 461 int ref_count; 462 462 463 463 int header_page_ts_offset; ··· 532 532 char *trace_clock; 533 533 }; 534 534 535 - static inline void pevent_set_flag(struct pevent *pevent, int flag) 535 + static inline void pevent_set_flag(struct tep_handle *pevent, int flag) 536 536 { 537 537 pevent->flags |= flag; 538 538 } 539 539 540 540 static inline unsigned short 541 - __data2host2(struct pevent *pevent, unsigned short data) 541 + __data2host2(struct tep_handle *pevent, unsigned short data) 542 542 { 543 543 unsigned short swap; 544 544 ··· 552 552 } 553 553 554 554 static inline unsigned int 555 - __data2host4(struct pevent *pevent, unsigned int data) 555 + __data2host4(struct tep_handle *pevent, unsigned int data) 556 556 { 557 557 unsigned int swap; 558 558 ··· 568 568 } 569 569 570 570 static inline unsigned long long 571 - __data2host8(struct pevent *pevent, unsigned long long data) 571 + __data2host8(struct tep_handle *pevent, unsigned long long data) 572 572 { 573 573 unsigned long long swap; 574 574 ··· 615 615 TRACE_FLAG_SOFTIRQ = 0x10, 616 616 }; 617 617 618 - int pevent_set_function_resolver(struct pevent *pevent, 618 + int pevent_set_function_resolver(struct tep_handle *pevent, 619 619 pevent_func_resolver_t *func, void *priv); 620 - void pevent_reset_function_resolver(struct pevent *pevent); 621 - int pevent_register_comm(struct pevent *pevent, const char *comm, int pid); 622 - int pevent_register_trace_clock(struct pevent *pevent, const char *trace_clock); 623 - int pevent_register_function(struct pevent *pevent, char *name, 620 + void pevent_reset_function_resolver(struct tep_handle *pevent); 621 + int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid); 622 + int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock); 623 + int pevent_register_function(struct tep_handle *pevent, char *name, 624 624 unsigned long long addr, char *mod); 625 - int pevent_register_print_string(struct pevent *pevent, const char *fmt, 625 + int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, 626 626 unsigned long long addr); 627 - int pevent_pid_is_registered(struct pevent *pevent, int pid); 627 + int pevent_pid_is_registered(struct tep_handle *pevent, int pid); 628 628 629 - void pevent_print_event_task(struct pevent *pevent, struct trace_seq *s, 629 + void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 630 630 struct event_format *event, 631 631 struct pevent_record *record); 632 - void pevent_print_event_time(struct pevent *pevent, struct trace_seq *s, 632 + void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s, 633 633 struct event_format *event, 634 634 struct pevent_record *record, 635 635 bool use_trace_clock); 636 - void pevent_print_event_data(struct pevent *pevent, struct trace_seq *s, 636 + void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s, 637 637 struct event_format *event, 638 638 struct pevent_record *record); 639 - void pevent_print_event(struct pevent *pevent, struct trace_seq *s, 639 + void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s, 640 640 struct pevent_record *record, bool use_trace_clock); 641 641 642 - int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size, 642 + int pevent_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size, 643 643 int long_size); 644 644 645 - enum pevent_errno pevent_parse_event(struct pevent *pevent, const char *buf, 645 + enum pevent_errno pevent_parse_event(struct tep_handle *pevent, const char *buf, 646 646 unsigned long size, const char *sys); 647 - enum pevent_errno pevent_parse_format(struct pevent *pevent, 647 + enum pevent_errno pevent_parse_format(struct tep_handle *pevent, 648 648 struct event_format **eventp, 649 649 const char *buf, 650 650 unsigned long size, const char *sys); ··· 673 673 struct event_format *event, const char *name, 674 674 struct pevent_record *record, int err); 675 675 676 - int pevent_register_event_handler(struct pevent *pevent, int id, 676 + int pevent_register_event_handler(struct tep_handle *pevent, int id, 677 677 const char *sys_name, const char *event_name, 678 678 pevent_event_handler_func func, void *context); 679 - int pevent_unregister_event_handler(struct pevent *pevent, int id, 679 + int pevent_unregister_event_handler(struct tep_handle *pevent, int id, 680 680 const char *sys_name, const char *event_name, 681 681 pevent_event_handler_func func, void *context); 682 - int pevent_register_print_function(struct pevent *pevent, 682 + int pevent_register_print_function(struct tep_handle *pevent, 683 683 pevent_func_handler func, 684 684 enum pevent_func_arg_type ret_type, 685 685 char *name, ...); 686 - int pevent_unregister_print_function(struct pevent *pevent, 686 + int pevent_unregister_print_function(struct tep_handle *pevent, 687 687 pevent_func_handler func, char *name); 688 688 689 689 struct format_field *pevent_find_common_field(struct event_format *event, const char *name); 690 690 struct format_field *pevent_find_field(struct event_format *event, const char *name); 691 691 struct format_field *pevent_find_any_field(struct event_format *event, const char *name); 692 692 693 - const char *pevent_find_function(struct pevent *pevent, unsigned long long addr); 693 + const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr); 694 694 unsigned long long 695 - pevent_find_function_address(struct pevent *pevent, unsigned long long addr); 696 - unsigned long long pevent_read_number(struct pevent *pevent, const void *ptr, int size); 695 + pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr); 696 + unsigned long long pevent_read_number(struct tep_handle *pevent, const void *ptr, int size); 697 697 int pevent_read_number_field(struct format_field *field, const void *data, 698 698 unsigned long long *value); 699 699 700 - struct event_format *pevent_find_event(struct pevent *pevent, int id); 700 + struct event_format *pevent_find_event(struct tep_handle *pevent, int id); 701 701 702 702 struct event_format * 703 - pevent_find_event_by_name(struct pevent *pevent, const char *sys, const char *name); 703 + pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); 704 704 705 705 struct event_format * 706 - pevent_find_event_by_record(struct pevent *pevent, struct pevent_record *record); 706 + pevent_find_event_by_record(struct tep_handle *pevent, struct pevent_record *record); 707 707 708 - void pevent_data_lat_fmt(struct pevent *pevent, 708 + void pevent_data_lat_fmt(struct tep_handle *pevent, 709 709 struct trace_seq *s, struct pevent_record *record); 710 - int pevent_data_type(struct pevent *pevent, struct pevent_record *rec); 711 - struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type); 712 - int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec); 713 - int pevent_data_preempt_count(struct pevent *pevent, struct pevent_record *rec); 714 - int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec); 715 - const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid); 710 + int pevent_data_type(struct tep_handle *pevent, struct pevent_record *rec); 711 + struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type); 712 + int pevent_data_pid(struct tep_handle *pevent, struct pevent_record *rec); 713 + int pevent_data_preempt_count(struct tep_handle *pevent, struct pevent_record *rec); 714 + int pevent_data_flags(struct tep_handle *pevent, struct pevent_record *rec); 715 + const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid); 716 716 struct cmdline; 717 - struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *comm, 717 + struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm, 718 718 struct cmdline *next); 719 - int pevent_cmdline_pid(struct pevent *pevent, struct cmdline *cmdline); 719 + int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); 720 720 721 721 void pevent_print_field(struct trace_seq *s, void *data, 722 722 struct format_field *field); ··· 724 724 int size __maybe_unused, struct event_format *event); 725 725 void pevent_event_info(struct trace_seq *s, struct event_format *event, 726 726 struct pevent_record *record); 727 - int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum, 727 + int pevent_strerror(struct tep_handle *pevent, enum pevent_errno errnum, 728 728 char *buf, size_t buflen); 729 729 730 - struct event_format **pevent_list_events(struct pevent *pevent, enum event_sort_type); 730 + struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sort_type); 731 731 struct format_field **pevent_event_common_fields(struct event_format *event); 732 732 struct format_field **pevent_event_fields(struct event_format *event); 733 733 734 - static inline int pevent_get_cpus(struct pevent *pevent) 734 + static inline int pevent_get_cpus(struct tep_handle *pevent) 735 735 { 736 736 return pevent->cpus; 737 737 } 738 738 739 - static inline void pevent_set_cpus(struct pevent *pevent, int cpus) 739 + static inline void pevent_set_cpus(struct tep_handle *pevent, int cpus) 740 740 { 741 741 pevent->cpus = cpus; 742 742 } 743 743 744 - static inline int pevent_get_long_size(struct pevent *pevent) 744 + static inline int pevent_get_long_size(struct tep_handle *pevent) 745 745 { 746 746 return pevent->long_size; 747 747 } 748 748 749 - static inline void pevent_set_long_size(struct pevent *pevent, int long_size) 749 + static inline void pevent_set_long_size(struct tep_handle *pevent, int long_size) 750 750 { 751 751 pevent->long_size = long_size; 752 752 } 753 753 754 - static inline int pevent_get_page_size(struct pevent *pevent) 754 + static inline int pevent_get_page_size(struct tep_handle *pevent) 755 755 { 756 756 return pevent->page_size; 757 757 } 758 758 759 - static inline void pevent_set_page_size(struct pevent *pevent, int _page_size) 759 + static inline void pevent_set_page_size(struct tep_handle *pevent, int _page_size) 760 760 { 761 761 pevent->page_size = _page_size; 762 762 } 763 763 764 - static inline int pevent_is_file_bigendian(struct pevent *pevent) 764 + static inline int pevent_is_file_bigendian(struct tep_handle *pevent) 765 765 { 766 766 return pevent->file_bigendian; 767 767 } 768 768 769 - static inline void pevent_set_file_bigendian(struct pevent *pevent, int endian) 769 + static inline void pevent_set_file_bigendian(struct tep_handle *pevent, int endian) 770 770 { 771 771 pevent->file_bigendian = endian; 772 772 } 773 773 774 - static inline int pevent_is_host_bigendian(struct pevent *pevent) 774 + static inline int pevent_is_host_bigendian(struct tep_handle *pevent) 775 775 { 776 776 return pevent->host_bigendian; 777 777 } 778 778 779 - static inline void pevent_set_host_bigendian(struct pevent *pevent, int endian) 779 + static inline void pevent_set_host_bigendian(struct tep_handle *pevent, int endian) 780 780 { 781 781 pevent->host_bigendian = endian; 782 782 } 783 783 784 - static inline int pevent_is_latency_format(struct pevent *pevent) 784 + static inline int pevent_is_latency_format(struct tep_handle *pevent) 785 785 { 786 786 return pevent->latency_format; 787 787 } 788 788 789 - static inline void pevent_set_latency_format(struct pevent *pevent, int lat) 789 + static inline void pevent_set_latency_format(struct tep_handle *pevent, int lat) 790 790 { 791 791 pevent->latency_format = lat; 792 792 } 793 793 794 - struct pevent *pevent_alloc(void); 795 - void pevent_free(struct pevent *pevent); 796 - void pevent_ref(struct pevent *pevent); 797 - void pevent_unref(struct pevent *pevent); 794 + struct tep_handle *pevent_alloc(void); 795 + void pevent_free(struct tep_handle *pevent); 796 + void pevent_ref(struct tep_handle *pevent); 797 + void pevent_unref(struct tep_handle *pevent); 798 798 799 799 /* access to the internal parser */ 800 800 void pevent_buffer_init(const char *buf, unsigned long long size); ··· 805 805 unsigned long long pevent_get_input_buf_ptr(void); 806 806 807 807 /* for debugging */ 808 - void pevent_print_funcs(struct pevent *pevent); 809 - void pevent_print_printk(struct pevent *pevent); 808 + void pevent_print_funcs(struct tep_handle *pevent); 809 + void pevent_print_printk(struct tep_handle *pevent); 810 810 811 811 /* ----------------------- filtering ----------------------- */ 812 812 ··· 933 933 #define PEVENT_FILTER_ERROR_BUFSZ 1024 934 934 935 935 struct event_filter { 936 - struct pevent *pevent; 936 + struct tep_handle *pevent; 937 937 int filters; 938 938 struct filter_type *event_filters; 939 939 char error_buffer[PEVENT_FILTER_ERROR_BUFSZ]; 940 940 }; 941 941 942 - struct event_filter *pevent_filter_alloc(struct pevent *pevent); 942 + struct event_filter *pevent_filter_alloc(struct tep_handle *pevent); 943 943 944 944 /* for backward compatibility */ 945 945 #define FILTER_NONE PEVENT_ERRNO__NO_FILTER
+7 -7
tools/lib/traceevent/event-plugin.c
··· 281 281 } 282 282 283 283 static void 284 - load_plugin(struct pevent *pevent, const char *path, 284 + load_plugin(struct tep_handle *pevent, const char *path, 285 285 const char *file, void *data) 286 286 { 287 287 struct plugin_list **plugin_list = data; ··· 336 336 } 337 337 338 338 static void 339 - load_plugins_dir(struct pevent *pevent, const char *suffix, 339 + load_plugins_dir(struct tep_handle *pevent, const char *suffix, 340 340 const char *path, 341 - void (*load_plugin)(struct pevent *pevent, 341 + void (*load_plugin)(struct tep_handle *pevent, 342 342 const char *path, 343 343 const char *name, 344 344 void *data), ··· 378 378 } 379 379 380 380 static void 381 - load_plugins(struct pevent *pevent, const char *suffix, 382 - void (*load_plugin)(struct pevent *pevent, 381 + load_plugins(struct tep_handle *pevent, const char *suffix, 382 + void (*load_plugin)(struct tep_handle *pevent, 383 383 const char *path, 384 384 const char *name, 385 385 void *data), ··· 431 431 } 432 432 433 433 struct plugin_list* 434 - traceevent_load_plugins(struct pevent *pevent) 434 + traceevent_load_plugins(struct tep_handle *pevent) 435 435 { 436 436 struct plugin_list *list = NULL; 437 437 ··· 440 440 } 441 441 442 442 void 443 - traceevent_unload_plugins(struct plugin_list *plugin_list, struct pevent *pevent) 443 + traceevent_unload_plugins(struct plugin_list *plugin_list, struct tep_handle *pevent) 444 444 { 445 445 pevent_plugin_unload_func func; 446 446 struct plugin_list *list;
+7 -7
tools/lib/traceevent/parse-filter.c
··· 179 179 * pevent_filter_alloc - create a new event filter 180 180 * @pevent: The pevent that this filter is associated with 181 181 */ 182 - struct event_filter *pevent_filter_alloc(struct pevent *pevent) 182 + struct event_filter *pevent_filter_alloc(struct tep_handle *pevent) 183 183 { 184 184 struct event_filter *filter; 185 185 ··· 269 269 } 270 270 271 271 static enum pevent_errno 272 - find_event(struct pevent *pevent, struct event_list **events, 272 + find_event(struct tep_handle *pevent, struct event_list **events, 273 273 char *sys_name, char *event_name) 274 274 { 275 275 struct event_format *event; ··· 1270 1270 enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter, 1271 1271 const char *filter_str) 1272 1272 { 1273 - struct pevent *pevent = filter->pevent; 1273 + struct tep_handle *pevent = filter->pevent; 1274 1274 struct event_list *event; 1275 1275 struct event_list *events = NULL; 1276 1276 const char *filter_start; ··· 1550 1550 int pevent_update_trivial(struct event_filter *dest, struct event_filter *source, 1551 1551 enum filter_trivial_type type) 1552 1552 { 1553 - struct pevent *src_pevent; 1554 - struct pevent *dest_pevent; 1553 + struct tep_handle *src_pevent; 1554 + struct tep_handle *dest_pevent; 1555 1555 struct event_format *event; 1556 1556 struct filter_type *filter_type; 1557 1557 struct filter_arg *arg; ··· 1874 1874 static const char *get_field_str(struct filter_arg *arg, struct pevent_record *record) 1875 1875 { 1876 1876 struct event_format *event; 1877 - struct pevent *pevent; 1877 + struct tep_handle *pevent; 1878 1878 unsigned long long addr; 1879 1879 const char *val = NULL; 1880 1880 unsigned int size; ··· 2049 2049 enum pevent_errno pevent_filter_match(struct event_filter *filter, 2050 2050 struct pevent_record *record) 2051 2051 { 2052 - struct pevent *pevent = filter->pevent; 2052 + struct tep_handle *pevent = filter->pevent; 2053 2053 struct filter_type *filter_type; 2054 2054 int event_id; 2055 2055 int ret;
+2 -2
tools/lib/traceevent/plugin_cfg80211.c
··· 25 25 return val ? (long long) le16toh(*val) : 0; 26 26 } 27 27 28 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 28 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 29 29 { 30 30 pevent_register_print_function(pevent, 31 31 process___le16_to_cpup, ··· 36 36 return 0; 37 37 } 38 38 39 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 39 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 40 40 { 41 41 pevent_unregister_print_function(pevent, process___le16_to_cpup, 42 42 "__le16_to_cpup");
+3 -3
tools/lib/traceevent/plugin_function.c
··· 125 125 static int function_handler(struct trace_seq *s, struct pevent_record *record, 126 126 struct event_format *event, void *context) 127 127 { 128 - struct pevent *pevent = event->pevent; 128 + struct tep_handle *pevent = event->pevent; 129 129 unsigned long long function; 130 130 unsigned long long pfunction; 131 131 const char *func; ··· 163 163 return 0; 164 164 } 165 165 166 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 166 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 167 167 { 168 168 pevent_register_event_handler(pevent, -1, "ftrace", "function", 169 169 function_handler, NULL); ··· 173 173 return 0; 174 174 } 175 175 176 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 176 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 177 177 { 178 178 int i, x; 179 179
+2 -2
tools/lib/traceevent/plugin_hrtimer.c
··· 66 66 return 0; 67 67 } 68 68 69 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 69 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 70 70 { 71 71 pevent_register_event_handler(pevent, -1, 72 72 "timer", "hrtimer_expire_entry", ··· 77 77 return 0; 78 78 } 79 79 80 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 80 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 81 81 { 82 82 pevent_unregister_event_handler(pevent, -1, 83 83 "timer", "hrtimer_expire_entry",
+2 -2
tools/lib/traceevent/plugin_jbd2.c
··· 47 47 return jiffies; 48 48 } 49 49 50 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 50 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 51 51 { 52 52 pevent_register_print_function(pevent, 53 53 process_jbd2_dev_to_name, ··· 65 65 return 0; 66 66 } 67 67 68 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 68 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 69 69 { 70 70 pevent_unregister_print_function(pevent, process_jbd2_dev_to_name, 71 71 "jbd2_dev_to_name");
+2 -2
tools/lib/traceevent/plugin_kmem.c
··· 48 48 return 1; 49 49 } 50 50 51 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 51 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 52 52 { 53 53 pevent_register_event_handler(pevent, -1, "kmem", "kfree", 54 54 call_site_handler, NULL); ··· 71 71 return 0; 72 72 } 73 73 74 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 74 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 75 75 { 76 76 pevent_unregister_event_handler(pevent, -1, "kmem", "kfree", 77 77 call_site_handler, NULL);
+2 -2
tools/lib/traceevent/plugin_kvm.c
··· 444 444 return pte & PT_WRITABLE_MASK; 445 445 } 446 446 447 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 447 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 448 448 { 449 449 init_disassembler(); 450 450 ··· 486 486 return 0; 487 487 } 488 488 489 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 489 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 490 490 { 491 491 pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_exit", 492 492 kvm_exit_handler, NULL);
+2 -2
tools/lib/traceevent/plugin_mac80211.c
··· 86 86 return 0; 87 87 } 88 88 89 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 89 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 90 90 { 91 91 pevent_register_event_handler(pevent, -1, "mac80211", 92 92 "drv_bss_info_changed", ··· 94 94 return 0; 95 95 } 96 96 97 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 97 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 98 98 { 99 99 pevent_unregister_event_handler(pevent, -1, "mac80211", 100 100 "drv_bss_info_changed",
+2 -2
tools/lib/traceevent/plugin_sched_switch.c
··· 134 134 return 0; 135 135 } 136 136 137 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 137 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 138 138 { 139 139 pevent_register_event_handler(pevent, -1, "sched", "sched_switch", 140 140 sched_switch_handler, NULL); ··· 147 147 return 0; 148 148 } 149 149 150 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 150 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 151 151 { 152 152 pevent_unregister_event_handler(pevent, -1, "sched", "sched_switch", 153 153 sched_switch_handler, NULL);
+2 -2
tools/lib/traceevent/plugin_scsi.c
··· 413 413 return 0; 414 414 } 415 415 416 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 416 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 417 417 { 418 418 pevent_register_print_function(pevent, 419 419 process_scsi_trace_parse_cdb, ··· 426 426 return 0; 427 427 } 428 428 429 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 429 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 430 430 { 431 431 pevent_unregister_print_function(pevent, process_scsi_trace_parse_cdb, 432 432 "scsi_trace_parse_cdb");
+2 -2
tools/lib/traceevent/plugin_xen.c
··· 119 119 return 0; 120 120 } 121 121 122 - int PEVENT_PLUGIN_LOADER(struct pevent *pevent) 122 + int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent) 123 123 { 124 124 pevent_register_print_function(pevent, 125 125 process_xen_hypercall_name, ··· 130 130 return 0; 131 131 } 132 132 133 - void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 133 + void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent) 134 134 { 135 135 pevent_unregister_print_function(pevent, process_xen_hypercall_name, 136 136 "xen_hypercall_name");
+2 -2
tools/perf/util/header.c
··· 3204 3204 } 3205 3205 3206 3206 static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, 3207 - struct pevent *pevent) 3207 + struct tep_handle *pevent) 3208 3208 { 3209 3209 struct event_format *event; 3210 3210 char bf[128]; ··· 3236 3236 } 3237 3237 3238 3238 static int perf_evlist__prepare_tracepoint_events(struct perf_evlist *evlist, 3239 - struct pevent *pevent) 3239 + struct tep_handle *pevent) 3240 3240 { 3241 3241 struct perf_evsel *pos; 3242 3242
+1 -1
tools/perf/util/python.c
··· 341 341 static PyObject* 342 342 tracepoint_field(struct pyrf_event *pe, struct format_field *field) 343 343 { 344 - struct pevent *pevent = field->event->pevent; 344 + struct tep_handle *pevent = field->event->pevent; 345 345 void *data = pe->sample.raw_data; 346 346 PyObject *ret = NULL; 347 347 unsigned long long val;
+1 -1
tools/perf/util/scripting-engines/trace-event-perl.c
··· 535 535 return 0; 536 536 } 537 537 538 - static int perl_generate_script(struct pevent *pevent, const char *outfile) 538 + static int perl_generate_script(struct tep_handle *pevent, const char *outfile) 539 539 { 540 540 struct event_format *event = NULL; 541 541 struct format_field *f;
+1 -1
tools/perf/util/scripting-engines/trace-event-python.c
··· 1588 1588 return 0; 1589 1589 } 1590 1590 1591 - static int python_generate_script(struct pevent *pevent, const char *outfile) 1591 + static int python_generate_script(struct tep_handle *pevent, const char *outfile) 1592 1592 { 1593 1593 struct event_format *event = NULL; 1594 1594 struct format_field *f;
+1 -1
tools/perf/util/sort.h
··· 276 276 extern struct list_head hist_entry__sort_list; 277 277 278 278 struct perf_evlist; 279 - struct pevent; 279 + struct tep_handle; 280 280 int setup_sorting(struct perf_evlist *evlist); 281 281 int setup_output_field(void); 282 282 void reset_output_field(void);
+6 -6
tools/perf/util/trace-event-parse.c
··· 32 32 static int get_common_field(struct scripting_context *context, 33 33 int *offset, int *size, const char *type) 34 34 { 35 - struct pevent *pevent = context->pevent; 35 + struct tep_handle *pevent = context->pevent; 36 36 struct event_format *event; 37 37 struct format_field *field; 38 38 ··· 136 136 return event_format__fprintf(event, cpu, data, size, stdout); 137 137 } 138 138 139 - void parse_ftrace_printk(struct pevent *pevent, 139 + void parse_ftrace_printk(struct tep_handle *pevent, 140 140 char *file, unsigned int size __maybe_unused) 141 141 { 142 142 unsigned long long addr; ··· 161 161 } 162 162 } 163 163 164 - void parse_saved_cmdline(struct pevent *pevent, 164 + void parse_saved_cmdline(struct tep_handle *pevent, 165 165 char *file, unsigned int size __maybe_unused) 166 166 { 167 167 char *comm; ··· 178 178 } 179 179 } 180 180 181 - int parse_ftrace_file(struct pevent *pevent, char *buf, unsigned long size) 181 + int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size) 182 182 { 183 183 return pevent_parse_event(pevent, buf, size, "ftrace"); 184 184 } 185 185 186 - int parse_event_file(struct pevent *pevent, 186 + int parse_event_file(struct tep_handle *pevent, 187 187 char *buf, unsigned long size, char *sys) 188 188 { 189 189 return pevent_parse_event(pevent, buf, size, sys); 190 190 } 191 191 192 - struct event_format *trace_find_next_event(struct pevent *pevent, 192 + struct event_format *trace_find_next_event(struct tep_handle *pevent, 193 193 struct event_format *event) 194 194 { 195 195 static int idx;
+12 -12
tools/perf/util/trace-event-read.c
··· 96 96 }; 97 97 } 98 98 99 - static unsigned int read4(struct pevent *pevent) 99 + static unsigned int read4(struct tep_handle *pevent) 100 100 { 101 101 unsigned int data; 102 102 ··· 105 105 return __data2host4(pevent, data); 106 106 } 107 107 108 - static unsigned long long read8(struct pevent *pevent) 108 + static unsigned long long read8(struct tep_handle *pevent) 109 109 { 110 110 unsigned long long data; 111 111 ··· 158 158 return str; 159 159 } 160 160 161 - static int read_proc_kallsyms(struct pevent *pevent) 161 + static int read_proc_kallsyms(struct tep_handle *pevent) 162 162 { 163 163 unsigned int size; 164 164 ··· 181 181 return 0; 182 182 } 183 183 184 - static int read_ftrace_printk(struct pevent *pevent) 184 + static int read_ftrace_printk(struct tep_handle *pevent) 185 185 { 186 186 unsigned int size; 187 187 char *buf; ··· 208 208 return 0; 209 209 } 210 210 211 - static int read_header_files(struct pevent *pevent) 211 + static int read_header_files(struct tep_handle *pevent) 212 212 { 213 213 unsigned long long size; 214 214 char *header_page; ··· 259 259 return ret; 260 260 } 261 261 262 - static int read_ftrace_file(struct pevent *pevent, unsigned long long size) 262 + static int read_ftrace_file(struct tep_handle *pevent, unsigned long long size) 263 263 { 264 264 int ret; 265 265 char *buf; ··· 284 284 return ret; 285 285 } 286 286 287 - static int read_event_file(struct pevent *pevent, char *sys, 288 - unsigned long long size) 287 + static int read_event_file(struct tep_handle *pevent, char *sys, 288 + unsigned long long size) 289 289 { 290 290 int ret; 291 291 char *buf; ··· 310 310 return ret; 311 311 } 312 312 313 - static int read_ftrace_files(struct pevent *pevent) 313 + static int read_ftrace_files(struct tep_handle *pevent) 314 314 { 315 315 unsigned long long size; 316 316 int count; ··· 328 328 return 0; 329 329 } 330 330 331 - static int read_event_files(struct pevent *pevent) 331 + static int read_event_files(struct tep_handle *pevent) 332 332 { 333 333 unsigned long long size; 334 334 char *sys; ··· 356 356 return 0; 357 357 } 358 358 359 - static int read_saved_cmdline(struct pevent *pevent) 359 + static int read_saved_cmdline(struct tep_handle *pevent) 360 360 { 361 361 unsigned long long size; 362 362 char *buf; ··· 399 399 int host_bigendian; 400 400 int file_long_size; 401 401 int file_page_size; 402 - struct pevent *pevent = NULL; 402 + struct tep_handle *pevent = NULL; 403 403 int err; 404 404 405 405 repipe = __repipe;
+2 -2
tools/perf/util/trace-event-scripting.c
··· 66 66 return -1; 67 67 } 68 68 69 - static int python_generate_script_unsupported(struct pevent *pevent 69 + static int python_generate_script_unsupported(struct tep_handle *pevent 70 70 __maybe_unused, 71 71 const char *outfile 72 72 __maybe_unused) ··· 130 130 return -1; 131 131 } 132 132 133 - static int perl_generate_script_unsupported(struct pevent *pevent 133 + static int perl_generate_script_unsupported(struct tep_handle *pevent 134 134 __maybe_unused, 135 135 const char *outfile __maybe_unused) 136 136 {
+3 -3
tools/perf/util/trace-event.c
··· 28 28 29 29 int trace_event__init(struct trace_event *t) 30 30 { 31 - struct pevent *pevent = pevent_alloc(); 31 + struct tep_handle *pevent = pevent_alloc(); 32 32 33 33 if (pevent) { 34 34 t->plugin_list = traceevent_load_plugins(pevent); ··· 41 41 static int trace_event__init2(void) 42 42 { 43 43 int be = traceevent_host_bigendian(); 44 - struct pevent *pevent; 44 + struct tep_handle *pevent; 45 45 46 46 if (trace_event__init(&tevent)) 47 47 return -1; ··· 76 76 tp_format(const char *sys, const char *name) 77 77 { 78 78 char *tp_dir = get_events_file(sys); 79 - struct pevent *pevent = tevent.pevent; 79 + struct tep_handle *pevent = tevent.pevent; 80 80 struct event_format *event = NULL; 81 81 char path[PATH_MAX]; 82 82 size_t size;
+9 -9
tools/perf/util/trace-event.h
··· 13 13 struct plugin_list; 14 14 15 15 struct trace_event { 16 - struct pevent *pevent; 16 + struct tep_handle *pevent; 17 17 struct plugin_list *plugin_list; 18 18 }; 19 19 ··· 34 34 void event_format__print(struct event_format *event, 35 35 int cpu, void *data, int size); 36 36 37 - int parse_ftrace_file(struct pevent *pevent, char *buf, unsigned long size); 38 - int parse_event_file(struct pevent *pevent, 37 + int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size); 38 + int parse_event_file(struct tep_handle *pevent, 39 39 char *buf, unsigned long size, char *sys); 40 40 41 41 unsigned long long 42 42 raw_field_value(struct event_format *event, const char *name, void *data); 43 43 44 - void parse_proc_kallsyms(struct pevent *pevent, char *file, unsigned int size); 45 - void parse_ftrace_printk(struct pevent *pevent, char *file, unsigned int size); 46 - void parse_saved_cmdline(struct pevent *pevent, char *file, unsigned int size); 44 + void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size); 45 + void parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigned int size); 46 + void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int size); 47 47 48 48 ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe); 49 49 50 - struct event_format *trace_find_next_event(struct pevent *pevent, 50 + struct event_format *trace_find_next_event(struct tep_handle *pevent, 51 51 struct event_format *event); 52 52 unsigned long long read_size(struct event_format *event, void *ptr, int size); 53 53 unsigned long long eval_flag(const char *flag); ··· 83 83 void (*process_stat)(struct perf_stat_config *config, 84 84 struct perf_evsel *evsel, u64 tstamp); 85 85 void (*process_stat_interval)(u64 tstamp); 86 - int (*generate_script) (struct pevent *pevent, const char *outfile); 86 + int (*generate_script) (struct tep_handle *pevent, const char *outfile); 87 87 }; 88 88 89 89 extern unsigned int scripting_max_stack; ··· 94 94 void setup_python_scripting(void); 95 95 96 96 struct scripting_context { 97 - struct pevent *pevent; 97 + struct tep_handle *pevent; 98 98 void *event_data; 99 99 }; 100 100