All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-trace-devel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 19/27] tools lib traceevent: Rename data2host*() APIs
Date: Mon, 24 Sep 2018 12:02:34 -0300	[thread overview]
Message-ID: <20180924150242.14235-20-acme@kernel.org> (raw)
In-Reply-To: <20180924150242.14235-1-acme@kernel.org>

From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>

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>
---
 tools/lib/traceevent/event-parse.c | 10 +++++-----
 tools/lib/traceevent/event-parse.h | 14 +++++++-------
 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,
 	case 1:
 		return *(unsigned char *)ptr;
 	case 2:
-		return data2host2(pevent, ptr);
+		return tep_data2host2(pevent, ptr);
 	case 4:
-		return data2host4(pevent, ptr);
+		return tep_data2host4(pevent, ptr);
 	case 8:
-		return data2host8(pevent, ptr);
+		return tep_data2host8(pevent, ptr);
 	default:
 		/* BUG! */
 		return 0;
@@ -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);
 			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;
 		print_str_to_seq(s, format, len_arg, ((char *)data) + str_offset);
 		break;
@@ -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);
 			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_offset &= 0xffff;
 		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)
 }
 
 static inline unsigned short
-__data2host2(struct tep_handle *pevent, unsigned short data)
+__tep_data2host2(struct tep_handle *pevent, unsigned short data)
 {
 	unsigned short swap;
 
@@ -510,7 +510,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data)
 }
 
 static inline unsigned int
-__data2host4(struct tep_handle *pevent, unsigned int data)
+__tep_data2host4(struct tep_handle *pevent, unsigned int data)
 {
 	unsigned int swap;
 
@@ -526,7 +526,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data)
 }
 
 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;
 
@@ -545,14 +545,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)
 	return swap;
 }
 
-#define data2host2(pevent, ptr)		__data2host2(pevent, *(unsigned short *)(ptr))
-#define data2host4(pevent, ptr)		__data2host4(pevent, *(unsigned int *)(ptr))
-#define data2host8(pevent, ptr)					\
+#define tep_data2host2(pevent, ptr)		__tep_data2host2(pevent, *(unsigned short *)(ptr))
+#define tep_data2host4(pevent, ptr)		__tep_data2host4(pevent, *(unsigned int *)(ptr))
+#define tep_data2host8(pevent, ptr)					\
 ({								\
 	unsigned long long __val;				\
 								\
 	memcpy(&__val, (ptr), sizeof(unsigned long long));	\
-	__data2host8(pevent, __val);				\
+	__tep_data2host8(pevent, __val);				\
 })
 
 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)
 
 	if (do_read(&data, 4) < 0)
 		return 0;
-	return __data2host4(pevent, data);
+	return __tep_data2host4(pevent, data);
 }
 
 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)
 		return 0;
-	return __data2host8(pevent, data);
+	return __tep_data2host8(pevent, data);
 }
 
 static char *read_string(void)
-- 
2.14.4


  parent reply	other threads:[~2018-09-24 15:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 15:02 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-09-24 15:02 ` Arnaldo Carvalho de Melo
2018-09-24 15:02 ` Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 01/27] perf help: Add missing subcommand `version` Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 02/27] perf tools: Report itrace options in help Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 03/27] tools lib subcmd: Support overwriting the pager Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 04/27] perf script: Allow sym and dso without ip, addr Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 05/27] perf script: Print DSO for callindent Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 06/27] tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 07/27] tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field} Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 08/27] tools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 09/27] tools lib traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 10/27] tools lib traceevent: Add prefix TEP_ to all EVENT_FL_* flags Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 11/27] tools lib traceevent, perf tools: Add prefix tep_ to all print_* structures Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 12/27] tools lib traceevent, perf tools: Rename enum print_arg_type to enum tep_print_arg_type Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 13/27] tools lib traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 14/27] tools lib traceevent: Add prefix tep_ to enums filter_{exp,arg}_type Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 15/27] tools lib traceevent: Add prefix tep_ to struct filter_{arg,value_type} Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 16/27] tools lib traceevent: Add prefix tep_ to various structs filter_arg_* Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 17/27] tools lib traceevent: Add prefix tep_ to structs filter_type and event_filter Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 18/27] tools lib traceevent: Rename struct plugin_list to struct tep_plugin_list Arnaldo Carvalho de Melo
2018-09-24 15:02 ` Arnaldo Carvalho de Melo [this message]
2018-09-24 15:02 ` [PATCH 20/27] tools lib traceevent: Add prefix tep_ to enum filter_trivial_type Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 21/27] perf script: Enhance sample flags for trace begin / end Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 22/27] perf db-export: Add trace begin / end branch type variants Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 23/27] perf tools: Improve thread_stack__event() for trace begin / end Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 24/27] perf tools: Improve thread_stack__process() " Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 25/27] perf intel-pt: Add decoder flags " Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 26/27] perf intel-pt: Implement " Arnaldo Carvalho de Melo
2018-09-24 15:02 ` [PATCH 27/27] perf vendor events arm64: Revise core JSON events for eMAG Arnaldo Carvalho de Melo
2018-09-24 15:02   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180924150242.14235-20-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tz.stoyanov@gmail.com \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.