Commit 1affd34f authored by Tzvetomir Stoyanov (VMware)'s avatar Tzvetomir Stoyanov (VMware) Committed by Arnaldo Carvalho de Melo

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: default avatarTzvetomir 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.orgSigned-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 785be0c9
...@@ -3331,11 +3331,11 @@ unsigned long long tep_read_number(struct tep_handle *pevent, ...@@ -3331,11 +3331,11 @@ unsigned long long tep_read_number(struct tep_handle *pevent,
case 1: case 1:
return *(unsigned char *)ptr; return *(unsigned char *)ptr;
case 2: case 2:
return data2host2(pevent, ptr); return tep_data2host2(pevent, ptr);
case 4: case 4:
return data2host4(pevent, ptr); return tep_data2host4(pevent, ptr);
case 8: case 8:
return data2host8(pevent, ptr); return tep_data2host8(pevent, ptr);
default: default:
/* BUG! */ /* BUG! */
return 0; return 0;
...@@ -4061,7 +4061,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, ...@@ -4061,7 +4061,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
f = tep_find_any_field(event, arg->string.string); f = tep_find_any_field(event, arg->string.string);
arg->string.offset = f->offset; arg->string.offset = f->offset;
} }
str_offset = data2host4(pevent, data + arg->string.offset); str_offset = tep_data2host4(pevent, data + arg->string.offset);
str_offset &= 0xffff; str_offset &= 0xffff;
print_str_to_seq(s, format, len_arg, ((char *)data) + str_offset); print_str_to_seq(s, format, len_arg, ((char *)data) + str_offset);
break; break;
...@@ -4079,7 +4079,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, ...@@ -4079,7 +4079,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
f = tep_find_any_field(event, arg->bitmask.bitmask); f = tep_find_any_field(event, arg->bitmask.bitmask);
arg->bitmask.offset = f->offset; arg->bitmask.offset = f->offset;
} }
bitmask_offset = data2host4(pevent, data + arg->bitmask.offset); bitmask_offset = tep_data2host4(pevent, data + arg->bitmask.offset);
bitmask_size = bitmask_offset >> 16; bitmask_size = bitmask_offset >> 16;
bitmask_offset &= 0xffff; bitmask_offset &= 0xffff;
print_bitmask_to_seq(pevent, s, format, len_arg, print_bitmask_to_seq(pevent, s, format, len_arg,
......
...@@ -496,7 +496,7 @@ static inline void tep_set_flag(struct tep_handle *pevent, int flag) ...@@ -496,7 +496,7 @@ static inline void tep_set_flag(struct tep_handle *pevent, int flag)
} }
static inline unsigned short static inline unsigned short
__data2host2(struct tep_handle *pevent, unsigned short data) __tep_data2host2(struct tep_handle *pevent, unsigned short data)
{ {
unsigned short swap; unsigned short swap;
...@@ -510,7 +510,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data) ...@@ -510,7 +510,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data)
} }
static inline unsigned int static inline unsigned int
__data2host4(struct tep_handle *pevent, unsigned int data) __tep_data2host4(struct tep_handle *pevent, unsigned int data)
{ {
unsigned int swap; unsigned int swap;
...@@ -526,7 +526,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data) ...@@ -526,7 +526,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data)
} }
static inline unsigned long long static inline unsigned long long
__data2host8(struct tep_handle *pevent, unsigned long long data) __tep_data2host8(struct tep_handle *pevent, unsigned long long data)
{ {
unsigned long long swap; unsigned long long swap;
...@@ -545,14 +545,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data) ...@@ -545,14 +545,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)
return swap; return swap;
} }
#define data2host2(pevent, ptr) __data2host2(pevent, *(unsigned short *)(ptr)) #define tep_data2host2(pevent, ptr) __tep_data2host2(pevent, *(unsigned short *)(ptr))
#define data2host4(pevent, ptr) __data2host4(pevent, *(unsigned int *)(ptr)) #define tep_data2host4(pevent, ptr) __tep_data2host4(pevent, *(unsigned int *)(ptr))
#define data2host8(pevent, ptr) \ #define tep_data2host8(pevent, ptr) \
({ \ ({ \
unsigned long long __val; \ unsigned long long __val; \
\ \
memcpy(&__val, (ptr), sizeof(unsigned long long)); \ memcpy(&__val, (ptr), sizeof(unsigned long long)); \
__data2host8(pevent, __val); \ __tep_data2host8(pevent, __val); \
}) })
static inline int tep_host_bigendian(void) static inline int tep_host_bigendian(void)
......
...@@ -102,7 +102,7 @@ static unsigned int read4(struct tep_handle *pevent) ...@@ -102,7 +102,7 @@ static unsigned int read4(struct tep_handle *pevent)
if (do_read(&data, 4) < 0) if (do_read(&data, 4) < 0)
return 0; return 0;
return __data2host4(pevent, data); return __tep_data2host4(pevent, data);
} }
static unsigned long long read8(struct tep_handle *pevent) static unsigned long long read8(struct tep_handle *pevent)
...@@ -111,7 +111,7 @@ static unsigned long long read8(struct tep_handle *pevent) ...@@ -111,7 +111,7 @@ static unsigned long long read8(struct tep_handle *pevent)
if (do_read(&data, 8) < 0) if (do_read(&data, 8) < 0)
return 0; return 0;
return __data2host8(pevent, data); return __tep_data2host8(pevent, data);
} }
static char *read_string(void) static char *read_string(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment