@@ -515,7 +515,6 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record);
void tep_data_lat_fmt(struct tep_handle *pevent,
struct trace_seq *s, struct tep_record *record);
int tep_data_type(struct tep_handle *pevent, struct tep_record *rec);
-struct tep_event *tep_data_event_from_type(struct tep_handle *pevent, int type);
int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec);
int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec);
int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec);
@@ -1187,7 +1187,7 @@ const char *kshark_get_event_name_easy(struct kshark_entry *entry)
* Use a mutex to protect the access.
*/
pthread_mutex_lock(&kshark_ctx->input_mutex);
- event = tep_data_event_from_type(kshark_ctx->pevent, event_id);
+ event = tep_find_event(kshark_ctx->pevent, event_id);
pthread_mutex_unlock(&kshark_ctx->input_mutex);
if (event)
@@ -1236,7 +1236,7 @@ const char *kshark_get_info_easy(struct kshark_entry *entry)
data = tracecmd_read_at(kshark_ctx->handle, entry->offset, NULL);
event_id = tep_data_type(kshark_ctx->pevent, data);
- event = tep_data_event_from_type(kshark_ctx->pevent, event_id);
+ event = tep_find_event(kshark_ctx->pevent, event_id);
if (event)
info = kshark_get_info(kshark_ctx->pevent, data, event);
@@ -1330,8 +1330,7 @@ char* kshark_dump_entry(const struct kshark_entry *entry)
data = tracecmd_read_at(kshark_ctx->handle, entry->offset,
NULL);
- event = tep_data_event_from_type(kshark_ctx->pevent,
- entry->event_id);
+ event = tep_find_event(kshark_ctx->pevent, entry->event_id);
event_name = event? event->name : "[UNKNOWN EVENT]";
lat = kshark_get_latency(kshark_ctx->pevent, data);
@@ -5266,18 +5266,6 @@ int tep_data_type(struct tep_handle *pevent, struct tep_record *rec)
return trace_parse_common_type(pevent, rec->data);
}
-/**
- * tep_data_event_from_type - find the event by a given type
- * @pevent: a handle to the pevent
- * @type: the type of the event.
- *
- * This returns the event form a given @type;
- */
-struct tep_event *tep_data_event_from_type(struct tep_handle *pevent, int type)
-{
- return tep_find_event(pevent, type);
-}
-
/**
* tep_data_pid - parse the PID from record
* @pevent: a handle to the pevent
@@ -204,7 +204,7 @@ class Trace(object):
rec = tracecmd_read_data(self._handle, cpu)
if rec:
type = tep_data_type(self._pevent, rec)
- format = tep_data_event_from_type(self._pevent, type)
+ format = tep_find_event(self._pevent, type)
# rec ownership goes over to Event instance
return Event(self._pevent, rec, format)
return None
@@ -216,7 +216,7 @@ class Trace(object):
return None
rec, cpu = res
type = tep_data_type(self._pevent, rec)
- format = tep_data_event_from_type(self._pevent, type)
+ format = tep_find_event(self._pevent, type)
# rec ownership goes over to Event instance
return Event(self._pevent, rec, format)
@@ -226,7 +226,7 @@ class Trace(object):
return None
rec, cpu = res
type = tep_data_type(self._pevent, rec)
- format = tep_data_event_from_type(self._pevent, type)
+ format = tep_find_event(self._pevent, type)
return Event(self._pevent, rec, format)
def peek_event(self, cpu):
@@ -234,7 +234,7 @@ class Trace(object):
if rec is None:
return None
type = tep_data_type(self._pevent, rec)
- format = tep_data_event_from_type(self._pevent, type)
+ format = tep_find_event(self._pevent, type)
# rec ownership goes over to Event instance
return Event(self._pevent, rec, format)
@@ -541,7 +541,7 @@ process_event(struct tep_handle *pevent, struct tep_record *record, int type)
reset_pending_stack();
}
- event = tep_data_event_from_type(pevent, type);
+ event = tep_find_event(pevent, type);
event_name = event->name;
ret = tep_read_number_field(common_pid_field, record->data, &val);
@@ -952,7 +952,7 @@ static void do_trace_hist(struct tracecmd_input *handle)
die("No records found in file");
ret = tep_data_type(pevent, record);
- event = tep_data_event_from_type(pevent, ret);
+ event = tep_find_event(pevent, ret);
long_size = tracecmd_long_size(handle);
@@ -488,7 +488,7 @@ static void do_trace_mem(struct tracecmd_input *handle)
die("No records found in file");
ret = tep_data_type(pevent, record);
- event = tep_data_event_from_type(pevent, ret);
+ event = tep_find_event(pevent, ret);
common_type_field = tep_find_common_field(event, "common_type");
if (!common_type_field)
@@ -3402,7 +3402,7 @@ find_ts_in_page(struct tep_handle *pevent, void *page, int size)
break;
free_record(last_record);
id = tep_data_type(pevent, record);
- event = tep_data_event_from_type(pevent, id);
+ event = tep_find_event(pevent, id);
if (event) {
/* Make sure this is our event */
field = tep_find_field(event, "buf");