Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] Rename a few libtracecmd APIs
@ 2020-12-22 12:09 Tzvetomir Stoyanov (VMware)
  2020-12-22 12:09 ` [PATCH 1/2] trace-cmd: Rename free_record() to tracecmd_free_record() Tzvetomir Stoyanov (VMware)
  2020-12-22 12:09 ` [PATCH 2/2] trace-cmd: Rename tracecmd_get_pevent() to tracecmd_get_tep() Tzvetomir Stoyanov (VMware)
  0 siblings, 2 replies; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-12-22 12:09 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

Renamed free_record() and tracecmd_get_pevent() APIs to have more consistent
and intuitive names.

Tzvetomir Stoyanov (VMware) (2):
  trace-cmd: Rename free_record() to tracecmd_free_record()
  trace-cmd: Rename tracecmd_get_pevent() to tracecmd_get_tep()

 include/trace-cmd/trace-cmd.h           |  4 +--
 kernel-shark/src/libkshark.c            | 20 +++++++-------
 kernel-shark/src/plugins/sched_events.c |  4 +--
 lib/trace-cmd/trace-blk-hack.c          |  2 +-
 lib/trace-cmd/trace-ftrace.c            |  4 +--
 lib/trace-cmd/trace-input.c             | 20 +++++++-------
 lib/trace-cmd/trace-output.c            |  8 +++---
 tracecmd/trace-hist.c                   |  4 +--
 tracecmd/trace-mem.c                    |  4 +--
 tracecmd/trace-profile.c                | 14 +++++-----
 tracecmd/trace-read.c                   | 36 ++++++++++++-------------
 tracecmd/trace-split.c                  | 20 +++++++-------
 tracecmd/trace-stream.c                 |  2 +-
 13 files changed, 71 insertions(+), 71 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] trace-cmd: Rename free_record() to tracecmd_free_record()
  2020-12-22 12:09 [PATCH 0/2] Rename a few libtracecmd APIs Tzvetomir Stoyanov (VMware)
@ 2020-12-22 12:09 ` Tzvetomir Stoyanov (VMware)
  2020-12-22 12:09 ` [PATCH 2/2] trace-cmd: Rename tracecmd_get_pevent() to tracecmd_get_tep() Tzvetomir Stoyanov (VMware)
  1 sibling, 0 replies; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-12-22 12:09 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

The free_record() function is a libtracecmd API used to free a trace
record read from a trace file. It should follow the tracecmd library
naming convention, start with a "tracecmd_ prefix.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 include/trace-cmd/trace-cmd.h           |  2 +-
 kernel-shark/src/libkshark.c            | 18 +++++++++---------
 kernel-shark/src/plugins/sched_events.c |  4 ++--
 lib/trace-cmd/trace-ftrace.c            |  2 +-
 lib/trace-cmd/trace-input.c             | 16 ++++++++--------
 tracecmd/trace-hist.c                   |  2 +-
 tracecmd/trace-mem.c                    |  2 +-
 tracecmd/trace-profile.c                | 12 ++++++------
 tracecmd/trace-read.c                   | 14 +++++++-------
 tracecmd/trace-split.c                  | 16 ++++++++--------
 tracecmd/trace-stream.c                 |  2 +-
 11 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
index 9751ac3b..9d9a61d3 100644
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -24,7 +24,7 @@ tracecmd_read_data(struct tracecmd_input *handle, int cpu);
 struct tep_record *
 tracecmd_read_at(struct tracecmd_input *handle, unsigned long long offset,
 		 int *cpu);
-void free_record(struct tep_record *record);
+void tracecmd_free_record(struct tep_record *record);
 
 struct tep_handle *tracecmd_get_pevent(struct tracecmd_input *handle);
 unsigned long long tracecmd_get_traceid(struct tracecmd_input *handle);
diff --git a/kernel-shark/src/libkshark.c b/kernel-shark/src/libkshark.c
index 4e625a25..9823ccc9 100644
--- a/kernel-shark/src/libkshark.c
+++ b/kernel-shark/src/libkshark.c
@@ -678,7 +678,7 @@ static void free_rec_list(struct rec_list **rec_list, int n_cpus,
 			temp_rec = rec_list[cpu];
 			rec_list[cpu] = temp_rec->next;
 			if (type == REC_RECORD)
-				free_record(temp_rec->rec);
+				tracecmd_free_record(temp_rec->rec);
 			free(temp_rec);
 		}
 	}
