diff options
author | Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> | 2018-09-19 14:56:57 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-09-19 16:30:06 -0400 |
commit | 1affd34f192a516436a2e0cec15a97bc1001678a (patch) | |
tree | d0ab1245c7759384bdf8aa1f602ae0c7bcad7955 | |
parent | 785be0c98d24aaf417588322c74999520ea790a4 (diff) |
tools lib traceevent: Rename data2host*() 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_". This renames data2host*() APIs
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180919185724.751088939@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 10 | ||||
-rw-r--r-- | tools/lib/traceevent/event-parse.h | 14 | ||||
-rw-r--r-- | tools/perf/util/trace-event-read.c | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 055bee7b738a..7980fc6c3bac 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -3331,11 +3331,11 @@ unsigned long long tep_read_number(struct tep_handle *pevent, | |||
3331 | case 1: | 3331 | case 1: |
3332 | return *(unsigned char *)ptr; | 3332 | return *(unsigned char *)ptr; |
3333 | case 2: | 3333 | case 2: |
3334 | return data2host2(pevent, ptr); | 3334 | return tep_data2host2(pevent, ptr); |
3335 | case 4: | 3335 | case 4: |
3336 | return data2host4(pevent, ptr); | 3336 | return tep_data2host4(pevent, ptr); |
3337 | case 8: | 3337 | case 8: |
3338 | return data2host8(pevent, ptr); | 3338 | return tep_data2host8(pevent, ptr); |
3339 | default: | 3339 | default: |
3340 | /* BUG! */ | 3340 | /* BUG! */ |
3341 | return 0; | 3341 | return 0; |
@@ -4061,7 +4061,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, | |||
4061 | f = tep_find_any_field(event, arg->string.string); | 4061 | f = tep_find_any_field(event, arg->string.string); |
4062 | arg->string.offset = f->offset; | 4062 | arg->string.offset = f->offset; |
4063 | } | 4063 | } |
4064 | str_offset = data2host4(pevent, data + arg->string.offset); | 4064 | str_offset = tep_data2host4(pevent, data + arg->string.offset); |
4065 | str_offset &= 0xffff; | 4065 | str_offset &= 0xffff; |
4066 | print_str_to_seq(s, format, len_arg, ((char *)data) + str_offset); | 4066 | print_str_to_seq(s, format, len_arg, ((char *)data) + str_offset); |
4067 | break; | 4067 | break; |
@@ -4079,7 +4079,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, | |||
4079 | f = tep_find_any_field(event, arg->bitmask.bitmask); | 4079 | f = tep_find_any_field(event, arg->bitmask.bitmask); |
4080 | arg->bitmask.offset = f->offset; | 4080 | arg->bitmask.offset = f->offset; |
4081 | } | 4081 | } |
4082 | bitmask_offset = data2host4(pevent, data + arg->bitmask.offset); | 4082 | bitmask_offset = tep_data2host4(pevent, data + arg->bitmask.offset); |
4083 | bitmask_size = bitmask_offset >> 16; | 4083 | bitmask_size = bitmask_offset >> 16; |
4084 | bitmask_offset &= 0xffff; | 4084 | bitmask_offset &= 0xffff; |
4085 | print_bitmask_to_seq(pevent, s, format, len_arg, | 4085 | print_bitmask_to_seq(pevent, s, format, len_arg, |
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 2a7b0a857f39..830147dc6b21 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
@@ -496,7 +496,7 @@ static inline void tep_set_flag(struct tep_handle *pevent, int flag) | |||
496 | } | 496 | } |
497 | 497 | ||
498 | static inline unsigned short | 498 | static inline unsigned short |
499 | __data2host2(struct tep_handle *pevent, unsigned short data) | 499 | __tep_data2host2(struct tep_handle *pevent, unsigned short data) |
500 | { | 500 | { |
501 | unsigned short swap; | 501 | unsigned short swap; |
502 | 502 | ||
@@ -510,7 +510,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data) | |||
510 | } | 510 | } |
511 | 511 | ||
512 | static inline unsigned int | 512 | static inline unsigned int |
513 | __data2host4(struct tep_handle *pevent, unsigned int data) | 513 | __tep_data2host4(struct tep_handle *pevent, unsigned int data) |
514 | { | 514 | { |
515 | unsigned int swap; | 515 | unsigned int swap; |
516 | 516 | ||
@@ -526,7 +526,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data) | |||
526 | } | 526 | } |
527 | 527 | ||
528 | static inline unsigned long long | 528 | static inline unsigned long long |
529 | __data2host8(struct tep_handle *pevent, unsigned long long data) | 529 | __tep_data2host8(struct tep_handle *pevent, unsigned long long data) |
530 | { | 530 | { |
531 | unsigned long long swap; | 531 | unsigned long long swap; |
532 | 532 | ||
@@ -545,14 +545,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data) | |||
545 | return swap; | 545 | return swap; |
546 | } | 546 | } |
547 | 547 | ||
548 | #define data2host2(pevent, ptr) __data2host2(pevent, *(unsigned short *)(ptr)) | 548 | #define tep_data2host2(pevent, ptr) __tep_data2host2(pevent, *(unsigned short *)(ptr)) |
549 | #define data2host4(pevent, ptr) __data2host4(pevent, *(unsigned int *)(ptr)) | 549 | #define tep_data2host4(pevent, ptr) __tep_data2host4(pevent, *(unsigned int *)(ptr)) |
550 | #define data2host8(pevent, ptr) \ | 550 | #define tep_data2host8(pevent, ptr) \ |
551 | ({ \ | 551 | ({ \ |
552 | unsigned long long __val; \ | 552 | unsigned long long __val; \ |
553 | \ | 553 | \ |
554 | memcpy(&__val, (ptr), sizeof(unsigned long long)); \ | 554 | memcpy(&__val, (ptr), sizeof(unsigned long long)); \ |
555 | __data2host8(pevent, __val); \ | 555 | __tep_data2host8(pevent, __val); \ |
556 | }) | 556 | }) |
557 | 557 | ||
558 | static inline int tep_host_bigendian(void) | 558 | static inline int tep_host_bigendian(void) |
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c index 3dfc1db6b25b..b98ee2a2eb44 100644 --- a/tools/perf/util/trace-event-read.c +++ b/tools/perf/util/trace-event-read.c | |||
@@ -102,7 +102,7 @@ static unsigned int read4(struct tep_handle *pevent) | |||
102 | 102 | ||
103 | if (do_read(&data, 4) < 0) | 103 | if (do_read(&data, 4) < 0) |
104 | return 0; | 104 | return 0; |
105 | return __data2host4(pevent, data); | 105 | return __tep_data2host4(pevent, data); |
106 | } | 106 | } |
107 | 107 | ||
108 | static unsigned long long read8(struct tep_handle *pevent) | 108 | static unsigned long long read8(struct tep_handle *pevent) |
@@ -111,7 +111,7 @@ static unsigned long long read8(struct tep_handle *pevent) | |||
111 | 111 | ||
112 | if (do_read(&data, 8) < 0) | 112 | if (do_read(&data, 8) < 0) |
113 | return 0; | 113 | return 0; |
114 | return __data2host8(pevent, data); | 114 | return __tep_data2host8(pevent, data); |
115 | } | 115 | } |
116 | 116 | ||
117 | static char *read_string(void) | 117 | static char *read_string(void) |