From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Yordan Karadzhov <y.karadz@gmail.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 09/24] tools lib traceevent, perf tools: Rename pevent_register_* APIs
Date: Tue, 21 Aug 2018 16:33:13 +0300 [thread overview]
Message-ID: <20180821133328.3249-10-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20180821133328.3249-1-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_" and not "pevent_". This changes
APIs: pevent_register_comm, pevent_register_print_string
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/20180808180700.948980691@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
include/traceevent/event-parse.h | 6 +++---
kernel-shark/trace-graph.c | 4 ++--
lib/trace-cmd/trace-util.c | 4 ++--
lib/traceevent/event-parse.c | 10 +++++-----
plugins/plugin_sched_switch.c | 2 +-
tracecmd/trace-hist.c | 6 +++---
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 97eb42d..c368a55 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -606,12 +606,12 @@ enum trace_flag_type {
int pevent_set_function_resolver(struct tep_handle *pevent,
tep_func_resolver_t *func, void *priv);
void pevent_reset_function_resolver(struct tep_handle *pevent);
-int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid);
+int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid);
int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock);
int pevent_register_function(struct tep_handle *pevent, char *name,
unsigned long long addr, char *mod);
-int pevent_register_print_string(struct tep_handle *pevent, const char *fmt,
- unsigned long long addr);
+int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
+ unsigned long long addr);
int pevent_pid_is_registered(struct tep_handle *pevent, int pid);
void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 04f58f1..3fe0f83 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1134,8 +1134,8 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
* comm / pid mappings.
*/
if (!pevent_pid_is_registered(ginfo->pevent, *pid))
- pevent_register_comm(ginfo->pevent,
- *comm, *pid);
+ tep_register_comm(ginfo->pevent,
+ *comm, *pid);
}
return ret;
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 7d4a2a4..877907d 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -374,7 +374,7 @@ void tracecmd_parse_cmdlines(struct tep_handle *pevent,
line = strtok_r(file, "\n", &next);
while (line) {
sscanf(line, "%d %ms", &pid, &comm);
- pevent_register_comm(pevent, comm, pid);
+ tep_register_comm(pevent, comm, pid);
free(comm);
line = strtok_r(NULL, "\n", &next);
}
@@ -473,7 +473,7 @@ void tracecmd_parse_ftrace_printk(struct tep_handle *pevent,
/* fmt still has a space, skip it */
printk = strdup(fmt+1);
line = strtok_r(NULL, "\n", &next);
- pevent_register_print_string(pevent, printk, addr);
+ tep_register_print_string(pevent, printk, addr);
free(printk);
}
}
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 3bcdde8..fcde4d1 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -274,7 +274,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid)
}
/**
- * pevent_register_comm - register a pid / comm mapping
+ * tep_register_comm - register a pid / comm mapping
* @pevent: handle for the pevent
* @comm: the command line to register
* @pid: the pid to map the command line to
@@ -282,7 +282,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid)
* This adds a mapping to search for command line names with
* a given pid. The comm is duplicated.
*/
-int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid)
+int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid)
{
struct cmdline_list *item;
@@ -671,7 +671,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr)
}
/**
- * pevent_register_print_string - register a string by its address
+ * tep_register_print_string - register a string by its address
* @pevent: handle for the pevent
* @fmt: the string format to register
* @addr: the address the string was located at
@@ -679,8 +679,8 @@ find_printk(struct tep_handle *pevent, unsigned long long addr)
* This registers a string by the address it was stored in the kernel.
* The @fmt passed in is duplicated.
*/
-int pevent_register_print_string(struct tep_handle *pevent, const char *fmt,
- unsigned long long addr)
+int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
+ unsigned long long addr)
{
struct printk_list *item = malloc(sizeof(*item));
char *p;
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index fa3add1..534e99c 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -46,7 +46,7 @@ static void write_and_save_comm(struct format_field *field,
comm = &s->buffer[len];
/* Help out the comm to ids. This will handle dups */
- pevent_register_comm(field->event->pevent, comm, pid);
+ tep_register_comm(field->event->pevent, comm, pid);
}
static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record,
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index 87f96d8..e8bf434 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -501,7 +501,7 @@ process_sched_wakeup(struct tep_handle *pevent, struct tep_record *record, int t
pid = val;
- pevent_register_comm(pevent, comm, pid);
+ tep_register_comm(pevent, comm, pid);
}
static void
@@ -517,14 +517,14 @@ process_sched_switch(struct tep_handle *pevent, struct tep_record *record)
if (ret < 0)
die("no prev_pid field in sched_switch?");
pid = val;
- pevent_register_comm(pevent, comm, pid);
+ tep_register_comm(pevent, comm, pid);
comm = (char *)(record->data + sched_switch_next_field->offset);
ret = tep_read_number_field(sched_switch_next_pid_field, record->data, &val);
if (ret < 0)
die("no next_pid field in sched_switch?");
pid = val;
- pevent_register_comm(pevent, comm, pid);
+ tep_register_comm(pevent, comm, pid);
}
static void
--
2.17.1
next prev parent reply other threads:[~2018-08-21 16:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-21 13:33 [PATCH 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 05/24] tools lib traceevent, perf tools: Rename pevent find APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 07/24] tools lib traceevent, perf tools: Rename pevent print APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 08/24] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` Tzvetomir Stoyanov (VMware) [this message]
2018-08-21 13:33 ` [PATCH 10/24] tools lib traceevent, perf tools: Rename pevent_set_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 11/24] tools lib traceevent, perf tools: Rename traceevent_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 12/24] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 13/24] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 14/24] tools lib traceevent: Rename pevent_function* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 15/24] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 16/24] tools lib traceevent: Rename pevent_filter* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 17/24] tools lib traceevent: Rename pevent_register / unregister APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 18/24] tools lib traceevent: Rename pevent_data_ APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 19/24] tools lib traceevent: Rename pevent field APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 20/24] tools lib traceevent: Rename pevent_find_* APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 22/24] tools lib traceevent: Rename internal parser related APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 23/24] tools lib traceevent: Rename various pevent APIs Tzvetomir Stoyanov (VMware)
2018-08-21 13:33 ` [PATCH 24/24] tools lib traceevent: Rename static variables and functions in event-parse.c Tzvetomir Stoyanov (VMware)
[not found] ` <20180821133328.3249-2-tz.stoyanov@gmail.com>
[not found] ` <20180823140648.GB2077@redhat.com>
2018-08-24 0:56 ` [PATCH 01/24] tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle Steven Rostedt
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=20180821133328.3249-10-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=acme@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=y.karadz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).