@@ -778,14 +778,14 @@ static ssize_t get_records(struct kshark_context *kshark_ctx,
 				if (!kshark_show_task(kshark_ctx, entry->pid)) {
 					entry->visible &= ~kshark_ctx->filter_mask;
 				}
-				free_record(rec);
+				tracecmd_free_record(rec);
 				break;
 			} /* REC_ENTRY */
 			}
 
 			task = kshark_add_task(kshark_ctx, pid);
 			if (!task) {
-				free_record(rec);
+				tracecmd_free_record(rec);
 				goto fail;
 			}
 
@@ -906,7 +906,7 @@ ssize_t kshark_load_data_entries(struct kshark_context *kshark_ctx,
  *	  to all fields of the record.
  *
  * @param kshark_ctx: Input location for the session context pointer.
- * @param data_rows: Output location for the trace data. Use free_record()
+ * @param data_rows: Output location for the trace data. Use tracecmd_free_record()
  *	 	     to free the elements of the outputted array.
  *
  * @returns The size of the outputted data in the case of success, or a
@@ -1171,7 +1171,7 @@ int kshark_get_pid_easy(struct kshark_entry *entry)
 		data = tracecmd_read_at(kshark_ctx->handle, entry->offset,
 					NULL);
 		pid = tep_data_pid(kshark_ctx->pevent, data);
-		free_record(data);
+		tracecmd_free_record(data);
 
 		pthread_mutex_unlock(&kshark_ctx->input_mutex);
 	}
@@ -1238,7 +1238,7 @@ const char *kshark_get_latency_easy(struct kshark_entry *entry)
 
 	data = tracecmd_read_at(kshark_ctx->handle, entry->offset, NULL);
 	lat = kshark_get_latency(kshark_ctx->pevent, data);
-	free_record(data);
+	tracecmd_free_record(data);
 
 	pthread_mutex_unlock(&kshark_ctx->input_mutex);
 
@@ -1283,7 +1283,7 @@ int kshark_get_event_id_easy(struct kshark_entry *entry)
 		data = tracecmd_read_at(kshark_ctx->handle, entry->offset,
 					NULL);
 		event_id = tep_data_type(kshark_ctx->pevent, data);
-		free_record(data);
+		tracecmd_free_record(data);
 
 		pthread_mutex_unlock(&kshark_ctx->input_mutex);
 	}
@@ -1382,7 +1382,7 @@ const char *kshark_get_info_easy(struct kshark_entry *entry)
 	if (event)
 		info = kshark_get_info(kshark_ctx->pevent, data, event);
 
-	free_record(data);
+	tracecmd_free_record(data);
 
 	pthread_mutex_unlock(&kshark_ctx->input_mutex);
 
@@ -1496,7 +1496,7 @@ char* kshark_dump_entry(const struct kshark_entry *entry)
 			free(temp_str);
 		}
 
-		free_record(data);
+		tracecmd_free_record(data);
 		if (size < 1)
 			entry_str = NULL;
 	} else {
diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c
index d0fd15e0..4b671f16 100644
--- a/kernel-shark/src/plugins/sched_events.c
+++ b/kernel-shark/src/plugins/sched_events.c
@@ -160,7 +160,7 @@ static int find_wakeup_pid(struct kshark_context *kshark_ctx, struct kshark_entr
 
 	record = tracecmd_read_at(kshark_ctx->handle, e->offset, NULL);
 	ret = tep_read_number_field(pid_field, record->data, &val);
-	free_record(record);
+	tracecmd_free_record(record);
 
 	if (ret)
 		return -1;
@@ -252,7 +252,7 @@ bool plugin_switch_match_rec_pid(struct kshark_context *kshark_ctx,
 		if (ret == 0 && !(val & 0x7f))
 			switch_pid = tep_data_pid(plugin_ctx->pevent, record);
 
-		free_record(record);
+		tracecmd_free_record(record);
 	}
 
 	if (switch_pid >= 0 && switch_pid == pid)
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index df7335f0..03e60eb0 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -292,7 +292,7 @@ fgraph_ent_handler(struct trace_seq *s, struct tep_record *record,
 		 * returns the return of the function
 		 */
 		print_graph_entry_leaf(s, event, record, rec, finfo);
-		free_record(rec);
+		tracecmd_free_record(rec);
 	} else
 		print_graph_nested(s, event, record);
 
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index af97883e..e57492e9 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -1072,7 +1072,7 @@ static void __free_record(struct tep_record *record)
 	free(record);
 }
 
-void free_record(struct tep_record *record)
+void tracecmd_free_record(struct tep_record *record)
 {
 	if (!record)
 		return;
@@ -1116,7 +1116,7 @@ static void free_next(struct tracecmd_input *handle, int cpu)
 	handle->cpu_data[cpu].next = NULL;
 
 	record->locked = 0;
-	free_record(record);
+	tracecmd_free_record(record);
 }
 
 static inline unsigned long long
@@ -1503,7 +1503,7 @@ tracecmd_read_cpu_last(struct tracecmd_input *handle, int cpu)
 	offset = page_offset;
 
 	do {
-		free_record(record);
+		tracecmd_free_record(record);
 		record = tracecmd_read_data(handle, cpu);
 		if (record)
 			offset = record->offset;
@@ -1988,7 +1988,7 @@ tracecmd_peek_next_data(struct tracecmd_input *handle, int *rec_cpu)
  * Note, this is not that fast of an algorithm, since it needs
  * to build the timestamp for the record.
  *
- * The record returned must be freed with free_record().
+ * The record returned must be freed with tracecmd_free_record().
  */
 struct tep_record *
 tracecmd_read_prev(struct tracecmd_input *handle, struct tep_record *record)
@@ -2028,9 +2028,9 @@ tracecmd_read_prev(struct tracecmd_input *handle, struct tep_record *record)
 		if (record->offset == offset)
 			break;
 		index = record->offset - page_offset;
-		free_record(record);
+		tracecmd_free_record(record);
 	}
-	free_record(record);
+	tracecmd_free_record(record);
 
 	if (index)
 		/* we found our record */
@@ -2054,14 +2054,14 @@ tracecmd_read_prev(struct tracecmd_input *handle, struct tep_record *record)
 		do {
 			if (record) {
 				index = record->offset - page_offset;
-				free_record(record);
+				tracecmd_free_record(record);
 			}
 			record = tracecmd_read_data(handle, cpu);
 			/* Should not happen */
 			if (!record)
 				return NULL;
 		} while (record->offset != offset);
-		free_record(record);
+		tracecmd_free_record(record);
 
 		if (index)
 			/* we found our record */
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index c4d8b403..76e8cae2 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -985,7 +985,7 @@ static void do_trace_hist(struct tracecmd_input *handle)
 				flush_stack();
 
 			process_record(pevent, record);
-			free_record(record);
+			tracecmd_free_record(record);
 		}
 	}
 
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 76f38fa7..c6cc7dee 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -508,7 +508,7 @@ static void do_trace_mem(struct tracecmd_input *handle)
 			missed_events = 1;
 
 		process_record(pevent, record);
-		free_record(record);
+		tracecmd_free_record(record);
 	}
 
 	sort_list();
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index cfae2a22..b82110e6 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -393,7 +393,7 @@ static void free_start(struct start_data *start)
 	if (start->task->last_start == start)
 		start->task->last_start = NULL;
 	if (start->stack.record)
-		free_record(start->stack.record);
+		tracecmd_free_record(start->stack.record);
 	trace_hash_del(&start->hash);
 	list_del(&start->list);
 	free(start);
@@ -442,7 +442,7 @@ add_and_free_start(struct task_data *task, struct start_data *start,
 
 		add_event_stack(event_hash, caller, size, delta,
 				start->stack.record->ts);
-		free_record(start->stack.record);
+		tracecmd_free_record(start->stack.record);
 		start->stack.record = NULL;
 	}
 
@@ -786,7 +786,7 @@ static void trace_profile_record(struct tracecmd_input *handle,
 
 	/* If the last stack hasn't changed, free it */
 	if (stack_record && task->last_stack == stack_record) {
-		free_record(stack_record);
+		tracecmd_free_record(stack_record);
 		task->last_stack = NULL;
 	}
 }
@@ -1069,7 +1069,7 @@ static int handle_stacktrace_event(struct handle_data *h,
 		return -1;
 
 	if (task->last_stack) {
-		free_record(task->last_stack);
+		tracecmd_free_record(task->last_stack);
 		task->last_stack = NULL;
 	}
 
@@ -2138,7 +2138,7 @@ static void __free_task(struct task_data *task)
 		trace_hash_while_item(item, bucket) {
 			start = start_from_item(item);
 			if (start->stack.record)
-				free_record(start->stack.record);
+				tracecmd_free_record(start->stack.record);
 			list_del(&start->list);
 			trace_hash_del(item);
 			free(start);
@@ -2156,7 +2156,7 @@ static void __free_task(struct task_data *task)
 	trace_hash_free(&task->event_hash);
 
 	if (task->last_stack)
-		free_record(task->last_stack);
+		tracecmd_free_record(task->last_stack);
 }
 
 static void free_task(struct task_data *task)
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 0b3eb1bc..11293bc8 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -209,7 +209,7 @@ static void show_test(struct tracecmd_input *handle)
 	trace_seq_destroy(&s);
 	printf("\n");
 
-	free_record(record);
+	tracecmd_free_record(record);
 }
 
 static void test_save(struct tep_record *record, int cpu)
@@ -253,7 +253,7 @@ static void show_test(struct tracecmd_input *handle)
 	trace_seq_destroy(&s);
 	printf("\n");
 
-	free_record(record);
+	tracecmd_free_record(record);
 }
 
 static void test_save(struct tep_record *record, int cpu)
@@ -291,7 +291,7 @@ static void show_test(struct tracecmd_input *handle)
 	trace_seq_destroy(&s);
 	printf("\n");
 
-	free_record(record);
+	tracecmd_free_record(record);
 
 	record = tracecmd_read_cpu_last(handle, cpu);
 	if (!record) {
@@ -307,7 +307,7 @@ static void show_test(struct tracecmd_input *handle)
 	trace_seq_destroy(&s);
 	printf("\n");
 
-	free_record(record);
+	tracecmd_free_record(record);
 }
 static void test_save(struct tep_record *record, int cpu)
 {
@@ -1122,7 +1122,7 @@ static struct tep_record *get_next_record(struct handle_list *handles)
 				    test_stacktrace(handles, record, 0))
 					found = 1;
 				else
-					free_record(record);
+					tracecmd_free_record(record);
 				break;
 			case FILTER_NONE:
 			case FILTER_MATCH:
@@ -1135,7 +1135,7 @@ static struct tep_record *get_next_record(struct handle_list *handles)
 				}
 				/* fall through */
 			default:
-				free_record(record);
+				tracecmd_free_record(record);
 			}
 		}
 	} while (record && !found);
@@ -1155,7 +1155,7 @@ static void free_handle_record(struct handle_list *handles)
 	if (!handles->record)
 		return;
 
-	free_record(handles->record);
+	tracecmd_free_record(handles->record);
 	handles->record = NULL;
 }
 
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index bb2c3d53..f6ab970b 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -214,7 +214,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 	if (start) {
 		set_cpu_time(handle, percpu, start, cpu, cpus);
 		while (record && record->ts < start) {
-			free_record(record);
+			tracecmd_free_record(record);
 			record = read_record(handle, percpu, &cpu);
 		}
 	} else if (record)
