All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Steven Rostedt <srostedt@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Borislav Petkov <bp@alien8.de>, Jiri Olsa <jolsa@redhat.com>,
	Arun Sharma <asharma@fb.com>, Namhyung Kim <namhyung.kim@lge.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 15/15] parse-events: Rename struct record to struct pevent_record
Date: Fri,  6 Apr 2012 00:48:06 +0200	[thread overview]
Message-ID: <1333666086-6517-16-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1333666086-6517-1-git-send-email-fweisbec@gmail.com>

From: Steven Rostedt <srostedt@redhat.com>

As libtraceevent will be a library, having struct record is far
too generic of a name to use. Renaming it to be consistent with the
rest of the functions will be a better long term solution.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 tools/lib/traceevent/event-parse.c  |   22 +++++++++++-----------
 tools/lib/traceevent/event-parse.h  |   30 +++++++++++++++---------------
 tools/lib/traceevent/parse-filter.c |   24 ++++++++++++------------
 tools/perf/util/trace-event-parse.c |    8 ++++----
 tools/perf/util/trace-event-read.c  |   10 +++++-----
 tools/perf/util/trace-event.h       |    4 ++--
 6 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index ec13174..9985349 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3872,7 +3872,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
  * and lock depth) and places it into the trace_seq.
  */
 void pevent_data_lat_fmt(struct pevent *pevent,
-			 struct trace_seq *s, struct record *record)
+			 struct trace_seq *s, struct pevent_record *record)
 {
 	static int check_lock_depth = 1;
 	static int lock_depth_exists;
@@ -3933,7 +3933,7 @@ void pevent_data_lat_fmt(struct pevent *pevent,
  *
  * This returns the event id from the @rec.
  */
-int pevent_data_type(struct pevent *pevent, struct record *rec)
+int pevent_data_type(struct pevent *pevent, struct pevent_record *rec)
 {
 	return trace_parse_common_type(pevent, rec->data);
 }
@@ -3957,7 +3957,7 @@ struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type
  *
  * This returns the PID from a raw data.
  */
-int pevent_data_pid(struct pevent *pevent, struct record *rec)
+int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec)
 {
 	return parse_common_pid(pevent, rec->data);
 }
@@ -3991,7 +3991,7 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid)
  * writes the print format into the trace_seq.
  */
 void pevent_event_info(struct trace_seq *s, struct event_format *event,
-		       struct record *record)
+		       struct pevent_record *record)
 {
 	int print_pretty = 1;
 
@@ -4011,7 +4011,7 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
 }
 
 void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
