aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent/event-parse.c
diff options
context:
space:
mode:
authorTzvetomir Stoyanov <tstoyanov@vmware.com>2019-04-01 12:43:16 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-04-01 14:18:09 -0400
commit55c34ae076f62ed7ad0fc86cd8b697a6f577c431 (patch)
tree77d66317f332f4c3c848ef3ab8f7d4ab5b781a34 /tools/lib/traceevent/event-parse.c
parentfea6b632235b9bedc58c72cd24f1865bb0c365db (diff)
tools tools, tools lib traceevent: Make traceevent APIs more consistent
Rename some traceevent APIs for consistency: tep_pid_is_registered() to tep_is_pid_registered() tep_file_bigendian() to tep_is_file_bigendian() to make the names and return values consistent with other tep_is_... APIs tep_data_lat_fmt() to tep_data_latency_format() to make the name more descriptive tep_host_bigendian() to tep_is_bigendian() tep_set_host_bigendian() to tep_set_local_bigendian() tep_is_host_bigendian() to tep_is_local_bigendian() "host" can be confused with VMs, and "local" is about the local machine. All tep_is_..._bigendian(struct tep_handle *tep) APIs return the saved data in the tep handle, while tep_is_bigendian() returns the running machine's endianness. All tep_is_... functions are modified to return bool value, instead of int. Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20190327141946.4353-2-tstoyanov@vmware.com Link: http://lkml.kernel.org/r/20190401164344.288624897@goodmis.org [ Removed some extra parenthesis around return statements ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent/event-parse.c')
-rw-r--r--tools/lib/traceevent/event-parse.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 000ab7514be7..8836702122be 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -199,23 +199,23 @@ static const char *find_cmdline(struct tep_handle *pevent, int pid)
199} 199}
200 200
201/** 201/**
202 * tep_pid_is_registered - return if a pid has a cmdline registered 202 * tep_is_pid_registered - return if a pid has a cmdline registered
203 * @pevent: handle for the pevent 203 * @pevent: handle for the pevent
204 * @pid: The pid to check if it has a cmdline registered with. 204 * @pid: The pid to check if it has a cmdline registered with.
205 * 205 *
206 * Returns 1 if the pid has a cmdline mapped to it 206 * Returns true if the pid has a cmdline mapped to it
207 * 0 otherwise. 207 * false otherwise.
208 */ 208 */
209int tep_pid_is_registered(struct tep_handle *pevent, int pid) 209bool tep_is_pid_registered(struct tep_handle *pevent, int pid)
210{ 210{
211 const struct tep_cmdline *comm; 211 const struct tep_cmdline *comm;
212 struct tep_cmdline key; 212 struct tep_cmdline key;
213 213
214 if (!pid) 214 if (!pid)
215 return 1; 215 return true;
216 216
217 if (!pevent->cmdlines && cmdline_init(pevent)) 217 if (!pevent->cmdlines && cmdline_init(pevent))
218 return 0; 218 return false;
219 219
220 key.pid = pid; 220 key.pid = pid;
221 221
@@ -223,8 +223,8 @@ int tep_pid_is_registered(struct tep_handle *pevent, int pid)
223 sizeof(*pevent->cmdlines), cmdline_cmp); 223 sizeof(*pevent->cmdlines), cmdline_cmp);
224 224
225 if (comm) 225 if (comm)
226 return 1; 226 return true;
227 return 0; 227 return false;
228} 228}
229 229
230/* 230/*
@@ -5172,7 +5172,7 @@ out_failed:
5172} 5172}
5173 5173
5174/** 5174/**
5175 * tep_data_lat_fmt - parse the data for the latency format 5175 * tep_data_latency_format - parse the data for the latency format
5176 * @pevent: a handle to the pevent 5176 * @pevent: a handle to the pevent
5177 * @s: the trace_seq to write to 5177 * @s: the trace_seq to write to
5178 * @record: the record to read from 5178 * @record: the record to read from
@@ -5181,8 +5181,8 @@ out_failed:
5181 * need rescheduling, in hard/soft interrupt, preempt count 5181 * need rescheduling, in hard/soft interrupt, preempt count
5182 * and lock depth) and places it into the trace_seq. 5182 * and lock depth) and places it into the trace_seq.
5183 */ 5183 */
5184void tep_data_lat_fmt(struct tep_handle *pevent, 5184void tep_data_latency_format(struct tep_handle *pevent,
5185 struct trace_seq *s, struct tep_record *record) 5185 struct trace_seq *s, struct tep_record *record)
5186{ 5186{
5187 static int check_lock_depth = 1; 5187 static int check_lock_depth = 1;
5188 static int check_migrate_disable = 1; 5188 static int check_migrate_disable = 1;
@@ -5532,7 +5532,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
5532 } 5532 }
5533 5533
5534 if (pevent->latency_format) { 5534 if (pevent->latency_format) {
5535 tep_data_lat_fmt(pevent, s, record); 5535 tep_data_latency_format(pevent, s, record);
5536 } 5536 }
5537 5537
5538 if (use_usec_format) { 5538 if (use_usec_format) {
@@ -6827,7 +6827,7 @@ struct tep_handle *tep_alloc(void)
6827 6827
6828 if (pevent) { 6828 if (pevent) {
6829 pevent->ref_count = 1; 6829 pevent->ref_count = 1;
6830 pevent->host_bigendian = tep_host_bigendian(); 6830 pevent->host_bigendian = tep_is_bigendian();
6831 } 6831 }
6832 6832
6833 return pevent; 6833 return pevent;