diff options
| author | Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> | 2018-08-08 14:03:03 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-13 14:28:36 -0400 |
| commit | dc05ebf373e9e66c27aae0d9059e5d4ac56f3be0 (patch) | |
| tree | b3e25bb151bc091fa39621790e8cbd4ef67b49ff /tools | |
| parent | b843e9c3a271a068b67df74ef24abb7c81f2463c (diff) | |
tools lib traceevent: Rename pevent_data_ 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_" and not "pevent_". This changes
APIs: pevent_data_lat_fmt, pevent_data_type, pevent_data_event_from_type,
pevent_data_pid, pevent_data_preempt_count, pevent_data_flags,
pevent_data_comm_from_pid, pevent_data_pid_from_comm, pevent_cmdline_pid
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/20180808180702.678020020@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/lib/traceevent/event-parse.c | 44 | ||||
| -rw-r--r-- | tools/lib/traceevent/event-parse.h | 22 | ||||
| -rw-r--r-- | tools/lib/traceevent/parse-filter.c | 6 |
3 files changed, 36 insertions, 36 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 0de470c07be9..4f924bf42b92 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
| @@ -5140,7 +5140,7 @@ out_failed: | |||
| 5140 | } | 5140 | } |
| 5141 | 5141 | ||
| 5142 | /** | 5142 | /** |
| 5143 | * pevent_data_lat_fmt - parse the data for the latency format | 5143 | * tep_data_lat_fmt - parse the data for the latency format |
| 5144 | * @pevent: a handle to the pevent | 5144 | * @pevent: a handle to the pevent |
| 5145 | * @s: the trace_seq to write to | 5145 | * @s: the trace_seq to write to |
| 5146 | * @record: the record to read from | 5146 | * @record: the record to read from |
| @@ -5149,8 +5149,8 @@ out_failed: | |||
| 5149 | * need rescheduling, in hard/soft interrupt, preempt count | 5149 | * need rescheduling, in hard/soft interrupt, preempt count |
| 5150 | * and lock depth) and places it into the trace_seq. | 5150 | * and lock depth) and places it into the trace_seq. |
| 5151 | */ | 5151 | */ |
| 5152 | void pevent_data_lat_fmt(struct tep_handle *pevent, | 5152 | void tep_data_lat_fmt(struct tep_handle *pevent, |
| 5153 | struct trace_seq *s, struct tep_record *record) | 5153 | struct trace_seq *s, struct tep_record *record) |
| 5154 | { | 5154 | { |
| 5155 | static int check_lock_depth = 1; | 5155 | static int check_lock_depth = 1; |
| 5156 | static int check_migrate_disable = 1; | 5156 | static int check_migrate_disable = 1; |
| @@ -5223,55 +5223,55 @@ void pevent_data_lat_fmt(struct tep_handle *pevent, | |||
| 5223 | } | 5223 | } |
| 5224 | 5224 | ||
| 5225 | /** | 5225 | /** |
| 5226 | * pevent_data_type - parse out the given event type | 5226 | * tep_data_type - parse out the given event type |
| 5227 | * @pevent: a handle to the pevent | 5227 | * @pevent: a handle to the pevent |
| 5228 | * @rec: the record to read from | 5228 | * @rec: the record to read from |
| 5229 | * | 5229 | * |
| 5230 | * This returns the event id from the @rec. | 5230 | * This returns the event id from the @rec. |
| 5231 | */ | 5231 | */ |
| 5232 | int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec) | 5232 | int tep_data_type(struct tep_handle *pevent, struct tep_record *rec) |
| 5233 | { | 5233 | { |
| 5234 | return trace_parse_common_type(pevent, rec->data); | 5234 | return trace_parse_common_type(pevent, rec->data); |
| 5235 | } | 5235 | } |
| 5236 | 5236 | ||
| 5237 | /** | 5237 | /** |
| 5238 | * pevent_data_event_from_type - find the event by a given type | 5238 | * tep_data_event_from_type - find the event by a given type |
| 5239 | * @pevent: a handle to the pevent | 5239 | * @pevent: a handle to the pevent |
| 5240 | * @type: the type of the event. | 5240 | * @type: the type of the event. |
| 5241 | * | 5241 | * |
| 5242 | * This returns the event form a given @type; | 5242 | * This returns the event form a given @type; |
| 5243 | */ | 5243 | */ |
| 5244 | struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type) | 5244 | struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type) |
| 5245 | { | 5245 | { |
| 5246 | return tep_find_event(pevent, type); | 5246 | return tep_find_event(pevent, type); |
| 5247 | } | 5247 | } |
| 5248 | 5248 | ||
| 5249 | /** | 5249 | /** |
| 5250 | * pevent_data_pid - parse the PID from record | 5250 | * tep_data_pid - parse the PID from record |
| 5251 | * @pevent: a handle to the pevent | 5251 | * @pevent: a handle to the pevent |
| 5252 | * @rec: the record to parse | 5252 | * @rec: the record to parse |
| 5253 | * | 5253 | * |
| 5254 | * This returns the PID from a record. | 5254 | * This returns the PID from a record. |
| 5255 | */ | 5255 | */ |
| 5256 | int pevent_data_pid(struct tep_handle *pevent, struct tep_record *rec) | 5256 | int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec) |
| 5257 | { | 5257 | { |
| 5258 | return parse_common_pid(pevent, rec->data); | 5258 | return parse_common_pid(pevent, rec->data); |
| 5259 | } | 5259 | } |
| 5260 | 5260 | ||
| 5261 | /** | 5261 | /** |
| 5262 | * pevent_data_preempt_count - parse the preempt count from the record | 5262 | * tep_data_preempt_count - parse the preempt count from the record |
| 5263 | * @pevent: a handle to the pevent | 5263 | * @pevent: a handle to the pevent |
| 5264 | * @rec: the record to parse | 5264 | * @rec: the record to parse |
| 5265 | * | 5265 | * |
| 5266 | * This returns the preempt count from a record. | 5266 | * This returns the preempt count from a record. |
| 5267 | */ | 5267 | */ |
| 5268 | int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) | 5268 | int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) |
| 5269 | { | 5269 | { |
| 5270 | return parse_common_pc(pevent, rec->data); | 5270 | return parse_common_pc(pevent, rec->data); |
| 5271 | } | 5271 | } |
| 5272 | 5272 | ||
| 5273 | /** | 5273 | /** |
| 5274 | * pevent_data_flags - parse the latency flags from the record | 5274 | * tep_data_flags - parse the latency flags from the record |
| 5275 | * @pevent: a handle to the pevent | 5275 | * @pevent: a handle to the pevent |
| 5276 | * @rec: the record to parse | 5276 | * @rec: the record to parse |
| 5277 | * | 5277 | * |
| @@ -5279,20 +5279,20 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) | |||
| 5279 | * | 5279 | * |
| 5280 | * Use trace_flag_type enum for the flags (see event-parse.h). | 5280 | * Use trace_flag_type enum for the flags (see event-parse.h). |
| 5281 | */ | 5281 | */ |
| 5282 | int pevent_data_flags(struct tep_handle *pevent, struct tep_record *rec) | 5282 | int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec) |
| 5283 | { | 5283 | { |
| 5284 | return parse_common_flags(pevent, rec->data); | 5284 | return parse_common_flags(pevent, rec->data); |
| 5285 | } | 5285 | } |
| 5286 | 5286 | ||
| 5287 | /** | 5287 | /** |
| 5288 | * pevent_data_comm_from_pid - return the command line from PID | 5288 | * tep_data_comm_from_pid - return the command line from PID |
| 5289 | * @pevent: a handle to the pevent | 5289 | * @pevent: a handle to the pevent |
| 5290 | * @pid: the PID of the task to search for | 5290 | * @pid: the PID of the task to search for |
| 5291 | * | 5291 | * |
| 5292 | * This returns a pointer to the command line that has the given | 5292 | * This returns a pointer to the command line that has the given |
| 5293 | * @pid. | 5293 | * @pid. |
| 5294 | */ | 5294 | */ |
| 5295 | const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid) | 5295 | const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid) |
| 5296 | { | 5296 | { |
| 5297 | const char *comm; | 5297 | const char *comm; |
| 5298 | 5298 | ||
| @@ -5317,7 +5317,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne | |||
| 5317 | } | 5317 | } |
| 5318 | 5318 | ||
| 5319 | /** | 5319 | /** |
| 5320 | * pevent_data_pid_from_comm - return the pid from a given comm | 5320 | * tep_data_pid_from_comm - return the pid from a given comm |
| 5321 | * @pevent: a handle to the pevent | 5321 | * @pevent: a handle to the pevent |
| 5322 | * @comm: the cmdline to find the pid from | 5322 | * @comm: the cmdline to find the pid from |
| 5323 | * @next: the cmdline structure to find the next comm | 5323 | * @next: the cmdline structure to find the next comm |
| @@ -5329,8 +5329,8 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne | |||
| 5329 | * next pid. | 5329 | * next pid. |
| 5330 | * Also, it does a linear seach, so it may be slow. | 5330 | * Also, it does a linear seach, so it may be slow. |
| 5331 | */ | 5331 | */ |
| 5332 | struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm, | 5332 | struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, |
| 5333 | struct cmdline *next) | 5333 | struct cmdline *next) |
| 5334 | { | 5334 | { |
| 5335 | struct cmdline *cmdline; | 5335 | struct cmdline *cmdline; |
| 5336 | 5336 | ||
| @@ -5365,13 +5365,13 @@ struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char | |||
| 5365 | } | 5365 | } |
| 5366 | 5366 | ||
| 5367 | /** | 5367 | /** |
| 5368 | * pevent_cmdline_pid - return the pid associated to a given cmdline | 5368 | * tep_cmdline_pid - return the pid associated to a given cmdline |
| 5369 | * @cmdline: The cmdline structure to get the pid from | 5369 | * @cmdline: The cmdline structure to get the pid from |
| 5370 | * | 5370 | * |
| 5371 | * Returns the pid for a give cmdline. If @cmdline is NULL, then | 5371 | * Returns the pid for a give cmdline. If @cmdline is NULL, then |
| 5372 | * -1 is returned. | 5372 | * -1 is returned. |
| 5373 | */ | 5373 | */ |
| 5374 | int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) | 5374 | int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) |
| 5375 | { | 5375 | { |
| 5376 | struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline; | 5376 | struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline; |
| 5377 | 5377 | ||
| @@ -5391,7 +5391,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) | |||
| 5391 | } | 5391 | } |
| 5392 | 5392 | ||
| 5393 | /** | 5393 | /** |
| 5394 | * pevent_data_comm_from_pid - parse the data into the print format | 5394 | * tep_event_info - parse the data into the print format |
| 5395 | * @s: the trace_seq to write to | 5395 | * @s: the trace_seq to write to |
| 5396 | * @event: the handle to the event | 5396 | * @event: the handle to the event |
| 5397 | * @record: the record to read from | 5397 | * @record: the record to read from |
| @@ -5511,7 +5511,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, | |||
| 5511 | } | 5511 | } |
| 5512 | 5512 | ||
| 5513 | if (pevent->latency_format) { | 5513 | if (pevent->latency_format) { |
| 5514 | pevent_data_lat_fmt(pevent, s, record); | 5514 | tep_data_lat_fmt(pevent, s, record); |
| 5515 | } | 5515 | } |
| 5516 | 5516 | ||
| 5517 | if (use_usec_format) { | 5517 | if (use_usec_format) { |
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index dc0d2d3b7c33..2c4da2f1d4ed 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
| @@ -705,18 +705,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char | |||
| 705 | struct event_format * | 705 | struct event_format * |
| 706 | pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); | 706 | pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); |
| 707 | 707 | ||
| 708 | void pevent_data_lat_fmt(struct tep_handle *pevent, | 708 | void tep_data_lat_fmt(struct tep_handle *pevent, |
| 709 | struct trace_seq *s, struct tep_record *record); | 709 | struct trace_seq *s, struct tep_record *record); |
| 710 | int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec); | 710 | int tep_data_type(struct tep_handle *pevent, struct tep_record *rec); |
| 711 | struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type); | 711 | struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type); |
| 712 | int pevent_data_pid(struct tep_handle *pevent, struct tep_record *rec); | 712 | int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec); |
| 713 | int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); | 713 | int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); |
| 714 | int pevent_data_flags(struct tep_handle *pevent, struct tep_record *rec); | 714 | int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec); |
| 715 | const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid); | 715 | const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid); |
| 716 | struct cmdline; | 716 | struct cmdline; |
| 717 | struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm, | 717 | struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, |
| 718 | struct cmdline *next); | 718 | struct cmdline *next); |
| 719 | int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); | 719 | int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); |
| 720 | 720 | ||
| 721 | void tep_print_field(struct trace_seq *s, void *data, | 721 | void tep_print_field(struct trace_seq *s, void *data, |
| 722 | struct format_field *field); | 722 | struct format_field *field); |
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index f3d812676169..474d820e97e1 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c | |||
| @@ -1705,8 +1705,8 @@ get_comm(struct event_format *event, struct tep_record *record) | |||
| 1705 | const char *comm; | 1705 | const char *comm; |
| 1706 | int pid; | 1706 | int pid; |
| 1707 | 1707 | ||
| 1708 | pid = pevent_data_pid(event->pevent, record); | 1708 | pid = tep_data_pid(event->pevent, record); |
| 1709 | comm = pevent_data_comm_from_pid(event->pevent, pid); | 1709 | comm = tep_data_comm_from_pid(event->pevent, pid); |
| 1710 | return comm; | 1710 | return comm; |
| 1711 | } | 1711 | } |
| 1712 | 1712 | ||
| @@ -2060,7 +2060,7 @@ enum tep_errno tep_filter_match(struct event_filter *filter, | |||
| 2060 | if (!filter->filters) | 2060 | if (!filter->filters) |
| 2061 | return TEP_ERRNO__NO_FILTER; | 2061 | return TEP_ERRNO__NO_FILTER; |
| 2062 | 2062 | ||
| 2063 | event_id = pevent_data_type(pevent, record); | 2063 | event_id = tep_data_type(pevent, record); |
| 2064 | 2064 | ||
| 2065 | filter_type = find_filter_type(filter, event_id); | 2065 | filter_type = find_filter_type(filter, event_id); |
| 2066 | if (!filter_type) | 2066 | if (!filter_type) |
