perf tools, tools lib traceevent: Rename "pevent" member of struct tep_event to ...
authorTzvetomir Stoyanov <tstoyanov@vmware.com>
Mon, 1 Apr 2019 16:43:18 +0000 (12:43 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 1 Apr 2019 18:18:10 +0000 (15:18 -0300)
The member "pevent" of the struct tep_event is renamed to "tep". This
makes the struct consistent with the chosen naming convention:

  tep (trace event parser), instead of the old pevent.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190401132111.13727-3-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.627724996@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
13 files changed:
tools/lib/traceevent/event-parse.c
tools/lib/traceevent/event-parse.h
tools/lib/traceevent/parse-filter.c
tools/lib/traceevent/plugin_function.c
tools/lib/traceevent/plugin_kmem.c
tools/lib/traceevent/plugin_kvm.c
tools/lib/traceevent/plugin_sched_switch.c
tools/perf/builtin-kmem.c
tools/perf/util/data-convert-bt.c
tools/perf/util/python.c
tools/perf/util/scripting-engines/trace-event-perl.c
tools/perf/util/scripting-engines/trace-event-python.c
tools/perf/util/trace-event-parse.c

index ceefa9b3d72654a9f15cc063547da58f0c891104..70ea638156f2e3de8a62b2b35c98ed87126a6829 100644 (file)
@@ -804,7 +804,7 @@ static int add_event(struct tep_handle *pevent, struct tep_event *event)
        pevent->events[i] = event;
        pevent->nr_events++;
 
-       event->pevent = pevent;
+       event->tep = pevent;
 
        return 0;
 }
@@ -1656,8 +1656,8 @@ static int event_read_fields(struct tep_event *event, struct tep_format_field **
                        else if (field->flags & TEP_FIELD_IS_STRING)
                                field->elementsize = 1;
                        else if (field->flags & TEP_FIELD_IS_LONG)
-                               field->elementsize = event->pevent ?
-                                                    event->pevent->long_size :
+                               field->elementsize = event->tep ?
+                                                    event->tep->long_size :
                                                     sizeof(long);
                } else
                        field->elementsize = field->size;
@@ -3075,7 +3075,7 @@ process_function(struct tep_event *event, struct tep_print_arg *arg,
                return process_dynamic_array_len(event, arg, tok);
        }
 
-       func = find_func_handler(event->pevent, token);
+       func = find_func_handler(event->tep, token);
        if (func) {
                free_token(token);
                return process_func_handler(event, func, arg, tok);
@@ -3405,7 +3405,7 @@ int tep_read_number_field(struct tep_format_field *field, const void *data,
        case 2:
        case 4:
        case 8:
-               *value = tep_read_number(field->event->pevent,
+               *value = tep_read_number(field->event->tep,
                                         data + field->offset, field->size);
                return 0;
        default:
@@ -3566,7 +3566,7 @@ tep_find_event_by_name(struct tep_handle *tep,
 static unsigned long long
 eval_num_arg(void *data, int size, struct tep_event *event, struct tep_print_arg *arg)
 {
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        unsigned long long val = 0;
        unsigned long long left, right;
        struct tep_print_arg *typearg = NULL;
@@ -3907,7 +3907,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
                          struct tep_event *event, const char *format,
                          int len_arg, struct tep_print_arg *arg)
 {
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        struct tep_print_flag_sym *flag;
        struct tep_format_field *field;
        struct printk_map *printk;
@@ -4256,7 +4256,7 @@ static void free_args(struct tep_print_arg *args)
 
 static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event *event)
 {
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        struct tep_format_field *field, *ip_field;
        struct tep_print_arg *args, *arg, **next;
        unsigned long long ip, val;
@@ -4434,7 +4434,7 @@ static char *
 get_bprint_format(void *data, int size __maybe_unused,
                  struct tep_event *event)
 {
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        unsigned long long addr;
        struct tep_format_field *field;
        struct printk_map *printk;
@@ -4835,7 +4835,7 @@ void tep_print_field(struct trace_seq *s, void *data,
 {
        unsigned long long val;
        unsigned int offset, len, i;
-       struct tep_handle *pevent = field->event->pevent;
+       struct tep_handle *pevent = field->event->tep;
 
        if (field->flags & TEP_FIELD_IS_ARRAY) {
                offset = field->offset;
@@ -4910,7 +4910,7 @@ void tep_print_fields(struct trace_seq *s, void *data,
 
 static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_event *event)
 {
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        struct tep_print_fmt *print_fmt = &event->print_fmt;
        struct tep_print_arg *arg = print_fmt->args;
        struct tep_print_arg *args = NULL;
@@ -5424,7 +5424,7 @@ void tep_event_info(struct trace_seq *s, struct tep_event *event,
 {
        int print_pretty = 1;
 
-       if (event->pevent->print_raw || (event->flags & TEP_EVENT_FL_PRINTRAW))
+       if (event->tep->print_raw || (event->flags & TEP_EVENT_FL_PRINTRAW))
                tep_print_fields(s, record->data, record->size, event);
        else {
 
@@ -6163,7 +6163,7 @@ enum tep_errno __tep_parse_format(struct tep_event **eventp,
        }
 
        /* Add pevent to event so that it can be referenced */
-       event->pevent = pevent;
+       event->tep = pevent;
 
        ret = event_read_format(event);
        if (ret < 0) {
@@ -6357,8 +6357,8 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event *event,
 
        offset = field->offset;
        if (field->flags & TEP_FIELD_IS_DYNAMIC) {
-               offset = tep_read_number(event->pevent,
-                                           data + offset, field->size);
+               offset = tep_read_number(event->tep,
+                                        data + offset, field->size);
                *len = offset >> 16;
                offset &= 0xffff;
        } else
@@ -6492,7 +6492,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,
                         struct tep_record *record, int err)
 {
        struct tep_format_field *field = tep_find_field(event, name);
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        unsigned long long val;
        struct func_map *func;
        char tmp[128];
index 2720a30ef86bab6b678615405ed87bcdcbc33142..de7ace173e7560a919e6e7a46cd66a2b42984ad7 100644 (file)
@@ -278,7 +278,7 @@ struct tep_print_fmt {
 };
 
 struct tep_event {
-       struct tep_handle       *pevent;
+       struct tep_handle       *tep;
        char                    *name;
        int                     id;
        int                     flags;
index 5d8f9d9bc253d90c47c0b82dfa8d95915dac699f..123358209297710d20f0560574d2d898fc58bcb8 100644 (file)
@@ -1528,8 +1528,8 @@ get_comm(struct tep_event *event, struct tep_record *record)
        const char *comm;
        int pid;
 
-       pid = tep_data_pid(event->pevent, record);
-       comm = tep_data_comm_from_pid(event->pevent, pid);
+       pid = tep_data_pid(event->tep, record);
+       comm = tep_data_comm_from_pid(event->tep, pid);
        return comm;
 }
 
@@ -1727,7 +1727,7 @@ static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *
 
        } else {
                event = arg->str.field->event;
-               pevent = event->pevent;
+               pevent = event->tep;
                addr = get_value(event, arg->str.field, record);
 
                if (arg->str.field->flags & (TEP_FIELD_IS_POINTER | TEP_FIELD_IS_LONG))
index e93f33bd705f8359c7dc96c0ed10c04b1b9fe397..d6a8df06061413ea2fff11cde5864dea8fce99d6 100644 (file)
@@ -126,7 +126,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)
 static int function_handler(struct trace_seq *s, struct tep_record *record,
                            struct tep_event *event, void *context)
 {
-       struct tep_handle *pevent = event->pevent;
+       struct tep_handle *pevent = event->tep;
        unsigned long long function;
        unsigned long long pfunction;
        const char *func;
index c09bafdd83775af79f7d19f51521204f0f9ad5bc..edaec5d962c3df00b47f9fdad5c760549903790a 100644 (file)
@@ -39,11 +39,11 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,
        if (tep_read_number_field(field, data, &val))
                return 1;
 
-       func = tep_find_function(event->pevent, val);
+       func = tep_find_function(event->tep, val);
        if (!func)
                return 1;
 
-       addr = tep_find_function_address(event->pevent, val);
+       addr = tep_find_function_address(event->tep, val);
 
        trace_seq_printf(s, "(%s+0x%x) ", func, (int)(val - addr));
        return 1;
index 472298c2b531ee735f5eee862242bcb938bf38d4..c8e623065a7e4bc515d127660ef2bde07e883da5 100644 (file)
@@ -389,8 +389,8 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
         * We can only use the structure if file is of the same
         * endianness.
         */
-       if (tep_is_file_bigendian(event->pevent) ==
-           tep_is_local_bigendian(event->pevent)) {
+       if (tep_is_file_bigendian(event->tep) ==
+           tep_is_local_bigendian(event->tep)) {
 
                trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s",
                                 role.level,
index 701c22913cf8753917b086336f8c6763ec6e7bf7..957389a0ff7ada5d7fb192083dba38bf742ce2c2 100644 (file)
@@ -62,7 +62,7 @@ static void write_and_save_comm(struct tep_format_field *field,
        comm = &s->buffer[len];
 
        /* Help out the comm to ids. This will handle dups */
-       tep_register_comm(field->event->pevent, comm, pid);
+       tep_register_comm(field->event->tep, comm, pid);
 }
 
 static int sched_wakeup_handler(struct trace_seq *s,
index fa520f4b8095ae6eac3922ac73781605041772be..b80eee45511113cd094bbe3f75bd2bdab001e0bc 100644 (file)
@@ -1975,7 +1975,7 @@ int cmd_kmem(int argc, const char **argv)
                        goto out_delete;
                }
 
-               kmem_page_size = tep_get_page_size(evsel->tp_format->pevent);
+               kmem_page_size = tep_get_page_size(evsel->tp_format->tep);
                symbol_conf.use_callchain = true;
        }
 
index 26af43ad9ddd331bd74b62a09d2833821bfc3996..e0311c9750ad5c9128c2cf6f4ce54d73c70a333f 100644 (file)
@@ -310,7 +310,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
        if (flags & TEP_FIELD_IS_DYNAMIC) {
                unsigned long long tmp_val;
 
-               tmp_val = tep_read_number(fmtf->event->pevent,
+               tmp_val = tep_read_number(fmtf->event->tep,
                                          data + offset, len);
                offset = tmp_val;
                len = offset >> 16;
@@ -354,7 +354,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
                        unsigned long long value_int;
 
                        value_int = tep_read_number(
-                                       fmtf->event->pevent,
+                                       fmtf->event->tep,
                                        data + offset + i * len, len);
 
                        if (!(flags & TEP_FIELD_IS_SIGNED))
index dda0ac978b1eb2371d9feebc64154d5cf9bb949e..6aa7e2352e16e118097ca128cedb69976cb7205c 100644 (file)
@@ -342,7 +342,7 @@ static bool is_tracepoint(struct pyrf_event *pevent)
 static PyObject*
 tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
 {
-       struct tep_handle *pevent = field->event->pevent;
+       struct tep_handle *pevent = field->event->tep;
        void *data = pe->sample.raw_data;
        PyObject *ret = NULL;
        unsigned long long val;
index 5f06378a482b80b53459509b4a141a1b1234253f..61aa7f3df915b80d0e73f06b3ce0ba685ace594e 100644 (file)
@@ -372,7 +372,7 @@ static void perl_process_tracepoint(struct perf_sample *sample,
        ns = nsecs - s * NSEC_PER_SEC;
 
        scripting_context->event_data = data;
-       scripting_context->pevent = evsel->tp_format->pevent;
+       scripting_context->pevent = evsel->tp_format->tep;
 
        ENTER;
        SAVETMPS;
index 09604c6508f040098eec7dbab6164afb5bc42768..22f52b6698719ed53b883071055182f5a53776b3 100644 (file)
@@ -837,7 +837,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
        ns = nsecs - s * NSEC_PER_SEC;
 
        scripting_context->event_data = data;
-       scripting_context->pevent = evsel->tp_format->pevent;
+       scripting_context->pevent = evsel->tp_format->tep;
 
        context = _PyCapsule_New(scripting_context, NULL, NULL);
 
index ad74be1f0e4208ab04e9425464f1a977b82db02f..863955e4094e2af752e28f86eb72142f8f36eaaf 100644 (file)
@@ -111,7 +111,7 @@ raw_field_value(struct tep_event *event, const char *name, void *data)
 
 unsigned long long read_size(struct tep_event *event, void *ptr, int size)
 {
-       return tep_read_number(event->pevent, ptr, size);
+       return tep_read_number(event->tep, ptr, size);
 }
 
 void event_format__fprintf(struct tep_event *event,