aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2018-08-08 14:03:05 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-13 14:31:28 -0400
commit610e1e4ff0431b3a86a0ebfcdb47828b8e082329 (patch)
tree07d6cc3e27d89fce8644b4409955be495a0888cb /tools
parent8b3e08722ec8b288066eab66193736a65645c0a2 (diff)
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/traceevent/event-parse.c24
-rw-r--r--tools/lib/traceevent/event-parse.h8
-rw-r--r--tools/lib/traceevent/parse-filter.c10
-rw-r--r--tools/lib/traceevent/plugin_function.c4
-rw-r--r--tools/lib/traceevent/plugin_kmem.c4
5 files changed, 25 insertions, 25 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 652b8ef6f4c7..53d866434478 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -503,7 +503,7 @@ find_func(struct tep_handle *pevent, unsigned long long addr)
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 * @pevent: handle for the pevent 507 * @pevent: handle for the pevent
508 * @addr: the address to find the function with 508 * @addr: the address to find the function with
509 * 509 *
@@ -511,7 +511,7 @@ find_func(struct tep_handle *pevent, unsigned long long addr)
511 * address. Note, the address does not have to be exact, it 511 * address. Note, the address does not have to be exact, it
512 * will select the function that would contain the address. 512 * will select the function that would contain the address.
513 */ 513 */
514const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr) 514const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr)
515{ 515{
516 struct func_map *map; 516 struct func_map *map;
517 517
@@ -523,16 +523,16 @@ const char *pevent_find_function(struct tep_handle *pevent, unsigned long long a
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 * @pevent: handle for the pevent 527 * @pevent: handle for the pevent
528 * @addr: the address to find the function with 528 * @addr: the address to find the function with
529 * 529 *
530 * Returns the address the function starts at. This can be used in 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 * name and the function offset. 532 * name and the function offset.
533 */ 533 */
534unsigned long long 534unsigned long long
535pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr) 535tep_find_function_address(struct tep_handle *pevent, unsigned long long addr)
536{ 536{
537 struct func_map *map; 537 struct func_map *map;
538 538
@@ -3498,7 +3498,7 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)
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 * @pevent: a handle to the pevent 3502 * @pevent: a handle to the pevent
3503 * @sys: the system name to search for 3503 * @sys: the system name to search for
3504 * @name: the name of the event to search for 3504 * @name: the name of the event to search for
@@ -3507,8 +3507,8 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)
3507 * @sys. If @sys is NULL the first event with @name is returned. 3507 * @sys. If @sys is NULL the first event with @name is returned.
3508 */ 3508 */
3509struct event_format * 3509struct event_format *
3510pevent_find_event_by_name(struct tep_handle *pevent, 3510tep_find_event_by_name(struct tep_handle *pevent,
3511 const char *sys, const char *name) 3511 const char *sys, const char *name)
3512{ 3512{
3513 struct event_format *event; 3513 struct event_format *event;
3514 int i; 3514 int i;
@@ -5433,7 +5433,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)
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 * @pevent: a handle to the pevent 5437 * @pevent: a handle to the pevent
5438 * @record: The record to get the event from 5438 * @record: The record to get the event from
5439 * 5439 *
@@ -5441,7 +5441,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)
5441 * is found. 5441 * is found.
5442 */ 5442 */
5443struct event_format * 5443struct event_format *
5444pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) 5444tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
5445{ 5445{
5446 int type; 5446 int type;
5447 5447
@@ -5564,7 +5564,7 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
5564{ 5564{
5565 struct event_format *event; 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 if (!event) { 5568 if (!event) {
5569 int i; 5569 int i;
5570 int type = trace_parse_common_type(pevent, record->data); 5570 int type = trace_parse_common_type(pevent, record->data);
@@ -6607,7 +6607,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i
6607 if (sys_name && (strcmp(sys_name, event->system) != 0)) 6607 if (sys_name && (strcmp(sys_name, event->system) != 0))
6608 return NULL; 6608 return NULL;
6609 } else { 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 if (!event) 6611 if (!event)
6612 return NULL; 6612 return NULL;
6613 } 6613 }
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 04ffc6e508cf..63ec6d419219 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -690,9 +690,9 @@ struct format_field *tep_find_common_field(struct event_format *event, const cha
690struct format_field *tep_find_field(struct event_format *event, const char *name); 690struct format_field *tep_find_field(struct event_format *event, const char *name);
691struct format_field *tep_find_any_field(struct event_format *event, const char *name); 691struct format_field *tep_find_any_field(struct event_format *event, const char *name);
692 692
693const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr); 693const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr);
694unsigned long long 694unsigned long long
695pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr); 695tep_find_function_address(struct tep_handle *pevent, unsigned long long addr);
696unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size); 696unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size);
697int tep_read_number_field(struct format_field *field, const void *data, 697int tep_read_number_field(struct format_field *field, const void *data,
698 unsigned long long *value); 698 unsigned long long *value);
@@ -700,10 +700,10 @@ int tep_read_number_field(struct format_field *field, const void *data,
700struct event_format *tep_find_event(struct tep_handle *pevent, int id); 700struct event_format *tep_find_event(struct tep_handle *pevent, int id);
701 701
702struct event_format * 702struct event_format *
703pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); 703tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name);
704 704
705struct event_format * 705struct event_format *
706pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); 706tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record);
707 707
708void tep_data_lat_fmt(struct tep_handle *pevent, 708void tep_data_lat_fmt(struct tep_handle *pevent,
709 struct trace_seq *s, struct tep_record *record); 709 struct trace_seq *s, struct tep_record *record);
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 474d820e97e1..3efab9b4298f 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1478,7 +1478,7 @@ static int copy_filter_type(struct event_filter *filter,
1478 /* Can't assume that the pevent's are the same */ 1478 /* Can't assume that the pevent's are the same */
1479 sys = filter_type->event->system; 1479 sys = filter_type->event->system;
1480 name = filter_type->event->name; 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 if (!event) 1482 if (!event)
1483 return -1; 1483 return -1;
1484 1484
@@ -1578,9 +1578,9 @@ int tep_update_trivial(struct event_filter *dest, struct event_filter *source,
1578 1578
1579 if (src_pevent != dest_pevent) { 1579 if (src_pevent != dest_pevent) {
1580 /* do a look up */ 1580 /* do a look up */
1581 event = pevent_find_event_by_name(src_pevent, 1581 event = tep_find_event_by_name(src_pevent,
1582 event->system, 1582 event->system,
1583 event->name); 1583 event->name);
1584 if (!event) 1584 if (!event)
1585 return -1; 1585 return -1;
1586 } 1586 }
@@ -1909,7 +1909,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco
1909 1909
1910 if (arg->str.field->flags & (FIELD_IS_POINTER | FIELD_IS_LONG)) 1910 if (arg->str.field->flags & (FIELD_IS_POINTER | FIELD_IS_LONG))
1911 /* convert to a kernel symbol */ 1911 /* convert to a kernel symbol */
1912 val = pevent_find_function(pevent, addr); 1912 val = tep_find_function(pevent, addr);
1913 1913
1914 if (val == NULL) { 1914 if (val == NULL) {
1915 /* just use the hex of the string name */ 1915 /* just use the hex of the string name */
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 0962120960eb..424747475d37 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -135,12 +135,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,
135 if (tep_get_field_val(s, event, "ip", record, &function, 1)) 135 if (tep_get_field_val(s, event, "ip", record, &function, 1))
136 return trace_seq_putc(s, '!'); 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 if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) 140 if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1))
141 return trace_seq_putc(s, '!'); 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 if (parent && ftrace_indent->set) 145 if (parent && ftrace_indent->set)
146 index = add_and_get_index(parent, func, record->cpu); 146 index = add_and_get_index(parent, func, record->cpu);
diff --git a/tools/lib/traceevent/plugin_kmem.c b/tools/lib/traceevent/plugin_kmem.c
index 6d5938d82c66..73966b05abce 100644
--- a/tools/lib/traceevent/plugin_kmem.c
+++ b/tools/lib/traceevent/plugin_kmem.c
@@ -38,11 +38,11 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,
38 if (tep_read_number_field(field, data, &val)) 38 if (tep_read_number_field(field, data, &val))
39 return 1; 39 return 1;
40 40
41 func = pevent_find_function(event->pevent, val); 41 func = tep_find_function(event->pevent, val);
42 if (!func) 42 if (!func)
43 return 1; 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 trace_seq_printf(s, "(%s+0x%x) ", func, (int)(val - addr)); 47 trace_seq_printf(s, "(%s+0x%x) ", func, (int)(val - addr));
48 return 1; 48 return 1;