@@ -249,7 +249,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 		cpu_data[cpu].offset = record->offset;
 
 		if (write_record(handle, record, &cpu_data[cpu], type)) {
-			free_record(record);
+			tracecmd_free_record(record);
 			record = read_record(handle, percpu, &cpu);
 
 			/* if we hit the end of the cpu, clear the offset */
@@ -268,7 +268,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 				if (record &&
 				    record->ts >
 				    (start + (unsigned long long)count_limit * 1000000000ULL)) {
-					free_record(record);
+					tracecmd_free_record(record);
 					record = NULL;
 				}
 				break;
@@ -276,7 +276,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 				if (record &&
 				    record->ts >
 				    (start + (unsigned long long)count_limit * 1000000ULL)) {
-					free_record(record);
+					tracecmd_free_record(record);
 					record = NULL;
 				}
 				break;
@@ -284,13 +284,13 @@ static int parse_cpu(struct tracecmd_input *handle,
 				if (record &&
 				    record->ts >
 				    (start + (unsigned long long)count_limit * 1000ULL)) {
-					free_record(record);
+					tracecmd_free_record(record);
 					record = NULL;
 				}
 				break;
 			case SPLIT_EVENTS:
 				if (++count >= count_limit) {
-					free_record(record);
+					tracecmd_free_record(record);
 					record = NULL;
 				}
 				break;
@@ -301,7 +301,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 	}
 
 	if (record)
-		free_record(record);
+		tracecmd_free_record(record);
 
 	if (percpu) {
 		if (cpu_data[cpu].page) {
@@ -393,7 +393,7 @@ static double parse_file(struct tracecmd_input *handle,
 			record = tracecmd_read_at(handle, cpu_data[cpu].offset, NULL);
 			if (record && (!current || record->ts > current))
 				current = record->ts + 1;
-			free_record(record);
+			tracecmd_free_record(record);
 		}
 		unlink(cpu_data[cpu].file);
 		free(cpu_data[cpu].file);
diff --git a/tracecmd/trace-stream.c b/tracecmd/trace-stream.c
index 3814a357..54c21c78 100644
--- a/tracecmd/trace-stream.c
+++ b/tracecmd/trace-stream.c
@@ -115,7 +115,7 @@ int trace_stream_read(struct pid_record_data *pids, int nr_pids, struct timeval
 	}
 	if (last_pid) {
 		trace_show_data(last_pid->instance->handle, last_pid->record);
-		free_record(last_pid->record);
+		tracecmd_free_record(last_pid->record);
 		last_pid->record = NULL;
 		return 1;
 	}
-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] trace-cmd: Rename tracecmd_get_pevent() to tracecmd_get_tep()
  2020-12-22 12:09 [PATCH 0/2] Rename a few libtracecmd APIs Tzvetomir Stoyanov (VMware)
  2020-12-22 12:09 ` [PATCH 1/2] trace-cmd: Rename free_record() to tracecmd_free_record() Tzvetomir Stoyanov (VMware)
@ 2020-12-22 12:09 ` Tzvetomir Stoyanov (VMware)
  1 sibling, 0 replies; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-12-22 12:09 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

The name of the trace event context from libtraceevent library
is tep, all APIs that work with a pointer to this context should refer
to it as "tep".

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 include/trace-cmd/trace-cmd.h  |  2 +-
 kernel-shark/src/libkshark.c   |  2 +-
 lib/trace-cmd/trace-blk-hack.c |  2 +-
 lib/trace-cmd/trace-ftrace.c   |  2 +-
 lib/trace-cmd/trace-input.c    |  4 ++--
 lib/trace-cmd/trace-output.c   |  8 ++++----
 tracecmd/trace-hist.c          |  2 +-
 tracecmd/trace-mem.c           |  2 +-
 tracecmd/trace-profile.c       |  2 +-
 tracecmd/trace-read.c          | 22 +++++++++++-----------
 tracecmd/trace-split.c         |  4 ++--
 11 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
index 9d9a61d3..75352309 100644
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -26,7 +26,7 @@ tracecmd_read_at(struct tracecmd_input *handle, unsigned long long offset,
 		 int *cpu);
 void tracecmd_free_record(struct tep_record *record);
 
-struct tep_handle *tracecmd_get_pevent(struct tracecmd_input *handle);
+struct tep_handle *tracecmd_get_tep(struct tracecmd_input *handle);
 unsigned long long tracecmd_get_traceid(struct tracecmd_input *handle);
 int tracecmd_get_guest_cpumap(struct tracecmd_input *handle,
 			      unsigned long long trace_id,
diff --git a/kernel-shark/src/libkshark.c b/kernel-shark/src/libkshark.c
index 9823ccc9..8f5dcb00 100644
--- a/kernel-shark/src/libkshark.c
+++ b/kernel-shark/src/libkshark.c
@@ -155,7 +155,7 @@ bool kshark_open(struct kshark_context *kshark_ctx, const char *file)
 	}
 
 	kshark_ctx->handle = handle;
-	kshark_ctx->pevent = tracecmd_get_pevent(handle);
+	kshark_ctx->pevent = tracecmd_get_tep(handle);
 
 	kshark_ctx->advanced_event_filter =
 		tep_filter_alloc(kshark_ctx->pevent);
diff --git a/lib/trace-cmd/trace-blk-hack.c b/lib/trace-cmd/trace-blk-hack.c
index 4f5953ad..2a05cf98 100644
--- a/lib/trace-cmd/trace-blk-hack.c
+++ b/lib/trace-cmd/trace-blk-hack.c
@@ -39,7 +39,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
 	int l;
 	int r;
 
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	/*
 	 * Unfortunately, the TRACE_BLK has changed a bit.
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 03e60eb0..f74f7c2e 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -370,7 +370,7 @@ int tracecmd_ftrace_overrides(struct tracecmd_input *handle,
 
 	finfo->handle = handle;
 
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	tep_register_event_handler(pevent, -1, "ftrace", "function",
 				      function_handler, NULL);
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index e57492e9..9dda0dd5 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -3776,10 +3776,10 @@ int tracecmd_cpus(struct tracecmd_input *handle)
 }
 
 /**
- * tracecmd_get_pevent - return the pevent handle
+ * tracecmd_get_tep - return the tep handle
  * @handle: input handle for the trace.dat file
  */
-struct tep_handle *tracecmd_get_pevent(struct tracecmd_input *handle)
+struct tep_handle *tracecmd_get_tep(struct tracecmd_input *handle)
 {
 	return handle->pevent;
 }
diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
index de76e3e7..032c8ff4 100644
--- a/lib/trace-cmd/trace-output.c
+++ b/lib/trace-cmd/trace-output.c
@@ -877,9 +877,9 @@ create_file_fd(int fd, struct tracecmd_input *ihandle,
 
 	/* get endian and page size */
 	if (ihandle) {
-		pevent = tracecmd_get_pevent(ihandle);
+		pevent = tracecmd_get_tep(ihandle);
 		/* Use the pevent of the ihandle for later writes */
-		handle->pevent = tracecmd_get_pevent(ihandle);
+		handle->pevent = tracecmd_get_tep(ihandle);
 		tep_ref(pevent);
 		if (tep_is_file_bigendian(pevent))
 			buf[0] = 1;
@@ -1433,9 +1433,9 @@ struct tracecmd_output *tracecmd_get_output_handle_fd(int fd)
 	handle->fd = fd;
 
 	/* get endian and page size */
-	pevent = tracecmd_get_pevent(ihandle);
+	pevent = tracecmd_get_tep(ihandle);
 	/* Use the pevent of the ihandle for later writes */
-	handle->pevent = tracecmd_get_pevent(ihandle);
+	handle->pevent = tracecmd_get_tep(ihandle);
 	tep_ref(pevent);
 	handle->page_size = tracecmd_page_size(ihandle);
 	list_head_init(&handle->options);
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index 76e8cae2..ea9b2bef 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -933,7 +933,7 @@ static void print_chains(struct tep_handle *pevent)
 
 static void do_trace_hist(struct tracecmd_input *handle)
 {
-	struct tep_handle *pevent = tracecmd_get_pevent(handle);
+	struct tep_handle *pevent = tracecmd_get_tep(handle);
 	struct tep_record *record;
 	struct tep_event *event;
 	int cpus;
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index c6cc7dee..2eb75a00 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -461,7 +461,7 @@ static void print_list(void)
 
 static void do_trace_mem(struct tracecmd_input *handle)
 {
-	struct tep_handle *pevent = tracecmd_get_pevent(handle);
+	struct tep_handle *pevent = tracecmd_get_tep(handle);
 	struct tep_record *record;
 	struct tep_event *event;
 	int missed_events = 0;
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index b82110e6..e3a75143 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -1267,7 +1267,7 @@ static int handle_sched_wakeup_event(struct handle_data *h,
 void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 			int global)
 {
-	struct tep_handle *pevent = tracecmd_get_pevent(handle);
+	struct tep_handle *pevent = tracecmd_get_tep(handle);
 	struct tep_format_field **fields;
 	struct handle_data *h;
 	struct event_data *event_data;
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 11293bc8..d07f4efe 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -150,7 +150,7 @@ enum time_fmt {
 
 static const char *time_format(struct tracecmd_input *handle, enum time_fmt tf)
 {
-	struct tep_handle *tep = tracecmd_get_pevent(handle);
+	struct tep_handle *tep = tracecmd_get_tep(handle);
 
 	switch (tf) {
 	case TIME_FMT_LAT:
@@ -171,7 +171,7 @@ static const char *time_format(struct tracecmd_input *handle, enum time_fmt tf)
 static void print_event(struct trace_seq *s, struct tracecmd_input *handle,
 			struct tep_record *record)
 {
-	struct tep_handle *tep = tracecmd_get_pevent(handle);
+	struct tep_handle *tep = tracecmd_get_tep(handle);
 	struct tep_event *event;
 	const char *lfmt = time_format(handle, TIME_FMT_LAT);
 	const char *tfmt = time_format(handle, TIME_FMT_NORMAL);
@@ -481,7 +481,7 @@ static void convert_comm_filter(struct tracecmd_input *handle)
 	if (!comm_list)
 		return;
 
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	/* Seach for comm names and get their pids */
 	for (list = comm_list; list; list = list->next) {
@@ -545,7 +545,7 @@ static void process_filters(struct handle_list *handles)
 	int filters = 0;
 	int ret;
 
-	pevent = tracecmd_get_pevent(handles->handle);
+	pevent = tracecmd_get_tep(handles->handle);
 
 	make_pid_filter(handles->handle);
 
@@ -592,7 +592,7 @@ static void init_wakeup(struct tracecmd_input *handle)
 	if (!show_wakeup)
 		return;
 
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	trace_hash_init(&wakeup_hash, WAKEUP_HASH_SIZE);
 
@@ -829,7 +829,7 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record)
 		return;
 	}
 
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 	event = tep_find_event_by_record(pevent, record);
 	use_trace_clock = tracecmd_get_use_trace_clock(handle);
 
@@ -1028,7 +1028,7 @@ test_stacktrace(struct handle_list *handles, struct tep_record *record,
 				die("Failed to allocate for %d cpus", info->nr_cpus);
 			memset(info->cpus, 0, sizeof(*info->cpus));
 
-			pevent = tracecmd_get_pevent(h->handle);
+			pevent = tracecmd_get_tep(h->handle);
 			event = tep_find_event_by_name(pevent, "ftrace",
 						       "kernel_stack");
 			if (event)
@@ -1044,7 +1044,7 @@ test_stacktrace(struct handle_list *handles, struct tep_record *record,
 	}
 
 	handle = handles->handle;
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	for (info = infos; info; info = info->next)
 		if (info->handles == handles)
@@ -1087,7 +1087,7 @@ static struct tep_record *get_next_record(struct handle_list *handles)
 	if (handles->done)
 		return NULL;
 
-	pevent = tracecmd_get_pevent(handles->handle);
+	pevent = tracecmd_get_tep(handles->handle);
 
 	do {
 		if (filter_cpus) {
@@ -1247,7 +1247,7 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype
 		}
 
 		/* Find the kernel_stacktrace if available */
-		pevent = tracecmd_get_pevent(handles->handle);
+		pevent = tracecmd_get_tep(handles->handle);
 		event = tep_find_event_by_name(pevent, "ftrace", "kernel_stack");
 		if (event)
 			stacktrace_id = event->id;
@@ -1795,7 +1795,7 @@ void trace_report (int argc, char **argv)
 		else if (ts2secs)
 			tracecmd_set_ts2secs(handle, ts2secs);
 
-		pevent = tracecmd_get_pevent(handle);
+		pevent = tracecmd_get_tep(handle);
 
 		if (nanosec)
 			tep_set_flag(pevent, TEP_NSEC_OUTPUT);
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index f6ab970b..9d347b36 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -87,7 +87,7 @@ static int write_record(struct tracecmd_input *handle,
 
 	page = cpu_data->page;
 
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	ptr = page + cpu_data->index;
 
@@ -191,7 +191,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 
 	long_size = tracecmd_long_size(handle);
 	page_size = tracecmd_page_size(handle);
-	pevent = tracecmd_get_pevent(handle);
+	pevent = tracecmd_get_tep(handle);
 
 	/* Force new creation of first page */
 	if (percpu) {
-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 12:09 [PATCH 0/2] Rename a few libtracecmd APIs Tzvetomir Stoyanov (VMware)
2020-12-22 12:09 ` [PATCH 1/2] trace-cmd: Rename free_record() to tracecmd_free_record() Tzvetomir Stoyanov (VMware)
2020-12-22 12:09 ` [PATCH 2/2] trace-cmd: Rename tracecmd_get_pevent() to tracecmd_get_tep() Tzvetomir Stoyanov (VMware)

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git