-			struct record *record)
+			struct pevent_record *record)
 {
 	static char *spaces = "                    "; /* 20 spaces */
 	struct event_format *event;
@@ -4587,7 +4587,7 @@ int pevent_parse_event(struct pevent *pevent,
 }
 
 int get_field_val(struct trace_seq *s, struct format_field *field,
-		  const char *name, struct record *record,
+		  const char *name, struct pevent_record *record,
 		  unsigned long long *val, int err)
 {
 	if (!field) {
@@ -4620,7 +4620,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,
  * On failure, it returns NULL.
  */
 void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
-			   const char *name, struct record *record,
+			   const char *name, struct pevent_record *record,
 			   int *len, int err)
 {
 	struct format_field *field;
@@ -4667,7 +4667,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
  * Returns 0 on success -1 on field not found.
  */
 int pevent_get_field_val(struct trace_seq *s, struct event_format *event,
-			 const char *name, struct record *record,
+			 const char *name, struct pevent_record *record,
 			 unsigned long long *val, int err)
 {
 	struct format_field *field;
@@ -4692,7 +4692,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,
  * Returns 0 on success -1 on field not found.
  */
 int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,
-				const char *name, struct record *record,
+				const char *name, struct pevent_record *record,
 				unsigned long long *val, int err)
 {
 	struct format_field *field;
@@ -4717,7 +4717,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,
  * Returns 0 on success -1 on field not found.
  */
 int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,
-			     const char *name, struct record *record,
+			     const char *name, struct pevent_record *record,
 			     unsigned long long *val, int err)
 {
 	struct format_field *field;
@@ -4743,7 +4743,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,
  */
 int pevent_print_num_field(struct trace_seq *s, const char *fmt,
 			   struct event_format *event, const char *name,
-			   struct record *record, int err)
+			   struct pevent_record *record, int err)
 {
 	struct format_field *field = pevent_find_field(event, name);
 	unsigned long long val;
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 8852827..ac997bc 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -39,7 +39,7 @@
 #define DEBUG_RECORD 0
 #endif
 
-struct record {
+struct pevent_record {
 	unsigned long long	ts;
 	unsigned long long	offset;
 	long long		missed_events;	/* buffer dropped events before */
@@ -51,8 +51,8 @@ struct record {
 	int			locked;		/* Do not free, even if ref_count is zero */
 	void			*private;
 #if DEBUG_RECORD
-	struct record		*prev;
-	struct record		*next;
+	struct pevent_record	*prev;
+	struct pevent_record	*next;
 	long			alloc_addr;
 #endif
 };
@@ -91,7 +91,7 @@ struct pevent;
 struct event_format;
 
 typedef int (*pevent_event_handler_func)(struct trace_seq *s,
-					 struct record *record,
+					 struct pevent_record *record,
 					 struct event_format *event,
 					 void *context);
 
@@ -497,7 +497,7 @@ int pevent_register_print_string(struct pevent *pevent, char *fmt,
 int pevent_pid_is_registered(struct pevent *pevent, int pid);
 
 void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
-			struct record *record);
+			struct pevent_record *record);
 
 int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long size,
 			     int long_size);
@@ -506,22 +506,22 @@ int pevent_parse_event(struct pevent *pevent, const char *buf,
 		       unsigned long size, const char *sys);
 
 void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
-			   const char *name, struct record *record,
+			   const char *name, struct pevent_record *record,
 			   int *len, int err);
 
 int pevent_get_field_val(struct trace_seq *s, struct event_format *event,
-			 const char *name, struct record *record,
+			 const char *name, struct pevent_record *record,
 			 unsigned long long *val, int err);
 int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,
-				const char *name, struct record *record,
+				const char *name, struct pevent_record *record,
 				unsigned long long *val, int err);
 int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,
-			     const char *name, struct record *record,
+			     const char *name, struct pevent_record *record,
 			     unsigned long long *val, int err);
 
 int pevent_print_num_field(struct trace_seq *s, const char *fmt,
 			   struct event_format *event, const char *name,
-			   struct record *record, int err);
+			   struct pevent_record *record, int err);
 
 int pevent_register_event_handler(struct pevent *pevent, int id, char *sys_name, char *event_name,
 				  pevent_event_handler_func func, void *context);
@@ -547,13 +547,13 @@ struct event_format *
 pevent_find_event_by_name(struct pevent *pevent, const char *sys, const char *name);
 
 void pevent_data_lat_fmt(struct pevent *pevent,
-			 struct trace_seq *s, struct record *record);
-int pevent_data_type(struct pevent *pevent, struct record *rec);
+			 struct trace_seq *s, struct pevent_record *record);
+int pevent_data_type(struct pevent *pevent, struct pevent_record *rec);
 struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type);
-int pevent_data_pid(struct pevent *pevent, struct record *rec);
+int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec);
 const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid);
 void pevent_event_info(struct trace_seq *s, struct event_format *event,
-		       struct record *record);
+		       struct pevent_record *record);
 
 struct event_format **pevent_list_events(struct pevent *pevent, enum event_sort_type);
 struct format_field **pevent_event_common_fields(struct event_format *event);
@@ -773,7 +773,7 @@ int pevent_filter_add_filter_str(struct event_filter *filter,
 
 
 int pevent_filter_match(struct event_filter *filter,
-			struct record *record);
+			struct pevent_record *record);
 
 int pevent_event_filtered(struct event_filter *filter,
 			  int event_id);
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index fe37182..2d40c5e 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1561,10 +1561,10 @@ int pevent_filter_event_has_trivial(struct event_filter *filter,
 }
 
 static int test_filter(struct event_format *event,
-		       struct filter_arg *arg, struct record *record);
+		       struct filter_arg *arg, struct pevent_record *record);
 
 static const char *
