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

tools lib traceevent: Rename pevent_find_* APIs

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
APIs: pevent_find_function, pevent_find_function_address,
pevent_find_event_by_name, pevent_find_event_by_record

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/20180808180702.966965051@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
610e1e4f 8b3e0872

+25 -25
+12 -12
tools/lib/traceevent/event-parse.c
··· 503 503 } 504 504 505 505 /** 506 - * pevent_find_function - find a function by a given address 506 + * tep_find_function - find a function by a given address 507 507 * @pevent: handle for the pevent 508 508 * @addr: the address to find the function with 509 509 * ··· 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 tep_handle *pevent, unsigned long long addr) 514 + const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr) 515 515 { 516 516 struct func_map *map; 517 517 ··· 523 523 } 524 524 525 525 /** 526 - * pevent_find_function_address - find a function address by a given address 526 + * tep_find_function_address - find a function address by a given address 527 527 * @pevent: handle for the pevent 528 528 * @addr: the address to find the function with 529 529 * 530 530 * Returns the address the function starts at. This can be used in 531 - * conjunction with pevent_find_function to print both the function 531 + * conjunction with tep_find_function to print both the function 532 532 * name and the function offset. 533 533 */ 534 534 unsigned long long 535 - pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr) 535 + tep_find_function_address(struct tep_handle *pevent, unsigned long long addr) 536 536 { 537 537 struct func_map *map; 538 538 ··· 3498 3498 } 3499 3499 3500 3500 /** 3501 - * pevent_find_event_by_name - find an event by given name 3501 + * tep_find_event_by_name - find an event by given name 3502 3502 * @pevent: a handle to the pevent 3503 3503 * @sys: the system name to search for 3504 3504 * @name: the name of the event to search for ··· 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 tep_handle *pevent, 3511 - const char *sys, const char *name) 3510 + tep_find_event_by_name(struct tep_handle *pevent, 3511 + const char *sys, const char *name) 3512 3512 { 3513 3513 struct event_format *event; 3514 3514 int i; ··· 5433 5433 } 5434 5434 5435 5435 /** 5436 - * pevent_find_event_by_record - return the event from a given record 5436 + * tep_find_event_by_record - return the event from a given record 5437 5437 * @pevent: a handle to the pevent 5438 5438 * @record: The record to get the event from 5439 5439 * ··· 5441 5441 * is found. 5442 5442 */ 5443 5443 struct event_format * 5444 - pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) 5444 + tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) 5445 5445 { 5446 5446 int type; 5447 5447 ··· 5564 5564 { 5565 5565 struct event_format *event; 5566 5566 5567 - event = pevent_find_event_by_record(pevent, record); 5567 + event = tep_find_event_by_record(pevent, record); 5568 5568 if (!event) { 5569 5569 int i; 5570 5570 int type = trace_parse_common_type(pevent, record->data); ··· 6607 6607 if (sys_name && (strcmp(sys_name, event->system) != 0)) 6608 6608 return NULL; 6609 6609 } else { 6610 - event = pevent_find_event_by_name(pevent, sys_name, event_name); 6610 + event = tep_find_event_by_name(pevent, sys_name, event_name); 6611 6611 if (!event) 6612 6612 return NULL; 6613 6613 }
+4 -4
tools/lib/traceevent/event-parse.h
··· 690 690 struct format_field *tep_find_field(struct event_format *event, const char *name); 691 691 struct format_field *tep_find_any_field(struct event_format *event, const char *name); 692 692 693 - const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr); 693 + const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); 694 694 unsigned long long 695 - pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr); 695 + tep_find_function_address(struct tep_handle *pevent, unsigned long long addr); 696 696 unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size); 697 697 int tep_read_number_field(struct format_field *field, const void *data, 698 698 unsigned long long *value); ··· 700 700 struct event_format *tep_find_event(struct tep_handle *pevent, int id); 701 701 702 702 struct event_format * 703 - pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); 703 + tep_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 tep_handle *pevent, struct tep_record *record); 706 + tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); 707 707 708 708 void tep_data_lat_fmt(struct tep_handle *pevent, 709 709 struct trace_seq *s, struct tep_record *record);
+5 -5
tools/lib/traceevent/parse-filter.c
··· 1478 1478 /* Can't assume that the pevent's are the same */ 1479 1479 sys = filter_type->event->system; 1480 1480 name = filter_type->event->name; 1481 - event = pevent_find_event_by_name(filter->pevent, sys, name); 1481 + event = tep_find_event_by_name(filter->pevent, sys, name); 1482 1482 if (!event) 1483 1483 return -1; 1484 1484 ··· 1578 1578 1579 1579 if (src_pevent != dest_pevent) { 1580 1580 /* do a look up */ 1581 - event = pevent_find_event_by_name(src_pevent, 1582 - event->system, 1583 - event->name); 1581 + event = tep_find_event_by_name(src_pevent, 1582 + event->system, 1583 + event->name); 1584 1584 if (!event) 1585 1585 return -1; 1586 1586 } ··· 1909 1909 1910 1910 if (arg->str.field->flags & (FIELD_IS_POINTER | FIELD_IS_LONG)) 1911 1911 /* convert to a kernel symbol */ 1912 - val = pevent_find_function(pevent, addr); 1912 + val = tep_find_function(pevent, addr); 1913 1913 1914 1914 if (val == NULL) { 1915 1915 /* just use the hex of the string name */
+2 -2
tools/lib/traceevent/plugin_function.c
··· 135 135 if (tep_get_field_val(s, event, "ip", record, &function, 1)) 136 136 return trace_seq_putc(s, '!'); 137 137 138 - func = pevent_find_function(pevent, function); 138 + func = tep_find_function(pevent, function); 139 139 140 140 if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) 141 141 return trace_seq_putc(s, '!'); 142 142 143 - parent = pevent_find_function(pevent, pfunction); 143 + parent = tep_find_function(pevent, pfunction); 144 144 145 145 if (parent && ftrace_indent->set) 146 146 index = add_and_get_index(parent, func, record->cpu);
+2 -2
tools/lib/traceevent/plugin_kmem.c
··· 38 38 if (tep_read_number_field(field, data, &val)) 39 39 return 1; 40 40 41 - func = pevent_find_function(event->pevent, val); 41 + func = tep_find_function(event->pevent, val); 42 42 if (!func) 43 43 return 1; 44 44 45 - addr = pevent_find_function_address(event->pevent, val); 45 + addr = tep_find_function_address(event->pevent, val); 46 46 47 47 trace_seq_printf(s, "(%s+0x%x) ", func, (int)(val - addr)); 48 48 return 1;