return 0;
event_add_failed:
- pevent_free_format(event);
+ tep_free_format(event);
return ret;
}
}
/**
- * pevent_get_field_raw - return the raw pointer into the data field
+ * tep_get_field_raw - return the raw pointer into the data field
* @s: The seq to print to on error
* @event: the event that the field is for
* @name: The name of the field
*
* On failure, it returns NULL.
*/
-void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- int *len, int err)
+void *tep_get_field_raw(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ int *len, int err)
{
struct format_field *field;
void *data = record->data;
}
/**
- * pevent_get_field_val - find a field and return its value
+ * tep_get_field_val - find a field and return its value
* @s: The seq to print to on error
* @event: the event that the field is for
* @name: The name of the field
*
* Returns 0 on success -1 on field not found.
*/
-int pevent_get_field_val(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- unsigned long long *val, int err)
+int tep_get_field_val(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ unsigned long long *val, int err)
{
struct format_field *field;
}
/**
- * pevent_get_common_field_val - find a common field and return its value
+ * tep_get_common_field_val - find a common field and return its value
* @s: The seq to print to on error
* @event: the event that the field is for
* @name: The name of the field
*
* Returns 0 on success -1 on field not found.
*/
-int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- unsigned long long *val, int err)
+int tep_get_common_field_val(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ unsigned long long *val, int err)
{
struct format_field *field;
}
/**
- * pevent_get_any_field_val - find a any field and return its value
+ * tep_get_any_field_val - find a any field and return its value
* @s: The seq to print to on error
* @event: the event that the field is for
* @name: The name of the field
*
* Returns 0 on success -1 on field not found.
*/
-int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- unsigned long long *val, int err)
+int tep_get_any_field_val(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ unsigned long long *val, int err)
{
struct format_field *field;
pevent->ref_count++;
}
-void pevent_free_format_field(struct format_field *field)
+void tep_free_format_field(struct format_field *field)
{
free(field->type);
if (field->alias != field->name)
while (field) {
next = field->next;
- pevent_free_format_field(field);
+ tep_free_format_field(field);
field = next;
}
}
free_format_fields(format->fields);
}
-void pevent_free_format(struct event_format *event)
+void tep_free_format(struct event_format *event)
{
free(event->name);
free(event->system);
}
for (i = 0; i < pevent->nr_events; i++)
- pevent_free_format(pevent->events[i]);
+ tep_free_format(pevent->events[i]);
while (pevent->handlers) {
handle = pevent->handlers;
struct event_format **eventp,
const char *buf,
unsigned long size, const char *sys);
-void pevent_free_format(struct event_format *event);
-void pevent_free_format_field(struct format_field *field);
-
-void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- int *len, int err);
-
-int pevent_get_field_val(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- unsigned long long *val, int err);
-int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,
- const char *name, struct tep_record *record,
- unsigned long long *val, int err);
-int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,
+void tep_free_format(struct event_format *event);
+void tep_free_format_field(struct format_field *field);
+
+void *tep_get_field_raw(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ int *len, int err);
+
+int tep_get_field_val(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ unsigned long long *val, int err);
+int tep_get_common_field_val(struct trace_seq *s, struct event_format *event,
const char *name, struct tep_record *record,
unsigned long long *val, int err);
+int tep_get_any_field_val(struct trace_seq *s, struct event_format *event,
+ const char *name, struct tep_record *record,
+ unsigned long long *val, int err);
int tep_print_num_field(struct trace_seq *s, const char *fmt,
struct event_format *event, const char *name,
const char *parent;
int index = 0;
- if (pevent_get_field_val(s, event, "ip", record, &function, 1))
+ if (tep_get_field_val(s, event, "ip", record, &function, 1))
return trace_seq_putc(s, '!');
func = pevent_find_function(pevent, function);
- if (pevent_get_field_val(s, event, "parent_ip", record, &pfunction, 1))
+ if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1))
return trace_seq_putc(s, '!');
parent = pevent_find_function(pevent, pfunction);
unsigned long long val;
const char *reason;
- if (pevent_get_field_val(s, event, field, record, &val, 1) < 0)
+ if (tep_get_field_val(s, event, field, record, &val, 1) < 0)
return -1;
- if (pevent_get_field_val(s, event, "isa", record, &isa, 0) < 0)
+ if (tep_get_field_val(s, event, "isa", record, &isa, 0) < 0)
isa = 1;
reason = find_exit_reason(isa, val);
tep_print_num_field(s, " rip 0x%lx", event, "guest_rip", record, 1);
- if (pevent_get_field_val(s, event, "info1", record, &info1, 0) >= 0
- && pevent_get_field_val(s, event, "info2", record, &info2, 0) >= 0)
+ if (tep_get_field_val(s, event, "info1", record, &info1, 0) >= 0
+ && tep_get_field_val(s, event, "info2", record, &info2, 0) >= 0)
trace_seq_printf(s, " info %llx %llx", info1, info2);
return 0;
uint8_t *insn;
const char *disasm;
- if (pevent_get_field_val(s, event, "rip", record, &rip, 1) < 0)
+ if (tep_get_field_val(s, event, "rip", record, &rip, 1) < 0)
return -1;
- if (pevent_get_field_val(s, event, "csbase", record, &csbase, 1) < 0)
+ if (tep_get_field_val(s, event, "csbase", record, &csbase, 1) < 0)
return -1;
- if (pevent_get_field_val(s, event, "len", record, &len, 1) < 0)
+ if (tep_get_field_val(s, event, "len", record, &len, 1) < 0)
return -1;
- if (pevent_get_field_val(s, event, "flags", record, &flags, 1) < 0)
+ if (tep_get_field_val(s, event, "flags", record, &flags, 1) < 0)
return -1;
- if (pevent_get_field_val(s, event, "failed", record, &failed, 1) < 0)
+ if (tep_get_field_val(s, event, "failed", record, &failed, 1) < 0)
return -1;
- insn = pevent_get_field_raw(s, event, "insn", record, &llen, 1);
+ insn = tep_get_field_raw(s, event, "insn", record, &llen, 1);
if (!insn)
return -1;
};
union kvm_mmu_page_role role;
- if (pevent_get_field_val(s, event, "role", record, &val, 1) < 0)
+ if (tep_get_field_val(s, event, "role", record, &val, 1) < 0)
return -1;
role.word = (int)val;
tep_print_num_field(s, " root %u ", event,
"root_count", record, 1);
- if (pevent_get_field_val(s, event, "unsync", record, &val, 1) < 0)
+ if (tep_get_field_val(s, event, "unsync", record, &val, 1) < 0)
return -1;
trace_seq_printf(s, "%s%c", val ? "unsync" : "sync", 0);
{
unsigned long long val;
- if (pevent_get_field_val(s, event, "created", record, &val, 1) < 0)
+ if (tep_get_field_val(s, event, "created", record, &val, 1) < 0)
return -1;
trace_seq_printf(s, "%s ", val ? "new" : "existing");
- if (pevent_get_field_val(s, event, "gfn", record, &val, 1) < 0)
+ if (tep_get_field_val(s, event, "gfn", record, &val, 1) < 0)
return -1;
trace_seq_printf(s, "sp gfn %llx ", val);
struct format_field *field;
unsigned long long val;
- if (pevent_get_field_val(s, event, "pid", record, &val, 1))
+ if (tep_get_field_val(s, event, "pid", record, &val, 1))
return trace_seq_putc(s, '!');
field = tep_find_any_field(event, "comm");
}
trace_seq_printf(s, "%lld", val);
- if (pevent_get_field_val(s, event, "prio", record, &val, 0) == 0)
+ if (tep_get_field_val(s, event, "prio", record, &val, 0) == 0)
trace_seq_printf(s, " [%lld]", val);
- if (pevent_get_field_val(s, event, "success", record, &val, 1) == 0)
+ if (tep_get_field_val(s, event, "success", record, &val, 1) == 0)
trace_seq_printf(s, " success=%lld", val);
- if (pevent_get_field_val(s, event, "target_cpu", record, &val, 0) == 0)
+ if (tep_get_field_val(s, event, "target_cpu", record, &val, 0) == 0)
trace_seq_printf(s, " CPU:%03llu", val);
return 0;
struct format_field *field;
unsigned long long val;
- if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1))
+ if (tep_get_field_val(s, event, "prev_pid", record, &val, 1))
return trace_seq_putc(s, '!');
field = tep_find_any_field(event, "prev_comm");
}
trace_seq_printf(s, "%lld ", val);
- if (pevent_get_field_val(s, event, "prev_prio", record, &val, 0) == 0)
+ if (tep_get_field_val(s, event, "prev_prio", record, &val, 0) == 0)
trace_seq_printf(s, "[%d] ", (int) val);
- if (pevent_get_field_val(s, event, "prev_state", record, &val, 0) == 0)
+ if (tep_get_field_val(s, event, "prev_state", record, &val, 0) == 0)
write_state(s, val);
trace_seq_puts(s, " ==> ");
- if (pevent_get_field_val(s, event, "next_pid", record, &val, 1))
+ if (tep_get_field_val(s, event, "next_pid", record, &val, 1))
return trace_seq_putc(s, '!');
field = tep_find_any_field(event, "next_comm");
}
trace_seq_printf(s, "%lld", val);
- if (pevent_get_field_val(s, event, "next_prio", record, &val, 0) == 0)
+ if (tep_get_field_val(s, event, "next_prio", record, &val, 0) == 0)
trace_seq_printf(s, " [%d]", (int) val);
return 0;