Commit 2c92f982 authored by Tzvetomir Stoyanov (VMware)'s avatar Tzvetomir Stoyanov (VMware) Committed by Arnaldo Carvalho de Melo

tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field}

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_". This renames struct format to
struct tep_format and struct format_field to struct tep_format_field
Signed-off-by: default avatarTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180919185722.661319373@goodmis.orgSigned-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4963b0f8
This diff is collapsed.
...@@ -141,8 +141,8 @@ enum format_flags { ...@@ -141,8 +141,8 @@ enum format_flags {
FIELD_IS_SYMBOLIC = 128, FIELD_IS_SYMBOLIC = 128,
}; };
struct format_field { struct tep_format_field {
struct format_field *next; struct tep_format_field *next;
struct tep_event_format *event; struct tep_event_format *event;
char *type; char *type;
char *name; char *name;
...@@ -154,11 +154,11 @@ struct format_field { ...@@ -154,11 +154,11 @@ struct format_field {
unsigned long flags; unsigned long flags;
}; };
struct format { struct tep_format {
int nr_common; int nr_common;
int nr_fields; int nr_fields;
struct format_field *common_fields; struct tep_format_field *common_fields;
struct format_field *fields; struct tep_format_field *fields;
}; };
struct print_arg_atom { struct print_arg_atom {
...@@ -177,7 +177,7 @@ struct print_arg_bitmask { ...@@ -177,7 +177,7 @@ struct print_arg_bitmask {
struct print_arg_field { struct print_arg_field {
char *name; char *name;
struct format_field *field; struct tep_format_field *field;
}; };
struct print_flag_sym { struct print_flag_sym {
...@@ -214,7 +214,7 @@ struct print_arg_int_array { ...@@ -214,7 +214,7 @@ struct print_arg_int_array {
}; };
struct print_arg_dynarray { struct print_arg_dynarray {
struct format_field *field; struct tep_format_field *field;
struct print_arg *index; struct print_arg *index;
}; };
...@@ -282,7 +282,7 @@ struct tep_event_format { ...@@ -282,7 +282,7 @@ struct tep_event_format {
char *name; char *name;
int id; int id;
int flags; int flags;
struct format format; struct tep_format format;
struct print_fmt print_fmt; struct print_fmt print_fmt;
char *system; char *system;
tep_event_handler_func handler; tep_event_handler_func handler;
...@@ -477,9 +477,9 @@ struct tep_handle { ...@@ -477,9 +477,9 @@ struct tep_handle {
int flags; int flags;
struct format_field *bprint_ip_field; struct tep_format_field *bprint_ip_field;
struct format_field *bprint_fmt_field; struct tep_format_field *bprint_fmt_field;
struct format_field *bprint_buf_field; struct tep_format_field *bprint_buf_field;
struct event_handler *handlers; struct event_handler *handlers;
struct tep_function_handler *func_handlers; struct tep_function_handler *func_handlers;
...@@ -607,7 +607,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent, ...@@ -607,7 +607,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,
const char *buf, const char *buf,
unsigned long size, const char *sys); unsigned long size, const char *sys);
void tep_free_format(struct tep_event_format *event); void tep_free_format(struct tep_event_format *event);
void tep_free_format_field(struct format_field *field); void tep_free_format_field(struct tep_format_field *field);
void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
...@@ -644,15 +644,15 @@ int tep_register_print_function(struct tep_handle *pevent, ...@@ -644,15 +644,15 @@ int tep_register_print_function(struct tep_handle *pevent,
int tep_unregister_print_function(struct tep_handle *pevent, int tep_unregister_print_function(struct tep_handle *pevent,
tep_func_handler func, char *name); tep_func_handler func, char *name);
struct format_field *tep_find_common_field(struct tep_event_format *event, const char *name); struct tep_format_field *tep_find_common_field(struct tep_event_format *event, const char *name);
struct format_field *tep_find_field(struct tep_event_format *event, const char *name); struct tep_format_field *tep_find_field(struct tep_event_format *event, const char *name);
struct format_field *tep_find_any_field(struct tep_event_format *event, const char *name); struct tep_format_field *tep_find_any_field(struct tep_event_format *event, const char *name);
const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr);
unsigned long long unsigned long long
tep_find_function_address(struct tep_handle *pevent, unsigned long long addr); tep_find_function_address(struct tep_handle *pevent, unsigned long long addr);
unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size); unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size);
int tep_read_number_field(struct format_field *field, const void *data, int tep_read_number_field(struct tep_format_field *field, const void *data,
unsigned long long *value); unsigned long long *value);
struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id); struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id);
...@@ -677,7 +677,7 @@ struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *co ...@@ -677,7 +677,7 @@ struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *co
int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
void tep_print_field(struct trace_seq *s, void *data, void tep_print_field(struct trace_seq *s, void *data,
struct format_field *field); struct tep_format_field *field);
void tep_print_fields(struct trace_seq *s, void *data, void tep_print_fields(struct trace_seq *s, void *data,
int size __maybe_unused, struct tep_event_format *event); int size __maybe_unused, struct tep_event_format *event);
void tep_event_info(struct trace_seq *s, struct tep_event_format *event, void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
...@@ -686,8 +686,8 @@ int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum, ...@@ -686,8 +686,8 @@ int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum,
char *buf, size_t buflen); char *buf, size_t buflen);
struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type); struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type);
struct format_field **tep_event_common_fields(struct tep_event_format *event); struct tep_format_field **tep_event_common_fields(struct tep_event_format *event);
struct format_field **tep_event_fields(struct tep_event_format *event); struct tep_format_field **tep_event_fields(struct tep_event_format *event);
static inline int tep_get_cpus(struct tep_handle *pevent) static inline int tep_get_cpus(struct tep_handle *pevent)
{ {
...@@ -832,7 +832,7 @@ struct filter_arg_boolean { ...@@ -832,7 +832,7 @@ struct filter_arg_boolean {
}; };
struct filter_arg_field { struct filter_arg_field {
struct format_field *field; struct tep_format_field *field;
}; };
struct filter_arg_value { struct filter_arg_value {
...@@ -863,7 +863,7 @@ struct filter_arg_num { ...@@ -863,7 +863,7 @@ struct filter_arg_num {
struct filter_arg_str { struct filter_arg_str {
enum filter_cmp_type type; enum filter_cmp_type type;
struct format_field *field; struct tep_format_field *field;
char *val; char *val;
char *buffer; char *buffer;
regex_t reg; regex_t reg;
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#define COMM "COMM" #define COMM "COMM"
#define CPU "CPU" #define CPU "CPU"
static struct format_field comm = { static struct tep_format_field comm = {
.name = "COMM", .name = "COMM",
}; };
static struct format_field cpu = { static struct tep_format_field cpu = {
.name = "CPU", .name = "CPU",
}; };
...@@ -336,7 +336,7 @@ static enum tep_errno ...@@ -336,7 +336,7 @@ static enum tep_errno
create_arg_item(struct tep_event_format *event, const char *token, create_arg_item(struct tep_event_format *event, const char *token,
enum event_type type, struct filter_arg **parg, char *error_str) enum event_type type, struct filter_arg **parg, char *error_str)
{ {
struct format_field *field; struct tep_format_field *field;
struct filter_arg *arg; struct filter_arg *arg;
arg = allocate_arg(); arg = allocate_arg();
...@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record) ...@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)
static unsigned long long static unsigned long long
get_value(struct tep_event_format *event, get_value(struct tep_event_format *event,
struct format_field *field, struct tep_record *record) struct tep_format_field *field, struct tep_record *record)
{ {
unsigned long long val; unsigned long long val;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
static int call_site_handler(struct trace_seq *s, struct tep_record *record, static int call_site_handler(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event_format *event, void *context)
{ {
struct format_field *field; struct tep_format_field *field;
unsigned long long val, addr; unsigned long long val, addr;
void *data = record->data; void *data = record->data;
const char *func; const char *func;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
static void print_string(struct trace_seq *s, struct tep_event_format *event, static void print_string(struct trace_seq *s, struct tep_event_format *event,
const char *name, const void *data) const char *name, const void *data)
{ {
struct format_field *f = tep_find_field(event, name); struct tep_format_field *f = tep_find_field(event, name);
int offset; int offset;
int length; int length;
......
...@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val) ...@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val)
trace_seq_putc(s, 'R'); trace_seq_putc(s, 'R');
} }
static void write_and_save_comm(struct format_field *field, static void write_and_save_comm(struct tep_format_field *field,
struct tep_record *record, struct tep_record *record,
struct trace_seq *s, int pid) struct trace_seq *s, int pid)
{ {
...@@ -69,7 +69,7 @@ static int sched_wakeup_handler(struct trace_seq *s, ...@@ -69,7 +69,7 @@ static int sched_wakeup_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event_format *event, void *context)
{ {
struct format_field *field; struct tep_format_field *field;
unsigned long long val; unsigned long long val;
if (tep_get_field_val(s, event, "pid", record, &val, 1)) if (tep_get_field_val(s, event, "pid", record, &val, 1))
...@@ -98,7 +98,7 @@ static int sched_switch_handler(struct trace_seq *s, ...@@ -98,7 +98,7 @@ static int sched_switch_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event_format *event, void *context)
{ {
struct format_field *field; struct tep_format_field *field;
unsigned long long val; unsigned long long val;
if (tep_get_field_val(s, event, "prev_pid", record, &val, 1)) if (tep_get_field_val(s, event, "prev_pid", record, &val, 1))
......
...@@ -181,7 +181,7 @@ static int __tp_field__init_uint(struct tp_field *field, int size, int offset, b ...@@ -181,7 +181,7 @@ static int __tp_field__init_uint(struct tp_field *field, int size, int offset, b
return 0; return 0;
} }
static int tp_field__init_uint(struct tp_field *field, struct format_field *format_field, bool needs_swap) static int tp_field__init_uint(struct tp_field *field, struct tep_format_field *format_field, bool needs_swap)
{ {
return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap); return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap);
} }
...@@ -198,7 +198,7 @@ static int __tp_field__init_ptr(struct tp_field *field, int offset) ...@@ -198,7 +198,7 @@ static int __tp_field__init_ptr(struct tp_field *field, int offset)
return 0; return 0;
} }
static int tp_field__init_ptr(struct tp_field *field, struct format_field *format_field) static int tp_field__init_ptr(struct tp_field *field, struct tep_format_field *format_field)
{ {
return __tp_field__init_ptr(field, format_field->offset); return __tp_field__init_ptr(field, format_field->offset);
} }
...@@ -214,7 +214,7 @@ static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel, ...@@ -214,7 +214,7 @@ static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel,
struct tp_field *field, struct tp_field *field,
const char *name) const char *name)
{ {
struct format_field *format_field = perf_evsel__field(evsel, name); struct tep_format_field *format_field = perf_evsel__field(evsel, name);
if (format_field == NULL) if (format_field == NULL)
return -1; return -1;
...@@ -230,7 +230,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel, ...@@ -230,7 +230,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel,
struct tp_field *field, struct tp_field *field,
const char *name) const char *name)
{ {
struct format_field *format_field = perf_evsel__field(evsel, name); struct tep_format_field *format_field = perf_evsel__field(evsel, name);
if (format_field == NULL) if (format_field == NULL)
return -1; return -1;
...@@ -867,7 +867,7 @@ struct syscall { ...@@ -867,7 +867,7 @@ struct syscall {
int args_size; int args_size;
bool is_exit; bool is_exit;
bool is_open; bool is_open;
struct format_field *args; struct tep_format_field *args;
const char *name; const char *name;
struct syscall_fmt *fmt; struct syscall_fmt *fmt;
struct syscall_arg_fmt *arg_fmt; struct syscall_arg_fmt *arg_fmt;
...@@ -1279,7 +1279,7 @@ static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args) ...@@ -1279,7 +1279,7 @@ static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args)
static int syscall__set_arg_fmts(struct syscall *sc) static int syscall__set_arg_fmts(struct syscall *sc)
{ {
struct format_field *field, *last_field = NULL; struct tep_format_field *field, *last_field = NULL;
int idx = 0, len; int idx = 0, len;
for (field = sc->args; field; field = field->next, ++idx) { for (field = sc->args; field; field = field->next, ++idx) {
...@@ -1525,7 +1525,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size, ...@@ -1525,7 +1525,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
ttrace->ret_scnprintf = NULL; ttrace->ret_scnprintf = NULL;
if (sc->args != NULL) { if (sc->args != NULL) {
struct format_field *field; struct tep_format_field *field;
for (field = sc->args; field; for (field = sc->args; field;
field = field->next, ++arg.idx, bit <<= 1) { field = field->next, ++arg.idx, bit <<= 1) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
int size, bool should_be_signed) int size, bool should_be_signed)
{ {
struct format_field *field = perf_evsel__field(evsel, name); struct tep_format_field *field = perf_evsel__field(evsel, name);
int is_signed; int is_signed;
int ret = 0; int ret = 0;
......
...@@ -182,7 +182,7 @@ value_set_string(struct ctf_writer *cw, struct bt_ctf_event *event, ...@@ -182,7 +182,7 @@ value_set_string(struct ctf_writer *cw, struct bt_ctf_event *event,
} }
static struct bt_ctf_field_type* static struct bt_ctf_field_type*
get_tracepoint_field_type(struct ctf_writer *cw, struct format_field *field) get_tracepoint_field_type(struct ctf_writer *cw, struct tep_format_field *field)
{ {
unsigned long flags = field->flags; unsigned long flags = field->flags;
...@@ -287,7 +287,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, ...@@ -287,7 +287,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
struct bt_ctf_event_class *event_class, struct bt_ctf_event_class *event_class,
struct bt_ctf_event *event, struct bt_ctf_event *event,
struct perf_sample *sample, struct perf_sample *sample,
struct format_field *fmtf) struct tep_format_field *fmtf)
{ {
struct bt_ctf_field_type *type; struct bt_ctf_field_type *type;
struct bt_ctf_field *array_field; struct bt_ctf_field *array_field;
...@@ -396,10 +396,10 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, ...@@ -396,10 +396,10 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
static int add_tracepoint_fields_values(struct ctf_writer *cw, static int add_tracepoint_fields_values(struct ctf_writer *cw,
struct bt_ctf_event_class *event_class, struct bt_ctf_event_class *event_class,
struct bt_ctf_event *event, struct bt_ctf_event *event,
struct format_field *fields, struct tep_format_field *fields,
struct perf_sample *sample) struct perf_sample *sample)
{ {
struct format_field *field; struct tep_format_field *field;
int ret; int ret;
for (field = fields; field; field = field->next) { for (field = fields; field; field = field->next) {
...@@ -417,8 +417,8 @@ static int add_tracepoint_values(struct ctf_writer *cw, ...@@ -417,8 +417,8 @@ static int add_tracepoint_values(struct ctf_writer *cw,
struct perf_evsel *evsel, struct perf_evsel *evsel,
struct perf_sample *sample) struct perf_sample *sample)
{ {
struct format_field *common_fields = evsel->tp_format->format.common_fields; struct tep_format_field *common_fields = evsel->tp_format->format.common_fields;
struct format_field *fields = evsel->tp_format->format.fields; struct tep_format_field *fields = evsel->tp_format->format.fields;
int ret; int ret;
ret = add_tracepoint_fields_values(cw, event_class, event, ret = add_tracepoint_fields_values(cw, event_class, event,
...@@ -970,7 +970,7 @@ static char *change_name(char *name, char *orig_name, int dup) ...@@ -970,7 +970,7 @@ static char *change_name(char *name, char *orig_name, int dup)
static int event_class_add_field(struct bt_ctf_event_class *event_class, static int event_class_add_field(struct bt_ctf_event_class *event_class,
struct bt_ctf_field_type *type, struct bt_ctf_field_type *type,
struct format_field *field) struct tep_format_field *field)
{ {
struct bt_ctf_field_type *t = NULL; struct bt_ctf_field_type *t = NULL;
char *name; char *name;
...@@ -1009,10 +1009,10 @@ static int event_class_add_field(struct bt_ctf_event_class *event_class, ...@@ -1009,10 +1009,10 @@ static int event_class_add_field(struct bt_ctf_event_class *event_class,
} }
static int add_tracepoint_fields_types(struct ctf_writer *cw, static int add_tracepoint_fields_types(struct ctf_writer *cw,
struct format_field *fields, struct tep_format_field *fields,
struct bt_ctf_event_class *event_class) struct bt_ctf_event_class *event_class)
{ {
struct format_field *field; struct tep_format_field *field;
int ret; int ret;
for (field = fields; field; field = field->next) { for (field = fields; field; field = field->next) {
...@@ -1055,8 +1055,8 @@ static int add_tracepoint_types(struct ctf_writer *cw, ...@@ -1055,8 +1055,8 @@ static int add_tracepoint_types(struct ctf_writer *cw,
struct perf_evsel *evsel, struct perf_evsel *evsel,
struct bt_ctf_event_class *class) struct bt_ctf_event_class *class)
{ {
struct format_field *common_fields = evsel->tp_format->format.common_fields; struct tep_format_field *common_fields = evsel->tp_format->format.common_fields;
struct format_field *fields = evsel->tp_format->format.fields; struct tep_format_field *fields = evsel->tp_format->format.fields;
int ret; int ret;
ret = add_tracepoint_fields_types(cw, common_fields, class); ret = add_tracepoint_fields_types(cw, common_fields, class);
......
...@@ -2682,7 +2682,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, ...@@ -2682,7 +2682,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
return 0; return 0;
} }
struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name) struct tep_format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name)
{ {
return tep_find_field(evsel->tp_format, name); return tep_find_field(evsel->tp_format, name);
} }
...@@ -2690,7 +2690,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *nam ...@@ -2690,7 +2690,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *nam
void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
const char *name) const char *name)
{ {
struct format_field *field = perf_evsel__field(evsel, name); struct tep_format_field *field = perf_evsel__field(evsel, name);
int offset; int offset;
if (!field) if (!field)
...@@ -2706,7 +2706,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, ...@@ -2706,7 +2706,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
return sample->raw_data + offset; return sample->raw_data + offset;
} }
u64 format_field__intval(struct format_field *field, struct perf_sample *sample, u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample,
bool needs_swap) bool needs_swap)
{ {
u64 value; u64 value;
...@@ -2748,7 +2748,7 @@ u64 format_field__intval(struct format_field *field, struct perf_sample *sample, ...@@ -2748,7 +2748,7 @@ u64 format_field__intval(struct format_field *field, struct perf_sample *sample,
u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
const char *name) const char *name)
{ {
struct format_field *field = perf_evsel__field(evsel, name); struct tep_format_field *field = perf_evsel__field(evsel, name);
if (!field) if (!field)
return 0; return 0;
......
...@@ -296,11 +296,11 @@ static inline char *perf_evsel__strval(struct perf_evsel *evsel, ...@@ -296,11 +296,11 @@ static inline char *perf_evsel__strval(struct perf_evsel *evsel,
return perf_evsel__rawptr(evsel, sample, name); return perf_evsel__rawptr(evsel, sample, name);
} }
struct format_field; struct tep_format_field;
u64 format_field__intval(struct format_field *field, struct perf_sample *sample, bool needs_swap); u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample, bool needs_swap);
struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name); struct tep_format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name);
#define perf_evsel__match(evsel, t, c) \ #define perf_evsel__match(evsel, t, c) \
(evsel->attr.type == PERF_TYPE_##t && \ (evsel->attr.type == PERF_TYPE_##t && \
......
...@@ -73,7 +73,7 @@ int perf_evsel__fprintf(struct perf_evsel *evsel, ...@@ -73,7 +73,7 @@ int perf_evsel__fprintf(struct perf_evsel *evsel,
} }
if (details->trace_fields) { if (details->trace_fields) {
struct format_field *field; struct tep_format_field *field;
if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { if (evsel->attr.type != PERF_TYPE_TRACEPOINT) {
printed += comma_fprintf(fp, &first, " (not a tracepoint)"); printed += comma_fprintf(fp, &first, " (not a tracepoint)");
......
...@@ -340,7 +340,7 @@ static bool is_tracepoint(struct pyrf_event *pevent) ...@@ -340,7 +340,7 @@ static bool is_tracepoint(struct pyrf_event *pevent)
} }
static PyObject* static PyObject*
tracepoint_field(struct pyrf_event *pe, struct format_field *field) tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
{ {
struct tep_handle *pevent = field->event->pevent; struct tep_handle *pevent = field->event->pevent;
void *data = pe->sample.raw_data; void *data = pe->sample.raw_data;
...@@ -383,7 +383,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) ...@@ -383,7 +383,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)
{ {
const char *str = _PyUnicode_AsString(PyObject_Str(attr_name)); const char *str = _PyUnicode_AsString(PyObject_Str(attr_name));
struct perf_evsel *evsel = pevent->evsel; struct perf_evsel *evsel = pevent->evsel;
struct format_field *field; struct tep_format_field *field;
if (!evsel->tp_format) { if (!evsel->tp_format) {
struct tep_event_format *tp_format; struct tep_event_format *tp_format;
......
...@@ -339,7 +339,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, ...@@ -339,7 +339,7 @@ static void perl_process_tracepoint(struct perf_sample *sample,
{ {
struct thread *thread = al->thread; struct thread *thread = al->thread;
struct tep_event_format *event = evsel->tp_format; struct tep_event_format *event = evsel->tp_format;
struct format_field *field; struct tep_format_field *field;
static char handler[256]; static char handler[256];
unsigned long long val; unsigned long long val;
unsigned long s, ns; unsigned long s, ns;
...@@ -538,7 +538,7 @@ static int perl_stop_script(void) ...@@ -538,7 +538,7 @@ static int perl_stop_script(void)
static int perl_generate_script(struct tep_handle *pevent, const char *outfile) static int perl_generate_script(struct tep_handle *pevent, const char *outfile)
{ {
struct tep_event_format *event = NULL; struct tep_event_format *event = NULL;
struct format_field *f; struct tep_format_field *f;
char fname[PATH_MAX]; char fname[PATH_MAX];
int not_first, count; int not_first, count;
FILE *ofp; FILE *ofp;
......
...@@ -333,7 +333,7 @@ static void define_event_symbols(struct tep_event_format *event, ...@@ -333,7 +333,7 @@ static void define_event_symbols(struct tep_event_format *event,
} }
static PyObject *get_field_numeric_entry(struct tep_event_format *event, static PyObject *get_field_numeric_entry(struct tep_event_format *event,
struct format_field *field, void *data) struct tep_format_field *field, void *data)
{ {
bool is_array = field->flags & FIELD_IS_ARRAY; bool is_array = field->flags & FIELD_IS_ARRAY;
PyObject *obj = NULL, *list = NULL; PyObject *obj = NULL, *list = NULL;
...@@ -794,7 +794,7 @@ static void python_process_tracepoint(struct perf_sample *sample, ...@@ -794,7 +794,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
PyObject *handler, *context, *t, *obj = NULL, *callchain; PyObject *handler, *context, *t, *obj = NULL, *callchain;
PyObject *dict = NULL, *all_entries_dict = NULL; PyObject *dict = NULL, *all_entries_dict = NULL;
static char handler_name[256]; static char handler_name[256];
struct format_field *field; struct tep_format_field *field;
unsigned long s, ns; unsigned long s, ns;
unsigned n = 0; unsigned n = 0;
int pid; int pid;
...@@ -1591,7 +1591,7 @@ static int python_stop_script(void) ...@@ -1591,7 +1591,7 @@ static int python_stop_script(void)
static int python_generate_script(struct tep_handle *pevent, const char *outfile) static int python_generate_script(struct tep_handle *pevent, const char *outfile)
{ {
struct tep_event_format *event = NULL; struct tep_event_format *event = NULL;
struct format_field *f; struct tep_format_field *f;
char fname[PATH_MAX]; char fname[PATH_MAX];
int not_first, count; int not_first, count;
FILE *ofp; FILE *ofp;
......
...@@ -1884,7 +1884,7 @@ static int __sort_dimension__add_hpp_output(struct sort_dimension *sd, ...@@ -1884,7 +1884,7 @@ static int __sort_dimension__add_hpp_output(struct sort_dimension *sd,
struct hpp_dynamic_entry { struct hpp_dynamic_entry {
struct perf_hpp_fmt hpp; struct perf_hpp_fmt hpp;
struct perf_evsel *evsel; struct perf_evsel *evsel;
struct format_field *field; struct tep_format_field *field;
unsigned dynamic_len; unsigned dynamic_len;
bool raw_trace; bool raw_trace;
}; };
...@@ -1915,7 +1915,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde, ...@@ -1915,7 +1915,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde,
struct hist_entry *he) struct hist_entry *he)
{ {
char *str, *pos; char *str, *pos;
struct format_field *field = hde->field; struct tep_format_field *field = hde->field;
size_t namelen; size_t namelen;
bool last = false; bool last = false;
...@@ -2000,7 +2000,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, ...@@ -2000,7 +2000,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
struct hpp_dynamic_entry *hde; struct hpp_dynamic_entry *hde;
size_t len = fmt->user_len; size_t len = fmt->user_len;
char *str, *pos; char *str, *pos;
struct format_field *field; struct tep_format_field *field;
size_t namelen; size_t namelen;
bool last = false; bool last = false;
int ret; int ret;
...@@ -2060,7 +2060,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, ...@@ -2060,7 +2060,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt,
struct hist_entry *a, struct hist_entry *b) struct hist_entry *a, struct hist_entry *b)
{ {
struct hpp_dynamic_entry *hde; struct hpp_dynamic_entry *hde;
struct format_field *field; struct tep_format_field *field;
unsigned offset, size; unsigned offset, size;
hde = container_of(fmt, struct hpp_dynamic_entry, hpp); hde = container_of(fmt, struct hpp_dynamic_entry, hpp);
...@@ -2117,7 +2117,7 @@ static void hde_free(struct perf_hpp_fmt *fmt) ...@@ -2117,7 +2117,7 @@ static void hde_free(struct perf_hpp_fmt *fmt)
} }
static struct hpp_dynamic_entry * static struct hpp_dynamic_entry *
__alloc_dynamic_entry(struct perf_evsel *evsel, struct format_field *field, __alloc_dynamic_entry(struct perf_evsel *evsel, struct tep_format_field *field,
int level) int level)
{ {
struct hpp_dynamic_entry *hde; struct hpp_dynamic_entry *hde;
...@@ -2252,7 +2252,7 @@ static struct perf_evsel *find_evsel(struct perf_evlist *evlist, char *event_nam ...@@ -2252,7 +2252,7 @@ static struct perf_evsel *find_evsel(struct perf_evlist *evlist, char *event_nam
} }
static int __dynamic_dimension__add(struct perf_evsel *evsel, static int __dynamic_dimension__add(struct perf_evsel *evsel,
struct format_field *field, struct tep_format_field *field,
bool raw_trace, int level) bool raw_trace, int level)
{ {
struct hpp_dynamic_entry *hde; struct hpp_dynamic_entry *hde;
...@@ -2270,7 +2270,7 @@ static int __dynamic_dimension__add(struct perf_evsel *evsel, ...@@ -2270,7 +2270,7 @@ static int __dynamic_dimension__add(struct perf_evsel *evsel,
static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level) static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level)
{ {
int ret; int ret;
struct format_field *field; struct tep_format_field *field;
field = evsel->tp_format->format.fields; field = evsel->tp_format->format.fields;
while (field) { while (field) {
...@@ -2305,7 +2305,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist, ...@@ -2305,7 +2305,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,
{ {
int ret = -ESRCH; int ret = -ESRCH;
struct perf_evsel *evsel; struct perf_evsel *evsel;
struct format_field *field; struct tep_format_field *field;
evlist__for_each_entry(evlist, evsel) { evlist__for_each_entry(evlist, evsel) {
if (evsel->attr.type != PERF_TYPE_TRACEPOINT) if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
...@@ -2327,7 +2327,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, ...@@ -2327,7 +2327,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok,
{ {
char *str, *event_name, *field_name, *opt_name; char *str, *event_name, *field_name, *opt_name;
struct perf_evsel *evsel; struct perf_evsel *evsel;
struct format_field *field; struct tep_format_field *field;
bool raw_trace = symbol_conf.raw_trace; bool raw_trace = symbol_conf.raw_trace;
int ret = 0; int ret = 0;
......
...@@ -34,7 +34,7 @@ static int get_common_field(struct scripting_context *context, ...@@ -34,7 +34,7 @@ static int get_common_field(struct scripting_context *context,
{ {
struct tep_handle *pevent = context->pevent; struct tep_handle *pevent = context->pevent;
struct tep_event_format *event; struct tep_event_format *event;
struct format_field *field; struct tep_format_field *field;
if (!*size) { if (!*size) {
if (!pevent->events) if (!pevent->events)
...@@ -96,7 +96,7 @@ int common_pc(struct scripting_context *context) ...@@ -96,7 +96,7 @@ int common_pc(struct scripting_context *context)
unsigned long long unsigned long long
raw_field_value(struct tep_event_format *event, const char *name, void *data) raw_field_value(struct tep_event_format *event, const char *name, void *data)
{ {
struct format_field *field; struct tep_format_field *field;
unsigned long long val; unsigned long long val;
field = tep_find_any_field(event, name); field = tep_find_any_field(event, name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment