diff mbox series

[v8,01/44] kernel-shark: Adopt trace-cmd API changes

Message ID 20210104174724.70404-2-y.karadz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Start KernelShark v2 transformation | expand

Commit Message

Yordan Karadzhov Jan. 4, 2021, 5:46 p.m. UTC
Use the new names of the methods

free_record() -> tracecmd_free_record()
tracecmd_get_pevent() -> tracecmd_get_tep()

follow the tracecmd library naming convention.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/libkshark.c            | 20 ++++++++++----------
 src/plugins/sched_events.c |  4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/src/libkshark.c b/src/libkshark.c
index 52aacd3..42dc08c 100644
--- a/src/libkshark.c
+++ b/src/libkshark.c
@@ -151,7 +151,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);
@@ -674,7 +674,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);
 		}
 	}
@@ -774,14 +774,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;
 			}
 
@@ -902,7 +902,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
@@ -1167,7 +1167,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);
 	}
@@ -1234,7 +1234,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);
 
@@ -1279,7 +1279,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);
 	}
@@ -1378,7 +1378,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);
 
@@ -1492,7 +1492,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/src/plugins/sched_events.c b/src/plugins/sched_events.c
index d0fd15e..4b671f1 100644
--- a/src/plugins/sched_events.c
+++ b/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)