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

tools lib traceevent: Rename various pevent get/set/is 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_pid_is_registered, pevent_get_cpus, pevent_set_cpus,
pevent_is_file_bigendian, pevent_is_host_bigendian, pevent_is_latency_format,
pevent_set_latency_format

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/20180808180703.114110715@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
413af01c 610e1e4f

+11 -11
+2 -2
tools/lib/traceevent/event-parse.c
··· 211 211 } 212 212 213 213 /** 214 - * pevent_pid_is_registered - return if a pid has a cmdline registered 214 + * tep_pid_is_registered - return if a pid has a cmdline registered 215 215 * @pevent: handle for the pevent 216 216 * @pid: The pid to check if it has a cmdline registered with. 217 217 * 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 tep_handle *pevent, int pid) 221 + int tep_pid_is_registered(struct tep_handle *pevent, int pid) 222 222 { 223 223 const struct cmdline *comm; 224 224 struct cmdline key;
+7 -7
tools/lib/traceevent/event-parse.h
··· 624 624 unsigned long long addr, char *mod); 625 625 int tep_register_print_string(struct tep_handle *pevent, const char *fmt, 626 626 unsigned long long addr); 627 - int pevent_pid_is_registered(struct tep_handle *pevent, int pid); 627 + int tep_pid_is_registered(struct tep_handle *pevent, int pid); 628 628 629 629 void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 630 630 struct event_format *event, ··· 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 tep_handle *pevent) 734 + static inline int tep_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 tep_handle *pevent, int cpus) 739 + static inline void tep_set_cpus(struct tep_handle *pevent, int cpus) 740 740 { 741 741 pevent->cpus = cpus; 742 742 } ··· 761 761 pevent->page_size = _page_size; 762 762 } 763 763 764 - static inline int pevent_is_file_bigendian(struct tep_handle *pevent) 764 + static inline int tep_is_file_bigendian(struct tep_handle *pevent) 765 765 { 766 766 return pevent->file_bigendian; 767 767 } ··· 771 771 pevent->file_bigendian = endian; 772 772 } 773 773 774 - static inline int pevent_is_host_bigendian(struct tep_handle *pevent) 774 + static inline int tep_is_host_bigendian(struct tep_handle *pevent) 775 775 { 776 776 return pevent->host_bigendian; 777 777 } ··· 781 781 pevent->host_bigendian = endian; 782 782 } 783 783 784 - static inline int pevent_is_latency_format(struct tep_handle *pevent) 784 + static inline int tep_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 tep_handle *pevent, int lat) 789 + static inline void tep_set_latency_format(struct tep_handle *pevent, int lat) 790 790 { 791 791 pevent->latency_format = lat; 792 792 }
+2 -2
tools/lib/traceevent/plugin_kvm.c
··· 388 388 * We can only use the structure if file is of the same 389 389 * endianess. 390 390 */ 391 - if (pevent_is_file_bigendian(event->pevent) == 392 - pevent_is_host_bigendian(event->pevent)) { 391 + if (tep_is_file_bigendian(event->pevent) == 392 + tep_is_host_bigendian(event->pevent)) { 393 393 394 394 trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s", 395 395 role.level,