-get_comm(struct event_format *event, struct record *record)
+get_comm(struct event_format *event, struct pevent_record *record)
 {
 	const char *comm;
 	int pid;
@@ -1576,7 +1576,7 @@ get_comm(struct event_format *event, struct record *record)
 
 static unsigned long long
 get_value(struct event_format *event,
-	  struct format_field *field, struct record *record)
+	  struct format_field *field, struct pevent_record *record)
 {
 	unsigned long long val;
 
@@ -1607,10 +1607,10 @@ get_value(struct event_format *event,
 }
 
 static unsigned long long
-get_arg_value(struct event_format *event, struct filter_arg *arg, struct record *record);
+get_arg_value(struct event_format *event, struct filter_arg *arg, struct pevent_record *record);
 
 static unsigned long long
-get_exp_value(struct event_format *event, struct filter_arg *arg, struct record *record)
+get_exp_value(struct event_format *event, struct filter_arg *arg, struct pevent_record *record)
 {
 	unsigned long long lval, rval;
 
@@ -1656,7 +1656,7 @@ get_exp_value(struct event_format *event, struct filter_arg *arg, struct record
 }
 
 static unsigned long long
-get_arg_value(struct event_format *event, struct filter_arg *arg, struct record *record)
+get_arg_value(struct event_format *event, struct filter_arg *arg, struct pevent_record *record)
 {
 	switch (arg->type) {
 	case FILTER_ARG_FIELD:
@@ -1677,7 +1677,7 @@ get_arg_value(struct event_format *event, struct filter_arg *arg, struct record
 }
 
 static int test_num(struct event_format *event,
-		    struct filter_arg *arg, struct record *record)
+		    struct filter_arg *arg, struct pevent_record *record)
 {
 	unsigned long long lval, rval;
 
@@ -1709,7 +1709,7 @@ static int test_num(struct event_format *event,
 	}
 }
 
-static const char *get_field_str(struct filter_arg *arg, struct record *record)
+static const char *get_field_str(struct filter_arg *arg, struct pevent_record *record)
 {
 	const char *val = record->data + arg->str.field->offset;
 
@@ -1727,7 +1727,7 @@ static const char *get_field_str(struct filter_arg *arg, struct record *record)
 }
 
 static int test_str(struct event_format *event,
-		    struct filter_arg *arg, struct record *record)
+		    struct filter_arg *arg, struct pevent_record *record)
 {
 	const char *val;
 
@@ -1757,7 +1757,7 @@ static int test_str(struct event_format *event,
 }
 
 static int test_op(struct event_format *event,
-		   struct filter_arg *arg, struct record *record)
+		   struct filter_arg *arg, struct pevent_record *record)
 {
 	switch (arg->op.type) {
 	case FILTER_OP_AND:
@@ -1778,7 +1778,7 @@ static int test_op(struct event_format *event,
 }
 
 static int test_filter(struct event_format *event,
-		       struct filter_arg *arg, struct record *record)
+		       struct filter_arg *arg, struct pevent_record *record)
 {
 	switch (arg->type) {
 	case FILTER_ARG_BOOLEAN:
@@ -1843,7 +1843,7 @@ int pevent_event_filtered(struct event_filter *filter,
  * -2 - if no filters exist
  */
 int pevent_filter_match(struct event_filter *filter,
-			struct record *record)
+			struct pevent_record *record)
 {
 	struct pevent *pevent = filter->pevent;
 	struct filter_type *filter_type;
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 39f22f8..df2fddb 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -152,7 +152,7 @@ void *raw_field_ptr(struct event_format *event, const char *name, void *data)
 
 int trace_parse_common_type(void *data)
 {
-	struct record record;
+	struct pevent_record record;
 
 	record.data = data;
 	return pevent_data_type(pevent, &record);
@@ -160,7 +160,7 @@ int trace_parse_common_type(void *data)
 
 int trace_parse_common_pid(void *data)
 {
-	struct record record;
+	struct pevent_record record;
 
 	record.data = data;
 	return pevent_data_pid(pevent, &record);
@@ -180,7 +180,7 @@ struct event_format *trace_find_event(int type)
 void print_trace_event(int cpu, void *data, int size)
 {
 	struct event_format *event;
-	struct record record;
+	struct pevent_record record;
 	struct trace_seq s;
 	int type;
 
@@ -206,7 +206,7 @@ void print_trace_event(int cpu, void *data, int size)
 void print_event(int cpu, void *data, int size, unsigned long long nsecs,
 		  char *comm)
 {
-	struct record record;
+	struct pevent_record record;
 	struct trace_seq s;
 	int pid;
 
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index 29b9206..f097e0d 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -292,7 +292,7 @@ struct cpu_data {
 	unsigned long long	offset;
 	unsigned long long	size;
 	unsigned long long	timestamp;
-	struct record		*next;
+	struct pevent_record	*next;
 	char			*page;
 	int			cpu;
 	int			index;
@@ -377,9 +377,9 @@ static int calc_index(void *ptr, int cpu)
 	return (unsigned long)ptr - (unsigned long)cpu_data[cpu].page;
 }
 
-struct record *trace_peek_data(int cpu)
+struct pevent_record *trace_peek_data(int cpu)
 {
-	struct record *data;
+	struct pevent_record *data;
 	void *page = cpu_data[cpu].page;
 	int idx = cpu_data[cpu].index;
 	void *ptr = page + idx;
@@ -477,9 +477,9 @@ read_again:
 	return data;
 }
 
-struct record *trace_read_data(int cpu)
+struct pevent_record *trace_read_data(int cpu)
 {
-	struct record *data;
+	struct pevent_record *data;
 
 	data = trace_peek_data(cpu);
 	cpu_data[cpu].next = NULL;
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index 112bc2a..639852a 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -38,7 +38,7 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs,
 int parse_ftrace_file(char *buf, unsigned long size);
 int parse_event_file(char *buf, unsigned long size, char *sys);
 
-struct record *trace_peek_data(int cpu);
+struct pevent_record *trace_peek_data(int cpu);
 struct event_format *trace_find_event(int type);
 
 unsigned long long
@@ -57,7 +57,7 @@ struct event_format *trace_find_next_event(struct event_format *event);
 unsigned long long read_size(void *ptr, int size);
 unsigned long long eval_flag(const char *flag);
 
-struct record *trace_read_data(int cpu);
+struct pevent_record *trace_read_data(int cpu);
 int read_tracing_data(int fd, struct list_head *pattrs);
 
 struct tracing_data {
-- 
1.7.5.4


  parent reply	other threads:[~2012-04-05 22:48 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 22:47 [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2 Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 01/15] perf: Separate out trace-cmd parse-events from perf files Frederic Weisbecker
2012-04-06 11:36   ` Borislav Petkov
2012-04-06 15:23     ` Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 02/15] tools/events: Add files to create libtraceevent.a Frederic Weisbecker
2012-04-06  0:08   ` David Ahern
2012-04-06  0:18     ` Steven Rostedt
2012-04-06  0:24       ` David Ahern
2012-04-06 11:40   ` Borislav Petkov
2012-04-06 13:21   ` Borislav Petkov
2012-04-06 22:15     ` Steven Rostedt
2012-04-07  9:08       ` Borislav Petkov
2012-04-11 15:20   ` Arnaldo Carvalho de Melo
2012-04-11 15:38     ` Steven Rostedt
2012-04-11 17:47       ` Frederic Weisbecker
2012-04-11 17:54       ` Arnaldo Carvalho de Melo
2012-04-05 22:47 ` [PATCH 03/15] perf: Build libtraceevent.a Frederic Weisbecker
2012-04-06 11:45   ` Borislav Petkov
2012-04-06 15:26     ` Frederic Weisbecker
2012-04-06 15:51       ` Borislav Petkov
2012-04-09 17:10         ` Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 04/15] events: Update tools/lib/traceevent to work with perf Frederic Weisbecker
2012-04-06 11:48   ` Borislav Petkov
2012-04-09 17:11     ` Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 05/15] perf: Have perf use the new libtraceevent.a library Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 06/15] perf/events: Add flag to produce nsec output Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 07/15] perf/events: Add flag/symbol format_flags Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 08/15] perf/events: Correct size given to memset Frederic Weisbecker
2012-04-06 11:24   ` Borislav Petkov
2012-04-06 12:00     ` Borislav Petkov
2012-04-06 12:27       ` Steven Rostedt
2012-04-05 22:48 ` [PATCH 09/15] parse-events: Handle invalid opcode parsing gracefully Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 10/15] parse-events: Handle opcode parsing error Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 11/15] parse-events: Let pevent_free() take a NULL pointer Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 12/15] parse-events: Support '+' opcode in print format Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 13/15] parse-events: Allow '*' and '/' operations in TP_printk Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 14/15] parse-event: Fix memset pointer size bug in handle Frederic Weisbecker
2012-04-05 22:48 ` Frederic Weisbecker [this message]
2012-04-06  3:07 ` [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2 David Sharp
2012-04-06 15:11   ` Frederic Weisbecker
2012-04-09 10:13 ` Namhyung Kim
2012-04-23 14:47 ` Our failure on tracing tools unification (Was: Re: [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2) Frederic Weisbecker
2012-04-23 15:08   ` Peter Zijlstra
2012-04-23 15:31     ` Steven Rostedt
2012-04-23 16:07       ` Borislav Petkov
2012-04-24  9:10     ` Thomas Gleixner
2012-04-25  8:05     ` Ingo Molnar
2012-04-25 12:39       ` Frederic Weisbecker
2012-04-25 14:19       ` Our failure on tracing tools unification Frank Ch. Eigler
2012-04-25 16:37         ` Arnaldo Carvalho de Melo
2012-04-25 12:26 [PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v3 Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 15/15] parse-events: Rename struct record to struct pevent_record Frederic Weisbecker

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=1333666086-6517-16-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=acme@infradead.org \
    --cc=asharma@fb.com \
    --cc=bp@alien8.de \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    /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.