tools/lib/traceevent: Namespace updates to make traceevent into a library
cover tools/lib/traceevent: Namespace updates to make traceevent into a library
Jiri,
This is another series to fix the namespace of libtraceevent.
Please pull in these patches or if you choose, pull in the branch. The code is based off of the latest tip/perf/core.
These changes can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/core
Head SHA1: bb730b5833b5bddf5cb226865e5f4496770d00b0 9bc7aeba01678955c3724052966ab8ad61053c89
Tzvetomir Stoyanov (VMware) (15):
tools/lib/traceevent, tools/perf: Rename struct event_format to struct tep_event_format tools/lib/traceevent, tools/perf: Rename struct format{_field} to struct tep_format{_field} tools/lib/traceevent, tools/perf: Rename enum format_flags to enum tep_format_flags tools/lib/traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type tools/lib/traceevent: Add prefix TEP_ to all EVENT_FL_* flags tools/lib/traceevent, tools/perf: Add prefix tep_ to all print_* structures tools/lib/traceevent, tools/perf: Rename enum print_arg_type to enum tep_print_arg_type tools/lib/traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type tools/lib/traceevent: Add prefix tep_ to enums filter_{exp,arg}_type tools/lib/traceevent: Add prefix tep_ to struct filter_{arg,value_type} tools/lib/traceevent: Add prefix tep_ to various structs filter_arg_*. tools/lib/traceevent: Add prefix tep_ to structs filter_type and event_filter tools/lib/traceevent: Rename struct plugin_list to struct tep_plugin_list tools/lib/traceevent: Rename data2host*() APIs
tools/lib/traceevent: Add prefix tep_ to enum filter_trivial_type
----
tools/lib/traceevent/event-parse.c | 1184 ++++++++++---------- tools/lib/traceevent/event-parse.h | 532 ++++----- tools/lib/traceevent/event-plugin.c | 18 +- tools/lib/traceevent/parse-filter.c | 646 +++++------ tools/lib/traceevent/plugin_function.c | 2 +- tools/lib/traceevent/plugin_hrtimer.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 4 +- tools/lib/traceevent/plugin_kvm.c | 14 +- tools/lib/traceevent/plugin_mac80211.c | 6 +- tools/lib/traceevent/plugin_sched_switch.c | 10 +- tools/perf/builtin-trace.c | 18 +- tools/perf/tests/evsel-tp-sched.c | 4 +- tools/perf/util/data-convert-bt.c | 56 +- tools/perf/util/evsel.c | 10 +- tools/perf/util/evsel.h | 10 +- tools/perf/util/evsel_fprintf.c | 2 +- tools/perf/util/header.c | 2 +- tools/perf/util/python.c | 20 +- .../perf/util/scripting-engines/trace-event-perl.c | 66 +- .../util/scripting-engines/trace-event-python.c | 100 +- tools/perf/util/sort.c | 22 +- tools/perf/util/trace-event-parse.c | 18 +- tools/perf/util/trace-event-read.c | 4 +- tools/perf/util/trace-event.c | 8 +- tools/perf/util/trace-event.h | 20 +- 25 files changed, 1390 insertions(+), 1390 deletions(-)
PATCH 3/15 tools/lib/traceevent, tools/perf: Rename enum format_flags to enum tep_format_flags
From: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 enum format_flags to enum tep_format_flags and adds prefix TEP_ to all of its members.
--- tools/lib/traceevent/event-parse.c | 48 +++++++++---------- tools/lib/traceevent/event-parse.h | 18 +++---- tools/lib/traceevent/parse-filter.c | 8 ++-- tools/perf/builtin-trace.c | 2 +- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/util/data-convert-bt.c | 34 ++++++------- tools/perf/util/evsel.c | 2 +- tools/perf/util/python.c | 12 ++--- .../util/scripting-engines/trace-event-perl.c | 18 +++---- .../scripting-engines/trace-event-python.c | 26 +++++----- tools/perf/util/sort.c | 4 +- 11 files changed, 87 insertions(+), 87 deletions(-)
tools/lib/traceevent/event-parse.c +24 -24
@@ -1301,7 +1301,7 @@ static int event_read_id(void)static int field_is_string (struct tep_format_field *field) { -if ((field->flags &FIELD_IS_ARRAY ) && +if ((field->flags &TEP_FIELD_IS_ARRAY ) && (strstr (field->type,"char" ) ||strstr (field->type,"u8" ) ||strstr (field->type,"s8" )))return 1 ;
@@ -1328,7 +1328,7 @@ static int field_is_long(struct tep_format_field *field)static unsigned int type_size (const char *name) { -/* This covers all FIELD_IS_STRING types. */ +/* This covers all TEP_FIELD_IS_STRING types. */ static struct { const char *type; unsigned int size;
@@ -1416,7 +1416,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f type == EVENT_OP && strcmp(token, ".") == 0)) {if (strcmp (token,"*" ) ==0 ) - field->flags |=FIELD_IS_POINTER ; + field->flags |=TEP_FIELD_IS_POINTER ;if (field->type) {char *new_type;
@@ -1455,7 +1455,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_fchar *new_brackets;int len; - field->flags |=FIELD_IS_ARRAY ; + field->flags |=TEP_FIELD_IS_ARRAY ; type =read_token (&token);
@@ -1544,11 +1544,11 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f }if (field_is_string (field)) - field->flags |=FIELD_IS_STRING ; + field->flags |=TEP_FIELD_IS_STRING ;if (field_is_dynamic (field)) - field->flags |=FIELD_IS_DYNAMIC ; + field->flags |=TEP_FIELD_IS_DYNAMIC ;if (field_is_long (field)) - field->flags |=FIELD_IS_LONG ; + field->flags |=TEP_FIELD_IS_LONG ;if (test_type_token (type, token,EVENT_OP ,";" )) goto fail;
@@ -1597,7 +1597,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f goto fail;if (strtoul (token,NULL ,0 )) - field->flags |=FIELD_IS_SIGNED ; + field->flags |=TEP_FIELD_IS_SIGNED ;free_token (token);if (read_expected (EVENT_OP ,";" ) <0 )
@@ -1609,14 +1609,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_ffree_token (token); -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) {if (field->arraylen) field->elementsize = field->size / field->arraylen; -else if (field->flags &FIELD_IS_DYNAMIC ) +else if (field->flags &TEP_FIELD_IS_DYNAMIC ) field->elementsize = size_dynamic; -else if (field->flags &FIELD_IS_STRING ) +else if (field->flags &TEP_FIELD_IS_STRING ) field->elementsize =1 ; -else if (field->flags &FIELD_IS_LONG ) +else if (field->flags &TEP_FIELD_IS_LONG ) field->elementsize = event->pevent ? event->pevent->long_size :sizeof (long );
@@ -2089,11 +2089,11 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *aif (is_flag_field) { arg->field.field =tep_find_any_field (event, arg->field.name); - arg->field.field->flags |=FIELD_IS_FLAG ; + arg->field.field->flags |=TEP_FIELD_IS_FLAG ; is_flag_field =0 ; }else if (is_symbolic_field) { arg->field.field =tep_find_any_field (event, arg->field.name); - arg->field.field->flags |=FIELD_IS_SYMBOLIC ; + arg->field.field->flags |=TEP_FIELD_IS_SYMBOLIC ; is_symbolic_field =0 ; }
@@ -3901,7 +3901,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,* and the size is the same as long_size, assume that it * is a pointer. */ -if (!(field->flags &FIELD_IS_ARRAY ) && +if (!(field->flags &TEP_FIELD_IS_ARRAY ) && field->size == pevent->long_size) {/* Handle heterogeneous recording and processing
@@ -4794,16 +4794,16 @@ void tep_print_field(struct trace_seq *s, void *data,unsigned int offset, len, i;struct tep_handle *pevent = field->event->pevent; -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) { offset = field->offset; len = field->size; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ; } -if (field->flags &FIELD_IS_STRING && +if (field->flags &TEP_FIELD_IS_STRING &&is_printable_array (data + offset, len)) {trace_seq_printf (s,"%s" , (char *)data + offset); }else {
@@ -4815,21 +4815,21 @@ void tep_print_field(struct trace_seq *s, void *data, *((unsigned char *)data + offset + i)); }trace_seq_putc (s,']' ); - field->flags &= ~FIELD_IS_STRING ; + field->flags &= ~TEP_FIELD_IS_STRING ; } }else { val =tep_read_number (pevent, data + field->offset, field->size); -if (field->flags &FIELD_IS_POINTER ) { +if (field->flags &TEP_FIELD_IS_POINTER ) {trace_seq_printf (s,"0x%llx" , val); - }else if (field->flags &FIELD_IS_SIGNED ) { + }else if (field->flags &TEP_FIELD_IS_SIGNED ) {switch (field->size) {case 4 :/* * If field is long then print it in hex. * A long usually stores pointers. */ -if (field->flags &FIELD_IS_LONG ) +if (field->flags &TEP_FIELD_IS_LONG )trace_seq_printf (s,"0x%x" , (int )val);else trace_seq_printf (s,"%d" , (int )val);
@@ -4844,7 +4844,7 @@ void tep_print_field(struct trace_seq *s, void *data,trace_seq_printf (s,"%lld" , val); } }else { -if (field->flags &FIELD_IS_LONG ) +if (field->flags &TEP_FIELD_IS_LONG )trace_seq_printf (s,"0x%llx" , val);else trace_seq_printf (s,"%llu" , val);
@@ -6288,7 +6288,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, len = &dummy; offset = field->offset; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { offset =tep_read_number (event->pevent, data + offset, field->size); *len = offset >>16 ;
tools/lib/traceevent/event-parse.h +9 -9
@@ -130,15 +130,15 @@ struct tep_plugin_option {#define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)#define TEP_PLUGIN_ALIAS_NAME MAKE_STR(TEP_PLUGIN_ALIAS) -enum format_flags { -FIELD_IS_ARRAY =1 , -FIELD_IS_POINTER =2 , -FIELD_IS_SIGNED =4 , -FIELD_IS_STRING =8 , -FIELD_IS_DYNAMIC =16 , -FIELD_IS_LONG =32 , -FIELD_IS_FLAG =64 , -FIELD_IS_SYMBOLIC =128 , +enum tep_format_flags { +TEP_FIELD_IS_ARRAY =1 , +TEP_FIELD_IS_POINTER =2 , +TEP_FIELD_IS_SIGNED =4 , +TEP_FIELD_IS_STRING =8 , +TEP_FIELD_IS_DYNAMIC =16 , +TEP_FIELD_IS_LONG =32 , +TEP_FIELD_IS_FLAG =64 , +TEP_FIELD_IS_SYMBOLIC =128 , };struct tep_format_field {
tools/lib/traceevent/parse-filter.c +4 -4
@@ -1716,7 +1716,7 @@ get_value(struct tep_event_format *event,tep_read_number_field (field, record->data, &val); -if (!(field->flags &FIELD_IS_SIGNED )) +if (!(field->flags &TEP_FIELD_IS_SIGNED ))return val;switch (field->size) {
@@ -1867,11 +1867,11 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *recochar hex[64 ];/* If the field is not a string convert it */ -if (arg->str.field->flags &FIELD_IS_STRING ) { +if (arg->str.field->flags &TEP_FIELD_IS_STRING ) { val = record->data + arg->str.field->offset; size = arg->str.field->size; -if (arg->str.field->flags &FIELD_IS_DYNAMIC ) { +if (arg->str.field->flags &TEP_FIELD_IS_DYNAMIC ) { addr = *(unsigned int *)val; val = record->data + (addr &0xffff ); size = addr >>16 ;
@@ -1893,7 +1893,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco pevent = event->pevent; addr =get_value (event, arg->str.field, record); -if (arg->str.field->flags & (FIELD_IS_POINTER |FIELD_IS_LONG )) +if (arg->str.field->flags & (TEP_FIELD_IS_POINTER |TEP_FIELD_IS_LONG ))/* convert to a kernel symbol */ val =tep_find_function (pevent, addr);
tools/perf/builtin-trace.c +1 -1
@@ -1293,7 +1293,7 @@ static int syscall__set_arg_fmts(struct syscall *sc)strcmp (field->name,"path" ) ==0 || strcmp(field->name, "pathname") == 0)) sc->arg_fmt[idx].scnprintf = SCA_FILENAME; - else if (field->flags & FIELD_IS_POINTER) + else if (field->flags & TEP_FIELD_IS_POINTER) sc->arg_fmt[idx].scnprintf = syscall_arg__scnprintf_hex; else if (strcmp(field->type, "pid_t") == 0) sc->arg_fmt[idx].scnprintf = SCA_PID;
tools/perf/tests/evsel-tp-sched.c +1 -1
@@ -17,7 +17,7 @@ static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,return -1 ; } - is_signed = !!(field->flags |FIELD_IS_SIGNED ); + is_signed = !!(field->flags |TEP_FIELD_IS_SIGNED );if (should_be_signed && !is_signed) {pr_debug ("%s: \"%s\" signedness(%d) is wrong, should be %d\n" , evsel->name, name, is_signed, should_be_signed);
tools/perf/util/data-convert-bt.c +17 -17
@@ -186,16 +186,16 @@ get_tracepoint_field_type(struct ctf_writer *cw, struct tep_format_field *field) {unsigned long flags = field->flags; -if (flags &FIELD_IS_STRING ) +if (flags &TEP_FIELD_IS_STRING )return cw->data.string; -if (!(flags &FIELD_IS_SIGNED )) { +if (!(flags &TEP_FIELD_IS_SIGNED )) {/* unsigned long are mostly pointers */ -if (flags &FIELD_IS_LONG || flags &FIELD_IS_POINTER ) +if (flags &TEP_FIELD_IS_LONG || flags &TEP_FIELD_IS_POINTER )return cw->data.u64_hex; } -if (flags &FIELD_IS_SIGNED ) { +if (flags &TEP_FIELD_IS_SIGNED ) {if (field->size ==8 )return cw->data.s64;else
@@ -304,10 +304,10 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, name = fmtf->alias; offset = fmtf->offset; len = fmtf->size; -if (flags &FIELD_IS_STRING ) - flags &= ~FIELD_IS_ARRAY ; +if (flags &TEP_FIELD_IS_STRING ) + flags &= ~TEP_FIELD_IS_ARRAY ; -if (flags &FIELD_IS_DYNAMIC ) { +if (flags &TEP_FIELD_IS_DYNAMIC ) {unsigned long long tmp_val; tmp_val = tep_read_number(fmtf->event->pevent,
@@ -317,7 +317,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, offset &=0xffff ; } -if (flags &FIELD_IS_ARRAY ) { +if (flags &TEP_FIELD_IS_ARRAY ) { type =bt_ctf_event_class_get_field_by_name ( event_class, name);
@@ -338,7 +338,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, type =get_tracepoint_field_type (cw, fmtf);for (i =0 ; i < n_items; i++) { -if (flags &FIELD_IS_ARRAY ) +if (flags &TEP_FIELD_IS_ARRAY ) field =bt_ctf_field_array_get_field (array_field, i);else field =bt_ctf_field_create (type);
@@ -348,7 +348,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,return -1 ; } -if (flags &FIELD_IS_STRING ) +if (flags &TEP_FIELD_IS_STRING ) ret =string_set_value (field, data + offset + i * len);else {unsigned long long value_int;
@@ -357,7 +357,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, fmtf->event->pevent, data + offset + i * len, len); -if (!(flags &FIELD_IS_SIGNED )) +if (!(flags &TEP_FIELD_IS_SIGNED )) ret =bt_ctf_field_unsigned_integer_set_value ( field, value_int);else
@@ -369,7 +369,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,pr_err ("failed to set file value %s\n" , name); goto err_put_field; } -if (!(flags &FIELD_IS_ARRAY )) { +if (!(flags &TEP_FIELD_IS_ARRAY )) { ret =bt_ctf_event_set_payload (event, name, field);if (ret) {pr_err ("failed to set payload %s\n" , name);
@@ -378,7 +378,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, }bt_ctf_field_put (field); } -if (flags &FIELD_IS_ARRAY ) { +if (flags &TEP_FIELD_IS_ARRAY ) { ret =bt_ctf_event_set_payload (event, name, array_field);if (ret) {pr_err ("Failed add payload array %s\n" , name);
@@ -1030,15 +1030,15 @@ static int add_tracepoint_fields_types(struct ctf_writer *cw,* type and don't care that it is an array. What we don't * support is an array of strings. */ -if (flags &FIELD_IS_STRING ) - flags &= ~FIELD_IS_ARRAY ; +if (flags &TEP_FIELD_IS_STRING ) + flags &= ~TEP_FIELD_IS_ARRAY ; -if (flags &FIELD_IS_ARRAY ) +if (flags &TEP_FIELD_IS_ARRAY ) type =bt_ctf_field_type_array_create (type, field->arraylen); ret =event_class_add_field (event_class, type, field); -if (flags &FIELD_IS_ARRAY ) +if (flags &TEP_FIELD_IS_ARRAY )bt_ctf_field_type_put (type);if (ret) {
tools/perf/util/evsel.c +1 -1
@@ -2698,7 +2698,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, offset = field->offset; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { offset = *(int *)(sample->raw_data + field->offset); offset &=0xffff ; }
tools/perf/util/python.c +6 -6
@@ -348,28 +348,28 @@ tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)unsigned long long val;unsigned int offset, len; -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) { offset = field->offset; len = field->size; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ; } -if (field->flags &FIELD_IS_STRING && +if (field->flags &TEP_FIELD_IS_STRING &&is_printable_array (data + offset, len)) { ret =_PyUnicode_FromString ((char *)data + offset); }else { ret =PyByteArray_FromStringAndSize ((const char *) data + offset, len); - field->flags &= ~FIELD_IS_STRING ; + field->flags &= ~TEP_FIELD_IS_STRING ; } }else { val =tep_read_number (pevent, data + field->offset, field->size); -if (field->flags &FIELD_IS_POINTER ) +if (field->flags &TEP_FIELD_IS_POINTER ) ret =PyLong_FromUnsignedLong ((unsigned long ) val); -else if (field->flags &FIELD_IS_SIGNED ) +else if (field->flags &TEP_FIELD_IS_SIGNED ) ret =PyLong_FromLong ((long ) val);else ret =PyLong_FromUnsignedLong ((unsigned long ) val);
tools/perf/util/scripting-engines/trace-event-perl.c +9 -9
@@ -388,9 +388,9 @@ static void perl_process_tracepoint(struct perf_sample *sample,/* common fields other than pid can be accessed via xsub fns */ for (field = event->format.fields; field; field = field->next) { -if (field->flags &FIELD_IS_STRING ) { +if (field->flags &TEP_FIELD_IS_STRING ) {int offset; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { offset = *(int *)(data + field->offset); offset &=0xffff ; }else
@@ -399,7 +399,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, }else {/* FIELD_IS_NUMERIC */ val =read_size (event, data + field->offset, field->size); -if (field->flags &FIELD_IS_SIGNED ) { +if (field->flags &TEP_FIELD_IS_SIGNED ) {XPUSHs (sv_2mortal (newSViv (val))); }else {XPUSHs (sv_2mortal (newSVuv (val)));
@@ -646,11 +646,11 @@ sub print_backtrace\n\ count++;fprintf (ofp,"%s=" , f->name); -if (f->flags &FIELD_IS_STRING || - f->flags &FIELD_IS_FLAG || - f->flags &FIELD_IS_SYMBOLIC ) +if (f->flags &TEP_FIELD_IS_STRING || + f->flags &TEP_FIELD_IS_FLAG || + f->flags &TEP_FIELD_IS_SYMBOLIC )fprintf (ofp,"%%s" ); -else if (f->flags &FIELD_IS_SIGNED ) +else if (f->flags &TEP_FIELD_IS_SIGNED )fprintf (ofp,"%%d" );else fprintf (ofp,"%%u" );
@@ -668,7 +668,7 @@ sub print_backtrace\n\if (++count %5 ==0 )fprintf (ofp,"\n\t " ); -if (f->flags &FIELD_IS_FLAG ) { +if (f->flags &TEP_FIELD_IS_FLAG ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t " ); count =4 ;
@@ -678,7 +678,7 @@ sub print_backtrace\n\ event->name);fprintf (ofp,"\"%s\", $%s)" , f->name, f->name); - }else if (f->flags &FIELD_IS_SYMBOLIC ) { + }else if (f->flags &TEP_FIELD_IS_SYMBOLIC ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t " ); count =4 ;
tools/perf/util/scripting-engines/trace-event-python.c +13 -13
@@ -335,7 +335,7 @@ static void define_event_symbols(struct tep_event_format *event,static PyObject *get_field_numeric_entry (struct tep_event_format *event,struct tep_format_field *field,void *data) { -bool is_array = field->flags &FIELD_IS_ARRAY ; +bool is_array = field->flags &TEP_FIELD_IS_ARRAY ;PyObject *obj =NULL , *list =NULL ;unsigned long long val;unsigned int item_size, n_items, i;
@@ -353,7 +353,7 @@ static PyObject *get_field_numeric_entry(struct tep_event_format *event, val =read_size (event, data + field->offset + i * item_size, item_size); -if (field->flags &FIELD_IS_SIGNED ) { +if (field->flags &TEP_FIELD_IS_SIGNED ) {if ((long long )val >=LONG_MIN && (long long )val <=LONG_MAX ) obj =_PyLong_FromLong (val);
@@ -867,22 +867,22 @@ static void python_process_tracepoint(struct perf_sample *sample,unsigned int offset, len;unsigned long long val; -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) { offset = field->offset; len = field->size; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { val =tep_read_number (scripting_context->pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ; } -if (field->flags &FIELD_IS_STRING && +if (field->flags &TEP_FIELD_IS_STRING &&is_printable_array (data + offset, len)) { obj =_PyUnicode_FromString ((char *) data + offset); }else { obj =PyByteArray_FromStringAndSize ((const char *) data + offset, len); - field->flags &= ~FIELD_IS_STRING ; + field->flags &= ~TEP_FIELD_IS_STRING ; } }else {/* FIELD_IS_NUMERIC */ obj =get_field_numeric_entry (event, field, data);
@@ -1686,12 +1686,12 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile count++;fprintf (ofp,"%s=" , f->name); -if (f->flags &FIELD_IS_STRING || - f->flags &FIELD_IS_FLAG || - f->flags &FIELD_IS_ARRAY || - f->flags &FIELD_IS_SYMBOLIC ) +if (f->flags &TEP_FIELD_IS_STRING || + f->flags &TEP_FIELD_IS_FLAG || + f->flags &TEP_FIELD_IS_ARRAY || + f->flags &TEP_FIELD_IS_SYMBOLIC )fprintf (ofp,"%%s" ); -else if (f->flags &FIELD_IS_SIGNED ) +else if (f->flags &TEP_FIELD_IS_SIGNED )fprintf (ofp,"%%d" );else fprintf (ofp,"%%u" );
@@ -1709,7 +1709,7 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfileif (++count %5 ==0 )fprintf (ofp,"\n\t\t" ); -if (f->flags &FIELD_IS_FLAG ) { +if (f->flags &TEP_FIELD_IS_FLAG ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t\t" ); count =4 ;
@@ -1719,7 +1719,7 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile event->name);fprintf (ofp,"\"%s\", %s)" , f->name, f->name); - }else if (f->flags &FIELD_IS_SYMBOLIC ) { + }else if (f->flags &TEP_FIELD_IS_SYMBOLIC ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t\t" ); count =4 ;
tools/perf/util/sort.c +2 -2
@@ -1899,7 +1899,7 @@ static int hde_width(struct hpp_dynamic_entry *hde)if (namelen > len) len = namelen; -if (!(hde->field->flags &FIELD_IS_STRING )) { +if (!(hde->field->flags &TEP_FIELD_IS_STRING )) {/* length for print hex numbers */ fieldlen = hde->field->size *2 +2 ; }
@@ -2071,7 +2071,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, } field = hde->field; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) {unsigned long long dyn;tep_read_number_field (field, a->raw_data, &dyn);
Signature · 1 line
2.18.0
PATCH 13/15 tools/lib/traceevent: Rename struct plugin_list to struct tep_plugin_list
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 plugin_list to struct tep_plugin_list
--- tools/lib/traceevent/event-parse.h | 8 ++++---- tools/lib/traceevent/event-plugin.c | 18 +++++++++--------- tools/perf/util/trace-event.h | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-)
tools/lib/traceevent/event-parse.h +4 -4
@@ -389,12 +389,12 @@ enum tep_errno { };#undef _PE -struct plugin_list ; +struct tep_plugin_list ;#define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) -struct plugin_list *tep_load_plugins (struct tep_handle *pevent); -void tep_unload_plugins (struct plugin_list *plugin_list, +struct tep_plugin_list *tep_load_plugins (struct tep_handle *pevent); +void tep_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent);char **tep_plugin_list_options (void );void tep_plugin_free_options_list (char **list);
@@ -403,7 +403,7 @@ int tep_plugin_add_options(const char *name,void tep_plugin_remove_options (struct tep_plugin_option *options);void tep_print_plugins (struct trace_seq *s,const char *prefix,const char *suffix, -const struct plugin_list *list); +const struct tep_plugin_list *list);struct cmdline ;struct cmdline_list ;
tools/lib/traceevent/event-plugin.c +9 -9
@@ -31,8 +31,8 @@ static struct trace_plugin_options {char *value; } *trace_plugin_options; -struct plugin_list { -struct plugin_list *next; +struct tep_plugin_list { +struct tep_plugin_list *next;char *name;void *handle; };
@@ -259,7 +259,7 @@ void tep_plugin_remove_options(struct tep_plugin_option *options)*/ void tep_print_plugins (struct trace_seq *s,const char *prefix,const char *suffix, -const struct plugin_list *list) +const struct tep_plugin_list *list) {while (list) {trace_seq_printf (s,"%s%s%s" , prefix, list->name, suffix);
@@ -271,9 +271,9 @@ static void load_plugin(struct tep_handle *pevent, const char *path, const char *file, void *data) { - struct plugin_list **plugin_list = data; + struct tep_plugin_list **plugin_list = data;tep_plugin_load_func func; -struct plugin_list *list; +struct tep_plugin_list *list;const char *alias;char *plugin;void *handle;
@@ -417,20 +417,20 @@ load_plugins(struct tep_handle *pevent, const char *suffix,free (path); } -struct plugin_list * +struct tep_plugin_list *tep_load_plugins (struct tep_handle *pevent) { -struct plugin_list *list =NULL ; +struct tep_plugin_list *list =NULL ;load_plugins (pevent,".so" , load_plugin, &list);return list; }void -tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) +tep_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent) {tep_plugin_unload_func func; -struct plugin_list *list; +struct tep_plugin_list *list;while (plugin_list) { list = plugin_list;
tools/perf/util/trace-event.h +2 -2
@@ -11,11 +11,11 @@ struct perf_sample;union perf_event ;struct perf_tool ;struct thread ; -struct plugin_list ; +struct tep_plugin_list ;struct trace_event {struct tep_handle *pevent; -struct plugin_list *plugin_list; +struct tep_plugin_list *plugin_list; };int trace_event__init (struct trace_event *t);
Signature · 1 line
2.18.0
PATCH 8/15 tools/lib/traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to enums filter_boolean_type, filter_op_type, filter_cmp_type and all enum's members
--- tools/lib/traceevent/event-parse.h | 46 ++++----- tools/lib/traceevent/parse-filter.c | 144 ++++++++++++++-------------- 2 files changed, 95 insertions(+), 95 deletions(-)
tools/lib/traceevent/event-parse.h +23 -23
@@ -768,29 +768,29 @@ void tep_print_printk(struct tep_handle *pevent);/* ----------------------- filtering ----------------------- */ -enum filter_boolean_type { -FILTER_FALSE , -FILTER_TRUE , +enum tep_filter_boolean_type { +TEP_FILTER_FALSE , +TEP_FILTER_TRUE , }; -enum filter_op_type { -FILTER_OP_AND =1 , -FILTER_OP_OR , -FILTER_OP_NOT , +enum tep_filter_op_type { +TEP_FILTER_OP_AND =1 , +TEP_FILTER_OP_OR , +TEP_FILTER_OP_NOT , }; -enum filter_cmp_type { -FILTER_CMP_NONE , -FILTER_CMP_EQ , -FILTER_CMP_NE , -FILTER_CMP_GT , -FILTER_CMP_LT , -FILTER_CMP_GE , -FILTER_CMP_LE , -FILTER_CMP_MATCH , -FILTER_CMP_NOT_MATCH , -FILTER_CMP_REGEX , -FILTER_CMP_NOT_REGEX , +enum tep_filter_cmp_type { +TEP_FILTER_CMP_NONE , +TEP_FILTER_CMP_EQ , +TEP_FILTER_CMP_NE , +TEP_FILTER_CMP_GT , +TEP_FILTER_CMP_LT , +TEP_FILTER_CMP_GE , +TEP_FILTER_CMP_LE , +TEP_FILTER_CMP_MATCH , +TEP_FILTER_CMP_NOT_MATCH , +TEP_FILTER_CMP_REGEX , +TEP_FILTER_CMP_NOT_REGEX , };enum filter_exp_type {
@@ -828,7 +828,7 @@ enum filter_value_type {struct fliter_arg ;struct filter_arg_boolean { -enum filter_boolean_type value; +enum tep_filter_boolean_type value; };struct filter_arg_field {
@@ -844,7 +844,7 @@ struct filter_arg_value { };struct filter_arg_op { -enum filter_op_type type; +enum tep_filter_op_type type;struct filter_arg *left;struct filter_arg *right; };
@@ -856,13 +856,13 @@ struct filter_arg_exp { };struct filter_arg_num { -enum filter_cmp_type type; +enum tep_filter_cmp_type type;struct filter_arg *left;struct filter_arg *right; };struct filter_arg_str { -enum filter_cmp_type type; +enum tep_filter_cmp_type type;struct tep_format_field *field;char *val;char *buffer;
tools/lib/traceevent/parse-filter.c +72 -72
376 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH 9/15 tools/lib/traceevent: Add prefix tep_ to enums filter_{exp,arg}_type
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to enums filter_exp_type, filter_arg_type and all enum's members
--- tools/lib/traceevent/event-parse.h | 56 ++++---- tools/lib/traceevent/parse-filter.c | 210 ++++++++++++++-------------- 2 files changed, 133 insertions(+), 133 deletions(-)
tools/lib/traceevent/event-parse.h +28 -28
@@ -793,30 +793,30 @@ enum tep_filter_cmp_type { TEP_FILTER_CMP_NOT_REGEX, }; -enum filter_exp_type { -FILTER_EXP_NONE , -FILTER_EXP_ADD , -FILTER_EXP_SUB , -FILTER_EXP_MUL , -FILTER_EXP_DIV , -FILTER_EXP_MOD , -FILTER_EXP_RSHIFT , -FILTER_EXP_LSHIFT , -FILTER_EXP_AND , -FILTER_EXP_OR , -FILTER_EXP_XOR , -FILTER_EXP_NOT , -}; - -enum filter_arg_type { -FILTER_ARG_NONE , -FILTER_ARG_BOOLEAN , -FILTER_ARG_VALUE , -FILTER_ARG_FIELD , -FILTER_ARG_EXP , -FILTER_ARG_OP , -FILTER_ARG_NUM , -FILTER_ARG_STR , +enum tep_filter_exp_type { +TEP_FILTER_EXP_NONE , +TEP_FILTER_EXP_ADD , +TEP_FILTER_EXP_SUB , +TEP_FILTER_EXP_MUL , +TEP_FILTER_EXP_DIV , +TEP_FILTER_EXP_MOD , +TEP_FILTER_EXP_RSHIFT , +TEP_FILTER_EXP_LSHIFT , +TEP_FILTER_EXP_AND , +TEP_FILTER_EXP_OR , +TEP_FILTER_EXP_XOR , +TEP_FILTER_EXP_NOT , +}; + +enum tep_filter_arg_type { +TEP_FILTER_ARG_NONE , +TEP_FILTER_ARG_BOOLEAN , +TEP_FILTER_ARG_VALUE , +TEP_FILTER_ARG_FIELD , +TEP_FILTER_ARG_EXP , +TEP_FILTER_ARG_OP , +TEP_FILTER_ARG_NUM , +TEP_FILTER_ARG_STR , };enum filter_value_type {
@@ -850,9 +850,9 @@ struct filter_arg_op { };struct filter_arg_exp { -enum filter_exp_type type; -struct filter_arg *left; -struct filter_arg *right; +enum tep_filter_exp_type type; +struct filter_arg *left; +struct filter_arg *right; };struct filter_arg_num {
@@ -870,7 +870,7 @@ struct filter_arg_str { };struct filter_arg { -enum filter_arg_type type; +enum tep_filter_arg_type type;union {struct filter_arg_boolean boolean;struct filter_arg_field field;
tools/lib/traceevent/parse-filter.c +105 -105
553 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH 7/15 tools/lib/traceevent, tools/perf: Rename enum print_arg_type to enum tep_print_arg_type
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 enum print_arg_type to enum tep_print_arg_type and add prefix TEP_ to all its members.
--- tools/lib/traceevent/event-parse.c | 248 +++++++++--------- tools/lib/traceevent/event-parse.h | 36 +-- .../util/scripting-engines/trace-event-perl.c | 32 +-- .../scripting-engines/trace-event-python.c | 56 ++-- 4 files changed, 186 insertions(+), 186 deletions(-)
tools/lib/traceevent/event-parse.c +124 -124
@@ -802,52 +802,52 @@ static void free_arg(struct tep_print_arg *arg)return ;switch (arg->type) { -case PRINT_ATOM : +case TEP_PRINT_ATOM :free (arg->atom.atom);break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :free (arg->field.name);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS :free_arg (arg->flags.field);free (arg->flags.delim);free_flag_sym (arg->flags.flags);break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL :free_arg (arg->symbol.field);free_flag_sym (arg->symbol.symbols);break ; -case PRINT_HEX : -case PRINT_HEX_STR : +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR :free_arg (arg->hex.field);free_arg (arg->hex.size);break ; -case PRINT_INT_ARRAY : +case TEP_PRINT_INT_ARRAY :free_arg (arg->int_array.field);free_arg (arg->int_array.count);free_arg (arg->int_array.el_size);break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE :free (arg->typecast.type);free_arg (arg->typecast.item);break ; -case PRINT_STRING : -case PRINT_BSTRING : +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING :free (arg->string.string);break ; -case PRINT_BITMASK : +case TEP_PRINT_BITMASK :free (arg->bitmask.bitmask);break ; -case PRINT_DYNAMIC_ARRAY : -case PRINT_DYNAMIC_ARRAY_LEN : +case TEP_PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY_LEN :free (arg->dynarray.index);break ; -case PRINT_OP : +case TEP_PRINT_OP :free (arg->op.op);free_arg (arg->op.left);free_arg (arg->op.right);break ; -case PRINT_FUNC : +case TEP_PRINT_FUNC :while (arg->func.args) { farg = arg->func.args; arg->func.args = farg->next;
@@ -855,7 +855,7 @@ static void free_arg(struct tep_print_arg *arg) }break ; -case PRINT_NULL : +case TEP_PRINT_NULL :default :break ; }
@@ -1729,7 +1729,7 @@ process_cond(struct tep_event_format *event, struct tep_print_arg *top, char **t goto out_free; } - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.left = left; arg->op.right = right;
@@ -1859,7 +1859,7 @@ static int set_op_prio(struct tep_print_arg *arg) {/* single ops are the greatest */ -if (!arg->op.left || arg->op.left->type ==PRINT_NULL ) +if (!arg->op.left || arg->op.left->type ==TEP_PRINT_NULL ) arg->op.prio =0 ;else arg->op.prio =get_op_prio (arg->op.op);
@@ -1878,7 +1878,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok/* the op is passed in via tok */ token = *tok; -if (arg->type ==PRINT_OP && !arg->op.left) { +if (arg->type ==TEP_PRINT_OP && !arg->op.left) {/* handle single op */ if (token[1 ]) {do_warning_event (event,"bad op token %s" , token);
@@ -1901,7 +1901,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tokif (!left) goto out_warn_free; - left->type =PRINT_NULL ; + left->type =TEP_PRINT_NULL ; arg->op.left = left; right =alloc_arg ();
@@ -1923,7 +1923,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok/* copy the top arg to the left */ *left = *arg; - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left = left; arg->op.prio =0 ;
@@ -1957,7 +1957,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok/* copy the top arg to the left */ *left = *arg; - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left = left; arg->op.right =NULL ;
@@ -1977,7 +1977,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok type == TEP_EVENT_DELIM && (strcmp(token, ")") == 0)) {char *new_atom; -if (left->type !=PRINT_ATOM ) { +if (left->type !=TEP_PRINT_ATOM ) {do_warning_event (event,"bad pointer type" ); goto out_free; }
@@ -2007,7 +2007,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok goto out_free; } -if (right->type ==PRINT_OP && +if (right->type ==TEP_PRINT_OP &&get_op_prio (arg->op.op) <get_op_prio (right->op.op)) {struct tep_print_arg tmp;
@@ -2031,7 +2031,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok *left = *arg; - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left = left;
@@ -2084,7 +2084,7 @@ process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_ar goto out_free; field = token; - arg->type =PRINT_FIELD ; + arg->type =TEP_PRINT_FIELD ; arg->field.name = field;if (is_flag_field) {
@@ -2240,7 +2240,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)static unsigned long long eval_type (unsigned long long val,struct tep_print_arg *arg,int pointer) { -if (arg->type !=PRINT_TYPE ) { +if (arg->type !=TEP_PRINT_TYPE ) {do_warning ("expected type argument" );return 0 ; }
@@ -2254,16 +2254,16 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val)int ret =1 ;switch (arg->type) { -case PRINT_ATOM : +case TEP_PRINT_ATOM : *val =strtoll (arg->atom.atom,NULL ,0 );break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE : ret =arg_num_eval (arg->typecast.item, val);if (!ret)break ; *val =eval_type (*val, arg,0 );break ; -case PRINT_OP : +case TEP_PRINT_OP :switch (arg->op.op[0 ]) {case '|' : ret =arg_num_eval (arg->op.left, &left);
@@ -2366,7 +2366,7 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val)break ;case '-' :/* check for negative */ -if (arg->op.left->type ==PRINT_NULL ) +if (arg->op.left->type ==TEP_PRINT_NULL ) left =0 ;else ret =arg_num_eval (arg->op.left, &left);
@@ -2378,7 +2378,7 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val) *val = left - right;break ;case '+' : -if (arg->op.left->type ==PRINT_NULL ) +if (arg->op.left->type ==TEP_PRINT_NULL ) left =0 ;else ret =arg_num_eval (arg->op.left, &left);
@@ -2401,11 +2401,11 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val) }break ; -case PRINT_NULL : - case PRINT_FIELD ... PRINT_SYMBOL: -case PRINT_STRING : -case PRINT_BSTRING : -case PRINT_BITMASK : +case TEP_PRINT_NULL : + case TEP_PRINT_FIELD ... TEP_PRINT_SYMBOL: +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING : +case TEP_PRINT_BITMASK :default :do_warning ("invalid eval type %d" , arg->type); ret =0 ;
@@ -2420,21 +2420,21 @@ static char *arg_eval (struct tep_print_arg *arg)static char buf[20 ];switch (arg->type) { -case PRINT_ATOM : +case TEP_PRINT_ATOM :return arg->atom.atom; -case PRINT_TYPE : +case TEP_PRINT_TYPE :return arg_eval (arg->typecast.item); -case PRINT_OP : +case TEP_PRINT_OP :if (!arg_num_eval (arg, &val))break ;sprintf (buf,"%lld" , val);return buf; -case PRINT_NULL : - case PRINT_FIELD ... PRINT_SYMBOL: -case PRINT_STRING : -case PRINT_BSTRING : -case PRINT_BITMASK : +case TEP_PRINT_NULL : + case TEP_PRINT_FIELD ... TEP_PRINT_SYMBOL: +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING : +case TEP_PRINT_BITMASK :default :do_warning ("invalid eval type %d" , arg->type);break ;
@@ -2532,7 +2532,7 @@ process_flags(struct tep_event_format *event, struct tep_print_arg *arg, char **char *token =NULL ;memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_FLAGS ; + arg->type =TEP_PRINT_FLAGS ; field =alloc_arg ();if (!field) {
@@ -2585,7 +2585,7 @@ process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, charchar *token =NULL ;memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_SYMBOL ; + arg->type =TEP_PRINT_SYMBOL ; field =alloc_arg ();if (!field) {
@@ -2618,7 +2618,7 @@ process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, charstatic enum tep_event_type process_hex_common (struct tep_event_format *event,struct tep_print_arg *arg, -char **tok,enum print_arg_type type) +char **tok,enum tep_print_arg_type type) {memset (arg,0 ,sizeof (*arg)); arg->type = type;
@@ -2642,21 +2642,21 @@ process_hex_common(struct tep_event_format *event, struct tep_print_arg *arg,static enum tep_event_type process_hex (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -return process_hex_common (event, arg, tok,PRINT_HEX ); +return process_hex_common (event, arg, tok,TEP_PRINT_HEX ); }static enum tep_event_type process_hex_str (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -return process_hex_common (event, arg, tok,PRINT_HEX_STR ); +return process_hex_common (event, arg, tok,TEP_PRINT_HEX_STR ); }static enum tep_event_type process_int_array (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_INT_ARRAY ; + arg->type =TEP_PRINT_INT_ARRAY ;if (alloc_and_process_delim (event,"," , &arg->int_array.field)) goto out;
@@ -2688,7 +2688,7 @@ process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg,char *token;memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_DYNAMIC_ARRAY ; + arg->type =TEP_PRINT_DYNAMIC_ARRAY ;/* * The item within the parenthesis is another field that holds
@@ -2755,7 +2755,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg *if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; - arg->type =PRINT_DYNAMIC_ARRAY_LEN ; + arg->type =TEP_PRINT_DYNAMIC_ARRAY_LEN ;/* Find the field */ field =tep_find_field (event, token);
@@ -2814,8 +2814,8 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char **/* make this a typecast and contine */ /* prevous must be an atom */ -if (arg->type !=PRINT_ATOM ) { -do_warning_event (event,"previous needed to be PRINT_ATOM" ); +if (arg->type !=TEP_PRINT_ATOM ) { +do_warning_event (event,"previous needed to be TEP_PRINT_ATOM" ); goto out_free; }
@@ -2826,7 +2826,7 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char ** goto out_free; } - arg->type =PRINT_TYPE ; + arg->type =TEP_PRINT_TYPE ; arg->typecast.type = arg->atom.atom; arg->typecast.item = item_arg; type =process_arg_token (event, item_arg, &token, type);
@@ -2853,7 +2853,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct tep_print_argif (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; - arg->type =PRINT_STRING ; + arg->type =TEP_PRINT_STRING ; arg->string.string = token; arg->string.offset =-1 ;
@@ -2882,7 +2882,7 @@ process_bitmask(struct tep_event_format *event __maybe_unused, struct tep_print_if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; - arg->type =PRINT_BITMASK ; + arg->type =TEP_PRINT_BITMASK ; arg->bitmask.bitmask = token; arg->bitmask.offset =-1 ;
@@ -2943,7 +2943,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handlerchar *token;int i; - arg->type =PRINT_FUNC ; + arg->type =TEP_PRINT_FUNC ; arg->func.func = func; *tok =NULL ;
@@ -3096,13 +3096,13 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, type =read_token_item (&token); } - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ; arg->atom.atom = atom;break ;case TEP_EVENT_DQUOTE :case TEP_EVENT_SQUOTE : - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ; arg->atom.atom = token; type =read_token_item (&token);break ;
@@ -3114,7 +3114,7 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, }case TEP_EVENT_OP :/* handle single ops */ - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left =NULL ; type =process_op (event, arg, &token);
@@ -3533,12 +3533,12 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_prunsigned int field_size;switch (arg->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :/* ?? */ return 0 ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :return strtoull (arg->atom.atom,NULL ,0 ); -case PRINT_FIELD : +case TEP_PRINT_FIELD :if (!arg->field.field) { arg->field.field =tep_find_any_field (event, arg->field.name);if (!arg->field.field)
@@ -3549,27 +3549,27 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr val =tep_read_number (pevent, data + arg->field.field->offset, arg->field.field->size);break ; -case PRINT_FLAGS : -case PRINT_SYMBOL : -case PRINT_INT_ARRAY : -case PRINT_HEX : -case PRINT_HEX_STR : +case TEP_PRINT_FLAGS : +case TEP_PRINT_SYMBOL : +case TEP_PRINT_INT_ARRAY : +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR :break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE : val =eval_num_arg (data, size, event, arg->typecast.item);return eval_type (val, arg,0 ); -case PRINT_STRING : -case PRINT_BSTRING : -case PRINT_BITMASK : +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING : +case TEP_PRINT_BITMASK :return 0 ; -case PRINT_FUNC : { +case TEP_PRINT_FUNC : {struct trace_seq s;trace_seq_init (&s); val =process_defined_func (&s, data, size, event, arg);trace_seq_destroy (&s);return val; } -case PRINT_OP : +case TEP_PRINT_OP :if (strcmp (arg->op.op,"[" ) ==0 ) {/* * Arrays are special, since we don't want
@@ -3579,7 +3579,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr/* handle typecasts */ larg = arg->op.left; -while (larg->type ==PRINT_TYPE ) { +while (larg->type ==TEP_PRINT_TYPE ) {if (!typearg) typearg = larg; larg = larg->typecast.item;
@@ -3589,7 +3589,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr field_size = pevent->long_size;switch (larg->type) { -case PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY : offset =tep_read_number (pevent, data + larg->dynarray.field->offset, larg->dynarray.field->size);
@@ -3603,7 +3603,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr offset &=0xffff ; offset += right;break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :if (!larg->field.field) { larg->field.field =tep_find_any_field (event, larg->field.name);
@@ -3719,7 +3719,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr goto out_warning_op; }break ; -case PRINT_DYNAMIC_ARRAY_LEN : +case TEP_PRINT_DYNAMIC_ARRAY_LEN : offset =tep_read_number (pevent, data + arg->dynarray.field->offset, arg->dynarray.field->size);
@@ -3730,7 +3730,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr*/ val = (unsigned long long )(offset >>16 );break ; -case PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY :/* Without [], we pass the address to the dynamic data */ offset = tep_read_number(pevent, data + arg->dynarray.field->offset,
@@ -3877,13 +3877,13 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,int i, len;switch (arg->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :/* ?? */ return ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :print_str_to_seq (s, format, len_arg, arg->atom.atom);return ; -case PRINT_FIELD : +case TEP_PRINT_FIELD : field = arg->field.field;if (!field) { field =tep_find_any_field (event, arg->field.name);
@@ -3940,7 +3940,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,print_str_to_seq (s, format, len_arg, str);free (str);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS : val =eval_num_arg (data, size, event, arg->flags.field); print =0 ;for (flag = arg->flags.flags; flag; flag = flag->next) {
@@ -3963,7 +3963,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,trace_seq_printf (s,"0x%llx" , val); }break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL : val =eval_num_arg (data, size, event, arg->symbol.field);for (flag = arg->symbol.symbols; flag; flag = flag->next) { fval =eval_flag (flag->value);
@@ -3975,9 +3975,9 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (!flag)trace_seq_printf (s,"0x%llx" , val);break ; -case PRINT_HEX : -case PRINT_HEX_STR : -if (arg->hex.field->type ==PRINT_DYNAMIC_ARRAY ) { +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR : +if (arg->hex.field->type ==TEP_PRINT_DYNAMIC_ARRAY ) {unsigned long offset; offset = tep_read_number(pevent, data + arg->hex.field->dynarray.field->offset,
@@ -3996,17 +3996,17 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, } len =eval_num_arg (data, size, event, arg->hex.size);for (i =0 ; i < len; i++) { -if (i && arg->type ==PRINT_HEX ) +if (i && arg->type ==TEP_PRINT_HEX )trace_seq_putc (s,' ' );trace_seq_printf (s,"%02x" , hex[i]); }break ; -case PRINT_INT_ARRAY : { +case TEP_PRINT_INT_ARRAY : {void *num;int el_size; -if (arg->int_array.field->type ==PRINT_DYNAMIC_ARRAY ) { +if (arg->int_array.field->type ==TEP_PRINT_DYNAMIC_ARRAY ) {unsigned long offset;struct tep_format_field *field = arg->int_array.field->dynarray.field;
@@ -4050,9 +4050,9 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, }break ; } -case PRINT_TYPE : +case TEP_PRINT_TYPE :break ; -case PRINT_STRING : { +case TEP_PRINT_STRING : {int str_offset;if (arg->string.offset ==-1 ) {
@@ -4066,10 +4066,10 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,print_str_to_seq (s, format, len_arg, ((char *)data) + str_offset);break ; } -case PRINT_BSTRING : +case TEP_PRINT_BSTRING :print_str_to_seq (s, format, len_arg, arg->string.string);break ; -case PRINT_BITMASK : { +case TEP_PRINT_BITMASK : {int bitmask_offset;int bitmask_size;
@@ -4086,7 +4086,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, data + bitmask_offset, bitmask_size);break ; } -case PRINT_OP : +case TEP_PRINT_OP :/* * The only op for string should be ? : */
@@ -4100,7 +4100,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,print_str_arg (s, data, size, event, format, len_arg, arg->op.right->op.right);break ; -case PRINT_FUNC : +case TEP_PRINT_FUNC :process_defined_func (s, data, size, event, arg);break ;default :
@@ -4255,7 +4255,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s arg->next =NULL ; next = &arg->next; - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ;if (asprintf (&arg->atom.atom,"%lld" , ip) <0 ) goto out_free;
@@ -4343,7 +4343,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s goto out_free; } arg->next =NULL ; - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ;if (asprintf (&arg->atom.atom,"%lld" , val) <0 ) {free (arg); goto out_free;
@@ -4367,7 +4367,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s goto out_free; } arg->next =NULL ; - arg->type =PRINT_BSTRING ; + arg->type =TEP_PRINT_BSTRING ; arg->string.string =strdup (bptr);if (!arg->string.string) goto out_free;
@@ -4429,12 +4429,12 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,unsigned char *buf;const char *fmt ="%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ; -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return ; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return ;
@@ -4582,12 +4582,12 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, {unsigned char *buf; -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return 0 ; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return 0 ; }
@@ -4628,12 +4628,12 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, rc++; } -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return rc; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return rc; }
@@ -4686,12 +4686,12 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, } } -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return rc; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return rc; }
@@ -4967,7 +4967,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_eif (isalnum (ptr[1 ])) ptr++; -if (arg->type ==PRINT_BSTRING ) { +if (arg->type ==TEP_PRINT_BSTRING ) {trace_seq_puts (s, arg->string.string);break ; }
@@ -5739,16 +5739,16 @@ static void print_args(struct tep_print_arg *args)struct trace_seq s;switch (args->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :printf ("null" );break ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :printf ("%s" , args->atom.atom);break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :printf ("REC->%s" , args->field.name);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS :printf ("__print_flags(" );print_args (args->flags.field);printf (", %s, " , args->flags.delim);
@@ -5758,7 +5758,7 @@ static void print_args(struct tep_print_arg *args)trace_seq_destroy (&s);printf (")" );break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL :printf ("__print_symbolic(" );print_args (args->symbol.field);printf (", " );
@@ -5768,21 +5768,21 @@ static void print_args(struct tep_print_arg *args)trace_seq_destroy (&s);printf (")" );break ; -case PRINT_HEX : +case TEP_PRINT_HEX :printf ("__print_hex(" );print_args (args->hex.field);printf (", " );print_args (args->hex.size);printf (")" );break ; -case PRINT_HEX_STR : +case TEP_PRINT_HEX_STR :printf ("__print_hex_str(" );print_args (args->hex.field);printf (", " );print_args (args->hex.size);printf (")" );break ; -case PRINT_INT_ARRAY : +case TEP_PRINT_INT_ARRAY :printf ("__print_array(" );print_args (args->int_array.field);printf (", " );
@@ -5791,18 +5791,18 @@ static void print_args(struct tep_print_arg *args)print_args (args->int_array.el_size);printf (")" );break ; -case PRINT_STRING : -case PRINT_BSTRING : +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING :printf ("__get_str(%s)" , args->string.string);break ; -case PRINT_BITMASK : +case TEP_PRINT_BITMASK :printf ("__get_bitmask(%s)" , args->bitmask.bitmask);break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE :printf ("(%s)" , args->typecast.type);print_args (args->typecast.item);break ; -case PRINT_OP : +case TEP_PRINT_OP :if (strcmp (args->op.op,":" ) ==0 ) print_paren =0 ;if (print_paren)
@@ -6101,7 +6101,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, event->flags |=TEP_EVENT_FL_FAILED ;return TEP_ERRNO__OLD_FTRACE_ARG_FAILED ; } - arg->type =PRINT_FIELD ; + arg->type =TEP_PRINT_FIELD ; arg->field.name =strdup (field->name);if (!arg->field.name) { event->flags |=TEP_EVENT_FL_FAILED ;
tools/lib/traceevent/event-parse.h +18 -18
@@ -234,28 +234,28 @@ struct tep_print_arg_func {struct tep_print_arg *args; }; -enum print_arg_type { -PRINT_NULL , -PRINT_ATOM , -PRINT_FIELD , -PRINT_FLAGS , -PRINT_SYMBOL , -PRINT_HEX , -PRINT_INT_ARRAY , -PRINT_TYPE , -PRINT_STRING , -PRINT_BSTRING , -PRINT_DYNAMIC_ARRAY , -PRINT_OP , -PRINT_FUNC , -PRINT_BITMASK , -PRINT_DYNAMIC_ARRAY_LEN , -PRINT_HEX_STR , +enum tep_print_arg_type { +TEP_PRINT_NULL , +TEP_PRINT_ATOM , +TEP_PRINT_FIELD , +TEP_PRINT_FLAGS , +TEP_PRINT_SYMBOL , +TEP_PRINT_HEX , +TEP_PRINT_INT_ARRAY , +TEP_PRINT_TYPE , +TEP_PRINT_STRING , +TEP_PRINT_BSTRING , +TEP_PRINT_DYNAMIC_ARRAY , +TEP_PRINT_OP , +TEP_PRINT_FUNC , +TEP_PRINT_BITMASK , +TEP_PRINT_DYNAMIC_ARRAY_LEN , +TEP_PRINT_HEX_STR , };struct tep_print_arg {struct tep_print_arg *next; -enum print_arg_type type; +enum tep_print_arg_type type;union {struct tep_print_arg_atom atom;struct tep_print_arg_field field;
tools/perf/util/scripting-engines/trace-event-perl.c +16 -16
@@ -197,54 +197,54 @@ static void define_event_symbols(struct tep_event_format *event,return ;switch (args->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :break ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :define_flag_value (ev_name, cur_field_name,"0" , args->atom.atom); zero_flag_atom =0 ;break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :free (cur_field_name); cur_field_name =strdup (args->field.name);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS :define_event_symbols (event, ev_name, args->flags.field);define_flag_field (ev_name, cur_field_name, args->flags.delim);define_flag_values (args->flags.flags, ev_name, cur_field_name);break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL :define_event_symbols (event, ev_name, args->symbol.field);define_symbolic_field (ev_name, cur_field_name);define_symbolic_values (args->symbol.symbols, ev_name, cur_field_name);break ; -case PRINT_HEX : -case PRINT_HEX_STR : +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR :define_event_symbols (event, ev_name, args->hex.field);define_event_symbols (event, ev_name, args->hex.size);break ; -case PRINT_INT_ARRAY : +case TEP_PRINT_INT_ARRAY :define_event_symbols (event, ev_name, args->int_array.field);define_event_symbols (event, ev_name, args->int_array.count);define_event_symbols (event, ev_name, args->int_array.el_size);break ; -case PRINT_BSTRING : -case PRINT_DYNAMIC_ARRAY : -case PRINT_DYNAMIC_ARRAY_LEN : -case PRINT_STRING : -case PRINT_BITMASK : +case TEP_PRINT_BSTRING : +case TEP_PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY_LEN : +case TEP_PRINT_STRING : +case TEP_PRINT_BITMASK :break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE :define_event_symbols (event, ev_name, args->typecast.item);break ; -case PRINT_OP : +case TEP_PRINT_OP :if (strcmp (args->op.op,":" ) ==0 ) zero_flag_atom =1 ;define_event_symbols (event, ev_name, args->op.left);define_event_symbols (event, ev_name, args->op.right);break ; -case PRINT_FUNC : +case TEP_PRINT_FUNC :default :pr_err ("Unsupported print arg type\n" );/* we should warn... */
tools/perf/util/scripting-engines/trace-event-python.c +28 -28
130 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH 10/15 tools/lib/traceevent: Add prefix tep_ to struct filter_{arg,value_type}
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to struct filter_arg, enum filter_value_type and all enum's members.
--- tools/lib/traceevent/event-parse.h | 28 +++---- tools/lib/traceevent/parse-filter.c | 120 ++++++++++++++-------------- 2 files changed, 74 insertions(+), 74 deletions(-)
tools/lib/traceevent/event-parse.h +14 -14
@@ -819,13 +819,13 @@ enum tep_filter_arg_type { TEP_FILTER_ARG_STR, }; -enum filter_value_type { -FILTER_NUMBER , -FILTER_STRING , -FILTER_CHAR +enum tep_filter_value_type { +TEP_FILTER_NUMBER , +TEP_FILTER_STRING , +TEP_FILTER_CHAR }; -struct fliter_arg ; +struct tep_filter_arg ;struct filter_arg_boolean {enum tep_filter_boolean_type value;
@@ -836,7 +836,7 @@ struct filter_arg_field { };struct filter_arg_value { -enum filter_value_type type; +enum tep_filter_value_type type;union {char *str;unsigned long long val;
@@ -845,20 +845,20 @@ struct filter_arg_value {struct filter_arg_op {enum tep_filter_op_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_exp {enum tep_filter_exp_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_num {enum tep_filter_cmp_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_str {
@@ -869,7 +869,7 @@ struct filter_arg_str {regex_t reg; }; -struct filter_arg { +struct tep_filter_arg {enum tep_filter_arg_type type;union {struct filter_arg_boolean boolean;
@@ -885,7 +885,7 @@ struct filter_arg {struct filter_type {int event_id;struct tep_event_format *event; -struct filter_arg *filter; +struct tep_filter_arg *filter; };#define TEP_FILTER_ERROR_BUFSZ 1024
tools/lib/traceevent/parse-filter.c +60 -60
381 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH 15/15 tools/lib/traceevent: Add prefix tep_ to enum filter_trivial_type
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to enum filter_trivial_type and all its members.
--- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/parse-filter.c | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-)
tools/lib/traceevent/event-parse.h +7 -7
@@ -905,10 +905,10 @@ struct tep_event_filter *tep_filter_alloc(struct tep_handle *pevent);#define FILTER_MISS TEP_ERRNO__FILTER_MISS#define FILTER_MATCH TEP_ERRNO__FILTER_MATCH -enum filter_trivial_type { -FILTER_TRIVIAL_FALSE , -FILTER_TRIVIAL_TRUE , -FILTER_TRIVIAL_BOTH , +enum tep_filter_trivial_type { +TEP_FILTER_TRIVIAL_FALSE , +TEP_FILTER_TRIVIAL_TRUE , +TEP_FILTER_TRIVIAL_BOTH , }; enum tep_errno tep_filter_add_filter_str(struct tep_event_filter *filter,
@@ -926,7 +926,7 @@ int tep_event_filtered(struct tep_event_filter *filter,void tep_filter_reset (struct tep_event_filter *filter);int tep_filter_clear_trivial (struct tep_event_filter *filter, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);void tep_filter_free (struct tep_event_filter *filter);
@@ -937,12 +937,12 @@ int tep_filter_remove_event(struct tep_event_filter *filter,int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);int tep_filter_copy (struct tep_event_filter *dest,struct tep_event_filter *source);int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);int tep_filter_compare (struct tep_event_filter *filter1,struct tep_event_filter *filter2);
tools/lib/traceevent/parse-filter.c +11 -11
@@ -1534,7 +1534,7 @@ int tep_filter_copy(struct tep_event_filter *dest, struct tep_event_filter *sour* events may have still been updated on error. */ int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_handle *src_pevent;struct tep_handle *dest_pevent;
@@ -1556,8 +1556,8 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s arg = filter_type->filter;if (arg->type !=TEP_FILTER_ARG_BOOLEAN )continue ; -if ((arg->boolean.value && type ==FILTER_TRIVIAL_FALSE ) || - (!arg->boolean.value && type ==FILTER_TRIVIAL_TRUE )) +if ((arg->boolean.value && type ==TEP_FILTER_TRIVIAL_FALSE ) || + (!arg->boolean.value && type ==TEP_FILTER_TRIVIAL_TRUE ))continue ; event = filter_type->event;
@@ -1593,7 +1593,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s* Returns 0 on success and -1 if there was a problem. */ int tep_filter_clear_trivial (struct tep_event_filter *filter, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_filter_type *filter_type;int count =0 ;
@@ -1614,11 +1614,11 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter,if (filter_type->filter->type !=TEP_FILTER_ARG_BOOLEAN )continue ;switch (type) { -case FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_FALSE :if (filter_type->filter->boolean.value)continue ;break ; -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_TRUE :if (!filter_type->filter->boolean.value)continue ;default :
@@ -1656,7 +1656,7 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter,*/ int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_filter_type *filter_type;
@@ -1672,10 +1672,10 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter,return 0 ;switch (type) { -case FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_FALSE :return !filter_type->filter->boolean.value; -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_TRUE :return filter_type->filter->boolean.value;default :return 1 ;
@@ -2409,8 +2409,8 @@ int tep_filter_compare(struct tep_event_filter *filter1, struct tep_event_filterif (filter_type1->filter->type != filter_type2->filter->type)break ;switch (filter_type1->filter->type) { -case FILTER_TRIVIAL_FALSE : -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_TRUE :/* trivial types just need the type compared */ continue ;default :
Signature · 1 line
2.18.0
PATCH 14/15 tools/lib/traceevent: Rename data2host*() APIs
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 data2host*() APIs
--- tools/lib/traceevent/event-parse.c | 10 +++++----- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/perf/util/trace-event-read.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-)
tools/lib/traceevent/event-parse.c +5 -5
@@ -3331,11 +3331,11 @@ unsigned long long tep_read_number(struct tep_handle *pevent,case 1 :return *(unsigned char *)ptr;case 2 : -return data2host2 (pevent, ptr); +return tep_data2host2 (pevent, ptr);case 4 : -return data2host4 (pevent, ptr); +return tep_data2host4 (pevent, ptr);case 8 : -return data2host8 (pevent, ptr); +return tep_data2host8 (pevent, ptr);default :/* BUG! */ return 0 ;
@@ -4061,7 +4061,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset; } - str_offset =data2host4 (pevent, data + arg->string.offset); + str_offset =tep_data2host4 (pevent, data + arg->string.offset); str_offset &=0xffff ;print_str_to_seq (s, format, len_arg, ((char *)data) + str_offset);break ;
@@ -4079,7 +4079,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset; } - bitmask_offset =data2host4 (pevent, data + arg->bitmask.offset); + bitmask_offset =tep_data2host4 (pevent, data + arg->bitmask.offset); bitmask_size = bitmask_offset >>16 ; bitmask_offset &=0xffff ; print_bitmask_to_seq(pevent, s, format, len_arg,
tools/lib/traceevent/event-parse.h +7 -7
@@ -496,7 +496,7 @@ static inline void tep_set_flag(struct tep_handle *pevent, int flag) }static inline unsigned short -__data2host2 (struct tep_handle *pevent,unsigned short data) +__tep_data2host2 (struct tep_handle *pevent,unsigned short data) {unsigned short swap;
@@ -510,7 +510,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data) }static inline unsigned int -__data2host4 (struct tep_handle *pevent,unsigned int data) +__tep_data2host4 (struct tep_handle *pevent,unsigned int data) {unsigned int swap;
@@ -526,7 +526,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data) }static inline unsigned long long -__data2host8 (struct tep_handle *pevent,unsigned long long data) +__tep_data2host8 (struct tep_handle *pevent,unsigned long long data) {unsigned long long swap;
@@ -545,14 +545,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)return swap; } -#define data2host2 (pevent, ptr) __data2host2(pevent, *(unsigned short *)(ptr)) -#define data2host4 (pevent, ptr) __data2host4(pevent, *(unsigned int *)(ptr)) -#define data2host8 (pevent, ptr) \ +#define tep_data2host2 (pevent, ptr) __tep_data2host2(pevent, *(unsigned short *)(ptr)) +#define tep_data2host4 (pevent, ptr) __tep_data2host4(pevent, *(unsigned int *)(ptr)) +#define tep_data2host8 (pevent, ptr) \ ({ \ unsigned long long __val; \ \ memcpy(&__val, (ptr), sizeof(unsigned long long)); \ - __data2host8(pevent, __val); \ + __tep_data2host8(pevent, __val); \ })static inline int tep_host_bigendian (void )
tools/perf/util/trace-event-read.c +2 -2
@@ -102,7 +102,7 @@ static unsigned int read4(struct tep_handle *pevent)if (do_read (&data,4 ) <0 )return 0 ; -return __data2host4 (pevent, data); +return __tep_data2host4 (pevent, data); }static unsigned long long read8 (struct tep_handle *pevent)
@@ -111,7 +111,7 @@ static unsigned long long read8(struct tep_handle *pevent)if (do_read (&data,8 ) <0 )return 0 ; -return __data2host8 (pevent, data); +return __tep_data2host8 (pevent, data); }static char *read_string (void )
Signature · 1 line
2.18.0
PATCH 11/15 tools/lib/traceevent: Add prefix tep_ to various structs filter_arg_*.
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to to various structs filter_arg_*..
--- tools/lib/traceevent/event-parse.h | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-)
tools/lib/traceevent/event-parse.h +24 -24
@@ -827,15 +827,15 @@ enum tep_filter_value_type {struct tep_filter_arg ; -struct filter_arg_boolean { +struct tep_filter_arg_boolean {enum tep_filter_boolean_type value; }; -struct filter_arg_field { -struct tep_format_field *field; +struct tep_filter_arg_field { +struct tep_format_field *field; }; -struct filter_arg_value { +struct tep_filter_arg_value {enum tep_filter_value_type type;union {char *str;
@@ -843,42 +843,42 @@ struct filter_arg_value { }; }; -struct filter_arg_op { -enum tep_filter_op_type type; -struct tep_filter_arg *left; -struct tep_filter_arg *right; +struct tep_filter_arg_op { +enum tep_filter_op_type type; +struct tep_filter_arg *left; +struct tep_filter_arg *right; }; -struct filter_arg_exp { +struct tep_filter_arg_exp {enum tep_filter_exp_type type;struct tep_filter_arg *left;struct tep_filter_arg *right; }; -struct filter_arg_num { +struct tep_filter_arg_num {enum tep_filter_cmp_type type; -struct tep_filter_arg *left; -struct tep_filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; }; -struct filter_arg_str { +struct tep_filter_arg_str {enum tep_filter_cmp_type type; -struct tep_format_field *field; -char *val; -char *buffer; -regex_t reg; +struct tep_format_field *field; +char *val; +char *buffer; +regex_t reg; };struct tep_filter_arg {enum tep_filter_arg_type type;union { -struct filter_arg_boolean boolean; -struct filter_arg_field field; -struct filter_arg_value value; -struct filter_arg_op op; -struct filter_arg_exp exp; -struct filter_arg_num num; -struct filter_arg_str str; +struct tep_filter_arg_boolean boolean; +struct tep_filter_arg_field field; +struct tep_filter_arg_value value; +struct tep_filter_arg_op op; +struct tep_filter_arg_exp exp; +struct tep_filter_arg_num num; +struct tep_filter_arg_str str; }; };
Signature · 1 line
2.18.0
PATCH 4/15 tools/lib/traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 enum event_type to enum tep_event_type, enum event_sort_type to enum tep_event_sort_type and add prefix TEP_ to all enum's members
--- tools/lib/traceevent/event-parse.c | 488 ++++++++++++++-------------- tools/lib/traceevent/event-parse.h | 34 +- tools/lib/traceevent/parse-filter.c | 36 +- 3 files changed, 279 insertions(+), 279 deletions(-)
tools/lib/traceevent/event-parse.c +244 -244
@@ -770,12 +770,12 @@ static int add_event(struct tep_handle *pevent, struct tep_event_format *event)return 0 ; } -static int event_item_type (enum event_type type) +static int event_item_type (enum tep_event_type type) {switch (type) { - case EVENT_ITEM ... EVENT_SQUOTE: + case TEP_EVENT_ITEM ... TEP_EVENT_SQUOTE:return 1 ; - case EVENT_ERROR ... EVENT_DELIM: + case TEP_EVENT_ERROR ... TEP_EVENT_DELIM:default :return 0 ; }
@@ -863,24 +863,24 @@ static void free_arg(struct print_arg *arg)free (arg); } -static enum event_type get_type (int ch) +static enum tep_event_type get_type (int ch) {if (ch =='\n' ) -return EVENT_NEWLINE ; +return TEP_EVENT_NEWLINE ;if (isspace (ch)) -return EVENT_SPACE ; +return TEP_EVENT_SPACE ;if (isalnum (ch) || ch =='_' ) -return EVENT_ITEM ; +return TEP_EVENT_ITEM ;if (ch =='\'' ) -return EVENT_SQUOTE ; +return TEP_EVENT_SQUOTE ;if (ch =='"' ) -return EVENT_DQUOTE ; +return TEP_EVENT_DQUOTE ;if (!isprint (ch)) -return EVENT_NONE ; +return TEP_EVENT_NONE ;if (ch =='(' || ch ==')' || ch ==',' ) -return EVENT_DELIM ; +return TEP_EVENT_DELIM ; -return EVENT_OP ; +return TEP_EVENT_OP ; }static int __read_char (void )
@@ -928,38 +928,38 @@ static int extend_token(char **tok, char *buf, int size)return 0 ; } -static enum event_type force_token (const char *str,char **tok); +static enum tep_event_type force_token (const char *str,char **tok); -static enum event_type __read_token (char **tok) +static enum tep_event_type __read_token (char **tok) {char buf[BUFSIZ ];int ch, last_ch, quote_ch, next_ch;int i =0 ;int tok_size =0 ; -enum event_type type; +enum tep_event_type type; *tok =NULL ; ch =__read_char ();if (ch <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; type =get_type (ch); -if (type ==EVENT_NONE ) +if (type ==TEP_EVENT_NONE )return type; buf[i++] = ch;switch (type) { -case EVENT_NEWLINE : -case EVENT_DELIM : +case TEP_EVENT_NEWLINE : +case TEP_EVENT_DELIM :if (asprintf (tok,"%c" , ch) <0 ) -return EVENT_ERROR ; +return TEP_EVENT_ERROR ;return type; -case EVENT_OP : +case TEP_EVENT_OP :switch (ch) {case '-' : next_ch =__peek_char ();
@@ -1002,8 +1002,8 @@ static enum event_type __read_token(char **tok) buf[i++] =__read_char (); goto out; -case EVENT_DQUOTE : -case EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_SQUOTE :/* don't keep quotes */ i--; quote_ch = ch;
@@ -1015,7 +1015,7 @@ static enum event_type __read_token(char **tok) tok_size +=BUFSIZ ;if (extend_token (tok, buf, tok_size) <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; i =0 ; } last_ch = ch;
@@ -1032,7 +1032,7 @@ static enum event_type __read_token(char **tok)* For strings (double quotes) check the next token. * If it is another string, concatinate the two. */ -if (type ==EVENT_DQUOTE ) { +if (type ==TEP_EVENT_DQUOTE ) {unsigned long long save_input_buf_ptr = input_buf_ptr; do {
@@ -1045,8 +1045,8 @@ static enum event_type __read_token(char **tok) goto out; - case EVENT_ERROR ... EVENT_SPACE: -case EVENT_ITEM : + case TEP_EVENT_ERROR ... TEP_EVENT_SPACE: +case TEP_EVENT_ITEM :default :break ; }
@@ -1057,7 +1057,7 @@ static enum event_type __read_token(char **tok) tok_size +=BUFSIZ ;if (extend_token (tok, buf, tok_size) <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; i =0 ; } ch =__read_char ();
@@ -1067,9 +1067,9 @@ static enum event_type __read_token(char **tok) out: buf[i] =0 ;if (extend_token (tok, buf, tok_size + i +1 ) <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; -if (type ==EVENT_ITEM ) { +if (type ==TEP_EVENT_ITEM ) {/* * Older versions of the kernel has a bug that * creates invalid symbols and will break the mac80211
@@ -1096,12 +1096,12 @@ static enum event_type __read_token(char **tok)return type; } -static enum event_type force_token (const char *str,char **tok) +static enum tep_event_type force_token (const char *str,char **tok) {const char *save_input_buf;unsigned long long save_input_buf_ptr;unsigned long long save_input_buf_siz; -enum event_type type; +enum tep_event_type type;/* save off the current input pointers */ save_input_buf = input_buf;
@@ -1126,13 +1126,13 @@ static void free_token(char *tok)free (tok); } -static enum event_type read_token (char **tok) +static enum tep_event_type read_token (char **tok) { -enum event_type type; +enum tep_event_type type;for (;;) { type =__read_token (tok); -if (type !=EVENT_SPACE ) +if (type !=TEP_EVENT_SPACE )return type;free_token (*tok);
@@ -1140,7 +1140,7 @@ static enum event_type read_token(char **tok)/* not reached */ *tok =NULL ; -return EVENT_NONE ; +return TEP_EVENT_NONE ; }/**
@@ -1152,7 +1152,7 @@ static enum event_type read_token(char **tok)* * Returns the token type. */ -enum event_type tep_read_token (char **tok) +enum tep_event_type tep_read_token (char **tok) {return read_token (tok); }
@@ -1167,13 +1167,13 @@ void tep_free_token(char *token) }/* no newline */ -static enum event_type read_token_item (char **tok) +static enum tep_event_type read_token_item (char **tok) { -enum event_type type; +enum tep_event_type type;for (;;) { type =__read_token (tok); -if (type !=EVENT_SPACE && type !=EVENT_NEWLINE ) +if (type !=TEP_EVENT_SPACE && type !=TEP_EVENT_NEWLINE )return type;free_token (*tok); *tok =NULL ;
@@ -1181,10 +1181,10 @@ static enum event_type read_token_item(char **tok)/* not reached */ *tok =NULL ; -return EVENT_NONE ; +return TEP_EVENT_NONE ; } -static int test_type (enum event_type type,enum event_type expect) +static int test_type (enum tep_event_type type,enum tep_event_type expect) {if (type != expect) { do_warning("Error: expected type %d but read %d",
@@ -1194,8 +1194,8 @@ static int test_type(enum event_type type, enum event_type expect)return 0 ; } -static int test_type_token (enum event_type type,const char *token, -enum event_type expect,const char *expect_tok) +static int test_type_token (enum tep_event_type type,const char *token, +enum tep_event_type expect,const char *expect_tok) {if (type != expect) { do_warning("Error: expected type %d but read %d",
@@ -1211,9 +1211,9 @@ static int test_type_token(enum event_type type, const char *token,return 0 ; } -static int __read_expect_type (enum event_type expect,char **tok,int newline_ok) +static int __read_expect_type (enum tep_event_type expect,char **tok,int newline_ok) { -enum event_type type; +enum tep_event_type type;if (newline_ok) type =read_token (tok);
@@ -1222,15 +1222,15 @@ static int __read_expect_type(enum event_type expect, char **tok, int newline_okreturn test_type (type, expect); } -static int read_expect_type (enum event_type expect,char **tok) +static int read_expect_type (enum tep_event_type expect,char **tok) {return __read_expect_type (expect, tok,1 ); } -static int __read_expected (enum event_type expect,const char *str, +static int __read_expected (enum tep_event_type expect,const char *str,int newline_ok) { -enum event_type type; +enum tep_event_type type;char *token;int ret;
@@ -1246,12 +1246,12 @@ static int __read_expected(enum event_type expect, const char *str,return ret; } -static int read_expected (enum event_type expect,const char *str) +static int read_expected (enum tep_event_type expect,const char *str) {return __read_expected (expect, str,1 ); } -static int read_expected_item (enum event_type expect,const char *str) +static int read_expected_item (enum tep_event_type expect,const char *str) {return __read_expected (expect, str,0 ); }
@@ -1260,13 +1260,13 @@ static char *event_read_name(void) {char *token; -if (read_expected (EVENT_ITEM ,"name" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"name" ) <0 )return NULL ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return NULL ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail;return token;
@@ -1281,13 +1281,13 @@ static int event_read_id(void)char *token;int id; -if (read_expected_item (EVENT_ITEM ,"ID" ) <0 ) +if (read_expected_item (TEP_EVENT_ITEM ,"ID" ) <0 )return -1 ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return -1 ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; id =strtoul (token,NULL ,0 );
@@ -1357,7 +1357,7 @@ static unsigned int type_size(const char *name)static int event_read_fields (struct tep_event_format *event,struct tep_format_field **fields) {struct tep_format_field *field =NULL ; -enum event_type type; +enum tep_event_type type;char *token;char *last_token;int count =0 ;
@@ -1366,14 +1366,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_funsigned int size_dynamic =0 ; type =read_token (&token); -if (type ==EVENT_NEWLINE ) { +if (type ==TEP_EVENT_NEWLINE ) {free_token (token);return count; } count++; -if (test_type_token (type, token,EVENT_ITEM ,"field" )) +if (test_type_token (type, token,TEP_EVENT_ITEM ,"field" )) goto fail;free_token (token);
@@ -1383,16 +1383,16 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* Just ignore it. */ if (event->flags &EVENT_FL_ISFTRACE && - type ==EVENT_ITEM &&strcmp (token,"special" ) ==0 ) { + type ==TEP_EVENT_ITEM &&strcmp (token,"special" ) ==0 ) {free_token (token); type =read_token (&token); } -if (test_type_token (type, token,EVENT_OP ,":" ) <0 ) +if (test_type_token (type, token,TEP_EVENT_OP ,":" ) <0 ) goto fail;free_token (token); -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; last_token = token;
@@ -1406,14 +1406,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f/* read the rest of the type */ for (;;) { type =read_token (&token); -if (type ==EVENT_ITEM || - (type ==EVENT_OP &&strcmp (token,"*" ) ==0 ) || +if (type ==TEP_EVENT_ITEM || + (type ==TEP_EVENT_OP &&strcmp (token,"*" ) ==0 ) ||/* * Some of the ftrace fields are broken and have * an illegal "." in them. */ (event->flags &EVENT_FL_ISFTRACE && - type ==EVENT_OP &&strcmp (token,"." ) ==0 )) { + type ==TEP_EVENT_OP &&strcmp (token,"." ) ==0 )) {if (strcmp (token,"*" ) ==0 ) field->flags |=TEP_FIELD_IS_POINTER ;
@@ -1446,11 +1446,11 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f } field->name = field->alias = last_token; -if (test_type (type,EVENT_OP )) +if (test_type (type,TEP_EVENT_OP )) goto fail;if (strcmp (token,"[" ) ==0 ) { -enum event_type last_type = type; +enum tep_event_type last_type = type;char *brackets = token;char *new_brackets;int len;
@@ -1459,14 +1459,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f type =read_token (&token); -if (type ==EVENT_ITEM ) +if (type ==TEP_EVENT_ITEM ) field->arraylen =strtoul (token,NULL ,0 );else field->arraylen =0 ;while (strcmp (token,"]" ) !=0 ) { -if (last_type ==EVENT_ITEM && - type ==EVENT_ITEM ) +if (last_type ==TEP_EVENT_ITEM && + type ==TEP_EVENT_ITEM ) len =2 ;else len =1 ;
@@ -1487,7 +1487,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f field->arraylen =strtoul (token,NULL ,0 );free_token (token); type =read_token (&token); -if (type ==EVENT_NONE ) { +if (type ==TEP_EVENT_NONE ) {do_warning_event (event,"failed to find token" ); goto fail; }
@@ -1510,7 +1510,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* If the next token is not an OP, then it is of * the format: type [] item; */ -if (type ==EVENT_ITEM ) { +if (type ==TEP_EVENT_ITEM ) {char *new_type; new_type = realloc(field->type, strlen(field->type) +
@@ -1550,60 +1550,60 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_fif (field_is_long (field)) field->flags |=TEP_FIELD_IS_LONG ; -if (test_type_token (type, token,EVENT_OP ,";" )) +if (test_type_token (type, token,TEP_EVENT_OP ,";" )) goto fail;free_token (token); -if (read_expected (EVENT_ITEM ,"offset" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"offset" ) <0 ) goto fail_expect; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail; field->offset =strtoul (token,NULL ,0 );free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 ) goto fail_expect; -if (read_expected (EVENT_ITEM ,"size" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"size" ) <0 ) goto fail_expect; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail; field->size =strtoul (token,NULL ,0 );free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 ) goto fail_expect; type =read_token (&token); -if (type !=EVENT_NEWLINE ) { +if (type !=TEP_EVENT_NEWLINE ) {/* newer versions of the kernel have a "signed" type */ -if (test_type_token (type, token,EVENT_ITEM ,"signed" )) +if (test_type_token (type, token,TEP_EVENT_ITEM ,"signed" )) goto fail;free_token (token); -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail;if (strtoul (token,NULL ,0 )) field->flags |=TEP_FIELD_IS_SIGNED ;free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_NEWLINE , &token)) +if (read_expect_type (TEP_EVENT_NEWLINE , &token)) goto fail; }
@@ -1646,13 +1646,13 @@ static int event_read_format(struct tep_event_format *event)char *token;int ret; -if (read_expected_item (EVENT_ITEM ,"format" ) <0 ) +if (read_expected_item (TEP_EVENT_ITEM ,"format" ) <0 )return -1 ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return -1 ; -if (read_expect_type (EVENT_NEWLINE , &token)) +if (read_expect_type (TEP_EVENT_NEWLINE , &token)) goto fail;free_token (token);
@@ -1673,14 +1673,14 @@ static int event_read_format(struct tep_event_format *event)return -1 ; } -static enum event_type +static enum tep_event_type process_arg_token (struct tep_event_format *event,struct print_arg *arg, -char **tok,enum event_type type); +char **tok,enum tep_event_type type); -static enum event_type +static enum tep_event_type process_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *token; type =read_token (&token);
@@ -1689,32 +1689,32 @@ process_arg(struct tep_event_format *event, struct print_arg *arg, char **tok)return process_arg_token (event, arg, tok, type); } -static enum event_type +static enum tep_event_type process_op (struct tep_event_format *event,struct print_arg *arg,char **tok);/* * For __print_symbolic() and __print_flags, we need to completely * evaluate the first argument, which defines what to print next. */ -static enum event_type +static enum tep_event_type process_field_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type; type =process_arg (event, arg, tok); -while (type ==EVENT_OP ) { +while (type ==TEP_EVENT_OP ) { type =process_op (event, arg, tok); }return type; } -static enum event_type +static enum tep_event_type process_cond (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg, *left, *right; -enum event_type type; +enum tep_event_type type;char *token =NULL ; arg =alloc_arg ();
@@ -1737,16 +1737,16 @@ process_cond(struct tep_event_format *event, struct print_arg *top, char **tok) type =process_arg (event, left, &token); again: -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free;/* Handle other operations in the arguments */ -if (type ==EVENT_OP &&strcmp (token,":" ) !=0 ) { +if (type ==TEP_EVENT_OP &&strcmp (token,":" ) !=0 ) { type =process_op (event, left, &token); goto again; } -if (test_type_token (type, token,EVENT_OP ,":" )) +if (test_type_token (type, token,TEP_EVENT_OP ,":" )) goto out_free; arg->op.op = token;
@@ -1763,14 +1763,14 @@ process_cond(struct tep_event_format *event, struct print_arg *top, char **tok) top->op.right =NULL ;free_token (token);free_arg (arg); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_array (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg; -enum event_type type; +enum tep_event_type type;char *token =NULL ; arg =alloc_arg ();
@@ -1778,12 +1778,12 @@ process_array(struct tep_event_format *event, struct print_arg *top, char **tok)do_warning_event (event,"%s: not enough memory!" , __func__);/* '*tok' is set to top->op.op. No need to free. */ *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } *tok =NULL ; type =process_arg (event, arg, &token); -if (test_type_token (type, token,EVENT_OP ,"]" )) +if (test_type_token (type, token,TEP_EVENT_OP ,"]" )) goto out_free; top->op.right = arg;
@@ -1797,7 +1797,7 @@ process_array(struct tep_event_format *event, struct print_arg *top, char **tok) out_free:free_token (token);free_arg (arg); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }static int get_op_prio (char *op)
@@ -1868,11 +1868,11 @@ static int set_op_prio(struct print_arg *arg) }/* Note, *tok does not get freed, but will most likely be saved */ -static enum event_type +static enum tep_event_type process_op (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *left, *right =NULL ; -enum event_type type; +enum tep_event_type type;char *token;/* the op is passed in via tok */
@@ -1974,7 +1974,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok)/* could just be a type pointer */ if ((strcmp (arg->op.op,"*" ) ==0 ) && - type ==EVENT_DELIM && (strcmp (token,")" ) ==0 )) { + type ==TEP_EVENT_DELIM && (strcmp (token,")" ) ==0 )) {char *new_atom;if (left->type !=PRINT_ATOM ) {
@@ -2000,7 +2000,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) goto out_warn_free; type =process_arg_token (event, right, tok, type); -if (type ==EVENT_ERROR ) { +if (type ==TEP_EVENT_ERROR ) {free_arg (right);/* token was freed in process_arg_token() via *tok */ token =NULL ;
@@ -2047,7 +2047,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) goto out_free; } -if (type ==EVENT_OP &&strcmp (*tok,":" ) !=0 ) { +if (type ==TEP_EVENT_OP &&strcmp (*tok,":" ) !=0 ) {int prio;/* higher prios need to be closer to the root */
@@ -2066,21 +2066,21 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_entry (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *field;char *token; -if (read_expected (EVENT_OP ,"->" ) <0 ) +if (read_expected (TEP_EVENT_OP ,"->" ) <0 ) goto out_err; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; field = token;
@@ -2106,14 +2106,14 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *afree_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }static int alloc_and_process_delim (struct tep_event_format *event,char *next_token,struct print_arg **print_arg) {struct print_arg *field; -enum event_type type; +enum tep_event_type type;char *token;int ret =0 ;
@@ -2126,7 +2126,7 @@ static int alloc_and_process_delim(struct tep_event_format *event, char *next_to type =process_arg (event, field, &token); -if (test_type_token (type, token,EVENT_DELIM , next_token)) { +if (test_type_token (type, token,TEP_EVENT_DELIM , next_token)) { errno =EINVAL ; ret =-1 ;free_arg (field);
@@ -2443,10 +2443,10 @@ static char *arg_eval (struct print_arg *arg)return NULL ; } -static enum event_type +static enum tep_event_type process_fields (struct tep_event_format *event,struct print_flag_sym **list,char **tok) { -enum event_type type; +enum tep_event_type type;struct print_arg *arg =NULL ;struct print_flag_sym *field;char *token = *tok;
@@ -2455,7 +2455,7 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, cha do { free_token(token); type = read_token_item(&token); - if (test_type_token(type, token, EVENT_OP, "{")) + if (test_type_token(type, token, TEP_EVENT_OP, "{")) break; arg = alloc_arg();
@@ -2465,13 +2465,13 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); type =process_arg (event, arg, &token); -if (type ==EVENT_OP ) +if (type ==TEP_EVENT_OP ) type =process_op (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free; -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free; field =calloc (1 ,sizeof (*field));
@@ -2492,7 +2492,7 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); type =process_arg (event, arg, &token); -if (test_type_token (type, token,EVENT_OP ,"}" )) +if (test_type_token (type, token,TEP_EVENT_OP ,"}" )) goto out_free_field; value =arg_eval (arg);
@@ -2509,7 +2509,7 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); type =read_token_item (&token); - }while (type ==EVENT_DELIM &&strcmp (token,"," ) ==0 ); + }while (type ==TEP_EVENT_DELIM &&strcmp (token,"," ) ==0 ); *tok = token;return type;
@@ -2521,14 +2521,14 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_flags (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field; -enum event_type type; +enum tep_event_type type;char *token =NULL ;memset (arg,0 ,sizeof (*arg));
@@ -2543,10 +2543,10 @@ process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok) type =process_field_arg (event, field, &token);/* Handle operations in the first argument */ -while (type ==EVENT_OP ) +while (type ==TEP_EVENT_OP ) type =process_op (event, field, &token); -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free_field;free_token (token);
@@ -2558,11 +2558,11 @@ process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok) type =read_token_item (&token); } -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free; type =process_fields (event, &arg->flags.flags, &token); -if (test_type_token (type, token,EVENT_DELIM ,")" )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,")" )) goto out_free;free_token (token);
@@ -2574,14 +2574,14 @@ process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok) out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_symbols (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field; -enum event_type type; +enum tep_event_type type;char *token =NULL ;memset (arg,0 ,sizeof (*arg));
@@ -2595,13 +2595,13 @@ process_symbols(struct tep_event_format *event, struct print_arg *arg, char **to type =process_field_arg (event, field, &token); -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free_field; arg->symbol.field = field; type =process_fields (event, &arg->symbol.symbols, &token); -if (test_type_token (type, token,EVENT_DELIM ,")" )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,")" )) goto out_free;free_token (token);
@@ -2613,10 +2613,10 @@ process_symbols(struct tep_event_format *event, struct print_arg *arg, char **to out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_hex_common (struct tep_event_format *event,struct print_arg *arg,char **tok,enum print_arg_type type) {
@@ -2636,23 +2636,23 @@ process_hex_common(struct tep_event_format *event, struct print_arg *arg, arg->hex.field =NULL ; out: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_hex (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX ); } -static enum event_type +static enum tep_event_type process_hex_str (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX_STR ); } -static enum event_type +static enum tep_event_type process_int_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg));
@@ -2677,14 +2677,14 @@ process_int_array(struct tep_event_format *event, struct print_arg *arg, char ** arg->int_array.field =NULL ; out: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct tep_format_field *field; -enum event_type type; +enum tep_event_type type;char *token;memset (arg,0 ,sizeof (*arg));
@@ -2696,7 +2696,7 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha*/ type =read_token (&token); *tok = token; -if (type !=EVENT_ITEM ) +if (type !=TEP_EVENT_ITEM ) goto out_free;/* Find the field */
@@ -2708,13 +2708,13 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha arg->dynarray.field = field; arg->dynarray.index =0 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_free;free_token (token); type =read_token_item (&token); *tok = token; -if (type !=EVENT_OP ||strcmp (token,"[" ) !=0 ) +if (type !=TEP_EVENT_OP ||strcmp (token,"[" ) !=0 )return type;free_token (token);
@@ -2722,14 +2722,14 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, chaif (!arg) {do_warning_event (event,"%s: not enough memory!" , __func__); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } type =process_arg (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free_arg; -if (!test_type_token (type, token,EVENT_OP ,"]" )) +if (!test_type_token (type, token,TEP_EVENT_OP ,"]" )) goto out_free_arg;free_token (token);
@@ -2741,18 +2741,18 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_dynamic_array_len (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct tep_format_field *field; -enum event_type type; +enum tep_event_type type;char *token; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; arg->type =PRINT_DYNAMIC_ARRAY_LEN ;
@@ -2765,7 +2765,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, arg->dynarray.field = field; arg->dynarray.index =0 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_err; type =read_token (&token);
@@ -2777,28 +2777,28 @@ process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg,free_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_paren (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *item_arg; -enum event_type type; +enum tep_event_type type;char *token; type =process_arg (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free; -if (type ==EVENT_OP ) +if (type ==TEP_EVENT_OP ) type =process_op (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free; -if (test_type_token (type, token,EVENT_DELIM ,")" )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,")" )) goto out_free;free_token (token);
@@ -2809,7 +2809,7 @@ process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok)* this was a typecast. */ if (event_item_type (type) || - (type ==EVENT_DELIM &&strcmp (token,"(" ) ==0 )) { + (type ==TEP_EVENT_DELIM &&strcmp (token,"(" ) ==0 )) {/* make this a typecast and contine */
@@ -2839,25 +2839,25 @@ process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok) out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_str (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *token; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; arg->type =PRINT_STRING ; arg->string.string = token; arg->string.offset =-1 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_err; type =read_token (&token);
@@ -2869,24 +2869,24 @@ process_str(struct tep_event_format *event __maybe_unused, struct print_arg *argfree_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_bitmask (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *token; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; arg->type =PRINT_BITMASK ; arg->bitmask.bitmask = token; arg->bitmask.offset =-1 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_err; type =read_token (&token);
@@ -2898,7 +2898,7 @@ process_bitmask(struct tep_event_format *event __maybe_unused, struct print_argfree_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } static struct tep_function_handler *
@@ -2933,13 +2933,13 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) } } -static enum event_type +static enum tep_event_type process_func_handler (struct tep_event_format *event,struct tep_function_handler *func,struct print_arg *arg,char **tok) {struct print_arg **next_arg;struct print_arg *farg; -enum event_type type; +enum tep_event_type type;char *token;int i;
@@ -2954,12 +2954,12 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handlerif (!farg) {do_warning_event (event,"%s: not enough memory!" , __func__); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } type =process_arg (event, farg, &token);if (i < (func->nr_args -1 )) { -if (type !=EVENT_DELIM ||strcmp (token,"," ) !=0 ) { +if (type !=TEP_EVENT_DELIM ||strcmp (token,"," ) !=0 ) { do_warning_event(event, "Error: function '%s()' expects %d arguments but event %s only uses %d", func->name, func->nr_args,
@@ -2967,7 +2967,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler goto err; } }else { -if (type !=EVENT_DELIM ||strcmp (token,")" ) !=0 ) { +if (type !=TEP_EVENT_DELIM ||strcmp (token,")" ) !=0 ) {do_warning_event (event,"Error: function '%s()' only expects %d arguments but event %s has more" , func->name, func->nr_args, event->name);
@@ -2988,10 +2988,10 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler err:free_arg (farg);free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_function (struct tep_event_format *event,struct print_arg *arg,char *token,char **tok) {
@@ -3044,12 +3044,12 @@ process_function(struct tep_event_format *event, struct print_arg *arg,do_warning_event (event,"function %s not defined" , token);free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_arg_token (struct tep_event_format *event,struct print_arg *arg, -char **tok,enum event_type type) +char **tok,enum tep_event_type type) {char *token;char *atom;
@@ -3057,7 +3057,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg, token = *tok;switch (type) { -case EVENT_ITEM : +case TEP_EVENT_ITEM :if (strcmp (token,"REC" ) ==0 ) {free_token (token); type =process_entry (event, arg, &token);
@@ -3071,7 +3071,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,* If the next token is a parenthesis, then this * is a function. */ -if (type ==EVENT_DELIM &&strcmp (token,"(" ) ==0 ) { +if (type ==TEP_EVENT_DELIM &&strcmp (token,"(" ) ==0 ) {free_token (token); token =NULL ;/* this will free atom. */
@@ -3079,7 +3079,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,break ; }/* atoms can be more than one token long */ -while (type ==EVENT_ITEM ) { +while (type ==TEP_EVENT_ITEM ) {char *new_atom; new_atom =realloc (atom,strlen (atom) +strlen (token) +2 );
@@ -3087,7 +3087,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,free (atom); *tok =NULL ;free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } atom = new_atom;strcat (atom," " );
@@ -3100,19 +3100,19 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg, arg->atom.atom = atom;break ; -case EVENT_DQUOTE : -case EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_SQUOTE : arg->type =PRINT_ATOM ; arg->atom.atom = token; type =read_token_item (&token);break ; -case EVENT_DELIM : +case TEP_EVENT_DELIM :if (strcmp (token,"(" ) ==0 ) {free_token (token); type =process_paren (event, arg, &token);break ; } -case EVENT_OP : +case TEP_EVENT_OP :/* handle single ops */ arg->type =PRINT_OP ; arg->op.op = token;
@@ -3120,16 +3120,16 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg, type =process_op (event, arg, &token);/* On error, the op is freed */ -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) arg->op.op =NULL ;/* return error type if errored */ break ; - case EVENT_ERROR ... EVENT_NEWLINE: + case TEP_EVENT_ERROR ... TEP_EVENT_NEWLINE:default :do_warning_event (event,"unexpected type %d" , type); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } *tok = token;
@@ -3138,13 +3138,13 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,static int event_read_print_args (struct tep_event_format *event,struct print_arg **list) { -enum event_type type =EVENT_ERROR ; +enum tep_event_type type =TEP_EVENT_ERROR ;struct print_arg *arg;char *token;int args =0 ; do { - if (type == EVENT_NEWLINE) { + if (type == TEP_EVENT_NEWLINE) { type = read_token_item(&token); continue; }
@@ -3158,7 +3158,7 @@ static int event_read_print_args(struct tep_event_format *event, struct print_ar type =process_arg (event, arg, &token); -if (type ==EVENT_ERROR ) { +if (type ==TEP_EVENT_ERROR ) {free_token (token);free_arg (arg);return -1 ;
@@ -3167,10 +3167,10 @@ static int event_read_print_args(struct tep_event_format *event, struct print_ar *list = arg; args++; -if (type ==EVENT_OP ) { +if (type ==TEP_EVENT_OP ) { type =process_op (event, arg, &token);free_token (token); -if (type ==EVENT_ERROR ) { +if (type ==TEP_EVENT_ERROR ) { *list =NULL ;free_arg (arg);return -1 ;
@@ -3179,16 +3179,16 @@ static int event_read_print_args(struct tep_event_format *event, struct print_arcontinue ; } -if (type ==EVENT_DELIM &&strcmp (token,"," ) ==0 ) { +if (type ==TEP_EVENT_DELIM &&strcmp (token,"," ) ==0 ) {free_token (token); *list = arg; list = &arg->next;continue ; }break ; - }while (type !=EVENT_NONE ); + }while (type !=TEP_EVENT_NONE ); -if (type !=EVENT_NONE && type !=EVENT_ERROR ) +if (type !=TEP_EVENT_NONE && type !=TEP_EVENT_ERROR )free_token (token);return args;
@@ -3196,20 +3196,20 @@ static int event_read_print_args(struct tep_event_format *event, struct print_arstatic int event_read_print (struct tep_event_format *event) { -enum event_type type; +enum tep_event_type type;char *token;int ret; -if (read_expected_item (EVENT_ITEM ,"print" ) <0 ) +if (read_expected_item (TEP_EVENT_ITEM ,"print" ) <0 )return -1 ; -if (read_expected (EVENT_ITEM ,"fmt" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"fmt" ) <0 )return -1 ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return -1 ; -if (read_expect_type (EVENT_DQUOTE , &token) <0 ) +if (read_expect_type (TEP_EVENT_DQUOTE , &token) <0 ) goto fail; concat:
@@ -3219,11 +3219,11 @@ static int event_read_print(struct tep_event_format *event)/* ok to have no arg */ type =read_token_item (&token); -if (type ==EVENT_NONE ) +if (type ==TEP_EVENT_NONE )return 0 ;/* Handle concatenation of print lines */ -if (type ==EVENT_DQUOTE ) { +if (type ==TEP_EVENT_DQUOTE ) {char *cat;if (asprintf (&cat,"%s%s" , event->print_fmt.format, token) <0 )
@@ -3235,7 +3235,7 @@ static int event_read_print(struct tep_event_format *event) goto concat; } -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto fail;free_token (token);
@@ -5617,7 +5617,7 @@ static int events_system_cmp(const void *a, const void *b)return events_id_cmp (a, b); } -struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) +struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum tep_event_sort_type sort_type) {struct tep_event_format **events;int (*sort)(const void *a,const void *b);
@@ -5638,20 +5638,20 @@ struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_ pevent->sort_events = events;/* the internal events are sorted by id */ -if (sort_type ==EVENT_SORT_ID ) { +if (sort_type ==TEP_EVENT_SORT_ID ) { pevent->last_type = sort_type;return events; } }switch (sort_type) { -case EVENT_SORT_ID : +case TEP_EVENT_SORT_ID : sort = events_id_cmp;break ; -case EVENT_SORT_NAME : +case TEP_EVENT_SORT_NAME : sort = events_name_cmp;break ; -case EVENT_SORT_SYSTEM : +case TEP_EVENT_SORT_SYSTEM : sort = events_system_cmp;break ;default :
@@ -5834,13 +5834,13 @@ static void parse_header_field(const char *field, save_input_buf_ptr = input_buf_ptr; save_input_buf_siz = input_buf_siz; -if (read_expected (EVENT_ITEM ,"field" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"field" ) <0 )return ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ;/* type */ -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail;free_token (token);
@@ -5848,42 +5848,42 @@ static void parse_header_field(const char *field,* If this is not a mandatory field, then test it first. */ if (mandatory) { -if (read_expected (EVENT_ITEM , field) <0 ) +if (read_expected (TEP_EVENT_ITEM , field) <0 )return ; }else { -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail;if (strcmp (token, field) !=0 ) goto discard;free_token (token); } -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; -if (read_expected (EVENT_ITEM ,"offset" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"offset" ) <0 )return ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; *offset =atoi (token);free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; -if (read_expected (EVENT_ITEM ,"size" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"size" ) <0 )return ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; *size =atoi (token);free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; type =read_token (&token); -if (type !=EVENT_NEWLINE ) { +if (type !=TEP_EVENT_NEWLINE ) {/* newer versions of the kernel have a "signed" type */ -if (type !=EVENT_ITEM ) +if (type !=TEP_EVENT_ITEM ) goto fail;if (strcmp (token,"signed" ) !=0 )
@@ -5891,17 +5891,17 @@ static void parse_header_field(const char *field,free_token (token); -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail;free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; -if (read_expect_type (EVENT_NEWLINE , &token)) +if (read_expect_type (TEP_EVENT_NEWLINE , &token)) goto fail; } fail:
tools/lib/traceevent/event-parse.h +17 -17
@@ -301,22 +301,22 @@ enum {EVENT_FL_FAILED =0x80000000 }; -enum event_sort_type { -EVENT_SORT_ID , -EVENT_SORT_NAME , -EVENT_SORT_SYSTEM , +enum tep_event_sort_type { +TEP_EVENT_SORT_ID , +TEP_EVENT_SORT_NAME , +TEP_EVENT_SORT_SYSTEM , }; -enum event_type { -EVENT_ERROR , -EVENT_NONE , -EVENT_SPACE , -EVENT_NEWLINE , -EVENT_OP , -EVENT_DELIM , -EVENT_ITEM , -EVENT_DQUOTE , -EVENT_SQUOTE , +enum tep_event_type { +TEP_EVENT_ERROR , +TEP_EVENT_NONE , +TEP_EVENT_SPACE , +TEP_EVENT_NEWLINE , +TEP_EVENT_OP , +TEP_EVENT_DELIM , +TEP_EVENT_ITEM , +TEP_EVENT_DQUOTE , +TEP_EVENT_SQUOTE , }; typedef unsigned long long (*tep_func_handler)(struct trace_seq *s,
@@ -454,7 +454,7 @@ struct tep_handle {struct tep_event_format **events;int nr_events;struct tep_event_format **sort_events; -enum event_sort_type last_type; +enum tep_event_sort_type last_type;int type_offset;int type_size;
@@ -685,7 +685,7 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event,int tep_strerror (struct tep_handle *pevent,enum tep_errno errnum,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 tep_event_sort_type );struct tep_format_field **tep_event_common_fields (struct tep_event_format *event);struct tep_format_field **tep_event_fields (struct tep_event_format *event);
@@ -756,7 +756,7 @@ void tep_unref(struct tep_handle *pevent);/* access to the internal parser */ void tep_buffer_init (const char *buf,unsigned long long size); -enum event_type tep_read_token (char **tok); +enum tep_event_type tep_read_token (char **tok);void tep_free_token (char *token);int tep_peek_char (void );const char *tep_get_input_buf (void );
tools/lib/traceevent/parse-filter.c +18 -18
@@ -61,15 +61,15 @@ static void free_token(char *token)tep_free_token (token); } -static enum event_type read_token (char **tok) +static enum tep_event_type read_token (char **tok) { -enum event_type type; +enum tep_event_type type;char *token =NULL ;do {free_token (token); type =tep_read_token (&token); - }while (type ==EVENT_NEWLINE || type ==EVENT_SPACE ); + }while (type ==TEP_EVENT_NEWLINE || type ==TEP_EVENT_SPACE );/* If token is = or ! check to see if the next char is ~ */ if (token &&
@@ -79,7 +79,7 @@ static enum event_type read_token(char **tok) *tok =malloc (3 );if (*tok ==NULL ) {free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }sprintf (*tok,"%c%c" , *token,'~' );free_token (token);
@@ -334,7 +334,7 @@ static void free_events(struct event_list *events)static enum tep_errno create_arg_item (struct tep_event_format *event,const char *token, -enum event_type type,struct filter_arg **parg,char *error_str) +enum tep_event_type type,struct filter_arg **parg,char *error_str) {struct tep_format_field *field;struct filter_arg *arg;
@@ -347,11 +347,11 @@ create_arg_item(struct tep_event_format *event, const char *token,switch (type) { -case EVENT_SQUOTE : -case EVENT_DQUOTE : +case TEP_EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : arg->type =FILTER_ARG_VALUE ; arg->value.type = - type ==EVENT_DQUOTE ?FILTER_STRING :FILTER_CHAR ; + type ==TEP_EVENT_DQUOTE ?FILTER_STRING :FILTER_CHAR ; arg->value.str =strdup (token);if (!arg->value.str) {free_arg (arg);
@@ -359,7 +359,7 @@ create_arg_item(struct tep_event_format *event, const char *token,return TEP_ERRNO__MEM_ALLOC_FAILED ; }break ; -case EVENT_ITEM : +case TEP_EVENT_ITEM :/* if it is a number, then convert it */ if (isdigit (token[0 ])) { arg->type =FILTER_ARG_VALUE ;
@@ -942,7 +942,7 @@ static enum tep_errno process_filter(struct tep_event_format *event, struct filter_arg **parg, char *error_str, int not) { - enum event_type type; + enum tep_event_type type;char *token =NULL ;struct filter_arg *current_op =NULL ;struct filter_arg *current_exp =NULL ;
@@ -960,9 +960,9 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,free (token); type =read_token (&token);switch (type) { -case EVENT_SQUOTE : -case EVENT_DQUOTE : -case EVENT_ITEM : +case TEP_EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_ITEM : ret =create_arg_item (event, token, type, &arg, error_str);if (ret <0 ) goto fail;
@@ -987,7 +987,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, arg =NULL ;break ; -case EVENT_DELIM : +case TEP_EVENT_DELIM :if (*token ==',' ) {show_error (error_str,"Illegal token ','" ); ret =TEP_ERRNO__ILLEGAL_TOKEN ;
@@ -1054,7 +1054,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, }break ; -case EVENT_OP : +case TEP_EVENT_OP : op_type =process_op (token, &btype, &ctype, &etype);/* All expect a left arg except for NOT */
@@ -1139,14 +1139,14 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,if (ret <0 ) goto fail_syntax;break ; -case EVENT_NONE : +case TEP_EVENT_NONE :break ; -case EVENT_ERROR : +case TEP_EVENT_ERROR : goto fail_alloc;default : goto fail_syntax; } - }while (type !=EVENT_NONE ); + }while (type !=TEP_EVENT_NONE );if (!current_op && !current_exp) goto fail_syntax;
Signature · 1 line
2.18.0
PATCH 12/15 tools/lib/traceevent: Add prefix tep_ to structs filter_type and event_filter
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to structs filter_type and event_filter
--- tools/lib/traceevent/event-parse.h | 34 +++++----- tools/lib/traceevent/parse-filter.c | 96 ++++++++++++++--------------- 2 files changed, 65 insertions(+), 65 deletions(-)
tools/lib/traceevent/event-parse.h +17 -17
@@ -882,7 +882,7 @@ struct tep_filter_arg { }; }; -struct filter_type { +struct tep_filter_type {int event_id;struct tep_event_format *event;struct tep_filter_arg *filter;
@@ -890,14 +890,14 @@ struct filter_type {#define TEP_FILTER_ERROR_BUFSZ 1024 -struct event_filter { +struct tep_event_filter {struct tep_handle *pevent;int filters; -struct filter_type *event_filters; +struct tep_filter_type *event_filters;char error_buffer[TEP_FILTER_ERROR_BUFSZ ]; }; -struct event_filter *tep_filter_alloc (struct tep_handle *pevent); +struct tep_event_filter *tep_filter_alloc (struct tep_handle *pevent);/* for backward compatibility */ #define FILTER_NONE TEP_ERRNO__NO_FILTER
@@ -911,39 +911,39 @@ enum filter_trivial_type { FILTER_TRIVIAL_BOTH, }; -enum tep_errno tep_filter_add_filter_str (struct event_filter *filter, +enum tep_errno tep_filter_add_filter_str (struct tep_event_filter *filter,const char *filter_str); -enum tep_errno tep_filter_match (struct event_filter *filter, +enum tep_errno tep_filter_match (struct tep_event_filter *filter,struct tep_record *record); -int tep_filter_strerror (struct event_filter *filter,enum tep_errno err, +int tep_filter_strerror (struct tep_event_filter *filter,enum tep_errno err,char *buf,size_t buflen); -int tep_event_filtered (struct event_filter *filter, +int tep_event_filtered (struct tep_event_filter *filter,int event_id); -void tep_filter_reset (struct event_filter *filter); +void tep_filter_reset (struct tep_event_filter *filter); -int tep_filter_clear_trivial (struct event_filter *filter, +int tep_filter_clear_trivial (struct tep_event_filter *filter,enum filter_trivial_type type); -void tep_filter_free (struct event_filter *filter); +void tep_filter_free (struct tep_event_filter *filter); -char *tep_filter_make_string (struct event_filter *filter,int event_id); +char *tep_filter_make_string (struct tep_event_filter *filter,int event_id); -int tep_filter_remove_event (struct event_filter *filter, +int tep_filter_remove_event (struct tep_event_filter *filter,int event_id); -int tep_filter_event_has_trivial (struct event_filter *filter, +int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id,enum filter_trivial_type type); -int tep_filter_copy (struct event_filter *dest,struct event_filter *source); +int tep_filter_copy (struct tep_event_filter *dest,struct tep_event_filter *source); -int tep_update_trivial (struct event_filter *dest,struct event_filter *source, +int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source,enum filter_trivial_type type); -int tep_filter_compare (struct event_filter *filter1,struct event_filter *filter2); +int tep_filter_compare (struct tep_event_filter *filter1,struct tep_event_filter *filter2);#endif /* _PARSE_EVENTS_H */
tools/lib/traceevent/parse-filter.c +48 -48
286 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH 1/15 tools/lib/traceevent, tools/perf: Rename struct event_format to struct tep_event_format
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 event_format to struct tep_event_format
--- tools/lib/traceevent/event-parse.c | 186 +++++++++--------- tools/lib/traceevent/event-parse.h | 66 +++---- tools/lib/traceevent/parse-filter.c | 42 ++-- tools/lib/traceevent/plugin_function.c | 2 +- tools/lib/traceevent/plugin_hrtimer.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_kvm.c | 14 +- tools/lib/traceevent/plugin_mac80211.c | 4 +- tools/lib/traceevent/plugin_sched_switch.c | 4 +- tools/perf/builtin-trace.c | 2 +- tools/perf/util/evsel.h | 4 +- tools/perf/util/header.c | 2 +- tools/perf/util/python.c | 4 +- .../util/scripting-engines/trace-event-perl.c | 6 +- .../scripting-engines/trace-event-python.c | 8 +- tools/perf/util/trace-event-parse.c | 14 +- tools/perf/util/trace-event.c | 8 +- tools/perf/util/trace-event.h | 16 +- 18 files changed, 194 insertions(+), 194 deletions(-)
tools/lib/traceevent/event-parse.c +93 -93
@@ -95,7 +95,7 @@ struct tep_function_handler {static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct event_format *event,struct print_arg *arg); +struct tep_event_format *event,struct print_arg *arg);static void free_func_handle (struct tep_function_handler *func);
@@ -738,16 +738,16 @@ void tep_print_printk(struct tep_handle *pevent) } } -static struct event_format *alloc_event (void ) +static struct tep_event_format *alloc_event (void ) { -return calloc (1 ,sizeof (struct event_format )); +return calloc (1 ,sizeof (struct tep_event_format )); } -static int add_event (struct tep_handle *pevent,struct event_format *event) +static int add_event (struct tep_handle *pevent,struct tep_event_format *event) {int i; -struct event_format **events =realloc (pevent->events,sizeof (event) * - (pevent->nr_events +1 )); +struct tep_event_format **events =realloc (pevent->events,sizeof (event) * + (pevent->nr_events +1 ));if (!events)return -1 ;
@@ -1354,7 +1354,7 @@ static unsigned int type_size(const char *name)return 0 ; } -static int event_read_fields (struct event_format *event,struct format_field **fields) +static int event_read_fields (struct tep_event_format *event,struct format_field **fields) {struct format_field *field =NULL ;enum event_type type;
@@ -1641,7 +1641,7 @@ static int event_read_fields(struct event_format *event, struct format_field **freturn -1 ; } -static int event_read_format (struct event_format *event) +static int event_read_format (struct tep_event_format *event) {char *token;int ret;
@@ -1674,11 +1674,11 @@ static int event_read_format(struct event_format *event) }static enum event_type -process_arg_token (struct event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct print_arg *arg,char **tok,enum event_type type);static enum event_type -process_arg (struct event_format *event,struct print_arg *arg,char **tok) +process_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) {enum event_type type;char *token;
@@ -1690,14 +1690,14 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_op (struct event_format *event,struct print_arg *arg,char **tok); +process_op (struct tep_event_format *event,struct print_arg *arg,char **tok);/* * For __print_symbolic() and __print_flags, we need to completely * evaluate the first argument, which defines what to print next. */ static enum event_type -process_field_arg (struct event_format *event,struct print_arg *arg,char **tok) +process_field_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) {enum event_type type;
@@ -1711,7 +1711,7 @@ process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_cond (struct event_format *event,struct print_arg *top,char **tok) +process_cond (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg, *left, *right;enum event_type type;
@@ -1767,7 +1767,7 @@ process_cond(struct event_format *event, struct print_arg *top, char **tok) }static enum event_type -process_array (struct event_format *event,struct print_arg *top,char **tok) +process_array (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg;enum event_type type;
@@ -1869,7 +1869,7 @@ static int set_op_prio(struct print_arg *arg)/* Note, *tok does not get freed, but will most likely be saved */ static enum event_type -process_op (struct event_format *event,struct print_arg *arg,char **tok) +process_op (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *left, *right =NULL ;enum event_type type;
@@ -2070,7 +2070,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_entry (struct event_format *event__maybe_unused ,struct print_arg *arg, +process_entry (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) {enum event_type type;
@@ -2109,7 +2109,7 @@ process_entry(struct event_format *event __maybe_unused, struct print_arg *arg,return EVENT_ERROR ; } -static int alloc_and_process_delim (struct event_format *event,char *next_token, +static int alloc_and_process_delim (struct tep_event_format *event,char *next_token,struct print_arg **print_arg) {struct print_arg *field;
@@ -2444,7 +2444,7 @@ static char *arg_eval (struct print_arg *arg) }static enum event_type -process_fields (struct event_format *event,struct print_flag_sym **list,char **tok) +process_fields (struct tep_event_format *event,struct print_flag_sym **list,char **tok) {enum event_type type;struct print_arg *arg =NULL ;
@@ -2525,7 +2525,7 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char ** }static enum event_type -process_flags (struct event_format *event,struct print_arg *arg,char **tok) +process_flags (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field;enum event_type type;
@@ -2578,7 +2578,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_symbols (struct event_format *event,struct print_arg *arg,char **tok) +process_symbols (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field;enum event_type type;
@@ -2617,7 +2617,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_hex_common (struct event_format *event,struct print_arg *arg, +process_hex_common (struct tep_event_format *event,struct print_arg *arg,char **tok,enum print_arg_type type) {memset (arg,0 ,sizeof (*arg));
@@ -2640,20 +2640,20 @@ process_hex_common(struct event_format *event, struct print_arg *arg, }static enum event_type -process_hex (struct event_format *event,struct print_arg *arg,char **tok) +process_hex (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX ); }static enum event_type -process_hex_str (struct event_format *event,struct print_arg *arg, +process_hex_str (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX_STR ); }static enum event_type -process_int_array (struct event_format *event,struct print_arg *arg,char **tok) +process_int_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg)); arg->type =PRINT_INT_ARRAY ;
@@ -2681,7 +2681,7 @@ process_int_array(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_dynamic_array (struct event_format *event,struct print_arg *arg,char **tok) +process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct format_field *field;enum event_type type;
@@ -2745,7 +2745,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char ** }static enum event_type -process_dynamic_array_len (struct event_format *event,struct print_arg *arg, +process_dynamic_array_len (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct format_field *field;
@@ -2781,7 +2781,7 @@ process_dynamic_array_len(struct event_format *event, struct print_arg *arg, }static enum event_type -process_paren (struct event_format *event,struct print_arg *arg,char **tok) +process_paren (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *item_arg;enum event_type type;
@@ -2844,7 +2844,7 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)static enum event_type -process_str (struct event_format *event__maybe_unused ,struct print_arg *arg, +process_str (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) {enum event_type type;
@@ -2873,8 +2873,8 @@ process_str(struct event_format *event __maybe_unused, struct print_arg *arg, }static enum event_type -process_bitmask (struct event_format *event__maybe_unused ,struct print_arg *arg, -char **tok) +process_bitmask (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +char **tok) {enum event_type type;char *token;
@@ -2934,7 +2934,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) }static enum event_type -process_func_handler (struct event_format *event,struct tep_function_handler *func, +process_func_handler (struct tep_event_format *event,struct tep_function_handler *func,struct print_arg *arg,char **tok) {struct print_arg **next_arg;
@@ -2992,7 +2992,7 @@ process_func_handler(struct event_format *event, struct tep_function_handler *fu }static enum event_type -process_function (struct event_format *event,struct print_arg *arg, +process_function (struct tep_event_format *event,struct print_arg *arg,char *token,char **tok) {struct tep_function_handler *func;
@@ -3048,7 +3048,7 @@ process_function(struct event_format *event, struct print_arg *arg, }static enum event_type -process_arg_token (struct event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct print_arg *arg,char **tok,enum event_type type) {char *token;
@@ -3136,7 +3136,7 @@ process_arg_token(struct event_format *event, struct print_arg *arg,return type; } -static int event_read_print_args (struct event_format *event,struct print_arg **list) +static int event_read_print_args (struct tep_event_format *event,struct print_arg **list) {enum event_type type =EVENT_ERROR ;struct print_arg *arg;
@@ -3194,7 +3194,7 @@ static int event_read_print_args(struct event_format *event, struct print_arg **return args; } -static int event_read_print (struct event_format *event) +static int event_read_print (struct tep_event_format *event) {enum event_type type;char *token;
@@ -3260,7 +3260,7 @@ static int event_read_print(struct event_format *event)* This only searchs the common fields and not all field. */ struct format_field * -tep_find_common_field (struct event_format *event,const char *name) +tep_find_common_field (struct tep_event_format *event,const char *name) {struct format_field *format;
@@ -3282,7 +3282,7 @@ tep_find_common_field(struct event_format *event, const char *name)* This does not search common fields. */ struct format_field * -tep_find_field (struct event_format *event,const char *name) +tep_find_field (struct tep_event_format *event,const char *name) {struct format_field *format;
@@ -3305,7 +3305,7 @@ tep_find_field(struct event_format *event, const char *name)* the non-common ones if a common one was not found. */ struct format_field * -tep_find_any_field (struct event_format *event,const char *name) +tep_find_any_field (struct tep_event_format *event,const char *name) {struct format_field *format;
@@ -3374,7 +3374,7 @@ int tep_read_number_field(struct format_field *field, const void *data,static int get_common_info (struct tep_handle *pevent,const char *type,int *offset,int *size) { -struct event_format *event; +struct tep_event_format *event;struct format_field *field;/*
@@ -3461,11 +3461,11 @@ static int events_id_cmp(const void *a, const void *b);* * Returns an event that has a given @id. */ -struct event_format *tep_find_event (struct tep_handle *pevent,int id) +struct tep_event_format *tep_find_event (struct tep_handle *pevent,int id) { -struct event_format **eventptr; -struct event_format key; -struct event_format *pkey = &key; +struct tep_event_format **eventptr; +struct tep_event_format key; +struct tep_event_format *pkey = &key;/* Check cache first */ if (pevent->last_event && pevent->last_event->id == id)
@@ -3493,11 +3493,11 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)* This returns an event with a given @name and under the system * @sys. If @sys is NULL the first event with @name is returned. */ -struct event_format * +struct tep_event_format *tep_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name) { -struct event_format *event; +struct tep_event_format *event;int i; if (pevent->last_event &&
@@ -3522,7 +3522,7 @@ tep_find_event_by_name(struct tep_handle *pevent, }static unsigned long long -eval_num_arg (void *data,int size,struct event_format *event,struct print_arg *arg) +eval_num_arg (void *data,int size,struct tep_event_format *event,struct print_arg *arg) {struct tep_handle *pevent = event->pevent;unsigned long long val =0 ;
@@ -3862,7 +3862,7 @@ static void print_bitmask_to_seq(struct tep_handle *pevent, }static void print_str_arg (struct trace_seq *s,void *data,int size, -struct event_format *event,const char *format, +struct tep_event_format *event,const char *format,int len_arg,struct print_arg *arg) {struct tep_handle *pevent = event->pevent;
@@ -4117,7 +4117,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct print_arg *arg) {struct tep_function_handler *func_handle = arg->func.func;struct func_params *param;
@@ -4212,7 +4212,7 @@ static void free_args(struct print_arg *args) } } -static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct event_format *event) +static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;struct format_field *field, *ip_field;
@@ -4389,7 +4389,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, strucstatic char *get_bprint_format (void *data,int size__maybe_unused , -struct event_format *event) +struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;unsigned long long addr;
@@ -4424,7 +4424,7 @@ get_bprint_format(void *data, int size __maybe_unused, }static void print_mac_arg (struct trace_seq *s,int mac,void *data,int size, -struct event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct print_arg *arg) {unsigned char *buf;const char *fmt ="%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ;
@@ -4577,7 +4577,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf)* %pISpc print an IP address based on sockaddr; p adds port. */ static int print_ipv4_arg (struct trace_seq *s,const char *ptr,char i, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {unsigned char *buf;
@@ -4614,7 +4614,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, }static int print_ipv6_arg (struct trace_seq *s,const char *ptr,char i, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {char have_c =0 ;
@@ -4664,7 +4664,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, }static int print_ipsa_arg (struct trace_seq *s,const char *ptr,char i, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {char have_c =0 , have_p =0 ;
@@ -4746,7 +4746,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, }static int print_ip_arg (struct trace_seq *s,const char *ptr, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {char i = *ptr;/* 'i' or 'I' */
@@ -4853,7 +4853,7 @@ void tep_print_field(struct trace_seq *s, void *data, }void tep_print_fields (struct trace_seq *s,void *data, -int size__maybe_unused ,struct event_format *event) +int size__maybe_unused ,struct tep_event_format *event) {struct format_field *field;
@@ -4865,7 +4865,7 @@ void tep_print_fields(struct trace_seq *s, void *data, } } -static void pretty_print (struct trace_seq *s,void *data,int size,struct event_format *event) +static void pretty_print (struct trace_seq *s,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;struct print_fmt *print_fmt = &event->print_fmt;
@@ -5228,7 +5228,7 @@ int tep_data_type(struct tep_handle *pevent, struct tep_record *rec)* * This returns the event form a given @type; */ -struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type) +struct tep_event_format *tep_data_event_from_type (struct tep_handle *pevent,int type) {return tep_find_event (pevent, type); }
@@ -5386,7 +5386,7 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)* This parses the raw @data using the given @event information and * writes the print format into the trace_seq. */ -void tep_event_info (struct trace_seq *s,struct event_format *event, +void tep_event_info (struct trace_seq *s,struct tep_event_format *event,struct tep_record *record) {int print_pretty =1 ;
@@ -5427,7 +5427,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)* Returns the associated event for a given record, or NULL if non is * is found. */ -struct event_format * +struct tep_event_format *tep_find_event_by_record (struct tep_handle *pevent,struct tep_record *record) {int type;
@@ -5452,7 +5452,7 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)* Writes the tasks comm, pid and CPU to @s. */ void tep_print_event_task (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record) {void *data = record->data;
@@ -5480,7 +5480,7 @@ void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,* Writes the timestamp of the record into @s. */ void tep_print_event_time (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record,bool use_trace_clock) {
@@ -5530,7 +5530,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,* Writes the parsing of the record's data to @s. */ void tep_print_event_data (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record) {static const char *spaces =" " ;/* 20 spaces */
@@ -5549,7 +5549,7 @@ void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,void tep_print_event (struct tep_handle *pevent,struct trace_seq *s,struct tep_record *record,bool use_trace_clock) { -struct event_format *event; +struct tep_event_format *event; event =tep_find_event_by_record (pevent, record);if (!event) {
@@ -5571,8 +5571,8 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,static int events_id_cmp (const void *a,const void *b) { -struct event_format *const * ea = a; -struct event_format *const * eb = b; +struct tep_event_format *const * ea = a; +struct tep_event_format *const * eb = b;if ((*ea)->id < (*eb)->id)return -1 ;
@@ -5585,8 +5585,8 @@ static int events_id_cmp(const void *a, const void *b)static int events_name_cmp (const void *a,const void *b) { -struct event_format *const * ea = a; -struct event_format *const * eb = b; +struct tep_event_format *const * ea = a; +struct tep_event_format *const * eb = b;int res; res =strcmp ((*ea)->name, (*eb)->name);
@@ -5602,8 +5602,8 @@ static int events_name_cmp(const void *a, const void *b)static int events_system_cmp (const void *a,const void *b) { -struct event_format *const * ea = a; -struct event_format *const * eb = b; +struct tep_event_format *const * ea = a; +struct tep_event_format *const * eb = b;int res; res =strcmp ((*ea)->system, (*eb)->system);
@@ -5617,9 +5617,9 @@ static int events_system_cmp(const void *a, const void *b)return events_id_cmp (a, b); } -struct event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) +struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) { -struct event_format **events; +struct tep_event_format **events;int (*sort)(const void *a,const void *b); events = pevent->sort_events;
@@ -5702,7 +5702,7 @@ get_event_fields(const char *type, const char *name,* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **tep_event_common_fields (struct event_format *event) +struct format_field **tep_event_common_fields (struct tep_event_format *event) { return get_event_fields("common", event->name, event->format.nr_common,
@@ -5716,7 +5716,7 @@ struct format_field **tep_event_common_fields(struct event_format *event)* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **tep_event_fields (struct event_format *event) +struct format_field **tep_event_fields (struct tep_event_format *event) { return get_event_fields("event", event->name, event->format.nr_fields,
@@ -5958,7 +5958,7 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long sireturn 0 ; } -static int event_matches (struct event_format *event, +static int event_matches (struct tep_event_format *event,int id,const char *sys_name,const char *event_name) {
@@ -5981,7 +5981,7 @@ static void free_handler(struct event_handler *handle)free (handle); } -static int find_event_handle (struct tep_handle *pevent,struct event_format *event) +static int find_event_handle (struct tep_handle *pevent,struct tep_event_format *event) {struct event_handler *handle, **next;
@@ -6022,11 +6022,11 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve* * /sys/kernel/debug/tracing/events/.../.../format */ -enum tep_errno __tep_parse_format (struct event_format **eventp, +enum tep_errno __tep_parse_format (struct tep_event_format **eventp,struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) { -struct event_format *event; +struct tep_event_format *event;int ret;init_input_buf (buf, size);
@@ -6131,12 +6131,12 @@ enum tep_errno __tep_parse_format(struct event_format **eventp,static enum tep_errno __parse_event (struct tep_handle *pevent, -struct event_format **eventp, +struct tep_event_format **eventp,const char *buf,unsigned long size,const char *sys) {int ret =__tep_parse_format (eventp, pevent, buf, size, sys); -struct event_format *event = *eventp; +struct tep_event_format *event = *eventp;if (event ==NULL )return ret;
@@ -6173,7 +6173,7 @@ __parse_event(struct tep_handle *pevent,* /sys/kernel/debug/tracing/events/.../.../format */ enum tep_errno tep_parse_format (struct tep_handle *pevent, -struct event_format **eventp, +struct tep_event_format **eventp,const char *buf,unsigned long size,const char *sys) {
@@ -6197,7 +6197,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,enum tep_errno tep_parse_event (struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) { -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;return __parse_event (pevent, &event, buf, size, sys); }
@@ -6263,7 +6263,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,* * On failure, it returns NULL. */ -void *tep_get_field_raw (struct trace_seq *s,struct event_format *event, +void *tep_get_field_raw (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,int *len,int err) {
@@ -6310,7 +6310,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int tep_get_field_val (struct trace_seq *s,struct event_format *event, +int tep_get_field_val (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6335,7 +6335,7 @@ int tep_get_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int tep_get_common_field_val (struct trace_seq *s,struct event_format *event, +int tep_get_common_field_val (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6360,7 +6360,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int tep_get_any_field_val (struct trace_seq *s,struct event_format *event, +int tep_get_any_field_val (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6386,7 +6386,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct event_format *event,* Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ int tep_print_num_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, +struct tep_event_format *event,const char *name,struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);
@@ -6418,7 +6418,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,* Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ int tep_print_func_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, +struct tep_event_format *event,const char *name,struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);
@@ -6578,11 +6578,11 @@ int tep_unregister_print_function(struct tep_handle *pevent,return -1 ; } -static struct event_format *search_event (struct tep_handle *pevent,int id, +static struct tep_event_format *search_event (struct tep_handle *pevent,int id,const char *sys_name,const char *event_name) { -struct event_format *event; +struct tep_event_format *event;if (id >=0 ) {/* search by id */
@@ -6622,7 +6622,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id, const char *sys_name, const char *event_name, tep_event_handler_func func, void *context) { - struct event_format *event; + struct tep_event_format *event;struct event_handler *handle; event =search_event (pevent, id, sys_name, event_name);
@@ -6706,7 +6706,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id, const char *sys_name, const char *event_name, tep_event_handler_func func, void *context) { - struct event_format *event; + struct tep_event_format *event;struct event_handler *handle;struct event_handler **next;
@@ -6784,7 +6784,7 @@ static void free_formats(struct format *format)free_format_fields (format->fields); } -void tep_free_format (struct event_format *event) +void tep_free_format (struct tep_event_format *event) {free (event->name);free (event->system);
tools/lib/traceevent/event-parse.h +33 -33
172 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +21 -21
162 lines not on this page · raw message
tools/lib/traceevent/plugin_function.c +1 -1
@@ -124,7 +124,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 event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tep_handle *pevent = event->pevent;unsigned long long function;
tools/lib/traceevent/plugin_hrtimer.c +2 -2
@@ -27,7 +27,7 @@static int timer_expire_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
@@ -47,7 +47,7 @@ static int timer_expire_handler(struct trace_seq *s,static int timer_start_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -25,7 +25,7 @@#include "trace-seq.h" static int call_site_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val, addr;
tools/lib/traceevent/plugin_kvm.c +7 -7
@@ -249,7 +249,7 @@ static const char *find_exit_reason(unsigned isa, int val) }static int print_exit_reason (struct trace_seq *s,struct tep_record *record, -struct event_format *event,const char *field) +struct tep_event_format *event,const char *field) {unsigned long long isa;unsigned long long val;
@@ -270,7 +270,7 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record, }static int kvm_exit_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long info1 =0 , info2 =0 ;
@@ -293,7 +293,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,static int kvm_emulate_insn_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long rip, csbase, len, flags, failed;int llen;
@@ -332,7 +332,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,static int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {if (print_exit_reason (s, record, event,"exit_code" ) <0 )return -1 ;
@@ -346,7 +346,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco }static int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {tep_print_num_field (s,"rip %llx " , event,"rip" , record,1 );
@@ -372,7 +372,7 @@ union kvm_mmu_page_role { };static int kvm_mmu_print_role (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val;static const char *access_str[] = {
@@ -419,7 +419,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,static int kvm_mmu_get_page_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val;
tools/lib/traceevent/plugin_mac80211.c +2 -2
@@ -26,7 +26,7 @@#define INDENT 65 -static void print_string (struct trace_seq *s,struct event_format *event, +static void print_string (struct trace_seq *s,struct tep_event_format *event,const char *name,const void *data) {struct format_field *f =tep_find_field (event, name);
@@ -60,7 +60,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,static int drv_bss_info_changed (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {void *data = record->data;
tools/lib/traceevent/plugin_sched_switch.c +2 -2
@@ -67,7 +67,7 @@ static void write_and_save_comm(struct format_field *field,static int sched_wakeup_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
@@ -96,7 +96,7 @@ static int sched_wakeup_handler(struct trace_seq *s,static int sched_switch_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
tools/perf/builtin-trace.c +1 -1
@@ -862,7 +862,7 @@ static struct syscall_fmt *syscall_fmt__find(const char *name)* args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc. */ struct syscall { -struct event_format *tp_format; +struct tep_event_format *tp_format;int nr_args;int args_size;bool is_exit;
tools/perf/util/evsel.h +2 -2
@@ -102,7 +102,7 @@ struct perf_evsel {char *name;double scale;const char *unit; -struct event_format *tp_format; +struct tep_event_format *tp_format;off_t id_offset;struct perf_stat_evsel *stats;void *priv;
@@ -211,7 +211,7 @@ static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char *struct perf_evsel *perf_evsel__new_cycles (bool precise); -struct event_format *event_format__new (const char *sys,const char *name); +struct tep_event_format *event_format__new (const char *sys,const char *name);void perf_evsel__init (struct perf_evsel *evsel,struct perf_event_attr *attr,int idx);
tools/perf/util/header.c +1 -1
@@ -3206,7 +3206,7 @@ static int read_attr(int fd, struct perf_header *ph,static int perf_evsel__prepare_tracepoint_event (struct perf_evsel *evsel,struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event;char bf[128 ];/* already prepared */
tools/perf/util/python.c +2 -2
@@ -386,7 +386,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)struct format_field *field;if (!evsel->tp_format) { -struct event_format *tp_format; +struct tep_event_format *tp_format; tp_format =trace_event__tp_format_id (evsel->attr.config);if (!tp_format)
@@ -1240,7 +1240,7 @@ static struct {static PyObject *pyrf__tracepoint (struct pyrf_evsel *pevsel,PyObject *args,PyObject *kwargs) { -struct event_format *tp_format; +struct tep_event_format *tp_format;static char *kwlist[] = {"sys" ,"name" ,NULL };char *sys =NULL ;char *name =NULL ;
tools/perf/util/scripting-engines/trace-event-perl.c +3 -3
@@ -189,7 +189,7 @@ static void define_flag_field(const char *ev_name,LEAVE ; } -static void define_event_symbols (struct event_format *event, +static void define_event_symbols (struct tep_event_format *event,const char *ev_name,struct print_arg *args) {
@@ -338,7 +338,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, struct addr_location *al) {struct thread *thread = al->thread; -struct event_format *event = evsel->tp_format; +struct tep_event_format *event = evsel->tp_format;struct format_field *field;static char handler[256 ];unsigned long long val;
@@ -537,7 +537,7 @@ static int perl_stop_script(void)static int perl_generate_script (struct tep_handle *pevent,const char *outfile) { -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;struct format_field *f;char fname[PATH_MAX ];int not_first, count;
tools/perf/util/scripting-engines/trace-event-python.c +4 -4
@@ -264,7 +264,7 @@ static void define_field(enum print_arg_type field_type,Py_DECREF (t); } -static void define_event_symbols (struct event_format *event, +static void define_event_symbols (struct tep_event_format *event,const char *ev_name,struct print_arg *args) {
@@ -332,7 +332,7 @@ static void define_event_symbols(struct event_format *event,define_event_symbols (event, ev_name, args->next); } -static PyObject *get_field_numeric_entry (struct event_format *event, +static PyObject *get_field_numeric_entry (struct tep_event_format *event,struct format_field *field,void *data) {bool is_array = field->flags &FIELD_IS_ARRAY ;
@@ -790,7 +790,7 @@ static void python_process_tracepoint(struct perf_sample *sample,struct perf_evsel *evsel, struct addr_location *al) { - struct event_format *event = evsel->tp_format; + struct tep_event_format *event = evsel->tp_format;PyObject *handler, *context, *t, *obj =NULL , *callchain;PyObject *dict =NULL , *all_entries_dict =NULL ;static char handler_name[256 ];
@@ -1590,7 +1590,7 @@ static int python_stop_script(void)static int python_generate_script (struct tep_handle *pevent,const char *outfile) { -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;struct format_field *f;char fname[PATH_MAX ];int not_first, count;
tools/perf/util/trace-event-parse.c +7 -7
@@ -33,7 +33,7 @@ static int get_common_field(struct scripting_context *context, int *offset, int *size, const char *type) { struct tep_handle *pevent = context->pevent; -struct event_format *event; +struct tep_event_format *event;struct format_field *field;if (!*size) {
@@ -94,7 +94,7 @@ int common_pc(struct scripting_context *context) }unsigned long long -raw_field_value (struct 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;unsigned long long val;
@@ -108,12 +108,12 @@ raw_field_value(struct event_format *event, const char *name, void *data)return val; } -unsigned long long read_size (struct event_format *event,void *ptr,int size) +unsigned long long read_size (struct tep_event_format *event,void *ptr,int size) {return tep_read_number (event->pevent, ptr, size); } -void event_format__fprintf (struct event_format *event, +void event_format__fprintf (struct tep_event_format *event,int cpu,void *data,int size,FILE *fp) {struct tep_record record;
@@ -130,7 +130,7 @@ void event_format__fprintf(struct event_format *event,trace_seq_destroy (&s); } -void event_format__print (struct event_format *event, +void event_format__print (struct tep_event_format *event,int cpu,void *data,int size) {return event_format__fprintf (event, cpu, data, size, stdout);
@@ -188,8 +188,8 @@ int parse_event_file(struct tep_handle *pevent,return tep_parse_event (pevent, buf, size, sys); } -struct event_format *trace_find_next_event (struct tep_handle *pevent, -struct event_format *event) +struct tep_event_format *trace_find_next_event (struct tep_handle *pevent, +struct tep_event_format *event) {static int idx;
tools/perf/util/trace-event.c +4 -4
@@ -72,12 +72,12 @@ void trace_event__cleanup(struct trace_event *t)/* * Returns pointer with encoded error via <linux/err.h> interface. */ -static struct event_format * +static struct tep_event_format *tp_format (const char *sys,const char *name) {char *tp_dir =get_events_file (sys);struct tep_handle *pevent = tevent.pevent; -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;char path[PATH_MAX ];size_t size;char *data;
@@ -102,7 +102,7 @@ tp_format(const char *sys, const char *name)/* * Returns pointer with encoded error via <linux/err.h> interface. */ -struct event_format * +struct tep_event_format *trace_event__tp_format (const char *sys,const char *name) {if (!tevent_initialized &&trace_event__init2 ())
@@ -111,7 +111,7 @@ trace_event__tp_format(const char *sys, const char *name)return tp_format (sys, name); } -struct event_format *trace_event__tp_format_id (int id) +struct tep_event_format *trace_event__tp_format_id (int id) {if (!tevent_initialized &&trace_event__init2 ())return ERR_PTR (-ENOMEM );
tools/perf/util/trace-event.h +8 -8
@@ -22,17 +22,17 @@ int trace_event__init(struct trace_event *t);void trace_event__cleanup (struct trace_event *t);int trace_event__register_resolver (struct machine *machine,tep_func_resolver_t *func); -struct event_format * +struct tep_event_format *trace_event__tp_format (const char *sys,const char *name); -struct event_format *trace_event__tp_format_id (int id); +struct tep_event_format *trace_event__tp_format_id (int id);int bigendian (void ); -void event_format__fprintf (struct event_format *event, +void event_format__fprintf (struct tep_event_format *event,int cpu,void *data,int size,FILE *fp); -void event_format__print (struct event_format *event, +void event_format__print (struct tep_event_format *event,int cpu,void *data,int size);int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size);
@@ -40,7 +40,7 @@ int parse_event_file(struct tep_handle *pevent, char *buf, unsigned long size, char *sys);unsigned long long -raw_field_value (struct event_format *event,const char *name,void *data); +raw_field_value (struct tep_event_format *event,const char *name,void *data);void parse_proc_kallsyms (struct tep_handle *pevent,char *file,unsigned int size);void parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size);
@@ -48,9 +48,9 @@ void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int sizssize_t trace_report (int fd,struct trace_event *tevent,bool repipe); -struct event_format *trace_find_next_event (struct tep_handle *pevent, -struct event_format *event); -unsigned long long read_size (struct event_format *event,void *ptr,int size); +struct tep_event_format *trace_find_next_event (struct tep_handle *pevent, +struct tep_event_format *event); +unsigned long long read_size (struct tep_event_format *event,void *ptr,int size);unsigned long long eval_flag (const char *flag);int read_tracing_data (int fd,struct list_head *pattrs);
Signature · 1 line
2.18.0
PATCH 5/15 tools/lib/traceevent: Add prefix TEP_ to all EVENT_FL_* flags
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix TEP_ to all members of nameless enum EVENT_FL_*
--- tools/lib/traceevent/event-parse.c | 42 +++++++++++++++--------------- tools/lib/traceevent/event-parse.h | 18 ++++++------- 2 files changed, 30 insertions(+), 30 deletions(-)
tools/lib/traceevent/event-parse.c +21 -21
@@ -1382,7 +1382,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* The ftrace fields may still use the "special" name. * Just ignore it. */ -if (event->flags &EVENT_FL_ISFTRACE && +if (event->flags &TEP_EVENT_FL_ISFTRACE && type ==TEP_EVENT_ITEM &&strcmp (token,"special" ) ==0 ) {free_token (token); type =read_token (&token);
@@ -1412,7 +1412,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* Some of the ftrace fields are broken and have * an illegal "." in them. */ - (event->flags & EVENT_FL_ISFTRACE && + (event->flags & TEP_EVENT_FL_ISFTRACE && type == TEP_EVENT_OP && strcmp(token, ".") == 0)) {if (strcmp (token,"*" ) ==0 )
@@ -1963,7 +1963,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) arg->op.right =NULL ;if (set_op_prio (arg) ==-1 ) { - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;/* arg->op.op (= token) will be freed at out_free */ arg->op.op =NULL ; goto out_free;
@@ -2042,7 +2042,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) }else {do_warning_event (event,"unknown op '%s'" , token); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;/* the arg is now the left side */ goto out_free; }
@@ -4884,13 +4884,13 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_eint len;int ls; -if (event->flags &EVENT_FL_FAILED ) { +if (event->flags &TEP_EVENT_FL_FAILED ) {trace_seq_printf (s,"[FAILED TO PARSE]" );tep_print_fields (s, data, size, event);return ; } -if (event->flags &EVENT_FL_ISBPRINT ) { +if (event->flags &TEP_EVENT_FL_ISBPRINT ) { bprint_fmt =get_bprint_format (data, size, event); args =make_bprint_args (bprint_fmt, data, size, event); arg = args;
@@ -4945,7 +4945,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e/* The argument is the length. */ if (!arg) {do_warning_event (event,"no argument match" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; goto out_failed; } len_arg =eval_num_arg (data, size, event, arg);
@@ -4998,7 +4998,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_ecase 'u' :if (!arg) {do_warning_event (event,"no argument match" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; goto out_failed; }
@@ -5008,7 +5008,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e/* should never happen */ if (len >31 ) {do_warning_event (event,"bad format!" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; len =31 ; }
@@ -5074,13 +5074,13 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_ebreak ;default :do_warning_event (event,"bad count (%d)" , ls); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; }break ;case 's' :if (!arg) {do_warning_event (event,"no matching argument" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; goto out_failed; }
@@ -5090,7 +5090,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e/* should never happen */ if (len >31 ) {do_warning_event (event,"bad format!" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; len =31 ; }
@@ -5115,7 +5115,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_etrace_seq_putc (s, *ptr); } -if (event->flags &EVENT_FL_FAILED ) { +if (event->flags &TEP_EVENT_FL_FAILED ) { out_failed:trace_seq_printf (s,"[FAILED TO PARSE]" ); }
@@ -5391,11 +5391,11 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event, {int print_pretty =1 ; -if (event->pevent->print_raw || (event->flags &EVENT_FL_PRINTRAW )) +if (event->pevent->print_raw || (event->flags &TEP_EVENT_FL_PRINTRAW ))tep_print_fields (s, record->data, record->size, event);else { -if (event->handler && !(event->flags &EVENT_FL_NOHANDLE )) +if (event->handler && !(event->flags &TEP_EVENT_FL_NOHANDLE )) print_pretty = event->handler (s, record, event, event->context);
@@ -6043,10 +6043,10 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, }if (strcmp (sys,"ftrace" ) ==0 ) { - event->flags |=EVENT_FL_ISFTRACE ; + event->flags |=TEP_EVENT_FL_ISFTRACE ;if (strcmp (event->name,"bprint" ) ==0 ) - event->flags |=EVENT_FL_ISBPRINT ; + event->flags |=TEP_EVENT_FL_ISBPRINT ; } event->id =event_read_id ();
@@ -6089,7 +6089,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, goto event_parse_failed; } -if (!ret && (event->flags &EVENT_FL_ISFTRACE )) { +if (!ret && (event->flags &TEP_EVENT_FL_ISFTRACE )) {struct tep_format_field *field;struct print_arg *arg, **list;
@@ -6098,13 +6098,13 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,for (field = event->format.fields; field; field = field->next) { arg =alloc_arg ();if (!arg) { - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;return TEP_ERRNO__OLD_FTRACE_ARG_FAILED ; } arg->type =PRINT_FIELD ; arg->field.name =strdup (field->name);if (!arg->field.name) { - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;free_arg (arg);return TEP_ERRNO__OLD_FTRACE_ARG_FAILED ; }
@@ -6118,7 +6118,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,return 0 ; event_parse_failed: - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;return ret; event_alloc_failed:
tools/lib/traceevent/event-parse.h +9 -9
@@ -290,15 +290,15 @@ struct tep_event_format { };enum { -EVENT_FL_ISFTRACE =0x01 , -EVENT_FL_ISPRINT =0x02 , -EVENT_FL_ISBPRINT =0x04 , -EVENT_FL_ISFUNCENT =0x10 , -EVENT_FL_ISFUNCRET =0x20 , -EVENT_FL_NOHANDLE =0x40 , -EVENT_FL_PRINTRAW =0x80 , - -EVENT_FL_FAILED =0x80000000 +TEP_EVENT_FL_ISFTRACE =0x01 , +TEP_EVENT_FL_ISPRINT =0x02 , +TEP_EVENT_FL_ISBPRINT =0x04 , +TEP_EVENT_FL_ISFUNCENT =0x10 , +TEP_EVENT_FL_ISFUNCRET =0x20 , +TEP_EVENT_FL_NOHANDLE =0x40 , +TEP_EVENT_FL_PRINTRAW =0x80 , + +TEP_EVENT_FL_FAILED =0x80000000 };enum tep_event_sort_type {
Signature · 1 line
2.18.0
PATCH 2/15 tools/lib/traceevent, tools/perf: Rename struct format{_field} to struct tep_format{_field}
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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
--- tools/lib/traceevent/event-parse.c | 82 +++++++++---------- tools/lib/traceevent/event-parse.h | 42 +++++----- tools/lib/traceevent/parse-filter.c | 8 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/lib/traceevent/plugin_sched_switch.c | 6 +- tools/perf/builtin-trace.c | 14 ++-- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/util/data-convert-bt.c | 22 ++--- tools/perf/util/evsel.c | 8 +- tools/perf/util/evsel.h | 6 +- tools/perf/util/evsel_fprintf.c | 2 +- tools/perf/util/python.c | 4 +- .../util/scripting-engines/trace-event-perl.c | 4 +- .../scripting-engines/trace-event-python.c | 6 +- tools/perf/util/sort.c | 18 ++-- tools/perf/util/trace-event-parse.c | 4 +- 17 files changed, 116 insertions(+), 116 deletions(-)
tools/lib/traceevent/event-parse.c +41 -41
@@ -1299,7 +1299,7 @@ static int event_read_id(void)return -1 ; } -static int field_is_string (struct format_field *field) +static int field_is_string (struct tep_format_field *field) { if ((field->flags & FIELD_IS_ARRAY) && (strstr(field->type, "char") || strstr(field->type, "u8") ||
@@ -1309,7 +1309,7 @@ static int field_is_string(struct format_field *field)return 0 ; } -static int field_is_dynamic (struct format_field *field) +static int field_is_dynamic (struct tep_format_field *field) {if (strncmp (field->type,"__data_loc" ,10 ) ==0 )return 1 ;
@@ -1317,7 +1317,7 @@ static int field_is_dynamic(struct format_field *field)return 0 ; } -static int field_is_long (struct format_field *field) +static int field_is_long (struct tep_format_field *field) {/* includes long long */ if (strstr (field->type,"long" ))
@@ -1354,9 +1354,9 @@ static unsigned int type_size(const char *name)return 0 ; } -static int event_read_fields (struct tep_event_format *event,struct format_field **fields) +static int event_read_fields (struct tep_event_format *event,struct tep_format_field **fields) { -struct format_field *field =NULL ; +struct tep_format_field *field =NULL ;enum event_type type;char *token;char *last_token;
@@ -2683,7 +2683,7 @@ process_int_array(struct tep_event_format *event, struct print_arg *arg, char **static enum event_type process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) { -struct format_field *field; +struct tep_format_field *field;enum event_type type;char *token;
@@ -2748,7 +2748,7 @@ static enum event_type process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, char **tok) { - struct format_field *field; + struct tep_format_field *field;enum event_type type;char *token;
@@ -3259,10 +3259,10 @@ static int event_read_print(struct tep_event_format *event)* Returns a common field from the event by the given @name. * This only searchs the common fields and not all field. */ -struct format_field * +struct tep_format_field *tep_find_common_field (struct tep_event_format *event,const char *name) { -struct format_field *format; +struct tep_format_field *format;for (format = event->format.common_fields; format; format = format->next) {
@@ -3281,10 +3281,10 @@ tep_find_common_field(struct tep_event_format *event, const char *name)* Returns a non-common field by the given @name. * This does not search common fields. */ -struct format_field * +struct tep_format_field *tep_find_field (struct tep_event_format *event,const char *name) { -struct format_field *format; +struct tep_format_field *format;for (format = event->format.fields; format; format = format->next) {
@@ -3304,10 +3304,10 @@ tep_find_field(struct tep_event_format *event, const char *name)* This searchs the common field names first, then * the non-common ones if a common one was not found. */ -struct format_field * +struct tep_format_field *tep_find_any_field (struct tep_event_format *event,const char *name) { -struct format_field *format; +struct tep_format_field *format; format =tep_find_common_field (event, name);if (format)
@@ -3353,7 +3353,7 @@ unsigned long long tep_read_number(struct tep_handle *pevent,* * Returns 0 on success, -1 otherwise. */ -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) {if (!field)
@@ -3375,7 +3375,7 @@ static int get_common_info(struct tep_handle *pevent, const char *type, int *offset, int *size) { struct tep_event_format *event; -struct format_field *field; +struct tep_format_field *field;/* * All events should have the same common elements.
@@ -3867,7 +3867,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, {struct tep_handle *pevent = event->pevent;struct print_flag_sym *flag; -struct format_field *field; +struct tep_format_field *field;struct printk_map *printk;long long val, fval;unsigned long long addr;
@@ -4008,7 +4008,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (arg->int_array.field->type ==PRINT_DYNAMIC_ARRAY ) {unsigned long offset; -struct format_field *field = +struct tep_format_field *field = arg->int_array.field->dynarray.field; offset = tep_read_number(pevent, data + field->offset,
@@ -4056,7 +4056,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,int str_offset;if (arg->string.offset ==-1 ) { -struct format_field *f; +struct tep_format_field *f; f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset;
@@ -4074,7 +4074,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,int bitmask_size;if (arg->bitmask.offset ==-1 ) { -struct format_field *f; +struct tep_format_field *f; f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset;
@@ -4215,7 +4215,7 @@ static void free_args(struct print_arg *args)static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent; -struct format_field *field, *ip_field; +struct tep_format_field *field, *ip_field;struct print_arg *args, *arg, **next;unsigned long long ip, val;char *ptr;
@@ -4393,7 +4393,7 @@ get_bprint_format(void *data, int size __maybe_unused, {struct tep_handle *pevent = event->pevent;unsigned long long addr; -struct format_field *field; +struct tep_format_field *field;struct printk_map *printk;char *format;
@@ -4788,7 +4788,7 @@ static int is_printable_array(char *p, unsigned int len) }void tep_print_field (struct trace_seq *s,void *data, -struct format_field *field) +struct tep_format_field *field) {unsigned long long val;unsigned int offset, len, i;
@@ -4855,7 +4855,7 @@ void tep_print_field(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) { -struct format_field *field; +struct tep_format_field *field; field = event->format.fields;while (field) {
@@ -5664,12 +5664,12 @@ struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_return events; } -static struct format_field ** +static struct tep_format_field **get_event_fields (const char *type,const char *name, -int count,struct format_field *list) +int count,struct tep_format_field *list) { -struct format_field **fields; -struct format_field *field; +struct tep_format_field **fields; +struct tep_format_field *field;int i =0 ; fields =malloc (sizeof (*fields) * (count +1 ));
@@ -5702,7 +5702,7 @@ get_event_fields(const char *type, const char *name,* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -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) { return get_event_fields("common", event->name, event->format.nr_common,
@@ -5716,7 +5716,7 @@ struct format_field **tep_event_common_fields(struct tep_event_format *event)* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **tep_event_fields (struct tep_event_format *event) +struct tep_format_field **tep_event_fields (struct tep_event_format *event) { return get_event_fields("event", event->name, event->format.nr_fields,
@@ -6090,7 +6090,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, }if (!ret && (event->flags &EVENT_FL_ISFTRACE )) { -struct format_field *field; +struct tep_format_field *field;struct print_arg *arg, **list;/* old ftrace had no args */
@@ -6230,7 +6230,7 @@ int tep_strerror(struct tep_handle *pevent __maybe_unused,return 0 ; } -int get_field_val (struct trace_seq *s,struct format_field *field, +int get_field_val (struct trace_seq *s,struct tep_format_field *field,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6267,7 +6267,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record, int *len, int err) { - struct format_field *field; + struct tep_format_field *field;void *data = record->data;unsigned offset;int dummy;
@@ -6314,7 +6314,7 @@ int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record, unsigned long long *val, int err) { - struct format_field *field; + struct tep_format_field *field;if (!event)return -1 ;
@@ -6339,7 +6339,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event const char *name, struct tep_record *record, unsigned long long *val, int err) { - struct format_field *field; + struct tep_format_field *field;if (!event)return -1 ;
@@ -6364,7 +6364,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record, unsigned long long *val, int err) { - struct format_field *field; + struct tep_format_field *field;if (!event)return -1 ;
@@ -6389,7 +6389,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt, struct tep_event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = tep_find_field(event, name); + struct tep_format_field *field = tep_find_field(event, name);unsigned long long val;if (!field)
@@ -6421,7 +6421,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt, struct tep_event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = tep_find_field(event, name); + struct tep_format_field *field = tep_find_field(event, name);struct tep_handle *pevent = event->pevent;unsigned long long val;struct func_map *func;
@@ -6758,7 +6758,7 @@ void tep_ref(struct tep_handle *pevent) pevent->ref_count++; } -void tep_free_format_field (struct format_field *field) +void tep_free_format_field (struct tep_format_field *field) {free (field->type);if (field->alias != field->name)
@@ -6767,9 +6767,9 @@ void tep_free_format_field(struct format_field *field)free (field); } -static void free_format_fields (struct format_field *field) +static void free_format_fields (struct tep_format_field *field) { -struct format_field *next; +struct tep_format_field *next;while (field) { next = field->next;
@@ -6778,7 +6778,7 @@ static void free_format_fields(struct format_field *field) } } -static void free_formats (struct format *format) +static void free_formats (struct tep_format *format) {free_format_fields (format->common_fields);free_format_fields (format->fields);
tools/lib/traceevent/event-parse.h +21 -21
121 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +4 -4
@@ -16,11 +16,11 @@#define COMM "COMM"#define CPU "CPU" -static struct format_field comm = { +static struct tep_format_field comm = { .name ="COMM" , }; -static struct format_field cpu = { +static struct tep_format_field cpu = { .name ="CPU" , };
@@ -336,7 +336,7 @@ static enum tep_errno create_arg_item(struct tep_event_format *event, const char *token, enum event_type type, struct filter_arg **parg, char *error_str) { - struct format_field *field; + struct tep_format_field *field;struct filter_arg *arg; arg =allocate_arg ();
@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)static unsigned long long 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;
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -27,7 +27,7 @@static int call_site_handler (struct trace_seq *s,struct tep_record *record,struct tep_event_format *event,void *context) { -struct format_field *field; +struct tep_format_field *field;unsigned long long val, addr;void *data = record->data;const char *func;
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -29,7 +29,7 @@static void print_string (struct trace_seq *s,struct tep_event_format *event,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 length;
tools/lib/traceevent/plugin_sched_switch.c +3 -3
@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val)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 trace_seq *s,int pid) {
@@ -69,7 +69,7 @@ static int sched_wakeup_handler(struct trace_seq *s,struct tep_record *record, struct tep_event_format *event, void *context) { - struct format_field *field; + struct tep_format_field *field;unsigned long long val;if (tep_get_field_val (s, event,"pid" , record, &val,1 ))
@@ -98,7 +98,7 @@ static int sched_switch_handler(struct trace_seq *s,struct tep_record *record, struct tep_event_format *event, void *context) { - struct format_field *field; + struct tep_format_field *field;unsigned long long val;if (tep_get_field_val (s, event,"prev_pid" , record, &val,1 ))
tools/perf/builtin-trace.c +7 -7
@@ -181,7 +181,7 @@ static int __tp_field__init_uint(struct tp_field *field, int size, int offset, breturn 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); }
@@ -198,7 +198,7 @@ static int __tp_field__init_ptr(struct tp_field *field, int offset)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); }
@@ -214,7 +214,7 @@ static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel,struct tp_field *field, 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 )return -1 ;
@@ -230,7 +230,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel,struct tp_field *field, 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 )return -1 ;
@@ -867,7 +867,7 @@ struct syscall {int args_size;bool is_exit;bool is_open; -struct format_field *args; +struct tep_format_field *args;const char *name;struct syscall_fmt *fmt;struct syscall_arg_fmt *arg_fmt;
@@ -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) { -struct format_field *field, *last_field =NULL ; +struct tep_format_field *field, *last_field =NULL ;int idx =0 , len;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, ttrace->ret_scnprintf =NULL ;if (sc->args !=NULL ) { -struct format_field *field; +struct tep_format_field *field;for (field = sc->args; field; field = field->next, ++arg.idx, bit <<=1 ) {
tools/perf/tests/evsel-tp-sched.c +1 -1
@@ -8,7 +8,7 @@static int perf_evsel__test_field (struct perf_evsel *evsel,const char *name,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 ret =0 ;
tools/perf/util/data-convert-bt.c +11 -11
@@ -182,7 +182,7 @@ value_set_string(struct ctf_writer *cw, struct bt_ctf_event *event, }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;
@@ -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 *event, struct perf_sample *sample, - struct format_field *fmtf) + struct tep_format_field *fmtf) { struct bt_ctf_field_type *type;struct bt_ctf_field *array_field;
@@ -396,10 +396,10 @@ static int add_tracepoint_field_value(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 *event, -struct format_field *fields, +struct tep_format_field *fields,struct perf_sample *sample) { -struct format_field *field; +struct tep_format_field *field;int ret;for (field = fields; field; field = field->next) {
@@ -417,8 +417,8 @@ static int add_tracepoint_values(struct ctf_writer *cw,struct perf_evsel *evsel, struct perf_sample *sample) { - struct format_field *common_fields = evsel->tp_format->format.common_fields; -struct format_field *fields = evsel->tp_format->format.fields; + struct tep_format_field *common_fields = evsel->tp_format->format.common_fields; +struct tep_format_field *fields = evsel->tp_format->format.fields;int ret; ret = add_tracepoint_fields_values(cw, event_class, event,
@@ -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,struct bt_ctf_field_type *type, -struct format_field *field) +struct tep_format_field *field) {struct bt_ctf_field_type *t =NULL ;char *name;
@@ -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, -struct format_field *fields, +struct tep_format_field *fields,struct bt_ctf_event_class *event_class) { -struct format_field *field; +struct tep_format_field *field;int ret;for (field = fields; field; field = field->next) {
@@ -1055,8 +1055,8 @@ static int add_tracepoint_types(struct ctf_writer *cw,struct perf_evsel *evsel, struct bt_ctf_event_class *class) { - struct format_field *common_fields = evsel->tp_format->format.common_fields; -struct format_field *fields = evsel->tp_format->format.fields; + struct tep_format_field *common_fields = evsel->tp_format->format.common_fields; +struct tep_format_field *fields = evsel->tp_format->format.fields;int ret; ret =add_tracepoint_fields_types (cw, common_fields, class);
tools/perf/util/evsel.c +4 -4
@@ -2682,7 +2682,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,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); }
@@ -2690,7 +2690,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *namvoid *perf_evsel__rawptr (struct perf_evsel *evsel,struct perf_sample *sample,const char *name) { -struct format_field *field =perf_evsel__field (evsel, name); +struct tep_format_field *field =perf_evsel__field (evsel, name);int offset;if (!field)
@@ -2706,7 +2706,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,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) {u64 value;
@@ -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,const char *name) { -struct format_field *field =perf_evsel__field (evsel, name); +struct tep_format_field *field =perf_evsel__field (evsel, name);if (!field)return 0 ;
tools/perf/util/evsel.h +3 -3
@@ -296,11 +296,11 @@ static inline char *perf_evsel__strval(struct perf_evsel *evsel,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) \ (evsel->attr.type == PERF_TYPE_##t && \
tools/perf/util/evsel_fprintf.c +1 -1
@@ -73,7 +73,7 @@ int perf_evsel__fprintf(struct perf_evsel *evsel, }if (details->trace_fields) { -struct format_field *field; +struct tep_format_field *field;if (evsel->attr.type !=PERF_TYPE_TRACEPOINT ) { printed +=comma_fprintf (fp, &first," (not a tracepoint)" );
tools/perf/util/python.c +2 -2
@@ -340,7 +340,7 @@ static bool is_tracepoint(struct pyrf_event *pevent) }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;void *data = pe->sample.raw_data;
@@ -383,7 +383,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) {const char *str =_PyUnicode_AsString (PyObject_Str (attr_name));struct perf_evsel *evsel = pevent->evsel; -struct format_field *field; +struct tep_format_field *field;if (!evsel->tp_format) {struct tep_event_format *tp_format;
tools/perf/util/scripting-engines/trace-event-perl.c +2 -2
@@ -339,7 +339,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, {struct thread *thread = al->thread;struct tep_event_format *event = evsel->tp_format; -struct format_field *field; +struct tep_format_field *field;static char handler[256 ];unsigned long long val;unsigned long s, ns;
@@ -538,7 +538,7 @@ static int perl_stop_script(void)static int perl_generate_script (struct tep_handle *pevent,const char *outfile) {struct tep_event_format *event =NULL ; -struct format_field *f; +struct tep_format_field *f;char fname[PATH_MAX ];int not_first, count;FILE *ofp;
tools/perf/util/scripting-engines/trace-event-python.c +3 -3
@@ -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, -struct format_field *field,void *data) +struct tep_format_field *field,void *data) {bool is_array = field->flags &FIELD_IS_ARRAY ;PyObject *obj =NULL , *list =NULL ;
@@ -794,7 +794,7 @@ static void python_process_tracepoint(struct perf_sample *sample,PyObject *handler, *context, *t, *obj =NULL , *callchain;PyObject *dict =NULL , *all_entries_dict =NULL ;static char handler_name[256 ]; -struct format_field *field; +struct tep_format_field *field;unsigned long s, ns;unsigned n =0 ;int pid;
@@ -1591,7 +1591,7 @@ static int python_stop_script(void)static int python_generate_script (struct tep_handle *pevent,const char *outfile) {struct tep_event_format *event =NULL ; -struct format_field *f; +struct tep_format_field *f;char fname[PATH_MAX ];int not_first, count;FILE *ofp;
tools/perf/util/sort.c +9 -9
@@ -1884,7 +1884,7 @@ static int __sort_dimension__add_hpp_output(struct sort_dimension *sd,struct hpp_dynamic_entry {struct perf_hpp_fmt hpp;struct perf_evsel *evsel; -struct format_field *field; +struct tep_format_field *field;unsigned dynamic_len;bool raw_trace; };
@@ -1915,7 +1915,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde, struct hist_entry *he) {char *str, *pos; -struct format_field *field = hde->field; +struct tep_format_field *field = hde->field;size_t namelen;bool last = false;
@@ -2000,7 +2000,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,struct hpp_dynamic_entry *hde;size_t len = fmt->user_len;char *str, *pos; -struct format_field *field; +struct tep_format_field *field;size_t namelen;bool last = false;int ret;
@@ -2060,7 +2060,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b) { struct hpp_dynamic_entry *hde; -struct format_field *field; +struct tep_format_field *field;unsigned offset, size; hde = container_of(fmt, struct hpp_dynamic_entry, hpp);
@@ -2117,7 +2117,7 @@ static void hde_free(struct perf_hpp_fmt *fmt) }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) {struct hpp_dynamic_entry *hde;
@@ -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, -struct format_field *field, +struct tep_format_field *field,bool raw_trace,int level) {struct hpp_dynamic_entry *hde;
@@ -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) {int ret; -struct format_field *field; +struct tep_format_field *field; field = evsel->tp_format->format.fields;while (field) {
@@ -2305,7 +2305,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist, {int ret = -ESRCH ;struct perf_evsel *evsel; -struct format_field *field; +struct tep_format_field *field;evlist__for_each_entry (evlist, evsel) {if (evsel->attr.type !=PERF_TYPE_TRACEPOINT )
@@ -2327,7 +2327,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, {char *str, *event_name, *field_name, *opt_name;struct perf_evsel *evsel; -struct format_field *field; +struct tep_format_field *field;bool raw_trace = symbol_conf.raw_trace;int ret =0 ;
tools/perf/util/trace-event-parse.c +2 -2
@@ -34,7 +34,7 @@ static int get_common_field(struct scripting_context *context, {struct tep_handle *pevent = context->pevent;struct tep_event_format *event; -struct format_field *field; +struct tep_format_field *field;if (!*size) {if (!pevent->events)
@@ -96,7 +96,7 @@ int common_pc(struct scripting_context *context)unsigned long long 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; field =tep_find_any_field (event, name);
Signature · 1 line
2.18.0
PATCH 6/15 tools/lib/traceevent, tools/perf: Add prefix tep_ to all print_* structures
In reply to Steven RostedtFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
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 adds prefix tep_ to all print_* structures
--- tools/lib/traceevent/event-parse.c | 144 +++++++++--------- tools/lib/traceevent/event-parse.h | 98 ++++++------ .../util/scripting-engines/trace-event-perl.c | 6 +- .../scripting-engines/trace-event-python.c | 4 +- 4 files changed, 126 insertions(+), 126 deletions(-)
tools/lib/traceevent/event-parse.c +72 -72
@@ -95,7 +95,7 @@ struct tep_function_handler {static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct tep_event_format *event,struct print_arg *arg); +struct tep_event_format *event,struct tep_print_arg *arg);static void free_func_handle (struct tep_function_handler *func);
@@ -118,9 +118,9 @@ void breakpoint(void) x++; } -struct print_arg *alloc_arg (void ) +struct tep_print_arg *alloc_arg (void ) { -return calloc (1 ,sizeof (struct print_arg )); +return calloc (1 ,sizeof (struct tep_print_arg )); }struct cmdline {
@@ -781,9 +781,9 @@ static int event_item_type(enum tep_event_type type) } } -static void free_flag_sym (struct print_flag_sym *fsym) +static void free_flag_sym (struct tep_print_flag_sym *fsym) { -struct print_flag_sym *next; +struct tep_print_flag_sym *next;while (fsym) { next = fsym->next;
@@ -794,9 +794,9 @@ static void free_flag_sym(struct print_flag_sym *fsym) } } -static void free_arg (struct print_arg *arg) +static void free_arg (struct tep_print_arg *arg) { -struct print_arg *farg; +struct tep_print_arg *farg;if (!arg)return ;
@@ -1674,11 +1674,11 @@ static int event_read_format(struct tep_event_format *event) }static enum tep_event_type -process_arg_token (struct tep_event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct tep_print_arg *arg,char **tok,enum tep_event_type type);static enum tep_event_type -process_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_arg (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;char *token;
@@ -1690,14 +1690,14 @@ process_arg(struct tep_event_format *event, struct print_arg *arg, char **tok) }static enum tep_event_type -process_op (struct tep_event_format *event,struct print_arg *arg,char **tok); +process_op (struct tep_event_format *event,struct tep_print_arg *arg,char **tok);/* * For __print_symbolic() and __print_flags, we need to completely * evaluate the first argument, which defines what to print next. */ static enum tep_event_type -process_field_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_field_arg (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -1711,9 +1711,9 @@ process_field_arg(struct tep_event_format *event, struct print_arg *arg, char ** }static enum tep_event_type -process_cond (struct tep_event_format *event,struct print_arg *top,char **tok) +process_cond (struct tep_event_format *event,struct tep_print_arg *top,char **tok) { -struct print_arg *arg, *left, *right; +struct tep_print_arg *arg, *left, *right;enum tep_event_type type;char *token =NULL ;
@@ -1767,9 +1767,9 @@ process_cond(struct tep_event_format *event, struct print_arg *top, char **tok) }static enum tep_event_type -process_array (struct tep_event_format *event,struct print_arg *top,char **tok) +process_array (struct tep_event_format *event,struct tep_print_arg *top,char **tok) { -struct print_arg *arg; +struct tep_print_arg *arg;enum tep_event_type type;char *token =NULL ;
@@ -1855,7 +1855,7 @@ static int get_op_prio(char *op) } } -static int set_op_prio (struct print_arg *arg) +static int set_op_prio (struct tep_print_arg *arg) {/* single ops are the greatest */
@@ -1869,9 +1869,9 @@ static int set_op_prio(struct print_arg *arg)/* Note, *tok does not get freed, but will most likely be saved */ static enum tep_event_type -process_op (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_op (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *left, *right =NULL ; +struct tep_print_arg *left, *right =NULL ;enum tep_event_type type;char *token;
@@ -2009,7 +2009,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok)if (right->type ==PRINT_OP &&get_op_prio (arg->op.op) <get_op_prio (right->op.op)) { -struct print_arg tmp; +struct tep_print_arg tmp;/* rotate ops according to the priority */ arg->op.right = right->op.left;
@@ -2070,7 +2070,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) }static enum tep_event_type -process_entry (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +process_entry (struct tep_event_format *event__maybe_unused ,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -2110,9 +2110,9 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *a }static int alloc_and_process_delim (struct tep_event_format *event,char *next_token, -struct print_arg **print_arg) +struct tep_print_arg **print_arg) { -struct print_arg *field; +struct tep_print_arg *field;enum tep_event_type type;char *token;int ret =0 ;
@@ -2141,7 +2141,7 @@ static int alloc_and_process_delim(struct tep_event_format *event, char *next_toreturn ret; } -static char *arg_eval (struct print_arg *arg); +static char *arg_eval (struct tep_print_arg *arg);static unsigned long long eval_type_str (unsigned long long val,const char *type,int pointer)
@@ -2238,7 +2238,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)* Try to figure out the type. */ static unsigned long long -eval_type (unsigned long long val,struct print_arg *arg,int pointer) +eval_type (unsigned long long val,struct tep_print_arg *arg,int pointer) {if (arg->type !=PRINT_TYPE ) {do_warning ("expected type argument" );
@@ -2248,7 +2248,7 @@ eval_type(unsigned long long val, struct print_arg *arg, int pointer)return eval_type_str (val, arg->typecast.type, pointer); } -static int arg_num_eval (struct print_arg *arg,long long *val) +static int arg_num_eval (struct tep_print_arg *arg,long long *val) {long long left, right;int ret =1 ;
@@ -2414,7 +2414,7 @@ static int arg_num_eval(struct print_arg *arg, long long *val)return ret; } -static char *arg_eval (struct print_arg *arg) +static char *arg_eval (struct tep_print_arg *arg) {long long val;static char buf[20 ];
@@ -2444,11 +2444,11 @@ static char *arg_eval (struct print_arg *arg) }static enum tep_event_type -process_fields (struct tep_event_format *event,struct print_flag_sym **list,char **tok) +process_fields (struct tep_event_format *event,struct tep_print_flag_sym **list,char **tok) {enum tep_event_type type; -struct print_arg *arg =NULL ; -struct print_flag_sym *field; +struct tep_print_arg *arg =NULL ; +struct tep_print_flag_sym *field;char *token = *tok;char *value;
@@ -2525,9 +2525,9 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, cha }static enum tep_event_type -process_flags (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_flags (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *field; +struct tep_print_arg *field;enum tep_event_type type;char *token =NULL ;
@@ -2578,9 +2578,9 @@ process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok) }static enum tep_event_type -process_symbols (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_symbols (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *field; +struct tep_print_arg *field;enum tep_event_type type;char *token =NULL ;
@@ -2617,7 +2617,7 @@ process_symbols(struct tep_event_format *event, struct print_arg *arg, char **to }static enum tep_event_type -process_hex_common (struct tep_event_format *event,struct print_arg *arg, +process_hex_common (struct tep_event_format *event,struct tep_print_arg *arg,char **tok,enum print_arg_type type) {memset (arg,0 ,sizeof (*arg));
@@ -2640,20 +2640,20 @@ process_hex_common(struct tep_event_format *event, struct print_arg *arg, }static enum tep_event_type -process_hex (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_hex (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX ); }static enum tep_event_type -process_hex_str (struct tep_event_format *event,struct print_arg *arg, +process_hex_str (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX_STR ); }static enum tep_event_type -process_int_array (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_int_array (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg)); arg->type =PRINT_INT_ARRAY ;
@@ -2681,7 +2681,7 @@ process_int_array(struct tep_event_format *event, struct print_arg *arg, char ** }static enum tep_event_type -process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_dynamic_array (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {struct tep_format_field *field;enum tep_event_type type;
@@ -2745,7 +2745,7 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha }static enum tep_event_type -process_dynamic_array_len (struct tep_event_format *event,struct print_arg *arg, +process_dynamic_array_len (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {struct tep_format_field *field;
@@ -2781,9 +2781,9 @@ process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, }static enum tep_event_type -process_paren (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_paren (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *item_arg; +struct tep_print_arg *item_arg;enum tep_event_type type;char *token;
@@ -2844,7 +2844,7 @@ process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok)static enum tep_event_type -process_str (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +process_str (struct tep_event_format *event__maybe_unused ,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -2873,7 +2873,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct print_arg *arg }static enum tep_event_type -process_bitmask (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +process_bitmask (struct tep_event_format *event__maybe_unused ,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -2935,10 +2935,10 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)static enum tep_event_type process_func_handler (struct tep_event_format *event,struct tep_function_handler *func, -struct print_arg *arg,char **tok) +struct tep_print_arg *arg,char **tok) { -struct print_arg **next_arg; -struct print_arg *farg; +struct tep_print_arg **next_arg; +struct tep_print_arg *farg;enum tep_event_type type;char *token;int i;
@@ -2992,7 +2992,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler }static enum tep_event_type -process_function (struct tep_event_format *event,struct print_arg *arg, +process_function (struct tep_event_format *event,struct tep_print_arg *arg,char *token,char **tok) {struct tep_function_handler *func;
@@ -3048,7 +3048,7 @@ process_function(struct tep_event_format *event, struct print_arg *arg, }static enum tep_event_type -process_arg_token (struct tep_event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct tep_print_arg *arg,char **tok,enum tep_event_type type) {char *token;
@@ -3136,10 +3136,10 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,return type; } -static int event_read_print_args (struct tep_event_format *event,struct print_arg **list) +static int event_read_print_args (struct tep_event_format *event,struct tep_print_arg **list) {enum tep_event_type type =TEP_EVENT_ERROR ; -struct print_arg *arg; +struct tep_print_arg *arg;char *token;int args =0 ;
@@ -3522,13 +3522,13 @@ tep_find_event_by_name(struct tep_handle *pevent, }static unsigned long long -eval_num_arg (void *data,int size,struct tep_event_format *event,struct print_arg *arg) +eval_num_arg (void *data,int size,struct tep_event_format *event,struct tep_print_arg *arg) {struct tep_handle *pevent = event->pevent;unsigned long long val =0 ;unsigned long long left, right; -struct print_arg *typearg =NULL ; -struct print_arg *larg; +struct tep_print_arg *typearg =NULL ; +struct tep_print_arg *larg;unsigned long offset;unsigned int field_size;
@@ -3863,10 +3863,10 @@ static void print_bitmask_to_seq(struct tep_handle *pevent,static void print_str_arg (struct trace_seq *s,void *data,int size,struct tep_event_format *event,const char *format, -int len_arg,struct print_arg *arg) +int len_arg,struct tep_print_arg *arg) {struct tep_handle *pevent = event->pevent; -struct print_flag_sym *flag; +struct tep_print_flag_sym *flag;struct tep_format_field *field;struct printk_map *printk;long long val, fval;
@@ -4117,13 +4117,13 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct tep_event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct tep_print_arg *arg) {struct tep_function_handler *func_handle = arg->func.func;struct func_params *param;unsigned long long *args;unsigned long long ret; -struct print_arg *farg; +struct tep_print_arg *farg;struct trace_seq str;struct save_str {struct save_str *next;
@@ -4200,9 +4200,9 @@ process_defined_func(struct trace_seq *s, void *data, int size,return ret; } -static void free_args (struct print_arg *args) +static void free_args (struct tep_print_arg *args) { -struct print_arg *next; +struct tep_print_arg *next;while (args) { next = args->next;
@@ -4212,11 +4212,11 @@ static void free_args(struct print_arg *args) } } -static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) +static struct tep_print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;struct tep_format_field *field, *ip_field; -struct print_arg *args, *arg, **next; +struct tep_print_arg *args, *arg, **next;unsigned long long ip, val;char *ptr;void *bptr;
@@ -4424,7 +4424,7 @@ get_bprint_format(void *data, int size __maybe_unused, }static void print_mac_arg (struct trace_seq *s,int mac,void *data,int size, -struct tep_event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct tep_print_arg *arg) {unsigned char *buf;const char *fmt ="%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ;
@@ -4578,7 +4578,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf)*/ static int print_ipv4_arg (struct trace_seq *s,const char *ptr,char i,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {unsigned char *buf;
@@ -4615,7 +4615,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,static int print_ipv6_arg (struct trace_seq *s,const char *ptr,char i,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {char have_c =0 ;unsigned char *buf;
@@ -4665,7 +4665,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,static int print_ipsa_arg (struct trace_seq *s,const char *ptr,char i,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {char have_c =0 , have_p =0 ;unsigned char *buf;
@@ -4747,7 +4747,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,static int print_ip_arg (struct trace_seq *s,const char *ptr,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {char i = *ptr;/* 'i' or 'I' */ char ver;
@@ -4868,9 +4868,9 @@ 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_format *event) {struct tep_handle *pevent = event->pevent; -struct print_fmt *print_fmt = &event->print_fmt; -struct print_arg *arg = print_fmt->args; -struct print_arg *args =NULL ; +struct tep_print_fmt *print_fmt = &event->print_fmt; +struct tep_print_arg *arg = print_fmt->args; +struct tep_print_arg *args =NULL ;const char *ptr = print_fmt->format;unsigned long long val;struct func_map *func;
@@ -5723,7 +5723,7 @@ struct tep_format_field **tep_event_fields(struct tep_event_format *event) event->format.fields); } -static void print_fields (struct trace_seq *s,struct print_flag_sym *field) +static void print_fields (struct trace_seq *s,struct tep_print_flag_sym *field) {trace_seq_printf (s,"{ %s, %s }" , field->value, field->str);if (field->next) {
@@ -5733,7 +5733,7 @@ static void print_fields(struct trace_seq *s, struct print_flag_sym *field) }/* for debugging */ -static void print_args (struct print_arg *args) +static void print_args (struct tep_print_arg *args) {int print_paren =1 ;struct trace_seq s;
@@ -6091,7 +6091,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,if (!ret && (event->flags &TEP_EVENT_FL_ISFTRACE )) {struct tep_format_field *field; -struct print_arg *arg, **list; +struct tep_print_arg *arg, **list;/* old ftrace had no args */ list = &event->print_fmt.args;
tools/lib/traceevent/event-parse.h +49 -49
161 lines not on this page · raw message
tools/perf/util/scripting-engines/trace-event-perl.c +3 -3
@@ -99,7 +99,7 @@ static void define_symbolic_value(const char *ev_name,LEAVE ; } -static void define_symbolic_values (struct print_flag_sym *field, +static void define_symbolic_values (struct tep_print_flag_sym *field,const char *ev_name,const char *field_name) {
@@ -157,7 +157,7 @@ static void define_flag_value(const char *ev_name,LEAVE ; } -static void define_flag_values (struct print_flag_sym *field, +static void define_flag_values (struct tep_print_flag_sym *field,const char *ev_name,const char *field_name) {
@@ -191,7 +191,7 @@ static void define_flag_field(const char *ev_name,static void define_event_symbols (struct tep_event_format *event,const char *ev_name, -struct print_arg *args) +struct tep_print_arg *args) {if (args ==NULL )return ;
tools/perf/util/scripting-engines/trace-event-python.c +2 -2
@@ -224,7 +224,7 @@ static void define_value(enum print_arg_type field_type, }static void define_values (enum print_arg_type field_type, -struct print_flag_sym *field, +struct tep_print_flag_sym *field,const char *ev_name,const char *field_name) {
@@ -266,7 +266,7 @@ static void define_field(enum print_arg_type field_type,static void define_event_symbols (struct tep_event_format *event,const char *ev_name, -struct print_arg *args) +struct tep_print_arg *args) {if (args ==NULL )return ;
Signature · 1 line
2.18.0
Quoted 8 lines · Steven Rostedt
Jiri,
This is another series to fix the namespace of libtraceevent.
Please pull in these patches or if you choose, pull in the branch. The code is based off of the latest tip/perf/core.
Quoted 7 lines
These changes can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/coreHead SHA1:
bb730b5833b5bddf5cb226865e5f4496770d00b09bc7aeba01678955c3724052966ab8ad61053c89
nice, looks good to me:
Arnaldo,
could you please pull this in?
Steven,
is there still something left to rename, or we can start moving it into public rpm?
thanks,
jirka
Quoted 46 lines
Tzvetomir Stoyanov (VMware) (15):
tools/lib/traceevent,tools/perf: Rename structevent_formatto structtep_event_formattools/lib/traceevent,tools/perf: Rename struct format{_field} to struct tep_format{_field}tools/lib/traceevent,tools/perf: Rename enumformat_flagsto enumtep_format_flagstools/lib/traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}typetools/lib/traceevent: Add prefixTEP_to all EVENT_FL_* flagstools/lib/traceevent,tools/perf: Add prefixtep_to all print_* structurestools/lib/traceevent,tools/perf: Rename enumprint_arg_typeto enumtep_print_arg_typetools/lib/traceevent: Add prefixtep_to enums filter_{boolean,op,cmp}_typetools/lib/traceevent: Add prefixtep_to enums filter_{exp,arg}_typetools/lib/traceevent: Add prefixtep_to struct filter_{arg,value_type}tools/lib/traceevent: Add prefixtep_to various structs filter_arg_*.tools/lib/traceevent: Add prefixtep_to structsfilter_typeandevent_filtertools/lib/traceevent: Rename structplugin_listto structtep_plugin_listtools/lib/traceevent: Rename data2host*() APIs
tools/lib/traceevent: Add prefixtep_to enumfilter_trivial_type----
tools/lib/traceevent/event-parse.c | 1184 ++++++++++---------- tools/lib/traceevent/event-parse.h | 532 ++++----- tools/lib/traceevent/event-plugin.c | 18 +- tools/lib/traceevent/parse-filter.c | 646 +++++------ tools/lib/traceevent/plugin_function.c | 2 +- tools/lib/traceevent/plugin_hrtimer.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 4 +- tools/lib/traceevent/plugin_kvm.c | 14 +- tools/lib/traceevent/plugin_mac80211.c | 6 +- tools/lib/traceevent/plugin_sched_switch.c | 10 +- tools/perf/builtin-trace.c | 18 +- tools/perf/tests/evsel-tp-sched.c | 4 +- tools/perf/util/data-convert-bt.c | 56 +- tools/perf/util/evsel.c | 10 +- tools/perf/util/evsel.h | 10 +- tools/perf/util/evsel_fprintf.c | 2 +- tools/perf/util/header.c | 2 +- tools/perf/util/python.c | 20 +- .../perf/util/scripting-engines/trace-event-perl.c | 66 +- .../util/scripting-engines/trace-event-python.c | 100 +- tools/perf/util/sort.c | 22 +- tools/perf/util/trace-event-parse.c | 18 +- tools/perf/util/trace-event-read.c | 4 +- tools/perf/util/trace-event.c | 8 +- tools/perf/util/trace-event.h | 20 +- 25 files changed, 1390 insertions(+), 1390 deletions(-)
Quoted 4 lines · On Sun, 23 Sep 2018 20:56:26 +0200 Jiri Olsa <[email protected]> wrote:
Steven,
is there still something left to rename, or we can start moving it into public rpm?
We're testing it as a external library, and we did find something. Did you get this patch?
https://lore.kernel.org/lkml/[email protected]
We're testing it against powertop and mceutils, when we get it working well with them, then I think it's time to start going ahead and making it into an rpm.
Thanks Jiri!
-- Steve
Arnaldo Carvalho de Melo
maintainerEm Mon, Sep 24, 2018 at 04:55:23AM -0400, Steven Rostedt escreveu:
Quoted 4 lines
Quoted 1 line · On Sun, 23 Sep 2018 20:56:26 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 8 lines
Quoted 3 lines
Steven,
is there still something left to rename, or we can start moving it into public rpm?We're testing it as a external library, and we did find something. Did you get this patch?
I'm finishing tests with the patchset before this last patch, will push to Ingo soon, then will check if the patch with the private copy of the strerror_r() wrapper passes on the systems that made that wrapper came to be, i.e. systems using the musl libc (https://www.musl-libc.org/).
Quoted 3 lines
We're testing it against powertop and mceutils, when we get it working well with them, then I think it's time to start going ahead and making it into an rpm.
At some point would be nice if you guys provided patches to make tools/perf/ link dynamicly to libtraceevent as well.
- Arnaldo
Quoted 2 lines · On Mon, 24 Sep 2018 11:16:32 -0300 Arnaldo Carvalho de Melo <[email protected]>…
At some point would be nice if you guys provided patches to make
tools/perf/link dynamicly to libtraceevent as well.
It's on the agenda, but we have to get it working first ;-)
Note, we are doing all the work in the kernel's tools/lib/traceevent and then backporting it to trace-cmd, but we are going to make the libtraceevent.so library live in the kernel's tools directory.
-- Steve
Arnaldo Carvalho de Melo
maintainerEm Mon, Sep 24, 2018 at 11:16:32AM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 9 lines
Em Mon, Sep 24, 2018 at 04:55:23AM -0400, Steven Rostedt escreveu:
Quoted 7 lines
Quoted 1 line · On Sun, 23 Sep 2018 20:56:26 +0200 Jiri Olsa <[email protected]> wrote:
is there still something left to rename, or we can start moving it into public rpm?
We're testing it as a external library, and we did find something. Did you get this patch?
Quoted 6 lines
Quoted 1 line
I'm finishing tests with the patchset before this last patch, will push to Ingo soon, then will check if the patch with the private copy of the
strerror_r()wrapper passes on the systems that made that wrapper came to be, i.e. systems using the musl libc (https://www.musl-libc.org/).
Ok, it passes on these systems:
1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0 6 alpine:edge : Ok gcc (Alpine 6.4.0) 6.4.0
Which puzzled me, but then I saw that you guys are not using strerror_r(), but strerror() that is not thread-safe, and then the pitfalls with strerror_r() XSI/_GNU_SOURCE problems are not hit.
This same problem happened with tools/lib/bpf/, and I fixed it in by having a separate file to create the wrapper, where we make sure _GNU_SOURCE is not defined and continue using strerror_r():
I think it would be interesting to use something similar so that libtraceevent becomes thread safe for this specific point.
For now I've applied the patch to my local perf/core branch, so that it gets tested in more systems.
- Arnaldo
Quoted 4 lines · Steven Rostedt
Quoted 1 line · On Sun, 23 Sep 2018 20:56:26 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 8 lines
Quoted 3 lines
Steven,
is there still something left to rename, or we can start moving it into public rpm?We're testing it as a external library, and we did find something. Did you get this patch?
ah yep, overlooked this one.. going to check it
jirka
Quoted 8 lines
We're testing it against powertop and mceutils, when we get it working well with them, then I think it's time to start going ahead and making it into an rpm.
Thanks Jiri!
-- Steve
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format
In reply to Steven Rostedttools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format
Commit-ID: 4963b0f88bb91ed0122f7b08876ae89fcafb2842 Gitweb: https://git.kernel.org/tip/4963b0f88bb91ed0122f7b08876ae89fcafb2842 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:44 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:11:50 -0300
tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format
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 event_format to struct tep_event_format
--- tools/lib/traceevent/event-parse.c | 186 ++++++++++----------- tools/lib/traceevent/event-parse.h | 66 ++++---- tools/lib/traceevent/parse-filter.c | 42 ++--- tools/lib/traceevent/plugin_function.c | 2 +- tools/lib/traceevent/plugin_hrtimer.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_kvm.c | 14 +- tools/lib/traceevent/plugin_mac80211.c | 4 +- tools/lib/traceevent/plugin_sched_switch.c | 4 +- tools/perf/builtin-trace.c | 2 +- tools/perf/util/evsel.h | 4 +- tools/perf/util/header.c | 2 +- tools/perf/util/python.c | 4 +- .../perf/util/scripting-engines/trace-event-perl.c | 6 +- .../util/scripting-engines/trace-event-python.c | 8 +- tools/perf/util/trace-event-parse.c | 14 +- tools/perf/util/trace-event.c | 8 +- tools/perf/util/trace-event.h | 16 +- 18 files changed, 194 insertions(+), 194 deletions(-)
tools/lib/traceevent/event-parse.c +93 -93
@@ -95,7 +95,7 @@ struct tep_function_handler {static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct event_format *event,struct print_arg *arg); +struct tep_event_format *event,struct print_arg *arg);static void free_func_handle (struct tep_function_handler *func);
@@ -738,16 +738,16 @@ void tep_print_printk(struct tep_handle *pevent) } } -static struct event_format *alloc_event (void ) +static struct tep_event_format *alloc_event (void ) { -return calloc (1 ,sizeof (struct event_format )); +return calloc (1 ,sizeof (struct tep_event_format )); } -static int add_event (struct tep_handle *pevent,struct event_format *event) +static int add_event (struct tep_handle *pevent,struct tep_event_format *event) {int i; -struct event_format **events =realloc (pevent->events,sizeof (event) * - (pevent->nr_events +1 )); +struct tep_event_format **events =realloc (pevent->events,sizeof (event) * + (pevent->nr_events +1 ));if (!events)return -1 ;
@@ -1354,7 +1354,7 @@ static unsigned int type_size(const char *name)return 0 ; } -static int event_read_fields (struct event_format *event,struct format_field **fields) +static int event_read_fields (struct tep_event_format *event,struct format_field **fields) {struct format_field *field =NULL ;enum event_type type;
@@ -1641,7 +1641,7 @@ fail_expect:return -1 ; } -static int event_read_format (struct event_format *event) +static int event_read_format (struct tep_event_format *event) {char *token;int ret;
@@ -1674,11 +1674,11 @@ static int event_read_format(struct event_format *event) }static enum event_type -process_arg_token (struct event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct print_arg *arg,char **tok,enum event_type type);static enum event_type -process_arg (struct event_format *event,struct print_arg *arg,char **tok) +process_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) {enum event_type type;char *token;
@@ -1690,14 +1690,14 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_op (struct event_format *event,struct print_arg *arg,char **tok); +process_op (struct tep_event_format *event,struct print_arg *arg,char **tok);/* * For __print_symbolic() and __print_flags, we need to completely * evaluate the first argument, which defines what to print next. */ static enum event_type -process_field_arg (struct event_format *event,struct print_arg *arg,char **tok) +process_field_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) {enum event_type type;
@@ -1711,7 +1711,7 @@ process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) }static enum event_type -process_cond (struct event_format *event,struct print_arg *top,char **tok) +process_cond (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg, *left, *right;enum event_type type;
@@ -1767,7 +1767,7 @@ out_free: }static enum event_type -process_array (struct event_format *event,struct print_arg *top,char **tok) +process_array (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg;enum event_type type;
@@ -1869,7 +1869,7 @@ static int set_op_prio(struct print_arg *arg)/* Note, *tok does not get freed, but will most likely be saved */ static enum event_type -process_op (struct event_format *event,struct print_arg *arg,char **tok) +process_op (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *left, *right =NULL ;enum event_type type;
@@ -2070,7 +2070,7 @@ out_free: }static enum event_type -process_entry (struct event_format *event__maybe_unused ,struct print_arg *arg, +process_entry (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) {enum event_type type;
@@ -2109,7 +2109,7 @@ process_entry(struct event_format *event __maybe_unused, struct print_arg *arg,return EVENT_ERROR ; } -static int alloc_and_process_delim (struct event_format *event,char *next_token, +static int alloc_and_process_delim (struct tep_event_format *event,char *next_token,struct print_arg **print_arg) {struct print_arg *field;
@@ -2444,7 +2444,7 @@ static char *arg_eval (struct print_arg *arg) }static enum event_type -process_fields (struct event_format *event,struct print_flag_sym **list,char **tok) +process_fields (struct tep_event_format *event,struct print_flag_sym **list,char **tok) {enum event_type type;struct print_arg *arg =NULL ;
@@ -2525,7 +2525,7 @@ out_free: }static enum event_type -process_flags (struct event_format *event,struct print_arg *arg,char **tok) +process_flags (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field;enum event_type type;
@@ -2578,7 +2578,7 @@ out_free: }static enum event_type -process_symbols (struct event_format *event,struct print_arg *arg,char **tok) +process_symbols (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field;enum event_type type;
@@ -2617,7 +2617,7 @@ out_free: }static enum event_type -process_hex_common (struct event_format *event,struct print_arg *arg, +process_hex_common (struct tep_event_format *event,struct print_arg *arg,char **tok,enum print_arg_type type) {memset (arg,0 ,sizeof (*arg));
@@ -2640,20 +2640,20 @@ out: }static enum event_type -process_hex (struct event_format *event,struct print_arg *arg,char **tok) +process_hex (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX ); }static enum event_type -process_hex_str (struct event_format *event,struct print_arg *arg, +process_hex_str (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX_STR ); }static enum event_type -process_int_array (struct event_format *event,struct print_arg *arg,char **tok) +process_int_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg)); arg->type =PRINT_INT_ARRAY ;
@@ -2681,7 +2681,7 @@ out: }static enum event_type -process_dynamic_array (struct event_format *event,struct print_arg *arg,char **tok) +process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct format_field *field;enum event_type type;
@@ -2745,7 +2745,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char ** }static enum event_type -process_dynamic_array_len (struct event_format *event,struct print_arg *arg, +process_dynamic_array_len (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct format_field *field;
@@ -2781,7 +2781,7 @@ process_dynamic_array_len(struct event_format *event, struct print_arg *arg, }static enum event_type -process_paren (struct event_format *event,struct print_arg *arg,char **tok) +process_paren (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *item_arg;enum event_type type;
@@ -2844,7 +2844,7 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)static enum event_type -process_str (struct event_format *event__maybe_unused ,struct print_arg *arg, +process_str (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) {enum event_type type;
@@ -2873,8 +2873,8 @@ process_str(struct event_format *event __maybe_unused, struct print_arg *arg, }static enum event_type -process_bitmask (struct event_format *event__maybe_unused ,struct print_arg *arg, -char **tok) +process_bitmask (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +char **tok) {enum event_type type;char *token;
@@ -2934,7 +2934,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) }static enum event_type -process_func_handler (struct event_format *event,struct tep_function_handler *func, +process_func_handler (struct tep_event_format *event,struct tep_function_handler *func,struct print_arg *arg,char **tok) {struct print_arg **next_arg;
@@ -2992,7 +2992,7 @@ err: }static enum event_type -process_function (struct event_format *event,struct print_arg *arg, +process_function (struct tep_event_format *event,struct print_arg *arg,char *token,char **tok) {struct tep_function_handler *func;
@@ -3048,7 +3048,7 @@ process_function(struct event_format *event, struct print_arg *arg, }static enum event_type -process_arg_token (struct event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct print_arg *arg,char **tok,enum event_type type) {char *token;
@@ -3136,7 +3136,7 @@ process_arg_token(struct event_format *event, struct print_arg *arg,return type; } -static int event_read_print_args (struct event_format *event,struct print_arg **list) +static int event_read_print_args (struct tep_event_format *event,struct print_arg **list) {enum event_type type =EVENT_ERROR ;struct print_arg *arg;
@@ -3194,7 +3194,7 @@ static int event_read_print_args(struct event_format *event, struct print_arg **return args; } -static int event_read_print (struct event_format *event) +static int event_read_print (struct tep_event_format *event) {enum event_type type;char *token;
@@ -3260,7 +3260,7 @@ static int event_read_print(struct event_format *event)* This only searchs the common fields and not all field. */ struct format_field * -tep_find_common_field (struct event_format *event,const char *name) +tep_find_common_field (struct tep_event_format *event,const char *name) {struct format_field *format;
@@ -3282,7 +3282,7 @@ tep_find_common_field(struct event_format *event, const char *name)* This does not search common fields. */ struct format_field * -tep_find_field (struct event_format *event,const char *name) +tep_find_field (struct tep_event_format *event,const char *name) {struct format_field *format;
@@ -3305,7 +3305,7 @@ tep_find_field(struct event_format *event, const char *name)* the non-common ones if a common one was not found. */ struct format_field * -tep_find_any_field (struct event_format *event,const char *name) +tep_find_any_field (struct tep_event_format *event,const char *name) {struct format_field *format;
@@ -3374,7 +3374,7 @@ int tep_read_number_field(struct format_field *field, const void *data,static int get_common_info (struct tep_handle *pevent,const char *type,int *offset,int *size) { -struct event_format *event; +struct tep_event_format *event;struct format_field *field;/*
@@ -3461,11 +3461,11 @@ static int events_id_cmp(const void *a, const void *b);* * Returns an event that has a given @id. */ -struct event_format *tep_find_event (struct tep_handle *pevent,int id) +struct tep_event_format *tep_find_event (struct tep_handle *pevent,int id) { -struct event_format **eventptr; -struct event_format key; -struct event_format *pkey = &key; +struct tep_event_format **eventptr; +struct tep_event_format key; +struct tep_event_format *pkey = &key;/* Check cache first */ if (pevent->last_event && pevent->last_event->id == id)
@@ -3493,11 +3493,11 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)* This returns an event with a given @name and under the system * @sys. If @sys is NULL the first event with @name is returned. */ -struct event_format * +struct tep_event_format *tep_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name) { -struct event_format *event; +struct tep_event_format *event;int i; if (pevent->last_event &&
@@ -3522,7 +3522,7 @@ tep_find_event_by_name(struct tep_handle *pevent, }static unsigned long long -eval_num_arg (void *data,int size,struct event_format *event,struct print_arg *arg) +eval_num_arg (void *data,int size,struct tep_event_format *event,struct print_arg *arg) {struct tep_handle *pevent = event->pevent;unsigned long long val =0 ;
@@ -3862,7 +3862,7 @@ static void print_bitmask_to_seq(struct tep_handle *pevent, }static void print_str_arg (struct trace_seq *s,void *data,int size, -struct event_format *event,const char *format, +struct tep_event_format *event,const char *format,int len_arg,struct print_arg *arg) {struct tep_handle *pevent = event->pevent;
@@ -4117,7 +4117,7 @@ out_warning_field:static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct print_arg *arg) {struct tep_function_handler *func_handle = arg->func.func;struct func_params *param;
@@ -4212,7 +4212,7 @@ static void free_args(struct print_arg *args) } } -static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct event_format *event) +static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;struct format_field *field, *ip_field;
@@ -4389,7 +4389,7 @@ out_free:static char *get_bprint_format (void *data,int size__maybe_unused , -struct event_format *event) +struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;unsigned long long addr;
@@ -4424,7 +4424,7 @@ get_bprint_format(void *data, int size __maybe_unused, }static void print_mac_arg (struct trace_seq *s,int mac,void *data,int size, -struct event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct print_arg *arg) {unsigned char *buf;const char *fmt ="%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ;
@@ -4577,7 +4577,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf)* %pISpc print an IP address based on sockaddr; p adds port. */ static int print_ipv4_arg (struct trace_seq *s,const char *ptr,char i, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {unsigned char *buf;
@@ -4614,7 +4614,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, }static int print_ipv6_arg (struct trace_seq *s,const char *ptr,char i, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {char have_c =0 ;
@@ -4664,7 +4664,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, }static int print_ipsa_arg (struct trace_seq *s,const char *ptr,char i, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {char have_c =0 , have_p =0 ;
@@ -4746,7 +4746,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, }static int print_ip_arg (struct trace_seq *s,const char *ptr, -void *data,int size,struct event_format *event, +void *data,int size,struct tep_event_format *event,struct print_arg *arg) {char i = *ptr;/* 'i' or 'I' */
@@ -4853,7 +4853,7 @@ void tep_print_field(struct trace_seq *s, void *data, }void tep_print_fields (struct trace_seq *s,void *data, -int size__maybe_unused ,struct event_format *event) +int size__maybe_unused ,struct tep_event_format *event) {struct format_field *field;
@@ -4865,7 +4865,7 @@ void tep_print_fields(struct trace_seq *s, void *data, } } -static void pretty_print (struct trace_seq *s,void *data,int size,struct event_format *event) +static void pretty_print (struct trace_seq *s,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;struct print_fmt *print_fmt = &event->print_fmt;
@@ -5228,7 +5228,7 @@ int tep_data_type(struct tep_handle *pevent, struct tep_record *rec)* * This returns the event form a given @type; */ -struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type) +struct tep_event_format *tep_data_event_from_type (struct tep_handle *pevent,int type) {return tep_find_event (pevent, type); }
@@ -5386,7 +5386,7 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)* This parses the raw @data using the given @event information and * writes the print format into the trace_seq. */ -void tep_event_info (struct trace_seq *s,struct event_format *event, +void tep_event_info (struct trace_seq *s,struct tep_event_format *event,struct tep_record *record) {int print_pretty =1 ;
@@ -5427,7 +5427,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)* Returns the associated event for a given record, or NULL if non is * is found. */ -struct event_format * +struct tep_event_format *tep_find_event_by_record (struct tep_handle *pevent,struct tep_record *record) {int type;
@@ -5452,7 +5452,7 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)* Writes the tasks comm, pid and CPU to @s. */ void tep_print_event_task (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record) {void *data = record->data;
@@ -5480,7 +5480,7 @@ void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,* Writes the timestamp of the record into @s. */ void tep_print_event_time (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record,bool use_trace_clock) {
@@ -5530,7 +5530,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,* Writes the parsing of the record's data to @s. */ void tep_print_event_data (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record) {static const char *spaces =" " ;/* 20 spaces */
@@ -5549,7 +5549,7 @@ void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,void tep_print_event (struct tep_handle *pevent,struct trace_seq *s,struct tep_record *record,bool use_trace_clock) { -struct event_format *event; +struct tep_event_format *event; event =tep_find_event_by_record (pevent, record);if (!event) {
@@ -5571,8 +5571,8 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,static int events_id_cmp (const void *a,const void *b) { -struct event_format *const * ea = a; -struct event_format *const * eb = b; +struct tep_event_format *const * ea = a; +struct tep_event_format *const * eb = b;if ((*ea)->id < (*eb)->id)return -1 ;
@@ -5585,8 +5585,8 @@ static int events_id_cmp(const void *a, const void *b)static int events_name_cmp (const void *a,const void *b) { -struct event_format *const * ea = a; -struct event_format *const * eb = b; +struct tep_event_format *const * ea = a; +struct tep_event_format *const * eb = b;int res; res =strcmp ((*ea)->name, (*eb)->name);
@@ -5602,8 +5602,8 @@ static int events_name_cmp(const void *a, const void *b)static int events_system_cmp (const void *a,const void *b) { -struct event_format *const * ea = a; -struct event_format *const * eb = b; +struct tep_event_format *const * ea = a; +struct tep_event_format *const * eb = b;int res; res =strcmp ((*ea)->system, (*eb)->system);
@@ -5617,9 +5617,9 @@ static int events_system_cmp(const void *a, const void *b)return events_id_cmp (a, b); } -struct event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) +struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) { -struct event_format **events; +struct tep_event_format **events;int (*sort)(const void *a,const void *b); events = pevent->sort_events;
@@ -5702,7 +5702,7 @@ get_event_fields(const char *type, const char *name,* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **tep_event_common_fields (struct event_format *event) +struct format_field **tep_event_common_fields (struct tep_event_format *event) { return get_event_fields("common", event->name, event->format.nr_common,
@@ -5716,7 +5716,7 @@ struct format_field **tep_event_common_fields(struct event_format *event)* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **tep_event_fields (struct event_format *event) +struct format_field **tep_event_fields (struct tep_event_format *event) { return get_event_fields("event", event->name, event->format.nr_fields,
@@ -5958,7 +5958,7 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long sireturn 0 ; } -static int event_matches (struct event_format *event, +static int event_matches (struct tep_event_format *event,int id,const char *sys_name,const char *event_name) {
@@ -5981,7 +5981,7 @@ static void free_handler(struct event_handler *handle)free (handle); } -static int find_event_handle (struct tep_handle *pevent,struct event_format *event) +static int find_event_handle (struct tep_handle *pevent,struct tep_event_format *event) {struct event_handler *handle, **next;
@@ -6022,11 +6022,11 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve* * /sys/kernel/debug/tracing/events/.../.../format */ -enum tep_errno __tep_parse_format (struct event_format **eventp, +enum tep_errno __tep_parse_format (struct tep_event_format **eventp,struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) { -struct event_format *event; +struct tep_event_format *event;int ret;init_input_buf (buf, size);
@@ -6131,12 +6131,12 @@ enum tep_errno __tep_parse_format(struct event_format **eventp,static enum tep_errno __parse_event (struct tep_handle *pevent, -struct event_format **eventp, +struct tep_event_format **eventp,const char *buf,unsigned long size,const char *sys) {int ret =__tep_parse_format (eventp, pevent, buf, size, sys); -struct event_format *event = *eventp; +struct tep_event_format *event = *eventp;if (event ==NULL )return ret;
@@ -6173,7 +6173,7 @@ event_add_failed:* /sys/kernel/debug/tracing/events/.../.../format */ enum tep_errno tep_parse_format (struct tep_handle *pevent, -struct event_format **eventp, +struct tep_event_format **eventp,const char *buf,unsigned long size,const char *sys) {
@@ -6197,7 +6197,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,enum tep_errno tep_parse_event (struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) { -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;return __parse_event (pevent, &event, buf, size, sys); }
@@ -6263,7 +6263,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,* * On failure, it returns NULL. */ -void *tep_get_field_raw (struct trace_seq *s,struct event_format *event, +void *tep_get_field_raw (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,int *len,int err) {
@@ -6310,7 +6310,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int tep_get_field_val (struct trace_seq *s,struct event_format *event, +int tep_get_field_val (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6335,7 +6335,7 @@ int tep_get_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int tep_get_common_field_val (struct trace_seq *s,struct event_format *event, +int tep_get_common_field_val (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6360,7 +6360,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int tep_get_any_field_val (struct trace_seq *s,struct event_format *event, +int tep_get_any_field_val (struct trace_seq *s,struct tep_event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6386,7 +6386,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct event_format *event,* Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ int tep_print_num_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, +struct tep_event_format *event,const char *name,struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);
@@ -6418,7 +6418,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,* Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ int tep_print_func_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, +struct tep_event_format *event,const char *name,struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);
@@ -6578,11 +6578,11 @@ int tep_unregister_print_function(struct tep_handle *pevent,return -1 ; } -static struct event_format *search_event (struct tep_handle *pevent,int id, +static struct tep_event_format *search_event (struct tep_handle *pevent,int id,const char *sys_name,const char *event_name) { -struct event_format *event; +struct tep_event_format *event;if (id >=0 ) {/* search by id */
@@ -6622,7 +6622,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id, const char *sys_name, const char *event_name, tep_event_handler_func func, void *context) { - struct event_format *event; + struct tep_event_format *event;struct event_handler *handle; event =search_event (pevent, id, sys_name, event_name);
@@ -6706,7 +6706,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id, const char *sys_name, const char *event_name, tep_event_handler_func func, void *context) { - struct event_format *event; + struct tep_event_format *event;struct event_handler *handle;struct event_handler **next;
@@ -6784,7 +6784,7 @@ static void free_formats(struct format *format)free_format_fields (format->fields); } -void tep_free_format (struct event_format *event) +void tep_free_format (struct tep_event_format *event) {free (event->name);free (event->system);
tools/lib/traceevent/event-parse.h +33 -33
172 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +21 -21
162 lines not on this page · raw message
tools/lib/traceevent/plugin_function.c +1 -1
@@ -124,7 +124,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 event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tep_handle *pevent = event->pevent;unsigned long long function;
tools/lib/traceevent/plugin_hrtimer.c +2 -2
@@ -27,7 +27,7 @@static int timer_expire_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
@@ -47,7 +47,7 @@ static int timer_expire_handler(struct trace_seq *s,static int timer_start_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -25,7 +25,7 @@#include "trace-seq.h" static int call_site_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val, addr;
tools/lib/traceevent/plugin_kvm.c +7 -7
@@ -249,7 +249,7 @@ static const char *find_exit_reason(unsigned isa, int val) }static int print_exit_reason (struct trace_seq *s,struct tep_record *record, -struct event_format *event,const char *field) +struct tep_event_format *event,const char *field) {unsigned long long isa;unsigned long long val;
@@ -270,7 +270,7 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record, }static int kvm_exit_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long info1 =0 , info2 =0 ;
@@ -293,7 +293,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,static int kvm_emulate_insn_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long rip, csbase, len, flags, failed;int llen;
@@ -332,7 +332,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,static int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {if (print_exit_reason (s, record, event,"exit_code" ) <0 )return -1 ;
@@ -346,7 +346,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco }static int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {tep_print_num_field (s,"rip %llx " , event,"rip" , record,1 );
@@ -372,7 +372,7 @@ union kvm_mmu_page_role { };static int kvm_mmu_print_role (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val;static const char *access_str[] = {
@@ -419,7 +419,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,static int kvm_mmu_get_page_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val;
tools/lib/traceevent/plugin_mac80211.c +2 -2
@@ -26,7 +26,7 @@#define INDENT 65 -static void print_string (struct trace_seq *s,struct event_format *event, +static void print_string (struct trace_seq *s,struct tep_event_format *event,const char *name,const void *data) {struct format_field *f =tep_find_field (event, name);
@@ -60,7 +60,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,static int drv_bss_info_changed (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {void *data = record->data;
tools/lib/traceevent/plugin_sched_switch.c +2 -2
@@ -67,7 +67,7 @@ static void write_and_save_comm(struct format_field *field,static int sched_wakeup_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
@@ -96,7 +96,7 @@ static int sched_wakeup_handler(struct trace_seq *s,static int sched_switch_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
tools/perf/builtin-trace.c +1 -1
@@ -862,7 +862,7 @@ static struct syscall_fmt *syscall_fmt__find(const char *name)* args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc. */ struct syscall { -struct event_format *tp_format; +struct tep_event_format *tp_format;int nr_args;int args_size;bool is_exit;
tools/perf/util/evsel.h +2 -2
@@ -102,7 +102,7 @@ struct perf_evsel {char *name;double scale;const char *unit; -struct event_format *tp_format; +struct tep_event_format *tp_format;off_t id_offset;struct perf_stat_evsel *stats;void *priv;
@@ -211,7 +211,7 @@ static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char *struct perf_evsel *perf_evsel__new_cycles (bool precise); -struct event_format *event_format__new (const char *sys,const char *name); +struct tep_event_format *event_format__new (const char *sys,const char *name);void perf_evsel__init (struct perf_evsel *evsel,struct perf_event_attr *attr,int idx);
tools/perf/util/header.c +1 -1
@@ -3206,7 +3206,7 @@ static int read_attr(int fd, struct perf_header *ph,static int perf_evsel__prepare_tracepoint_event (struct perf_evsel *evsel,struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event;char bf[128 ];/* already prepared */
tools/perf/util/python.c +2 -2
@@ -386,7 +386,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)struct format_field *field;if (!evsel->tp_format) { -struct event_format *tp_format; +struct tep_event_format *tp_format; tp_format =trace_event__tp_format_id (evsel->attr.config);if (!tp_format)
@@ -1240,7 +1240,7 @@ static struct {static PyObject *pyrf__tracepoint (struct pyrf_evsel *pevsel,PyObject *args,PyObject *kwargs) { -struct event_format *tp_format; +struct tep_event_format *tp_format;static char *kwlist[] = {"sys" ,"name" ,NULL };char *sys =NULL ;char *name =NULL ;
tools/perf/util/scripting-engines/trace-event-perl.c +3 -3
@@ -189,7 +189,7 @@ static void define_flag_field(const char *ev_name,LEAVE ; } -static void define_event_symbols (struct event_format *event, +static void define_event_symbols (struct tep_event_format *event,const char *ev_name,struct print_arg *args) {
@@ -338,7 +338,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, struct addr_location *al) {struct thread *thread = al->thread; -struct event_format *event = evsel->tp_format; +struct tep_event_format *event = evsel->tp_format;struct format_field *field;static char handler[256 ];unsigned long long val;
@@ -537,7 +537,7 @@ static int perl_stop_script(void)static int perl_generate_script (struct tep_handle *pevent,const char *outfile) { -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;struct format_field *f;char fname[PATH_MAX ];int not_first, count;
tools/perf/util/scripting-engines/trace-event-python.c +4 -4
@@ -264,7 +264,7 @@ static void define_field(enum print_arg_type field_type,Py_DECREF (t); } -static void define_event_symbols (struct event_format *event, +static void define_event_symbols (struct tep_event_format *event,const char *ev_name,struct print_arg *args) {
@@ -332,7 +332,7 @@ static void define_event_symbols(struct event_format *event,define_event_symbols (event, ev_name, args->next); } -static PyObject *get_field_numeric_entry (struct event_format *event, +static PyObject *get_field_numeric_entry (struct tep_event_format *event,struct format_field *field,void *data) {bool is_array = field->flags &FIELD_IS_ARRAY ;
@@ -790,7 +790,7 @@ static void python_process_tracepoint(struct perf_sample *sample,struct perf_evsel *evsel, struct addr_location *al) { - struct event_format *event = evsel->tp_format; + struct tep_event_format *event = evsel->tp_format;PyObject *handler, *context, *t, *obj =NULL , *callchain;PyObject *dict =NULL , *all_entries_dict =NULL ;static char handler_name[256 ];
@@ -1590,7 +1590,7 @@ static int python_stop_script(void)static int python_generate_script (struct tep_handle *pevent,const char *outfile) { -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;struct format_field *f;char fname[PATH_MAX ];int not_first, count;
tools/perf/util/trace-event-parse.c +7 -7
@@ -33,7 +33,7 @@ static int get_common_field(struct scripting_context *context, int *offset, int *size, const char *type) { struct tep_handle *pevent = context->pevent; -struct event_format *event; +struct tep_event_format *event;struct format_field *field;if (!*size) {
@@ -94,7 +94,7 @@ int common_pc(struct scripting_context *context) }unsigned long long -raw_field_value (struct 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;unsigned long long val;
@@ -108,12 +108,12 @@ raw_field_value(struct event_format *event, const char *name, void *data)return val; } -unsigned long long read_size (struct event_format *event,void *ptr,int size) +unsigned long long read_size (struct tep_event_format *event,void *ptr,int size) {return tep_read_number (event->pevent, ptr, size); } -void event_format__fprintf (struct event_format *event, +void event_format__fprintf (struct tep_event_format *event,int cpu,void *data,int size,FILE *fp) {struct tep_record record;
@@ -130,7 +130,7 @@ void event_format__fprintf(struct event_format *event,trace_seq_destroy (&s); } -void event_format__print (struct event_format *event, +void event_format__print (struct tep_event_format *event,int cpu,void *data,int size) {return event_format__fprintf (event, cpu, data, size, stdout);
@@ -188,8 +188,8 @@ int parse_event_file(struct tep_handle *pevent,return tep_parse_event (pevent, buf, size, sys); } -struct event_format *trace_find_next_event (struct tep_handle *pevent, -struct event_format *event) +struct tep_event_format *trace_find_next_event (struct tep_handle *pevent, +struct tep_event_format *event) {static int idx;
tools/perf/util/trace-event.c +4 -4
@@ -72,12 +72,12 @@ void trace_event__cleanup(struct trace_event *t)/* * Returns pointer with encoded error via <linux/err.h> interface. */ -static struct event_format * +static struct tep_event_format *tp_format (const char *sys,const char *name) {char *tp_dir =get_events_file (sys);struct tep_handle *pevent = tevent.pevent; -struct event_format *event =NULL ; +struct tep_event_format *event =NULL ;char path[PATH_MAX ];size_t size;char *data;
@@ -102,7 +102,7 @@ tp_format(const char *sys, const char *name)/* * Returns pointer with encoded error via <linux/err.h> interface. */ -struct event_format * +struct tep_event_format *trace_event__tp_format (const char *sys,const char *name) {if (!tevent_initialized &&trace_event__init2 ())
@@ -111,7 +111,7 @@ trace_event__tp_format(const char *sys, const char *name)return tp_format (sys, name); } -struct event_format *trace_event__tp_format_id (int id) +struct tep_event_format *trace_event__tp_format_id (int id) {if (!tevent_initialized &&trace_event__init2 ())return ERR_PTR (-ENOMEM );
tools/perf/util/trace-event.h +8 -8
@@ -22,17 +22,17 @@ int trace_event__init(struct trace_event *t);void trace_event__cleanup (struct trace_event *t);int trace_event__register_resolver (struct machine *machine,tep_func_resolver_t *func); -struct event_format * +struct tep_event_format *trace_event__tp_format (const char *sys,const char *name); -struct event_format *trace_event__tp_format_id (int id); +struct tep_event_format *trace_event__tp_format_id (int id);int bigendian (void ); -void event_format__fprintf (struct event_format *event, +void event_format__fprintf (struct tep_event_format *event,int cpu,void *data,int size,FILE *fp); -void event_format__print (struct event_format *event, +void event_format__print (struct tep_event_format *event,int cpu,void *data,int size);int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size);
@@ -40,7 +40,7 @@ int parse_event_file(struct tep_handle *pevent, char *buf, unsigned long size, char *sys);unsigned long long -raw_field_value (struct event_format *event,const char *name,void *data); +raw_field_value (struct tep_event_format *event,const char *name,void *data);void parse_proc_kallsyms (struct tep_handle *pevent,char *file,unsigned int size);void parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size);
@@ -48,9 +48,9 @@ void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int sizssize_t trace_report (int fd,struct trace_event *tevent,bool repipe); -struct event_format *trace_find_next_event (struct tep_handle *pevent, -struct event_format *event); -unsigned long long read_size (struct event_format *event,void *ptr,int size); +struct tep_event_format *trace_find_next_event (struct tep_handle *pevent, +struct tep_event_format *event); +unsigned long long read_size (struct tep_event_format *event,void *ptr,int size);unsigned long long eval_flag (const char *flag);int read_tracing_data (int fd,struct list_head *pattrs);
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field}
In reply to Steven Rostedttools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field}
Commit-ID: 2c92f9828b3ca4e82e7ceffeea76c6fba4044acc Gitweb: https://git.kernel.org/tip/2c92f9828b3ca4e82e7ceffeea76c6fba4044acc Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:45 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:13:15 -0300
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
--- tools/lib/traceevent/event-parse.c | 82 +++++++++++----------- tools/lib/traceevent/event-parse.h | 42 +++++------ tools/lib/traceevent/parse-filter.c | 8 +-- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/lib/traceevent/plugin_sched_switch.c | 6 +- tools/perf/builtin-trace.c | 14 ++-- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/util/data-convert-bt.c | 22 +++--- tools/perf/util/evsel.c | 8 +-- tools/perf/util/evsel.h | 6 +- tools/perf/util/evsel_fprintf.c | 2 +- tools/perf/util/python.c | 4 +- .../perf/util/scripting-engines/trace-event-perl.c | 4 +- .../util/scripting-engines/trace-event-python.c | 6 +- tools/perf/util/sort.c | 18 ++--- tools/perf/util/trace-event-parse.c | 4 +- 17 files changed, 116 insertions(+), 116 deletions(-)
tools/lib/traceevent/event-parse.c +41 -41
@@ -1299,7 +1299,7 @@ static int event_read_id(void)return -1 ; } -static int field_is_string (struct format_field *field) +static int field_is_string (struct tep_format_field *field) { if ((field->flags & FIELD_IS_ARRAY) && (strstr(field->type, "char") || strstr(field->type, "u8") ||
@@ -1309,7 +1309,7 @@ static int field_is_string(struct format_field *field)return 0 ; } -static int field_is_dynamic (struct format_field *field) +static int field_is_dynamic (struct tep_format_field *field) {if (strncmp (field->type,"__data_loc" ,10 ) ==0 )return 1 ;
@@ -1317,7 +1317,7 @@ static int field_is_dynamic(struct format_field *field)return 0 ; } -static int field_is_long (struct format_field *field) +static int field_is_long (struct tep_format_field *field) {/* includes long long */ if (strstr (field->type,"long" ))
@@ -1354,9 +1354,9 @@ static unsigned int type_size(const char *name)return 0 ; } -static int event_read_fields (struct tep_event_format *event,struct format_field **fields) +static int event_read_fields (struct tep_event_format *event,struct tep_format_field **fields) { -struct format_field *field =NULL ; +struct tep_format_field *field =NULL ;enum event_type type;char *token;char *last_token;
@@ -2683,7 +2683,7 @@ out:static enum event_type process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) { -struct format_field *field; +struct tep_format_field *field;enum event_type type;char *token;
@@ -2748,7 +2748,7 @@ static enum event_type process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, char **tok) { - struct format_field *field; + struct tep_format_field *field;enum event_type type;char *token;
@@ -3259,10 +3259,10 @@ static int event_read_print(struct tep_event_format *event)* Returns a common field from the event by the given @name. * This only searchs the common fields and not all field. */ -struct format_field * +struct tep_format_field *tep_find_common_field (struct tep_event_format *event,const char *name) { -struct format_field *format; +struct tep_format_field *format;for (format = event->format.common_fields; format; format = format->next) {
@@ -3281,10 +3281,10 @@ tep_find_common_field(struct tep_event_format *event, const char *name)* Returns a non-common field by the given @name. * This does not search common fields. */ -struct format_field * +struct tep_format_field *tep_find_field (struct tep_event_format *event,const char *name) { -struct format_field *format; +struct tep_format_field *format;for (format = event->format.fields; format; format = format->next) {
@@ -3304,10 +3304,10 @@ tep_find_field(struct tep_event_format *event, const char *name)* This searchs the common field names first, then * the non-common ones if a common one was not found. */ -struct format_field * +struct tep_format_field *tep_find_any_field (struct tep_event_format *event,const char *name) { -struct format_field *format; +struct tep_format_field *format; format =tep_find_common_field (event, name);if (format)
@@ -3353,7 +3353,7 @@ unsigned long long tep_read_number(struct tep_handle *pevent,* * Returns 0 on success, -1 otherwise. */ -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) {if (!field)
@@ -3375,7 +3375,7 @@ static int get_common_info(struct tep_handle *pevent, const char *type, int *offset, int *size) { struct tep_event_format *event; -struct format_field *field; +struct tep_format_field *field;/* * All events should have the same common elements.
@@ -3867,7 +3867,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, {struct tep_handle *pevent = event->pevent;struct print_flag_sym *flag; -struct format_field *field; +struct tep_format_field *field;struct printk_map *printk;long long val, fval;unsigned long long addr;
@@ -4008,7 +4008,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (arg->int_array.field->type ==PRINT_DYNAMIC_ARRAY ) {unsigned long offset; -struct format_field *field = +struct tep_format_field *field = arg->int_array.field->dynarray.field; offset = tep_read_number(pevent, data + field->offset,
@@ -4056,7 +4056,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,int str_offset;if (arg->string.offset ==-1 ) { -struct format_field *f; +struct tep_format_field *f; f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset;
@@ -4074,7 +4074,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,int bitmask_size;if (arg->bitmask.offset ==-1 ) { -struct format_field *f; +struct tep_format_field *f; f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset;
@@ -4215,7 +4215,7 @@ static void free_args(struct print_arg *args)static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent; -struct format_field *field, *ip_field; +struct tep_format_field *field, *ip_field;struct print_arg *args, *arg, **next;unsigned long long ip, val;char *ptr;
@@ -4393,7 +4393,7 @@ get_bprint_format(void *data, int size __maybe_unused, {struct tep_handle *pevent = event->pevent;unsigned long long addr; -struct format_field *field; +struct tep_format_field *field;struct printk_map *printk;char *format;
@@ -4788,7 +4788,7 @@ static int is_printable_array(char *p, unsigned int len) }void tep_print_field (struct trace_seq *s,void *data, -struct format_field *field) +struct tep_format_field *field) {unsigned long long val;unsigned int offset, len, i;
@@ -4855,7 +4855,7 @@ void tep_print_field(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) { -struct format_field *field; +struct tep_format_field *field; field = event->format.fields;while (field) {
@@ -5664,12 +5664,12 @@ struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_return events; } -static struct format_field ** +static struct tep_format_field **get_event_fields (const char *type,const char *name, -int count,struct format_field *list) +int count,struct tep_format_field *list) { -struct format_field **fields; -struct format_field *field; +struct tep_format_field **fields; +struct tep_format_field *field;int i =0 ; fields =malloc (sizeof (*fields) * (count +1 ));
@@ -5702,7 +5702,7 @@ get_event_fields(const char *type, const char *name,* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -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) { return get_event_fields("common", event->name, event->format.nr_common,
@@ -5716,7 +5716,7 @@ struct format_field **tep_event_common_fields(struct tep_event_format *event)* Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **tep_event_fields (struct tep_event_format *event) +struct tep_format_field **tep_event_fields (struct tep_event_format *event) { return get_event_fields("event", event->name, event->format.nr_fields,
@@ -6090,7 +6090,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, }if (!ret && (event->flags &EVENT_FL_ISFTRACE )) { -struct format_field *field; +struct tep_format_field *field;struct print_arg *arg, **list;/* old ftrace had no args */
@@ -6230,7 +6230,7 @@ int tep_strerror(struct tep_handle *pevent __maybe_unused,return 0 ; } -int get_field_val (struct trace_seq *s,struct format_field *field, +int get_field_val (struct trace_seq *s,struct tep_format_field *field,const char *name,struct tep_record *record,unsigned long long *val,int err) {
@@ -6267,7 +6267,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record, int *len, int err) { - struct format_field *field; + struct tep_format_field *field;void *data = record->data;unsigned offset;int dummy;
@@ -6314,7 +6314,7 @@ int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record, unsigned long long *val, int err) { - struct format_field *field; + struct tep_format_field *field;if (!event)return -1 ;
@@ -6339,7 +6339,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event const char *name, struct tep_record *record, unsigned long long *val, int err) { - struct format_field *field; + struct tep_format_field *field;if (!event)return -1 ;
@@ -6364,7 +6364,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record, unsigned long long *val, int err) { - struct format_field *field; + struct tep_format_field *field;if (!event)return -1 ;
@@ -6389,7 +6389,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt, struct tep_event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = tep_find_field(event, name); + struct tep_format_field *field = tep_find_field(event, name);unsigned long long val;if (!field)
@@ -6421,7 +6421,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt, struct tep_event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = tep_find_field(event, name); + struct tep_format_field *field = tep_find_field(event, name);struct tep_handle *pevent = event->pevent;unsigned long long val;struct func_map *func;
@@ -6758,7 +6758,7 @@ void tep_ref(struct tep_handle *pevent) pevent->ref_count++; } -void tep_free_format_field (struct format_field *field) +void tep_free_format_field (struct tep_format_field *field) {free (field->type);if (field->alias != field->name)
@@ -6767,9 +6767,9 @@ void tep_free_format_field(struct format_field *field)free (field); } -static void free_format_fields (struct format_field *field) +static void free_format_fields (struct tep_format_field *field) { -struct format_field *next; +struct tep_format_field *next;while (field) { next = field->next;
@@ -6778,7 +6778,7 @@ static void free_format_fields(struct format_field *field) } } -static void free_formats (struct format *format) +static void free_formats (struct tep_format *format) {free_format_fields (format->common_fields);free_format_fields (format->fields);
tools/lib/traceevent/event-parse.h +21 -21
121 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +4 -4
@@ -16,11 +16,11 @@#define COMM "COMM"#define CPU "CPU" -static struct format_field comm = { +static struct tep_format_field comm = { .name ="COMM" , }; -static struct format_field cpu = { +static struct tep_format_field cpu = { .name ="CPU" , };
@@ -336,7 +336,7 @@ static enum tep_errno create_arg_item(struct tep_event_format *event, const char *token, enum event_type type, struct filter_arg **parg, char *error_str) { - struct format_field *field; + struct tep_format_field *field;struct filter_arg *arg; arg =allocate_arg ();
@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)static unsigned long long 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;
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -27,7 +27,7 @@static int call_site_handler (struct trace_seq *s,struct tep_record *record,struct tep_event_format *event,void *context) { -struct format_field *field; +struct tep_format_field *field;unsigned long long val, addr;void *data = record->data;const char *func;
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -29,7 +29,7 @@static void print_string (struct trace_seq *s,struct tep_event_format *event,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 length;
tools/lib/traceevent/plugin_sched_switch.c +3 -3
@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val)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 trace_seq *s,int pid) {
@@ -69,7 +69,7 @@ static int sched_wakeup_handler(struct trace_seq *s,struct tep_record *record, struct tep_event_format *event, void *context) { - struct format_field *field; + struct tep_format_field *field;unsigned long long val;if (tep_get_field_val (s, event,"pid" , record, &val,1 ))
@@ -98,7 +98,7 @@ static int sched_switch_handler(struct trace_seq *s,struct tep_record *record, struct tep_event_format *event, void *context) { - struct format_field *field; + struct tep_format_field *field;unsigned long long val;if (tep_get_field_val (s, event,"prev_pid" , record, &val,1 ))
tools/perf/builtin-trace.c +7 -7
@@ -181,7 +181,7 @@ static int __tp_field__init_uint(struct tp_field *field, int size, int offset, breturn 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); }
@@ -198,7 +198,7 @@ static int __tp_field__init_ptr(struct tp_field *field, int offset)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); }
@@ -214,7 +214,7 @@ static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel,struct tp_field *field, 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 )return -1 ;
@@ -230,7 +230,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel,struct tp_field *field, 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 )return -1 ;
@@ -867,7 +867,7 @@ struct syscall {int args_size;bool is_exit;bool is_open; -struct format_field *args; +struct tep_format_field *args;const char *name;struct syscall_fmt *fmt;struct syscall_arg_fmt *arg_fmt;
@@ -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) { -struct format_field *field, *last_field =NULL ; +struct tep_format_field *field, *last_field =NULL ;int idx =0 , len;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, ttrace->ret_scnprintf =NULL ;if (sc->args !=NULL ) { -struct format_field *field; +struct tep_format_field *field;for (field = sc->args; field; field = field->next, ++arg.idx, bit <<=1 ) {
tools/perf/tests/evsel-tp-sched.c +1 -1
@@ -8,7 +8,7 @@static int perf_evsel__test_field (struct perf_evsel *evsel,const char *name,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 ret =0 ;
tools/perf/util/data-convert-bt.c +11 -11
@@ -182,7 +182,7 @@ err_put_field: }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;
@@ -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 *event, struct perf_sample *sample, - struct format_field *fmtf) + struct tep_format_field *fmtf) { struct bt_ctf_field_type *type;struct bt_ctf_field *array_field;
@@ -396,10 +396,10 @@ err_put_field:static int add_tracepoint_fields_values (struct ctf_writer *cw,struct bt_ctf_event_class *event_class,struct bt_ctf_event *event, -struct format_field *fields, +struct tep_format_field *fields,struct perf_sample *sample) { -struct format_field *field; +struct tep_format_field *field;int ret;for (field = fields; field; field = field->next) {
@@ -417,8 +417,8 @@ static int add_tracepoint_values(struct ctf_writer *cw,struct perf_evsel *evsel, struct perf_sample *sample) { - struct format_field *common_fields = evsel->tp_format->format.common_fields; -struct format_field *fields = evsel->tp_format->format.fields; + struct tep_format_field *common_fields = evsel->tp_format->format.common_fields; +struct tep_format_field *fields = evsel->tp_format->format.fields;int ret; ret = add_tracepoint_fields_values(cw, event_class, event,
@@ -970,7 +970,7 @@ out:static int event_class_add_field (struct bt_ctf_event_class *event_class,struct bt_ctf_field_type *type, -struct format_field *field) +struct tep_format_field *field) {struct bt_ctf_field_type *t =NULL ;char *name;
@@ -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, -struct format_field *fields, +struct tep_format_field *fields,struct bt_ctf_event_class *event_class) { -struct format_field *field; +struct tep_format_field *field;int ret;for (field = fields; field; field = field->next) {
@@ -1055,8 +1055,8 @@ static int add_tracepoint_types(struct ctf_writer *cw,struct perf_evsel *evsel, struct bt_ctf_event_class *class) { - struct format_field *common_fields = evsel->tp_format->format.common_fields; -struct format_field *fields = evsel->tp_format->format.fields; + struct tep_format_field *common_fields = evsel->tp_format->format.common_fields; +struct tep_format_field *fields = evsel->tp_format->format.fields;int ret; ret =add_tracepoint_fields_types (cw, common_fields, class);
tools/perf/util/evsel.c +4 -4
@@ -2682,7 +2682,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,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); }
@@ -2690,7 +2690,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *namvoid *perf_evsel__rawptr (struct perf_evsel *evsel,struct perf_sample *sample,const char *name) { -struct format_field *field =perf_evsel__field (evsel, name); +struct tep_format_field *field =perf_evsel__field (evsel, name);int offset;if (!field)
@@ -2706,7 +2706,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,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) {u64 value;
@@ -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,const char *name) { -struct format_field *field =perf_evsel__field (evsel, name); +struct tep_format_field *field =perf_evsel__field (evsel, name);if (!field)return 0 ;
tools/perf/util/evsel.h +3 -3
@@ -296,11 +296,11 @@ static inline char *perf_evsel__strval(struct perf_evsel *evsel,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) \ (evsel->attr.type == PERF_TYPE_##t && \
tools/perf/util/evsel_fprintf.c +1 -1
@@ -73,7 +73,7 @@ int perf_evsel__fprintf(struct perf_evsel *evsel, }if (details->trace_fields) { -struct format_field *field; +struct tep_format_field *field;if (evsel->attr.type !=PERF_TYPE_TRACEPOINT ) { printed +=comma_fprintf (fp, &first," (not a tracepoint)" );
tools/perf/util/python.c +2 -2
@@ -340,7 +340,7 @@ static bool is_tracepoint(struct pyrf_event *pevent) }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;void *data = pe->sample.raw_data;
@@ -383,7 +383,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) {const char *str =_PyUnicode_AsString (PyObject_Str (attr_name));struct perf_evsel *evsel = pevent->evsel; -struct format_field *field; +struct tep_format_field *field;if (!evsel->tp_format) {struct tep_event_format *tp_format;
tools/perf/util/scripting-engines/trace-event-perl.c +2 -2
@@ -339,7 +339,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, {struct thread *thread = al->thread;struct tep_event_format *event = evsel->tp_format; -struct format_field *field; +struct tep_format_field *field;static char handler[256 ];unsigned long long val;unsigned long s, ns;
@@ -538,7 +538,7 @@ static int perl_stop_script(void)static int perl_generate_script (struct tep_handle *pevent,const char *outfile) {struct tep_event_format *event =NULL ; -struct format_field *f; +struct tep_format_field *f;char fname[PATH_MAX ];int not_first, count;FILE *ofp;
tools/perf/util/scripting-engines/trace-event-python.c +3 -3
@@ -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, -struct format_field *field,void *data) +struct tep_format_field *field,void *data) {bool is_array = field->flags &FIELD_IS_ARRAY ;PyObject *obj =NULL , *list =NULL ;
@@ -794,7 +794,7 @@ static void python_process_tracepoint(struct perf_sample *sample,PyObject *handler, *context, *t, *obj =NULL , *callchain;PyObject *dict =NULL , *all_entries_dict =NULL ;static char handler_name[256 ]; -struct format_field *field; +struct tep_format_field *field;unsigned long s, ns;unsigned n =0 ;int pid;
@@ -1591,7 +1591,7 @@ static int python_stop_script(void)static int python_generate_script (struct tep_handle *pevent,const char *outfile) {struct tep_event_format *event =NULL ; -struct format_field *f; +struct tep_format_field *f;char fname[PATH_MAX ];int not_first, count;FILE *ofp;
tools/perf/util/sort.c +9 -9
@@ -1884,7 +1884,7 @@ static int __sort_dimension__add_hpp_output(struct sort_dimension *sd,struct hpp_dynamic_entry {struct perf_hpp_fmt hpp;struct perf_evsel *evsel; -struct format_field *field; +struct tep_format_field *field;unsigned dynamic_len;bool raw_trace; };
@@ -1915,7 +1915,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde, struct hist_entry *he) {char *str, *pos; -struct format_field *field = hde->field; +struct tep_format_field *field = hde->field;size_t namelen;bool last = false;
@@ -2000,7 +2000,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,struct hpp_dynamic_entry *hde;size_t len = fmt->user_len;char *str, *pos; -struct format_field *field; +struct tep_format_field *field;size_t namelen;bool last = false;int ret;
@@ -2060,7 +2060,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b) { struct hpp_dynamic_entry *hde; -struct format_field *field; +struct tep_format_field *field;unsigned offset, size; hde = container_of(fmt, struct hpp_dynamic_entry, hpp);
@@ -2117,7 +2117,7 @@ static void hde_free(struct perf_hpp_fmt *fmt) }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) {struct hpp_dynamic_entry *hde;
@@ -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, -struct format_field *field, +struct tep_format_field *field,bool raw_trace,int level) {struct hpp_dynamic_entry *hde;
@@ -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) {int ret; -struct format_field *field; +struct tep_format_field *field; field = evsel->tp_format->format.fields;while (field) {
@@ -2305,7 +2305,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist, {int ret = -ESRCH ;struct perf_evsel *evsel; -struct format_field *field; +struct tep_format_field *field;evlist__for_each_entry (evlist, evsel) {if (evsel->attr.type !=PERF_TYPE_TRACEPOINT )
@@ -2327,7 +2327,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, {char *str, *event_name, *field_name, *opt_name;struct perf_evsel *evsel; -struct format_field *field; +struct tep_format_field *field;bool raw_trace = symbol_conf.raw_trace;int ret =0 ;
tools/perf/util/trace-event-parse.c +2 -2
@@ -34,7 +34,7 @@ static int get_common_field(struct scripting_context *context, {struct tep_handle *pevent = context->pevent;struct tep_event_format *event; -struct format_field *field; +struct tep_format_field *field;if (!*size) {if (!pevent->events)
@@ -96,7 +96,7 @@ int common_pc(struct scripting_context *context)unsigned long long 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; field =tep_find_any_field (event, name);
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags
In reply to Steven Rostedttools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags
Commit-ID: bb39ccb204cc2e8135660b9cb768ffcf242bf33e Gitweb: https://git.kernel.org/tip/bb39ccb204cc2e8135660b9cb768ffcf242bf33e Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:46 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:14:13 -0300
tools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags
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 enum format_flags to enum tep_format_flags and adds prefix TEP_ to all of its members.
--- tools/lib/traceevent/event-parse.c | 48 +++++++++++----------- tools/lib/traceevent/event-parse.h | 18 ++++---- tools/lib/traceevent/parse-filter.c | 8 ++-- tools/perf/builtin-trace.c | 2 +- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/util/data-convert-bt.c | 34 +++++++-------- tools/perf/util/evsel.c | 2 +- tools/perf/util/python.c | 12 +++--- .../perf/util/scripting-engines/trace-event-perl.c | 18 ++++---- .../util/scripting-engines/trace-event-python.c | 26 ++++++------ tools/perf/util/sort.c | 4 +- 11 files changed, 87 insertions(+), 87 deletions(-)
tools/lib/traceevent/event-parse.c +24 -24
@@ -1301,7 +1301,7 @@ static int event_read_id(void)static int field_is_string (struct tep_format_field *field) { -if ((field->flags &FIELD_IS_ARRAY ) && +if ((field->flags &TEP_FIELD_IS_ARRAY ) && (strstr (field->type,"char" ) ||strstr (field->type,"u8" ) ||strstr (field->type,"s8" )))return 1 ;
@@ -1328,7 +1328,7 @@ static int field_is_long(struct tep_format_field *field)static unsigned int type_size (const char *name) { -/* This covers all FIELD_IS_STRING types. */ +/* This covers all TEP_FIELD_IS_STRING types. */ static struct { const char *type; unsigned int size;
@@ -1416,7 +1416,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f type == EVENT_OP && strcmp(token, ".") == 0)) {if (strcmp (token,"*" ) ==0 ) - field->flags |=FIELD_IS_POINTER ; + field->flags |=TEP_FIELD_IS_POINTER ;if (field->type) {char *new_type;
@@ -1455,7 +1455,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_fchar *new_brackets;int len; - field->flags |=FIELD_IS_ARRAY ; + field->flags |=TEP_FIELD_IS_ARRAY ; type =read_token (&token);
@@ -1544,11 +1544,11 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f }if (field_is_string (field)) - field->flags |=FIELD_IS_STRING ; + field->flags |=TEP_FIELD_IS_STRING ;if (field_is_dynamic (field)) - field->flags |=FIELD_IS_DYNAMIC ; + field->flags |=TEP_FIELD_IS_DYNAMIC ;if (field_is_long (field)) - field->flags |=FIELD_IS_LONG ; + field->flags |=TEP_FIELD_IS_LONG ;if (test_type_token (type, token,EVENT_OP ,";" )) goto fail;
@@ -1597,7 +1597,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f goto fail;if (strtoul (token,NULL ,0 )) - field->flags |=FIELD_IS_SIGNED ; + field->flags |=TEP_FIELD_IS_SIGNED ;free_token (token);if (read_expected (EVENT_OP ,";" ) <0 )
@@ -1609,14 +1609,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_ffree_token (token); -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) {if (field->arraylen) field->elementsize = field->size / field->arraylen; -else if (field->flags &FIELD_IS_DYNAMIC ) +else if (field->flags &TEP_FIELD_IS_DYNAMIC ) field->elementsize = size_dynamic; -else if (field->flags &FIELD_IS_STRING ) +else if (field->flags &TEP_FIELD_IS_STRING ) field->elementsize =1 ; -else if (field->flags &FIELD_IS_LONG ) +else if (field->flags &TEP_FIELD_IS_LONG ) field->elementsize = event->pevent ? event->pevent->long_size :sizeof (long );
@@ -2089,11 +2089,11 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *aif (is_flag_field) { arg->field.field =tep_find_any_field (event, arg->field.name); - arg->field.field->flags |=FIELD_IS_FLAG ; + arg->field.field->flags |=TEP_FIELD_IS_FLAG ; is_flag_field =0 ; }else if (is_symbolic_field) { arg->field.field =tep_find_any_field (event, arg->field.name); - arg->field.field->flags |=FIELD_IS_SYMBOLIC ; + arg->field.field->flags |=TEP_FIELD_IS_SYMBOLIC ; is_symbolic_field =0 ; }
@@ -3901,7 +3901,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,* and the size is the same as long_size, assume that it * is a pointer. */ -if (!(field->flags &FIELD_IS_ARRAY ) && +if (!(field->flags &TEP_FIELD_IS_ARRAY ) && field->size == pevent->long_size) {/* Handle heterogeneous recording and processing
@@ -4794,16 +4794,16 @@ void tep_print_field(struct trace_seq *s, void *data,unsigned int offset, len, i;struct tep_handle *pevent = field->event->pevent; -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) { offset = field->offset; len = field->size; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ; } -if (field->flags &FIELD_IS_STRING && +if (field->flags &TEP_FIELD_IS_STRING &&is_printable_array (data + offset, len)) {trace_seq_printf (s,"%s" , (char *)data + offset); }else {
@@ -4815,21 +4815,21 @@ void tep_print_field(struct trace_seq *s, void *data, *((unsigned char *)data + offset + i)); }trace_seq_putc (s,']' ); - field->flags &= ~FIELD_IS_STRING ; + field->flags &= ~TEP_FIELD_IS_STRING ; } }else { val =tep_read_number (pevent, data + field->offset, field->size); -if (field->flags &FIELD_IS_POINTER ) { +if (field->flags &TEP_FIELD_IS_POINTER ) {trace_seq_printf (s,"0x%llx" , val); - }else if (field->flags &FIELD_IS_SIGNED ) { + }else if (field->flags &TEP_FIELD_IS_SIGNED ) {switch (field->size) {case 4 :/* * If field is long then print it in hex. * A long usually stores pointers. */ -if (field->flags &FIELD_IS_LONG ) +if (field->flags &TEP_FIELD_IS_LONG )trace_seq_printf (s,"0x%x" , (int )val);else trace_seq_printf (s,"%d" , (int )val);
@@ -4844,7 +4844,7 @@ void tep_print_field(struct trace_seq *s, void *data,trace_seq_printf (s,"%lld" , val); } }else { -if (field->flags &FIELD_IS_LONG ) +if (field->flags &TEP_FIELD_IS_LONG )trace_seq_printf (s,"0x%llx" , val);else trace_seq_printf (s,"%llu" , val);
@@ -6288,7 +6288,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, len = &dummy; offset = field->offset; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { offset =tep_read_number (event->pevent, data + offset, field->size); *len = offset >>16 ;
tools/lib/traceevent/event-parse.h +9 -9
@@ -130,15 +130,15 @@ struct tep_plugin_option {#define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)#define TEP_PLUGIN_ALIAS_NAME MAKE_STR(TEP_PLUGIN_ALIAS) -enum format_flags { -FIELD_IS_ARRAY =1 , -FIELD_IS_POINTER =2 , -FIELD_IS_SIGNED =4 , -FIELD_IS_STRING =8 , -FIELD_IS_DYNAMIC =16 , -FIELD_IS_LONG =32 , -FIELD_IS_FLAG =64 , -FIELD_IS_SYMBOLIC =128 , +enum tep_format_flags { +TEP_FIELD_IS_ARRAY =1 , +TEP_FIELD_IS_POINTER =2 , +TEP_FIELD_IS_SIGNED =4 , +TEP_FIELD_IS_STRING =8 , +TEP_FIELD_IS_DYNAMIC =16 , +TEP_FIELD_IS_LONG =32 , +TEP_FIELD_IS_FLAG =64 , +TEP_FIELD_IS_SYMBOLIC =128 , };struct tep_format_field {
tools/lib/traceevent/parse-filter.c +4 -4
@@ -1716,7 +1716,7 @@ get_value(struct tep_event_format *event,tep_read_number_field (field, record->data, &val); -if (!(field->flags &FIELD_IS_SIGNED )) +if (!(field->flags &TEP_FIELD_IS_SIGNED ))return val;switch (field->size) {
@@ -1867,11 +1867,11 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *recochar hex[64 ];/* If the field is not a string convert it */ -if (arg->str.field->flags &FIELD_IS_STRING ) { +if (arg->str.field->flags &TEP_FIELD_IS_STRING ) { val = record->data + arg->str.field->offset; size = arg->str.field->size; -if (arg->str.field->flags &FIELD_IS_DYNAMIC ) { +if (arg->str.field->flags &TEP_FIELD_IS_DYNAMIC ) { addr = *(unsigned int *)val; val = record->data + (addr &0xffff ); size = addr >>16 ;
@@ -1893,7 +1893,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco pevent = event->pevent; addr =get_value (event, arg->str.field, record); -if (arg->str.field->flags & (FIELD_IS_POINTER |FIELD_IS_LONG )) +if (arg->str.field->flags & (TEP_FIELD_IS_POINTER |TEP_FIELD_IS_LONG ))/* convert to a kernel symbol */ val =tep_find_function (pevent, addr);
tools/perf/builtin-trace.c +1 -1
@@ -1293,7 +1293,7 @@ static int syscall__set_arg_fmts(struct syscall *sc)strcmp (field->name,"path" ) ==0 || strcmp(field->name, "pathname") == 0)) sc->arg_fmt[idx].scnprintf = SCA_FILENAME; - else if (field->flags & FIELD_IS_POINTER) + else if (field->flags & TEP_FIELD_IS_POINTER) sc->arg_fmt[idx].scnprintf = syscall_arg__scnprintf_hex; else if (strcmp(field->type, "pid_t") == 0) sc->arg_fmt[idx].scnprintf = SCA_PID;
tools/perf/tests/evsel-tp-sched.c +1 -1
@@ -17,7 +17,7 @@ static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,return -1 ; } - is_signed = !!(field->flags |FIELD_IS_SIGNED ); + is_signed = !!(field->flags |TEP_FIELD_IS_SIGNED );if (should_be_signed && !is_signed) {pr_debug ("%s: \"%s\" signedness(%d) is wrong, should be %d\n" , evsel->name, name, is_signed, should_be_signed);
tools/perf/util/data-convert-bt.c +17 -17
@@ -186,16 +186,16 @@ get_tracepoint_field_type(struct ctf_writer *cw, struct tep_format_field *field) {unsigned long flags = field->flags; -if (flags &FIELD_IS_STRING ) +if (flags &TEP_FIELD_IS_STRING )return cw->data.string; -if (!(flags &FIELD_IS_SIGNED )) { +if (!(flags &TEP_FIELD_IS_SIGNED )) {/* unsigned long are mostly pointers */ -if (flags &FIELD_IS_LONG || flags &FIELD_IS_POINTER ) +if (flags &TEP_FIELD_IS_LONG || flags &TEP_FIELD_IS_POINTER )return cw->data.u64_hex; } -if (flags &FIELD_IS_SIGNED ) { +if (flags &TEP_FIELD_IS_SIGNED ) {if (field->size ==8 )return cw->data.s64;else
@@ -304,10 +304,10 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, name = fmtf->alias; offset = fmtf->offset; len = fmtf->size; -if (flags &FIELD_IS_STRING ) - flags &= ~FIELD_IS_ARRAY ; +if (flags &TEP_FIELD_IS_STRING ) + flags &= ~TEP_FIELD_IS_ARRAY ; -if (flags &FIELD_IS_DYNAMIC ) { +if (flags &TEP_FIELD_IS_DYNAMIC ) {unsigned long long tmp_val; tmp_val = tep_read_number(fmtf->event->pevent,
@@ -317,7 +317,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, offset &=0xffff ; } -if (flags &FIELD_IS_ARRAY ) { +if (flags &TEP_FIELD_IS_ARRAY ) { type =bt_ctf_event_class_get_field_by_name ( event_class, name);
@@ -338,7 +338,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, type =get_tracepoint_field_type (cw, fmtf);for (i =0 ; i < n_items; i++) { -if (flags &FIELD_IS_ARRAY ) +if (flags &TEP_FIELD_IS_ARRAY ) field =bt_ctf_field_array_get_field (array_field, i);else field =bt_ctf_field_create (type);
@@ -348,7 +348,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,return -1 ; } -if (flags &FIELD_IS_STRING ) +if (flags &TEP_FIELD_IS_STRING ) ret =string_set_value (field, data + offset + i * len);else {unsigned long long value_int;
@@ -357,7 +357,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, fmtf->event->pevent, data + offset + i * len, len); -if (!(flags &FIELD_IS_SIGNED )) +if (!(flags &TEP_FIELD_IS_SIGNED )) ret =bt_ctf_field_unsigned_integer_set_value ( field, value_int);else
@@ -369,7 +369,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,pr_err ("failed to set file value %s\n" , name); goto err_put_field; } -if (!(flags &FIELD_IS_ARRAY )) { +if (!(flags &TEP_FIELD_IS_ARRAY )) { ret =bt_ctf_event_set_payload (event, name, field);if (ret) {pr_err ("failed to set payload %s\n" , name);
@@ -378,7 +378,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, }bt_ctf_field_put (field); } -if (flags &FIELD_IS_ARRAY ) { +if (flags &TEP_FIELD_IS_ARRAY ) { ret =bt_ctf_event_set_payload (event, name, array_field);if (ret) {pr_err ("Failed add payload array %s\n" , name);
@@ -1030,15 +1030,15 @@ static int add_tracepoint_fields_types(struct ctf_writer *cw,* type and don't care that it is an array. What we don't * support is an array of strings. */ -if (flags &FIELD_IS_STRING ) - flags &= ~FIELD_IS_ARRAY ; +if (flags &TEP_FIELD_IS_STRING ) + flags &= ~TEP_FIELD_IS_ARRAY ; -if (flags &FIELD_IS_ARRAY ) +if (flags &TEP_FIELD_IS_ARRAY ) type =bt_ctf_field_type_array_create (type, field->arraylen); ret =event_class_add_field (event_class, type, field); -if (flags &FIELD_IS_ARRAY ) +if (flags &TEP_FIELD_IS_ARRAY )bt_ctf_field_type_put (type);if (ret) {
tools/perf/util/evsel.c +1 -1
@@ -2698,7 +2698,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, offset = field->offset; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { offset = *(int *)(sample->raw_data + field->offset); offset &=0xffff ; }
tools/perf/util/python.c +6 -6
@@ -348,28 +348,28 @@ tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)unsigned long long val;unsigned int offset, len; -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) { offset = field->offset; len = field->size; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ; } -if (field->flags &FIELD_IS_STRING && +if (field->flags &TEP_FIELD_IS_STRING &&is_printable_array (data + offset, len)) { ret =_PyUnicode_FromString ((char *)data + offset); }else { ret =PyByteArray_FromStringAndSize ((const char *) data + offset, len); - field->flags &= ~FIELD_IS_STRING ; + field->flags &= ~TEP_FIELD_IS_STRING ; } }else { val =tep_read_number (pevent, data + field->offset, field->size); -if (field->flags &FIELD_IS_POINTER ) +if (field->flags &TEP_FIELD_IS_POINTER ) ret =PyLong_FromUnsignedLong ((unsigned long ) val); -else if (field->flags &FIELD_IS_SIGNED ) +else if (field->flags &TEP_FIELD_IS_SIGNED ) ret =PyLong_FromLong ((long ) val);else ret =PyLong_FromUnsignedLong ((unsigned long ) val);
tools/perf/util/scripting-engines/trace-event-perl.c +9 -9
@@ -388,9 +388,9 @@ static void perl_process_tracepoint(struct perf_sample *sample,/* common fields other than pid can be accessed via xsub fns */ for (field = event->format.fields; field; field = field->next) { -if (field->flags &FIELD_IS_STRING ) { +if (field->flags &TEP_FIELD_IS_STRING ) {int offset; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { offset = *(int *)(data + field->offset); offset &=0xffff ; }else
@@ -399,7 +399,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, }else {/* FIELD_IS_NUMERIC */ val =read_size (event, data + field->offset, field->size); -if (field->flags &FIELD_IS_SIGNED ) { +if (field->flags &TEP_FIELD_IS_SIGNED ) {XPUSHs (sv_2mortal (newSViv (val))); }else {XPUSHs (sv_2mortal (newSVuv (val)));
@@ -646,11 +646,11 @@ sub print_backtrace\n\ count++;fprintf (ofp,"%s=" , f->name); -if (f->flags &FIELD_IS_STRING || - f->flags &FIELD_IS_FLAG || - f->flags &FIELD_IS_SYMBOLIC ) +if (f->flags &TEP_FIELD_IS_STRING || + f->flags &TEP_FIELD_IS_FLAG || + f->flags &TEP_FIELD_IS_SYMBOLIC )fprintf (ofp,"%%s" ); -else if (f->flags &FIELD_IS_SIGNED ) +else if (f->flags &TEP_FIELD_IS_SIGNED )fprintf (ofp,"%%d" );else fprintf (ofp,"%%u" );
@@ -668,7 +668,7 @@ sub print_backtrace\n\if (++count %5 ==0 )fprintf (ofp,"\n\t " ); -if (f->flags &FIELD_IS_FLAG ) { +if (f->flags &TEP_FIELD_IS_FLAG ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t " ); count =4 ;
@@ -678,7 +678,7 @@ sub print_backtrace\n\ event->name);fprintf (ofp,"\"%s\", $%s)" , f->name, f->name); - }else if (f->flags &FIELD_IS_SYMBOLIC ) { + }else if (f->flags &TEP_FIELD_IS_SYMBOLIC ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t " ); count =4 ;
tools/perf/util/scripting-engines/trace-event-python.c +13 -13
@@ -335,7 +335,7 @@ static void define_event_symbols(struct tep_event_format *event,static PyObject *get_field_numeric_entry (struct tep_event_format *event,struct tep_format_field *field,void *data) { -bool is_array = field->flags &FIELD_IS_ARRAY ; +bool is_array = field->flags &TEP_FIELD_IS_ARRAY ;PyObject *obj =NULL , *list =NULL ;unsigned long long val;unsigned int item_size, n_items, i;
@@ -353,7 +353,7 @@ static PyObject *get_field_numeric_entry(struct tep_event_format *event, val =read_size (event, data + field->offset + i * item_size, item_size); -if (field->flags &FIELD_IS_SIGNED ) { +if (field->flags &TEP_FIELD_IS_SIGNED ) {if ((long long )val >=LONG_MIN && (long long )val <=LONG_MAX ) obj =_PyLong_FromLong (val);
@@ -867,22 +867,22 @@ static void python_process_tracepoint(struct perf_sample *sample,unsigned int offset, len;unsigned long long val; -if (field->flags &FIELD_IS_ARRAY ) { +if (field->flags &TEP_FIELD_IS_ARRAY ) { offset = field->offset; len = field->size; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) { val =tep_read_number (scripting_context->pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ; } -if (field->flags &FIELD_IS_STRING && +if (field->flags &TEP_FIELD_IS_STRING &&is_printable_array (data + offset, len)) { obj =_PyUnicode_FromString ((char *) data + offset); }else { obj =PyByteArray_FromStringAndSize ((const char *) data + offset, len); - field->flags &= ~FIELD_IS_STRING ; + field->flags &= ~TEP_FIELD_IS_STRING ; } }else {/* FIELD_IS_NUMERIC */ obj =get_field_numeric_entry (event, field, data);
@@ -1686,12 +1686,12 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile count++;fprintf (ofp,"%s=" , f->name); -if (f->flags &FIELD_IS_STRING || - f->flags &FIELD_IS_FLAG || - f->flags &FIELD_IS_ARRAY || - f->flags &FIELD_IS_SYMBOLIC ) +if (f->flags &TEP_FIELD_IS_STRING || + f->flags &TEP_FIELD_IS_FLAG || + f->flags &TEP_FIELD_IS_ARRAY || + f->flags &TEP_FIELD_IS_SYMBOLIC )fprintf (ofp,"%%s" ); -else if (f->flags &FIELD_IS_SIGNED ) +else if (f->flags &TEP_FIELD_IS_SIGNED )fprintf (ofp,"%%d" );else fprintf (ofp,"%%u" );
@@ -1709,7 +1709,7 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfileif (++count %5 ==0 )fprintf (ofp,"\n\t\t" ); -if (f->flags &FIELD_IS_FLAG ) { +if (f->flags &TEP_FIELD_IS_FLAG ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t\t" ); count =4 ;
@@ -1719,7 +1719,7 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile event->name);fprintf (ofp,"\"%s\", %s)" , f->name, f->name); - }else if (f->flags &FIELD_IS_SYMBOLIC ) { + }else if (f->flags &TEP_FIELD_IS_SYMBOLIC ) {if ((count -1 ) %5 !=0 ) {fprintf (ofp,"\n\t\t" ); count =4 ;
tools/perf/util/sort.c +2 -2
@@ -1899,7 +1899,7 @@ static int hde_width(struct hpp_dynamic_entry *hde)if (namelen > len) len = namelen; -if (!(hde->field->flags &FIELD_IS_STRING )) { +if (!(hde->field->flags &TEP_FIELD_IS_STRING )) {/* length for print hex numbers */ fieldlen = hde->field->size *2 +2 ; }
@@ -2071,7 +2071,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, } field = hde->field; -if (field->flags &FIELD_IS_DYNAMIC ) { +if (field->flags &TEP_FIELD_IS_DYNAMIC ) {unsigned long long dyn;tep_read_number_field (field, a->raw_data, &dyn);
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type
In reply to Steven Rostedttools lib traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type
Commit-ID: f25d9e09e9354bded677d21b51a7b1879cfa02a8 Gitweb: https://git.kernel.org/tip/f25d9e09e9354bded677d21b51a7b1879cfa02a8 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:47 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:14:58 -0300
tools lib traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type
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 enum event_type to enum tep_event_type, enum event_sort_type to enum tep_event_sort_type and add prefix TEP_ to all enum's members
--- tools/lib/traceevent/event-parse.c | 488 ++++++++++++++++++------------------ tools/lib/traceevent/event-parse.h | 34 +-- tools/lib/traceevent/parse-filter.c | 36 +-- 3 files changed, 279 insertions(+), 279 deletions(-)
tools/lib/traceevent/event-parse.c +244 -244
@@ -770,12 +770,12 @@ static int add_event(struct tep_handle *pevent, struct tep_event_format *event)return 0 ; } -static int event_item_type (enum event_type type) +static int event_item_type (enum tep_event_type type) {switch (type) { - case EVENT_ITEM ... EVENT_SQUOTE: + case TEP_EVENT_ITEM ... TEP_EVENT_SQUOTE:return 1 ; - case EVENT_ERROR ... EVENT_DELIM: + case TEP_EVENT_ERROR ... TEP_EVENT_DELIM:default :return 0 ; }
@@ -863,24 +863,24 @@ static void free_arg(struct print_arg *arg)free (arg); } -static enum event_type get_type (int ch) +static enum tep_event_type get_type (int ch) {if (ch =='\n' ) -return EVENT_NEWLINE ; +return TEP_EVENT_NEWLINE ;if (isspace (ch)) -return EVENT_SPACE ; +return TEP_EVENT_SPACE ;if (isalnum (ch) || ch =='_' ) -return EVENT_ITEM ; +return TEP_EVENT_ITEM ;if (ch =='\'' ) -return EVENT_SQUOTE ; +return TEP_EVENT_SQUOTE ;if (ch =='"' ) -return EVENT_DQUOTE ; +return TEP_EVENT_DQUOTE ;if (!isprint (ch)) -return EVENT_NONE ; +return TEP_EVENT_NONE ;if (ch =='(' || ch ==')' || ch ==',' ) -return EVENT_DELIM ; +return TEP_EVENT_DELIM ; -return EVENT_OP ; +return TEP_EVENT_OP ; }static int __read_char (void )
@@ -928,38 +928,38 @@ static int extend_token(char **tok, char *buf, int size)return 0 ; } -static enum event_type force_token (const char *str,char **tok); +static enum tep_event_type force_token (const char *str,char **tok); -static enum event_type __read_token (char **tok) +static enum tep_event_type __read_token (char **tok) {char buf[BUFSIZ ];int ch, last_ch, quote_ch, next_ch;int i =0 ;int tok_size =0 ; -enum event_type type; +enum tep_event_type type; *tok =NULL ; ch =__read_char ();if (ch <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; type =get_type (ch); -if (type ==EVENT_NONE ) +if (type ==TEP_EVENT_NONE )return type; buf[i++] = ch;switch (type) { -case EVENT_NEWLINE : -case EVENT_DELIM : +case TEP_EVENT_NEWLINE : +case TEP_EVENT_DELIM :if (asprintf (tok,"%c" , ch) <0 ) -return EVENT_ERROR ; +return TEP_EVENT_ERROR ;return type; -case EVENT_OP : +case TEP_EVENT_OP :switch (ch) {case '-' : next_ch =__peek_char ();
@@ -1002,8 +1002,8 @@ static enum event_type __read_token(char **tok) buf[i++] =__read_char (); goto out; -case EVENT_DQUOTE : -case EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_SQUOTE :/* don't keep quotes */ i--; quote_ch = ch;
@@ -1015,7 +1015,7 @@ static enum event_type __read_token(char **tok) tok_size +=BUFSIZ ;if (extend_token (tok, buf, tok_size) <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; i =0 ; } last_ch = ch;
@@ -1032,7 +1032,7 @@ static enum event_type __read_token(char **tok)* For strings (double quotes) check the next token. * If it is another string, concatinate the two. */ -if (type ==EVENT_DQUOTE ) { +if (type ==TEP_EVENT_DQUOTE ) {unsigned long long save_input_buf_ptr = input_buf_ptr; do {
@@ -1045,8 +1045,8 @@ static enum event_type __read_token(char **tok) goto out; - case EVENT_ERROR ... EVENT_SPACE: -case EVENT_ITEM : + case TEP_EVENT_ERROR ... TEP_EVENT_SPACE: +case TEP_EVENT_ITEM :default :break ; }
@@ -1057,7 +1057,7 @@ static enum event_type __read_token(char **tok) tok_size +=BUFSIZ ;if (extend_token (tok, buf, tok_size) <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; i =0 ; } ch =__read_char ();
@@ -1067,9 +1067,9 @@ static enum event_type __read_token(char **tok) out: buf[i] =0 ;if (extend_token (tok, buf, tok_size + i +1 ) <0 ) -return EVENT_NONE ; +return TEP_EVENT_NONE ; -if (type ==EVENT_ITEM ) { +if (type ==TEP_EVENT_ITEM ) {/* * Older versions of the kernel has a bug that * creates invalid symbols and will break the mac80211
@@ -1096,12 +1096,12 @@ static enum event_type __read_token(char **tok)return type; } -static enum event_type force_token (const char *str,char **tok) +static enum tep_event_type force_token (const char *str,char **tok) {const char *save_input_buf;unsigned long long save_input_buf_ptr;unsigned long long save_input_buf_siz; -enum event_type type; +enum tep_event_type type;/* save off the current input pointers */ save_input_buf = input_buf;
@@ -1126,13 +1126,13 @@ static void free_token(char *tok)free (tok); } -static enum event_type read_token (char **tok) +static enum tep_event_type read_token (char **tok) { -enum event_type type; +enum tep_event_type type;for (;;) { type =__read_token (tok); -if (type !=EVENT_SPACE ) +if (type !=TEP_EVENT_SPACE )return type;free_token (*tok);
@@ -1140,7 +1140,7 @@ static enum event_type read_token(char **tok)/* not reached */ *tok =NULL ; -return EVENT_NONE ; +return TEP_EVENT_NONE ; }/**
@@ -1152,7 +1152,7 @@ static enum event_type read_token(char **tok)* * Returns the token type. */ -enum event_type tep_read_token (char **tok) +enum tep_event_type tep_read_token (char **tok) {return read_token (tok); }
@@ -1167,13 +1167,13 @@ void tep_free_token(char *token) }/* no newline */ -static enum event_type read_token_item (char **tok) +static enum tep_event_type read_token_item (char **tok) { -enum event_type type; +enum tep_event_type type;for (;;) { type =__read_token (tok); -if (type !=EVENT_SPACE && type !=EVENT_NEWLINE ) +if (type !=TEP_EVENT_SPACE && type !=TEP_EVENT_NEWLINE )return type;free_token (*tok); *tok =NULL ;
@@ -1181,10 +1181,10 @@ static enum event_type read_token_item(char **tok)/* not reached */ *tok =NULL ; -return EVENT_NONE ; +return TEP_EVENT_NONE ; } -static int test_type (enum event_type type,enum event_type expect) +static int test_type (enum tep_event_type type,enum tep_event_type expect) {if (type != expect) { do_warning("Error: expected type %d but read %d",
@@ -1194,8 +1194,8 @@ static int test_type(enum event_type type, enum event_type expect)return 0 ; } -static int test_type_token (enum event_type type,const char *token, -enum event_type expect,const char *expect_tok) +static int test_type_token (enum tep_event_type type,const char *token, +enum tep_event_type expect,const char *expect_tok) {if (type != expect) { do_warning("Error: expected type %d but read %d",
@@ -1211,9 +1211,9 @@ static int test_type_token(enum event_type type, const char *token,return 0 ; } -static int __read_expect_type (enum event_type expect,char **tok,int newline_ok) +static int __read_expect_type (enum tep_event_type expect,char **tok,int newline_ok) { -enum event_type type; +enum tep_event_type type;if (newline_ok) type =read_token (tok);
@@ -1222,15 +1222,15 @@ static int __read_expect_type(enum event_type expect, char **tok, int newline_okreturn test_type (type, expect); } -static int read_expect_type (enum event_type expect,char **tok) +static int read_expect_type (enum tep_event_type expect,char **tok) {return __read_expect_type (expect, tok,1 ); } -static int __read_expected (enum event_type expect,const char *str, +static int __read_expected (enum tep_event_type expect,const char *str,int newline_ok) { -enum event_type type; +enum tep_event_type type;char *token;int ret;
@@ -1246,12 +1246,12 @@ static int __read_expected(enum event_type expect, const char *str,return ret; } -static int read_expected (enum event_type expect,const char *str) +static int read_expected (enum tep_event_type expect,const char *str) {return __read_expected (expect, str,1 ); } -static int read_expected_item (enum event_type expect,const char *str) +static int read_expected_item (enum tep_event_type expect,const char *str) {return __read_expected (expect, str,0 ); }
@@ -1260,13 +1260,13 @@ static char *event_read_name(void) {char *token; -if (read_expected (EVENT_ITEM ,"name" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"name" ) <0 )return NULL ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return NULL ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail;return token;
@@ -1281,13 +1281,13 @@ static int event_read_id(void)char *token;int id; -if (read_expected_item (EVENT_ITEM ,"ID" ) <0 ) +if (read_expected_item (TEP_EVENT_ITEM ,"ID" ) <0 )return -1 ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return -1 ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; id =strtoul (token,NULL ,0 );
@@ -1357,7 +1357,7 @@ static unsigned int type_size(const char *name)static int event_read_fields (struct tep_event_format *event,struct tep_format_field **fields) {struct tep_format_field *field =NULL ; -enum event_type type; +enum tep_event_type type;char *token;char *last_token;int count =0 ;
@@ -1366,14 +1366,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_funsigned int size_dynamic =0 ; type =read_token (&token); -if (type ==EVENT_NEWLINE ) { +if (type ==TEP_EVENT_NEWLINE ) {free_token (token);return count; } count++; -if (test_type_token (type, token,EVENT_ITEM ,"field" )) +if (test_type_token (type, token,TEP_EVENT_ITEM ,"field" )) goto fail;free_token (token);
@@ -1383,16 +1383,16 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* Just ignore it. */ if (event->flags &EVENT_FL_ISFTRACE && - type ==EVENT_ITEM &&strcmp (token,"special" ) ==0 ) { + type ==TEP_EVENT_ITEM &&strcmp (token,"special" ) ==0 ) {free_token (token); type =read_token (&token); } -if (test_type_token (type, token,EVENT_OP ,":" ) <0 ) +if (test_type_token (type, token,TEP_EVENT_OP ,":" ) <0 ) goto fail;free_token (token); -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; last_token = token;
@@ -1406,14 +1406,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f/* read the rest of the type */ for (;;) { type =read_token (&token); -if (type ==EVENT_ITEM || - (type ==EVENT_OP &&strcmp (token,"*" ) ==0 ) || +if (type ==TEP_EVENT_ITEM || + (type ==TEP_EVENT_OP &&strcmp (token,"*" ) ==0 ) ||/* * Some of the ftrace fields are broken and have * an illegal "." in them. */ (event->flags &EVENT_FL_ISFTRACE && - type ==EVENT_OP &&strcmp (token,"." ) ==0 )) { + type ==TEP_EVENT_OP &&strcmp (token,"." ) ==0 )) {if (strcmp (token,"*" ) ==0 ) field->flags |=TEP_FIELD_IS_POINTER ;
@@ -1446,11 +1446,11 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f } field->name = field->alias = last_token; -if (test_type (type,EVENT_OP )) +if (test_type (type,TEP_EVENT_OP )) goto fail;if (strcmp (token,"[" ) ==0 ) { -enum event_type last_type = type; +enum tep_event_type last_type = type;char *brackets = token;char *new_brackets;int len;
@@ -1459,14 +1459,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f type =read_token (&token); -if (type ==EVENT_ITEM ) +if (type ==TEP_EVENT_ITEM ) field->arraylen =strtoul (token,NULL ,0 );else field->arraylen =0 ;while (strcmp (token,"]" ) !=0 ) { -if (last_type ==EVENT_ITEM && - type ==EVENT_ITEM ) +if (last_type ==TEP_EVENT_ITEM && + type ==TEP_EVENT_ITEM ) len =2 ;else len =1 ;
@@ -1487,7 +1487,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f field->arraylen =strtoul (token,NULL ,0 );free_token (token); type =read_token (&token); -if (type ==EVENT_NONE ) { +if (type ==TEP_EVENT_NONE ) {do_warning_event (event,"failed to find token" ); goto fail; }
@@ -1510,7 +1510,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* If the next token is not an OP, then it is of * the format: type [] item; */ -if (type ==EVENT_ITEM ) { +if (type ==TEP_EVENT_ITEM ) {char *new_type; new_type = realloc(field->type, strlen(field->type) +
@@ -1550,60 +1550,60 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_fif (field_is_long (field)) field->flags |=TEP_FIELD_IS_LONG ; -if (test_type_token (type, token,EVENT_OP ,";" )) +if (test_type_token (type, token,TEP_EVENT_OP ,";" )) goto fail;free_token (token); -if (read_expected (EVENT_ITEM ,"offset" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"offset" ) <0 ) goto fail_expect; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail; field->offset =strtoul (token,NULL ,0 );free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 ) goto fail_expect; -if (read_expected (EVENT_ITEM ,"size" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"size" ) <0 ) goto fail_expect; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail; field->size =strtoul (token,NULL ,0 );free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 ) goto fail_expect; type =read_token (&token); -if (type !=EVENT_NEWLINE ) { +if (type !=TEP_EVENT_NEWLINE ) {/* newer versions of the kernel have a "signed" type */ -if (test_type_token (type, token,EVENT_ITEM ,"signed" )) +if (test_type_token (type, token,TEP_EVENT_ITEM ,"signed" )) goto fail;free_token (token); -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail;if (strtoul (token,NULL ,0 )) field->flags |=TEP_FIELD_IS_SIGNED ;free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 ) goto fail_expect; -if (read_expect_type (EVENT_NEWLINE , &token)) +if (read_expect_type (TEP_EVENT_NEWLINE , &token)) goto fail; }
@@ -1646,13 +1646,13 @@ static int event_read_format(struct tep_event_format *event)char *token;int ret; -if (read_expected_item (EVENT_ITEM ,"format" ) <0 ) +if (read_expected_item (TEP_EVENT_ITEM ,"format" ) <0 )return -1 ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return -1 ; -if (read_expect_type (EVENT_NEWLINE , &token)) +if (read_expect_type (TEP_EVENT_NEWLINE , &token)) goto fail;free_token (token);
@@ -1673,14 +1673,14 @@ static int event_read_format(struct tep_event_format *event)return -1 ; } -static enum event_type +static enum tep_event_type process_arg_token (struct tep_event_format *event,struct print_arg *arg, -char **tok,enum event_type type); +char **tok,enum tep_event_type type); -static enum event_type +static enum tep_event_type process_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *token; type =read_token (&token);
@@ -1689,32 +1689,32 @@ process_arg(struct tep_event_format *event, struct print_arg *arg, char **tok)return process_arg_token (event, arg, tok, type); } -static enum event_type +static enum tep_event_type process_op (struct tep_event_format *event,struct print_arg *arg,char **tok);/* * For __print_symbolic() and __print_flags, we need to completely * evaluate the first argument, which defines what to print next. */ -static enum event_type +static enum tep_event_type process_field_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type; type =process_arg (event, arg, tok); -while (type ==EVENT_OP ) { +while (type ==TEP_EVENT_OP ) { type =process_op (event, arg, tok); }return type; } -static enum event_type +static enum tep_event_type process_cond (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg, *left, *right; -enum event_type type; +enum tep_event_type type;char *token =NULL ; arg =alloc_arg ();
@@ -1737,16 +1737,16 @@ process_cond(struct tep_event_format *event, struct print_arg *top, char **tok) type =process_arg (event, left, &token); again: -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free;/* Handle other operations in the arguments */ -if (type ==EVENT_OP &&strcmp (token,":" ) !=0 ) { +if (type ==TEP_EVENT_OP &&strcmp (token,":" ) !=0 ) { type =process_op (event, left, &token); goto again; } -if (test_type_token (type, token,EVENT_OP ,":" )) +if (test_type_token (type, token,TEP_EVENT_OP ,":" )) goto out_free; arg->op.op = token;
@@ -1763,14 +1763,14 @@ out_free: top->op.right =NULL ;free_token (token);free_arg (arg); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_array (struct tep_event_format *event,struct print_arg *top,char **tok) {struct print_arg *arg; -enum event_type type; +enum tep_event_type type;char *token =NULL ; arg =alloc_arg ();
@@ -1778,12 +1778,12 @@ process_array(struct tep_event_format *event, struct print_arg *top, char **tok)do_warning_event (event,"%s: not enough memory!" , __func__);/* '*tok' is set to top->op.op. No need to free. */ *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } *tok =NULL ; type =process_arg (event, arg, &token); -if (test_type_token (type, token,EVENT_OP ,"]" )) +if (test_type_token (type, token,TEP_EVENT_OP ,"]" )) goto out_free; top->op.right = arg;
@@ -1797,7 +1797,7 @@ process_array(struct tep_event_format *event, struct print_arg *top, char **tok) out_free:free_token (token);free_arg (arg); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }static int get_op_prio (char *op)
@@ -1868,11 +1868,11 @@ static int set_op_prio(struct print_arg *arg) }/* Note, *tok does not get freed, but will most likely be saved */ -static enum event_type +static enum tep_event_type process_op (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *left, *right =NULL ; -enum event_type type; +enum tep_event_type type;char *token;/* the op is passed in via tok */
@@ -1974,7 +1974,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok)/* could just be a type pointer */ if ((strcmp (arg->op.op,"*" ) ==0 ) && - type ==EVENT_DELIM && (strcmp (token,")" ) ==0 )) { + type ==TEP_EVENT_DELIM && (strcmp (token,")" ) ==0 )) {char *new_atom;if (left->type !=PRINT_ATOM ) {
@@ -2000,7 +2000,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) goto out_warn_free; type =process_arg_token (event, right, tok, type); -if (type ==EVENT_ERROR ) { +if (type ==TEP_EVENT_ERROR ) {free_arg (right);/* token was freed in process_arg_token() via *tok */ token =NULL ;
@@ -2047,7 +2047,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) goto out_free; } -if (type ==EVENT_OP &&strcmp (*tok,":" ) !=0 ) { +if (type ==TEP_EVENT_OP &&strcmp (*tok,":" ) !=0 ) {int prio;/* higher prios need to be closer to the root */
@@ -2066,21 +2066,21 @@ out_warn_free: out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_entry (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *field;char *token; -if (read_expected (EVENT_OP ,"->" ) <0 ) +if (read_expected (TEP_EVENT_OP ,"->" ) <0 ) goto out_err; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; field = token;
@@ -2106,14 +2106,14 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *afree_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }static int alloc_and_process_delim (struct tep_event_format *event,char *next_token,struct print_arg **print_arg) {struct print_arg *field; -enum event_type type; +enum tep_event_type type;char *token;int ret =0 ;
@@ -2126,7 +2126,7 @@ static int alloc_and_process_delim(struct tep_event_format *event, char *next_to type =process_arg (event, field, &token); -if (test_type_token (type, token,EVENT_DELIM , next_token)) { +if (test_type_token (type, token,TEP_EVENT_DELIM , next_token)) { errno =EINVAL ; ret =-1 ;free_arg (field);
@@ -2443,10 +2443,10 @@ static char *arg_eval (struct print_arg *arg)return NULL ; } -static enum event_type +static enum tep_event_type process_fields (struct tep_event_format *event,struct print_flag_sym **list,char **tok) { -enum event_type type; +enum tep_event_type type;struct print_arg *arg =NULL ;struct print_flag_sym *field;char *token = *tok;
@@ -2455,7 +2455,7 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, cha do { free_token(token); type = read_token_item(&token); - if (test_type_token(type, token, EVENT_OP, "{")) + if (test_type_token(type, token, TEP_EVENT_OP, "{")) break; arg = alloc_arg();
@@ -2465,13 +2465,13 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); type =process_arg (event, arg, &token); -if (type ==EVENT_OP ) +if (type ==TEP_EVENT_OP ) type =process_op (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free; -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free; field =calloc (1 ,sizeof (*field));
@@ -2492,7 +2492,7 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); type =process_arg (event, arg, &token); -if (test_type_token (type, token,EVENT_OP ,"}" )) +if (test_type_token (type, token,TEP_EVENT_OP ,"}" )) goto out_free_field; value =arg_eval (arg);
@@ -2509,7 +2509,7 @@ process_fields(struct tep_event_format *event, struct print_flag_sym **list, chafree_token (token); type =read_token_item (&token); - }while (type ==EVENT_DELIM &&strcmp (token,"," ) ==0 ); + }while (type ==TEP_EVENT_DELIM &&strcmp (token,"," ) ==0 ); *tok = token;return type;
@@ -2521,14 +2521,14 @@ out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_flags (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field; -enum event_type type; +enum tep_event_type type;char *token =NULL ;memset (arg,0 ,sizeof (*arg));
@@ -2543,10 +2543,10 @@ process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok) type =process_field_arg (event, field, &token);/* Handle operations in the first argument */ -while (type ==EVENT_OP ) +while (type ==TEP_EVENT_OP ) type =process_op (event, field, &token); -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free_field;free_token (token);
@@ -2558,11 +2558,11 @@ process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok) type =read_token_item (&token); } -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free; type =process_fields (event, &arg->flags.flags, &token); -if (test_type_token (type, token,EVENT_DELIM ,")" )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,")" )) goto out_free;free_token (token);
@@ -2574,14 +2574,14 @@ out_free_field: out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_symbols (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *field; -enum event_type type; +enum tep_event_type type;char *token =NULL ;memset (arg,0 ,sizeof (*arg));
@@ -2595,13 +2595,13 @@ process_symbols(struct tep_event_format *event, struct print_arg *arg, char **to type =process_field_arg (event, field, &token); -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto out_free_field; arg->symbol.field = field; type =process_fields (event, &arg->symbol.symbols, &token); -if (test_type_token (type, token,EVENT_DELIM ,")" )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,")" )) goto out_free;free_token (token);
@@ -2613,10 +2613,10 @@ out_free_field: out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_hex_common (struct tep_event_format *event,struct print_arg *arg,char **tok,enum print_arg_type type) {
@@ -2636,23 +2636,23 @@ free_field: arg->hex.field =NULL ; out: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_hex (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX ); } -static enum event_type +static enum tep_event_type process_hex_str (struct tep_event_format *event,struct print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX_STR ); } -static enum event_type +static enum tep_event_type process_int_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg));
@@ -2677,14 +2677,14 @@ free_field: arg->int_array.field =NULL ; out: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct tep_format_field *field; -enum event_type type; +enum tep_event_type type;char *token;memset (arg,0 ,sizeof (*arg));
@@ -2696,7 +2696,7 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha*/ type =read_token (&token); *tok = token; -if (type !=EVENT_ITEM ) +if (type !=TEP_EVENT_ITEM ) goto out_free;/* Find the field */
@@ -2708,13 +2708,13 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha arg->dynarray.field = field; arg->dynarray.index =0 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_free;free_token (token); type =read_token_item (&token); *tok = token; -if (type !=EVENT_OP ||strcmp (token,"[" ) !=0 ) +if (type !=TEP_EVENT_OP ||strcmp (token,"[" ) !=0 )return type;free_token (token);
@@ -2722,14 +2722,14 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, chaif (!arg) {do_warning_event (event,"%s: not enough memory!" , __func__); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } type =process_arg (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free_arg; -if (!test_type_token (type, token,EVENT_OP ,"]" )) +if (!test_type_token (type, token,TEP_EVENT_OP ,"]" )) goto out_free_arg;free_token (token);
@@ -2741,18 +2741,18 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_dynamic_array_len (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct tep_format_field *field; -enum event_type type; +enum tep_event_type type;char *token; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; arg->type =PRINT_DYNAMIC_ARRAY_LEN ;
@@ -2765,7 +2765,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, arg->dynarray.field = field; arg->dynarray.index =0 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_err; type =read_token (&token);
@@ -2777,28 +2777,28 @@ process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg,free_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_paren (struct tep_event_format *event,struct print_arg *arg,char **tok) {struct print_arg *item_arg; -enum event_type type; +enum tep_event_type type;char *token; type =process_arg (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free; -if (type ==EVENT_OP ) +if (type ==TEP_EVENT_OP ) type =process_op (event, arg, &token); -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) goto out_free; -if (test_type_token (type, token,EVENT_DELIM ,")" )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,")" )) goto out_free;free_token (token);
@@ -2809,7 +2809,7 @@ process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok)* this was a typecast. */ if (event_item_type (type) || - (type ==EVENT_DELIM &&strcmp (token,"(" ) ==0 )) { + (type ==TEP_EVENT_DELIM &&strcmp (token,"(" ) ==0 )) {/* make this a typecast and contine */
@@ -2839,25 +2839,25 @@ process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok) out_free:free_token (token); *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_str (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *token; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; arg->type =PRINT_STRING ; arg->string.string = token; arg->string.offset =-1 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_err; type =read_token (&token);
@@ -2869,24 +2869,24 @@ process_str(struct tep_event_format *event __maybe_unused, struct print_arg *argfree_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_bitmask (struct tep_event_format *event__maybe_unused ,struct print_arg *arg,char **tok) { -enum event_type type; +enum tep_event_type type;char *token; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; arg->type =PRINT_BITMASK ; arg->bitmask.bitmask = token; arg->bitmask.offset =-1 ; -if (read_expected (EVENT_DELIM ,")" ) <0 ) +if (read_expected (TEP_EVENT_DELIM ,")" ) <0 ) goto out_err; type =read_token (&token);
@@ -2898,7 +2898,7 @@ process_bitmask(struct tep_event_format *event __maybe_unused, struct print_argfree_token (token); out_err: *tok =NULL ; -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } static struct tep_function_handler *
@@ -2933,13 +2933,13 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) } } -static enum event_type +static enum tep_event_type process_func_handler (struct tep_event_format *event,struct tep_function_handler *func,struct print_arg *arg,char **tok) {struct print_arg **next_arg;struct print_arg *farg; -enum event_type type; +enum tep_event_type type;char *token;int i;
@@ -2954,12 +2954,12 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handlerif (!farg) {do_warning_event (event,"%s: not enough memory!" , __func__); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } type =process_arg (event, farg, &token);if (i < (func->nr_args -1 )) { -if (type !=EVENT_DELIM ||strcmp (token,"," ) !=0 ) { +if (type !=TEP_EVENT_DELIM ||strcmp (token,"," ) !=0 ) { do_warning_event(event, "Error: function '%s()' expects %d arguments but event %s only uses %d", func->name, func->nr_args,
@@ -2967,7 +2967,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler goto err; } }else { -if (type !=EVENT_DELIM ||strcmp (token,")" ) !=0 ) { +if (type !=TEP_EVENT_DELIM ||strcmp (token,")" ) !=0 ) {do_warning_event (event,"Error: function '%s()' only expects %d arguments but event %s has more" , func->name, func->nr_args, event->name);
@@ -2988,10 +2988,10 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler err:free_arg (farg);free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_function (struct tep_event_format *event,struct print_arg *arg,char *token,char **tok) {
@@ -3044,12 +3044,12 @@ process_function(struct tep_event_format *event, struct print_arg *arg,do_warning_event (event,"function %s not defined" , token);free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } -static enum event_type +static enum tep_event_type process_arg_token (struct tep_event_format *event,struct print_arg *arg, -char **tok,enum event_type type) +char **tok,enum tep_event_type type) {char *token;char *atom;
@@ -3057,7 +3057,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg, token = *tok;switch (type) { -case EVENT_ITEM : +case TEP_EVENT_ITEM :if (strcmp (token,"REC" ) ==0 ) {free_token (token); type =process_entry (event, arg, &token);
@@ -3071,7 +3071,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,* If the next token is a parenthesis, then this * is a function. */ -if (type ==EVENT_DELIM &&strcmp (token,"(" ) ==0 ) { +if (type ==TEP_EVENT_DELIM &&strcmp (token,"(" ) ==0 ) {free_token (token); token =NULL ;/* this will free atom. */
@@ -3079,7 +3079,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,break ; }/* atoms can be more than one token long */ -while (type ==EVENT_ITEM ) { +while (type ==TEP_EVENT_ITEM ) {char *new_atom; new_atom =realloc (atom,strlen (atom) +strlen (token) +2 );
@@ -3087,7 +3087,7 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,free (atom); *tok =NULL ;free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } atom = new_atom;strcat (atom," " );
@@ -3100,19 +3100,19 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg, arg->atom.atom = atom;break ; -case EVENT_DQUOTE : -case EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_SQUOTE : arg->type =PRINT_ATOM ; arg->atom.atom = token; type =read_token_item (&token);break ; -case EVENT_DELIM : +case TEP_EVENT_DELIM :if (strcmp (token,"(" ) ==0 ) {free_token (token); type =process_paren (event, arg, &token);break ; } -case EVENT_OP : +case TEP_EVENT_OP :/* handle single ops */ arg->type =PRINT_OP ; arg->op.op = token;
@@ -3120,16 +3120,16 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg, type =process_op (event, arg, &token);/* On error, the op is freed */ -if (type ==EVENT_ERROR ) +if (type ==TEP_EVENT_ERROR ) arg->op.op =NULL ;/* return error type if errored */ break ; - case EVENT_ERROR ... EVENT_NEWLINE: + case TEP_EVENT_ERROR ... TEP_EVENT_NEWLINE:default :do_warning_event (event,"unexpected type %d" , type); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; } *tok = token;
@@ -3138,13 +3138,13 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,static int event_read_print_args (struct tep_event_format *event,struct print_arg **list) { -enum event_type type =EVENT_ERROR ; +enum tep_event_type type =TEP_EVENT_ERROR ;struct print_arg *arg;char *token;int args =0 ; do { - if (type == EVENT_NEWLINE) { + if (type == TEP_EVENT_NEWLINE) { type = read_token_item(&token); continue; }
@@ -3158,7 +3158,7 @@ static int event_read_print_args(struct tep_event_format *event, struct print_ar type =process_arg (event, arg, &token); -if (type ==EVENT_ERROR ) { +if (type ==TEP_EVENT_ERROR ) {free_token (token);free_arg (arg);return -1 ;
@@ -3167,10 +3167,10 @@ static int event_read_print_args(struct tep_event_format *event, struct print_ar *list = arg; args++; -if (type ==EVENT_OP ) { +if (type ==TEP_EVENT_OP ) { type =process_op (event, arg, &token);free_token (token); -if (type ==EVENT_ERROR ) { +if (type ==TEP_EVENT_ERROR ) { *list =NULL ;free_arg (arg);return -1 ;
@@ -3179,16 +3179,16 @@ static int event_read_print_args(struct tep_event_format *event, struct print_arcontinue ; } -if (type ==EVENT_DELIM &&strcmp (token,"," ) ==0 ) { +if (type ==TEP_EVENT_DELIM &&strcmp (token,"," ) ==0 ) {free_token (token); *list = arg; list = &arg->next;continue ; }break ; - }while (type !=EVENT_NONE ); + }while (type !=TEP_EVENT_NONE ); -if (type !=EVENT_NONE && type !=EVENT_ERROR ) +if (type !=TEP_EVENT_NONE && type !=TEP_EVENT_ERROR )free_token (token);return args;
@@ -3196,20 +3196,20 @@ static int event_read_print_args(struct tep_event_format *event, struct print_arstatic int event_read_print (struct tep_event_format *event) { -enum event_type type; +enum tep_event_type type;char *token;int ret; -if (read_expected_item (EVENT_ITEM ,"print" ) <0 ) +if (read_expected_item (TEP_EVENT_ITEM ,"print" ) <0 )return -1 ; -if (read_expected (EVENT_ITEM ,"fmt" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"fmt" ) <0 )return -1 ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return -1 ; -if (read_expect_type (EVENT_DQUOTE , &token) <0 ) +if (read_expect_type (TEP_EVENT_DQUOTE , &token) <0 ) goto fail; concat:
@@ -3219,11 +3219,11 @@ static int event_read_print(struct tep_event_format *event)/* ok to have no arg */ type =read_token_item (&token); -if (type ==EVENT_NONE ) +if (type ==TEP_EVENT_NONE )return 0 ;/* Handle concatenation of print lines */ -if (type ==EVENT_DQUOTE ) { +if (type ==TEP_EVENT_DQUOTE ) {char *cat;if (asprintf (&cat,"%s%s" , event->print_fmt.format, token) <0 )
@@ -3235,7 +3235,7 @@ static int event_read_print(struct tep_event_format *event) goto concat; } -if (test_type_token (type, token,EVENT_DELIM ,"," )) +if (test_type_token (type, token,TEP_EVENT_DELIM ,"," )) goto fail;free_token (token);
@@ -5617,7 +5617,7 @@ static int events_system_cmp(const void *a, const void *b)return events_id_cmp (a, b); } -struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) +struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum tep_event_sort_type sort_type) {struct tep_event_format **events;int (*sort)(const void *a,const void *b);
@@ -5638,20 +5638,20 @@ struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_ pevent->sort_events = events;/* the internal events are sorted by id */ -if (sort_type ==EVENT_SORT_ID ) { +if (sort_type ==TEP_EVENT_SORT_ID ) { pevent->last_type = sort_type;return events; } }switch (sort_type) { -case EVENT_SORT_ID : +case TEP_EVENT_SORT_ID : sort = events_id_cmp;break ; -case EVENT_SORT_NAME : +case TEP_EVENT_SORT_NAME : sort = events_name_cmp;break ; -case EVENT_SORT_SYSTEM : +case TEP_EVENT_SORT_SYSTEM : sort = events_system_cmp;break ;default :
@@ -5834,13 +5834,13 @@ static void parse_header_field(const char *field, save_input_buf_ptr = input_buf_ptr; save_input_buf_siz = input_buf_siz; -if (read_expected (EVENT_ITEM ,"field" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"field" ) <0 )return ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ;/* type */ -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail;free_token (token);
@@ -5848,42 +5848,42 @@ static void parse_header_field(const char *field,* If this is not a mandatory field, then test it first. */ if (mandatory) { -if (read_expected (EVENT_ITEM , field) <0 ) +if (read_expected (TEP_EVENT_ITEM , field) <0 )return ; }else { -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail;if (strcmp (token, field) !=0 ) goto discard;free_token (token); } -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; -if (read_expected (EVENT_ITEM ,"offset" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"offset" ) <0 )return ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; *offset =atoi (token);free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; -if (read_expected (EVENT_ITEM ,"size" ) <0 ) +if (read_expected (TEP_EVENT_ITEM ,"size" ) <0 )return ; -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ; -if (read_expect_type (EVENT_ITEM , &token) <0 ) +if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto fail; *size =atoi (token);free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; type =read_token (&token); -if (type !=EVENT_NEWLINE ) { +if (type !=TEP_EVENT_NEWLINE ) {/* newer versions of the kernel have a "signed" type */ -if (type !=EVENT_ITEM ) +if (type !=TEP_EVENT_ITEM ) goto fail;if (strcmp (token,"signed" ) !=0 )
@@ -5891,17 +5891,17 @@ static void parse_header_field(const char *field,free_token (token); -if (read_expected (EVENT_OP ,":" ) <0 ) +if (read_expected (TEP_EVENT_OP ,":" ) <0 )return ; -if (read_expect_type (EVENT_ITEM , &token)) +if (read_expect_type (TEP_EVENT_ITEM , &token)) goto fail;free_token (token); -if (read_expected (EVENT_OP ,";" ) <0 ) +if (read_expected (TEP_EVENT_OP ,";" ) <0 )return ; -if (read_expect_type (EVENT_NEWLINE , &token)) +if (read_expect_type (TEP_EVENT_NEWLINE , &token)) goto fail; } fail:
tools/lib/traceevent/event-parse.h +17 -17
@@ -301,22 +301,22 @@ enum {EVENT_FL_FAILED =0x80000000 }; -enum event_sort_type { -EVENT_SORT_ID , -EVENT_SORT_NAME , -EVENT_SORT_SYSTEM , +enum tep_event_sort_type { +TEP_EVENT_SORT_ID , +TEP_EVENT_SORT_NAME , +TEP_EVENT_SORT_SYSTEM , }; -enum event_type { -EVENT_ERROR , -EVENT_NONE , -EVENT_SPACE , -EVENT_NEWLINE , -EVENT_OP , -EVENT_DELIM , -EVENT_ITEM , -EVENT_DQUOTE , -EVENT_SQUOTE , +enum tep_event_type { +TEP_EVENT_ERROR , +TEP_EVENT_NONE , +TEP_EVENT_SPACE , +TEP_EVENT_NEWLINE , +TEP_EVENT_OP , +TEP_EVENT_DELIM , +TEP_EVENT_ITEM , +TEP_EVENT_DQUOTE , +TEP_EVENT_SQUOTE , }; typedef unsigned long long (*tep_func_handler)(struct trace_seq *s,
@@ -454,7 +454,7 @@ struct tep_handle {struct tep_event_format **events;int nr_events;struct tep_event_format **sort_events; -enum event_sort_type last_type; +enum tep_event_sort_type last_type;int type_offset;int type_size;
@@ -685,7 +685,7 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event,int tep_strerror (struct tep_handle *pevent,enum tep_errno errnum,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 tep_event_sort_type );struct tep_format_field **tep_event_common_fields (struct tep_event_format *event);struct tep_format_field **tep_event_fields (struct tep_event_format *event);
@@ -756,7 +756,7 @@ void tep_unref(struct tep_handle *pevent);/* access to the internal parser */ void tep_buffer_init (const char *buf,unsigned long long size); -enum event_type tep_read_token (char **tok); +enum tep_event_type tep_read_token (char **tok);void tep_free_token (char *token);int tep_peek_char (void );const char *tep_get_input_buf (void );
tools/lib/traceevent/parse-filter.c +18 -18
@@ -61,15 +61,15 @@ static void free_token(char *token)tep_free_token (token); } -static enum event_type read_token (char **tok) +static enum tep_event_type read_token (char **tok) { -enum event_type type; +enum tep_event_type type;char *token =NULL ;do {free_token (token); type =tep_read_token (&token); - }while (type ==EVENT_NEWLINE || type ==EVENT_SPACE ); + }while (type ==TEP_EVENT_NEWLINE || type ==TEP_EVENT_SPACE );/* If token is = or ! check to see if the next char is ~ */ if (token &&
@@ -79,7 +79,7 @@ static enum event_type read_token(char **tok) *tok =malloc (3 );if (*tok ==NULL ) {free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }sprintf (*tok,"%c%c" , *token,'~' );free_token (token);
@@ -334,7 +334,7 @@ static void free_events(struct event_list *events)static enum tep_errno create_arg_item (struct tep_event_format *event,const char *token, -enum event_type type,struct filter_arg **parg,char *error_str) +enum tep_event_type type,struct filter_arg **parg,char *error_str) {struct tep_format_field *field;struct filter_arg *arg;
@@ -347,11 +347,11 @@ create_arg_item(struct tep_event_format *event, const char *token,switch (type) { -case EVENT_SQUOTE : -case EVENT_DQUOTE : +case TEP_EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : arg->type =FILTER_ARG_VALUE ; arg->value.type = - type ==EVENT_DQUOTE ?FILTER_STRING :FILTER_CHAR ; + type ==TEP_EVENT_DQUOTE ?FILTER_STRING :FILTER_CHAR ; arg->value.str =strdup (token);if (!arg->value.str) {free_arg (arg);
@@ -359,7 +359,7 @@ create_arg_item(struct tep_event_format *event, const char *token,return TEP_ERRNO__MEM_ALLOC_FAILED ; }break ; -case EVENT_ITEM : +case TEP_EVENT_ITEM :/* if it is a number, then convert it */ if (isdigit (token[0 ])) { arg->type =FILTER_ARG_VALUE ;
@@ -942,7 +942,7 @@ static enum tep_errno process_filter(struct tep_event_format *event, struct filter_arg **parg, char *error_str, int not) { - enum event_type type; + enum tep_event_type type;char *token =NULL ;struct filter_arg *current_op =NULL ;struct filter_arg *current_exp =NULL ;
@@ -960,9 +960,9 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,free (token); type =read_token (&token);switch (type) { -case EVENT_SQUOTE : -case EVENT_DQUOTE : -case EVENT_ITEM : +case TEP_EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_ITEM : ret =create_arg_item (event, token, type, &arg, error_str);if (ret <0 ) goto fail;
@@ -987,7 +987,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, arg =NULL ;break ; -case EVENT_DELIM : +case TEP_EVENT_DELIM :if (*token ==',' ) {show_error (error_str,"Illegal token ','" ); ret =TEP_ERRNO__ILLEGAL_TOKEN ;
@@ -1054,7 +1054,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, }break ; -case EVENT_OP : +case TEP_EVENT_OP : op_type =process_op (token, &btype, &ctype, &etype);/* All expect a left arg except for NOT */
@@ -1139,14 +1139,14 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,if (ret <0 ) goto fail_syntax;break ; -case EVENT_NONE : +case TEP_EVENT_NONE :break ; -case EVENT_ERROR : +case TEP_EVENT_ERROR : goto fail_alloc;default : goto fail_syntax; } - }while (type !=EVENT_NONE ); + }while (type !=TEP_EVENT_NONE );if (!current_op && !current_exp) goto fail_syntax;
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix TEP_ to all EVENT_FL_* flags
In reply to Steven Rostedttools lib traceevent: Add prefix TEP_ to all EVENT_FL_* flags
Commit-ID: c1953bcc73115b5f1f7e8a45f124cf9f434494cd Gitweb: https://git.kernel.org/tip/c1953bcc73115b5f1f7e8a45f124cf9f434494cd Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:48 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:15:40 -0300
tools lib traceevent: Add prefix TEP_ to all EVENT_FL_* flags
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 adds prefix TEP_ to all members of nameless enum EVENT_FL_*
--- tools/lib/traceevent/event-parse.c | 42 +++++++++++++++++++------------------- tools/lib/traceevent/event-parse.h | 18 ++++++++-------- 2 files changed, 30 insertions(+), 30 deletions(-)
tools/lib/traceevent/event-parse.c +21 -21
@@ -1382,7 +1382,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* The ftrace fields may still use the "special" name. * Just ignore it. */ -if (event->flags &EVENT_FL_ISFTRACE && +if (event->flags &TEP_EVENT_FL_ISFTRACE && type ==TEP_EVENT_ITEM &&strcmp (token,"special" ) ==0 ) {free_token (token); type =read_token (&token);
@@ -1412,7 +1412,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f* Some of the ftrace fields are broken and have * an illegal "." in them. */ - (event->flags & EVENT_FL_ISFTRACE && + (event->flags & TEP_EVENT_FL_ISFTRACE && type == TEP_EVENT_OP && strcmp(token, ".") == 0)) {if (strcmp (token,"*" ) ==0 )
@@ -1963,7 +1963,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) arg->op.right =NULL ;if (set_op_prio (arg) ==-1 ) { - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;/* arg->op.op (= token) will be freed at out_free */ arg->op.op =NULL ; goto out_free;
@@ -2042,7 +2042,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok) }else {do_warning_event (event,"unknown op '%s'" , token); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;/* the arg is now the left side */ goto out_free; }
@@ -4884,13 +4884,13 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_eint len;int ls; -if (event->flags &EVENT_FL_FAILED ) { +if (event->flags &TEP_EVENT_FL_FAILED ) {trace_seq_printf (s,"[FAILED TO PARSE]" );tep_print_fields (s, data, size, event);return ; } -if (event->flags &EVENT_FL_ISBPRINT ) { +if (event->flags &TEP_EVENT_FL_ISBPRINT ) { bprint_fmt =get_bprint_format (data, size, event); args =make_bprint_args (bprint_fmt, data, size, event); arg = args;
@@ -4945,7 +4945,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e/* The argument is the length. */ if (!arg) {do_warning_event (event,"no argument match" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; goto out_failed; } len_arg =eval_num_arg (data, size, event, arg);
@@ -4998,7 +4998,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_ecase 'u' :if (!arg) {do_warning_event (event,"no argument match" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; goto out_failed; }
@@ -5008,7 +5008,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e/* should never happen */ if (len >31 ) {do_warning_event (event,"bad format!" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; len =31 ; }
@@ -5074,13 +5074,13 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_ebreak ;default :do_warning_event (event,"bad count (%d)" , ls); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; }break ;case 's' :if (!arg) {do_warning_event (event,"no matching argument" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; goto out_failed; }
@@ -5090,7 +5090,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e/* should never happen */ if (len >31 ) {do_warning_event (event,"bad format!" ); - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ; len =31 ; }
@@ -5115,7 +5115,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_etrace_seq_putc (s, *ptr); } -if (event->flags &EVENT_FL_FAILED ) { +if (event->flags &TEP_EVENT_FL_FAILED ) { out_failed:trace_seq_printf (s,"[FAILED TO PARSE]" ); }
@@ -5391,11 +5391,11 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event, {int print_pretty =1 ; -if (event->pevent->print_raw || (event->flags &EVENT_FL_PRINTRAW )) +if (event->pevent->print_raw || (event->flags &TEP_EVENT_FL_PRINTRAW ))tep_print_fields (s, record->data, record->size, event);else { -if (event->handler && !(event->flags &EVENT_FL_NOHANDLE )) +if (event->handler && !(event->flags &TEP_EVENT_FL_NOHANDLE )) print_pretty = event->handler (s, record, event, event->context);
@@ -6043,10 +6043,10 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, }if (strcmp (sys,"ftrace" ) ==0 ) { - event->flags |=EVENT_FL_ISFTRACE ; + event->flags |=TEP_EVENT_FL_ISFTRACE ;if (strcmp (event->name,"bprint" ) ==0 ) - event->flags |=EVENT_FL_ISBPRINT ; + event->flags |=TEP_EVENT_FL_ISBPRINT ; } event->id =event_read_id ();
@@ -6089,7 +6089,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, goto event_parse_failed; } -if (!ret && (event->flags &EVENT_FL_ISFTRACE )) { +if (!ret && (event->flags &TEP_EVENT_FL_ISFTRACE )) {struct tep_format_field *field;struct print_arg *arg, **list;
@@ -6098,13 +6098,13 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,for (field = event->format.fields; field; field = field->next) { arg =alloc_arg ();if (!arg) { - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;return TEP_ERRNO__OLD_FTRACE_ARG_FAILED ; } arg->type =PRINT_FIELD ; arg->field.name =strdup (field->name);if (!arg->field.name) { - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;free_arg (arg);return TEP_ERRNO__OLD_FTRACE_ARG_FAILED ; }
@@ -6118,7 +6118,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,return 0 ; event_parse_failed: - event->flags |=EVENT_FL_FAILED ; + event->flags |=TEP_EVENT_FL_FAILED ;return ret; event_alloc_failed:
tools/lib/traceevent/event-parse.h +9 -9
@@ -290,15 +290,15 @@ struct tep_event_format { };enum { -EVENT_FL_ISFTRACE =0x01 , -EVENT_FL_ISPRINT =0x02 , -EVENT_FL_ISBPRINT =0x04 , -EVENT_FL_ISFUNCENT =0x10 , -EVENT_FL_ISFUNCRET =0x20 , -EVENT_FL_NOHANDLE =0x40 , -EVENT_FL_PRINTRAW =0x80 , - -EVENT_FL_FAILED =0x80000000 +TEP_EVENT_FL_ISFTRACE =0x01 , +TEP_EVENT_FL_ISPRINT =0x02 , +TEP_EVENT_FL_ISBPRINT =0x04 , +TEP_EVENT_FL_ISFUNCENT =0x10 , +TEP_EVENT_FL_ISFUNCRET =0x20 , +TEP_EVENT_FL_NOHANDLE =0x40 , +TEP_EVENT_FL_PRINTRAW =0x80 , + +TEP_EVENT_FL_FAILED =0x80000000 };enum tep_event_sort_type {
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent, perf tools: Add prefix tep_ to all print_* structures
In reply to Steven Rostedttools lib traceevent, perf tools: Add prefix tep_ to all print_* structures
Commit-ID: 5647f94b90f6681bcc6f37abeb3bc3d1850b12cb Gitweb: https://git.kernel.org/tip/5647f94b90f6681bcc6f37abeb3bc3d1850b12cb Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:49 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:16:34 -0300
tools lib traceevent, perf tools: Add prefix tep_ to all print_* structures
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 adds prefix tep_ to all print_* structures
--- tools/lib/traceevent/event-parse.c | 144 ++++++++++----------- tools/lib/traceevent/event-parse.h | 98 +++++++------- .../perf/util/scripting-engines/trace-event-perl.c | 6 +- .../util/scripting-engines/trace-event-python.c | 4 +- 4 files changed, 126 insertions(+), 126 deletions(-)
tools/lib/traceevent/event-parse.c +72 -72
@@ -95,7 +95,7 @@ struct tep_function_handler {static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct tep_event_format *event,struct print_arg *arg); +struct tep_event_format *event,struct tep_print_arg *arg);static void free_func_handle (struct tep_function_handler *func);
@@ -118,9 +118,9 @@ void breakpoint(void) x++; } -struct print_arg *alloc_arg (void ) +struct tep_print_arg *alloc_arg (void ) { -return calloc (1 ,sizeof (struct print_arg )); +return calloc (1 ,sizeof (struct tep_print_arg )); }struct cmdline {
@@ -781,9 +781,9 @@ static int event_item_type(enum tep_event_type type) } } -static void free_flag_sym (struct print_flag_sym *fsym) +static void free_flag_sym (struct tep_print_flag_sym *fsym) { -struct print_flag_sym *next; +struct tep_print_flag_sym *next;while (fsym) { next = fsym->next;
@@ -794,9 +794,9 @@ static void free_flag_sym(struct print_flag_sym *fsym) } } -static void free_arg (struct print_arg *arg) +static void free_arg (struct tep_print_arg *arg) { -struct print_arg *farg; +struct tep_print_arg *farg;if (!arg)return ;
@@ -1674,11 +1674,11 @@ static int event_read_format(struct tep_event_format *event) }static enum tep_event_type -process_arg_token (struct tep_event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct tep_print_arg *arg,char **tok,enum tep_event_type type);static enum tep_event_type -process_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_arg (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;char *token;
@@ -1690,14 +1690,14 @@ process_arg(struct tep_event_format *event, struct print_arg *arg, char **tok) }static enum tep_event_type -process_op (struct tep_event_format *event,struct print_arg *arg,char **tok); +process_op (struct tep_event_format *event,struct tep_print_arg *arg,char **tok);/* * For __print_symbolic() and __print_flags, we need to completely * evaluate the first argument, which defines what to print next. */ static enum tep_event_type -process_field_arg (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_field_arg (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -1711,9 +1711,9 @@ process_field_arg(struct tep_event_format *event, struct print_arg *arg, char ** }static enum tep_event_type -process_cond (struct tep_event_format *event,struct print_arg *top,char **tok) +process_cond (struct tep_event_format *event,struct tep_print_arg *top,char **tok) { -struct print_arg *arg, *left, *right; +struct tep_print_arg *arg, *left, *right;enum tep_event_type type;char *token =NULL ;
@@ -1767,9 +1767,9 @@ out_free: }static enum tep_event_type -process_array (struct tep_event_format *event,struct print_arg *top,char **tok) +process_array (struct tep_event_format *event,struct tep_print_arg *top,char **tok) { -struct print_arg *arg; +struct tep_print_arg *arg;enum tep_event_type type;char *token =NULL ;
@@ -1855,7 +1855,7 @@ static int get_op_prio(char *op) } } -static int set_op_prio (struct print_arg *arg) +static int set_op_prio (struct tep_print_arg *arg) {/* single ops are the greatest */
@@ -1869,9 +1869,9 @@ static int set_op_prio(struct print_arg *arg)/* Note, *tok does not get freed, but will most likely be saved */ static enum tep_event_type -process_op (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_op (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *left, *right =NULL ; +struct tep_print_arg *left, *right =NULL ;enum tep_event_type type;char *token;
@@ -2009,7 +2009,7 @@ process_op(struct tep_event_format *event, struct print_arg *arg, char **tok)if (right->type ==PRINT_OP &&get_op_prio (arg->op.op) <get_op_prio (right->op.op)) { -struct print_arg tmp; +struct tep_print_arg tmp;/* rotate ops according to the priority */ arg->op.right = right->op.left;
@@ -2070,7 +2070,7 @@ out_free: }static enum tep_event_type -process_entry (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +process_entry (struct tep_event_format *event__maybe_unused ,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -2110,9 +2110,9 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *a }static int alloc_and_process_delim (struct tep_event_format *event,char *next_token, -struct print_arg **print_arg) +struct tep_print_arg **print_arg) { -struct print_arg *field; +struct tep_print_arg *field;enum tep_event_type type;char *token;int ret =0 ;
@@ -2141,7 +2141,7 @@ out_free_token:return ret; } -static char *arg_eval (struct print_arg *arg); +static char *arg_eval (struct tep_print_arg *arg);static unsigned long long eval_type_str (unsigned long long val,const char *type,int pointer)
@@ -2238,7 +2238,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)* Try to figure out the type. */ static unsigned long long -eval_type (unsigned long long val,struct print_arg *arg,int pointer) +eval_type (unsigned long long val,struct tep_print_arg *arg,int pointer) {if (arg->type !=PRINT_TYPE ) {do_warning ("expected type argument" );
@@ -2248,7 +2248,7 @@ eval_type(unsigned long long val, struct print_arg *arg, int pointer)return eval_type_str (val, arg->typecast.type, pointer); } -static int arg_num_eval (struct print_arg *arg,long long *val) +static int arg_num_eval (struct tep_print_arg *arg,long long *val) {long long left, right;int ret =1 ;
@@ -2414,7 +2414,7 @@ static int arg_num_eval(struct print_arg *arg, long long *val)return ret; } -static char *arg_eval (struct print_arg *arg) +static char *arg_eval (struct tep_print_arg *arg) {long long val;static char buf[20 ];
@@ -2444,11 +2444,11 @@ static char *arg_eval (struct print_arg *arg) }static enum tep_event_type -process_fields (struct tep_event_format *event,struct print_flag_sym **list,char **tok) +process_fields (struct tep_event_format *event,struct tep_print_flag_sym **list,char **tok) {enum tep_event_type type; -struct print_arg *arg =NULL ; -struct print_flag_sym *field; +struct tep_print_arg *arg =NULL ; +struct tep_print_flag_sym *field;char *token = *tok;char *value;
@@ -2525,9 +2525,9 @@ out_free: }static enum tep_event_type -process_flags (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_flags (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *field; +struct tep_print_arg *field;enum tep_event_type type;char *token =NULL ;
@@ -2578,9 +2578,9 @@ out_free: }static enum tep_event_type -process_symbols (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_symbols (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *field; +struct tep_print_arg *field;enum tep_event_type type;char *token =NULL ;
@@ -2617,7 +2617,7 @@ out_free: }static enum tep_event_type -process_hex_common (struct tep_event_format *event,struct print_arg *arg, +process_hex_common (struct tep_event_format *event,struct tep_print_arg *arg,char **tok,enum print_arg_type type) {memset (arg,0 ,sizeof (*arg));
@@ -2640,20 +2640,20 @@ out: }static enum tep_event_type -process_hex (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_hex (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX ); }static enum tep_event_type -process_hex_str (struct tep_event_format *event,struct print_arg *arg, +process_hex_str (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {return process_hex_common (event, arg, tok,PRINT_HEX_STR ); }static enum tep_event_type -process_int_array (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_int_array (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg)); arg->type =PRINT_INT_ARRAY ;
@@ -2681,7 +2681,7 @@ out: }static enum tep_event_type -process_dynamic_array (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_dynamic_array (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {struct tep_format_field *field;enum tep_event_type type;
@@ -2745,7 +2745,7 @@ process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, cha }static enum tep_event_type -process_dynamic_array_len (struct tep_event_format *event,struct print_arg *arg, +process_dynamic_array_len (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {struct tep_format_field *field;
@@ -2781,9 +2781,9 @@ process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, }static enum tep_event_type -process_paren (struct tep_event_format *event,struct print_arg *arg,char **tok) +process_paren (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -struct print_arg *item_arg; +struct tep_print_arg *item_arg;enum tep_event_type type;char *token;
@@ -2844,7 +2844,7 @@ process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok)static enum tep_event_type -process_str (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +process_str (struct tep_event_format *event__maybe_unused ,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -2873,7 +2873,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct print_arg *arg }static enum tep_event_type -process_bitmask (struct tep_event_format *event__maybe_unused ,struct print_arg *arg, +process_bitmask (struct tep_event_format *event__maybe_unused ,struct tep_print_arg *arg,char **tok) {enum tep_event_type type;
@@ -2935,10 +2935,10 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)static enum tep_event_type process_func_handler (struct tep_event_format *event,struct tep_function_handler *func, -struct print_arg *arg,char **tok) +struct tep_print_arg *arg,char **tok) { -struct print_arg **next_arg; -struct print_arg *farg; +struct tep_print_arg **next_arg; +struct tep_print_arg *farg;enum tep_event_type type;char *token;int i;
@@ -2992,7 +2992,7 @@ err: }static enum tep_event_type -process_function (struct tep_event_format *event,struct print_arg *arg, +process_function (struct tep_event_format *event,struct tep_print_arg *arg,char *token,char **tok) {struct tep_function_handler *func;
@@ -3048,7 +3048,7 @@ process_function(struct tep_event_format *event, struct print_arg *arg, }static enum tep_event_type -process_arg_token (struct tep_event_format *event,struct print_arg *arg, +process_arg_token (struct tep_event_format *event,struct tep_print_arg *arg,char **tok,enum tep_event_type type) {char *token;
@@ -3136,10 +3136,10 @@ process_arg_token(struct tep_event_format *event, struct print_arg *arg,return type; } -static int event_read_print_args (struct tep_event_format *event,struct print_arg **list) +static int event_read_print_args (struct tep_event_format *event,struct tep_print_arg **list) {enum tep_event_type type =TEP_EVENT_ERROR ; -struct print_arg *arg; +struct tep_print_arg *arg;char *token;int args =0 ;
@@ -3522,13 +3522,13 @@ tep_find_event_by_name(struct tep_handle *pevent, }static unsigned long long -eval_num_arg (void *data,int size,struct tep_event_format *event,struct print_arg *arg) +eval_num_arg (void *data,int size,struct tep_event_format *event,struct tep_print_arg *arg) {struct tep_handle *pevent = event->pevent;unsigned long long val =0 ;unsigned long long left, right; -struct print_arg *typearg =NULL ; -struct print_arg *larg; +struct tep_print_arg *typearg =NULL ; +struct tep_print_arg *larg;unsigned long offset;unsigned int field_size;
@@ -3863,10 +3863,10 @@ static void print_bitmask_to_seq(struct tep_handle *pevent,static void print_str_arg (struct trace_seq *s,void *data,int size,struct tep_event_format *event,const char *format, -int len_arg,struct print_arg *arg) +int len_arg,struct tep_print_arg *arg) {struct tep_handle *pevent = event->pevent; -struct print_flag_sym *flag; +struct tep_print_flag_sym *flag;struct tep_format_field *field;struct printk_map *printk;long long val, fval;
@@ -4117,13 +4117,13 @@ out_warning_field:static unsigned long long process_defined_func (struct trace_seq *s,void *data,int size, -struct tep_event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct tep_print_arg *arg) {struct tep_function_handler *func_handle = arg->func.func;struct func_params *param;unsigned long long *args;unsigned long long ret; -struct print_arg *farg; +struct tep_print_arg *farg;struct trace_seq str;struct save_str {struct save_str *next;
@@ -4200,9 +4200,9 @@ out_free:return ret; } -static void free_args (struct print_arg *args) +static void free_args (struct tep_print_arg *args) { -struct print_arg *next; +struct tep_print_arg *next;while (args) { next = args->next;
@@ -4212,11 +4212,11 @@ static void free_args(struct print_arg *args) } } -static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) +static struct tep_print_arg *make_bprint_args (char *fmt,void *data,int size,struct tep_event_format *event) {struct tep_handle *pevent = event->pevent;struct tep_format_field *field, *ip_field; -struct print_arg *args, *arg, **next; +struct tep_print_arg *args, *arg, **next;unsigned long long ip, val;char *ptr;void *bptr;
@@ -4424,7 +4424,7 @@ get_bprint_format(void *data, int size __maybe_unused, }static void print_mac_arg (struct trace_seq *s,int mac,void *data,int size, -struct tep_event_format *event,struct print_arg *arg) +struct tep_event_format *event,struct tep_print_arg *arg) {unsigned char *buf;const char *fmt ="%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ;
@@ -4578,7 +4578,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf)*/ static int print_ipv4_arg (struct trace_seq *s,const char *ptr,char i,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {unsigned char *buf;
@@ -4615,7 +4615,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,static int print_ipv6_arg (struct trace_seq *s,const char *ptr,char i,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {char have_c =0 ;unsigned char *buf;
@@ -4665,7 +4665,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,static int print_ipsa_arg (struct trace_seq *s,const char *ptr,char i,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {char have_c =0 , have_p =0 ;unsigned char *buf;
@@ -4747,7 +4747,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,static int print_ip_arg (struct trace_seq *s,const char *ptr,void *data,int size,struct tep_event_format *event, -struct print_arg *arg) +struct tep_print_arg *arg) {char i = *ptr;/* 'i' or 'I' */ char ver;
@@ -4868,9 +4868,9 @@ 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_format *event) {struct tep_handle *pevent = event->pevent; -struct print_fmt *print_fmt = &event->print_fmt; -struct print_arg *arg = print_fmt->args; -struct print_arg *args =NULL ; +struct tep_print_fmt *print_fmt = &event->print_fmt; +struct tep_print_arg *arg = print_fmt->args; +struct tep_print_arg *args =NULL ;const char *ptr = print_fmt->format;unsigned long long val;struct func_map *func;
@@ -5723,7 +5723,7 @@ struct tep_format_field **tep_event_fields(struct tep_event_format *event) event->format.fields); } -static void print_fields (struct trace_seq *s,struct print_flag_sym *field) +static void print_fields (struct trace_seq *s,struct tep_print_flag_sym *field) {trace_seq_printf (s,"{ %s, %s }" , field->value, field->str);if (field->next) {
@@ -5733,7 +5733,7 @@ static void print_fields(struct trace_seq *s, struct print_flag_sym *field) }/* for debugging */ -static void print_args (struct print_arg *args) +static void print_args (struct tep_print_arg *args) {int print_paren =1 ;struct trace_seq s;
@@ -6091,7 +6091,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,if (!ret && (event->flags &TEP_EVENT_FL_ISFTRACE )) {struct tep_format_field *field; -struct print_arg *arg, **list; +struct tep_print_arg *arg, **list;/* old ftrace had no args */ list = &event->print_fmt.args;
tools/lib/traceevent/event-parse.h +49 -49
161 lines not on this page · raw message
tools/perf/util/scripting-engines/trace-event-perl.c +3 -3
@@ -99,7 +99,7 @@ static void define_symbolic_value(const char *ev_name,LEAVE ; } -static void define_symbolic_values (struct print_flag_sym *field, +static void define_symbolic_values (struct tep_print_flag_sym *field,const char *ev_name,const char *field_name) {
@@ -157,7 +157,7 @@ static void define_flag_value(const char *ev_name,LEAVE ; } -static void define_flag_values (struct print_flag_sym *field, +static void define_flag_values (struct tep_print_flag_sym *field,const char *ev_name,const char *field_name) {
@@ -191,7 +191,7 @@ static void define_flag_field(const char *ev_name,static void define_event_symbols (struct tep_event_format *event,const char *ev_name, -struct print_arg *args) +struct tep_print_arg *args) {if (args ==NULL )return ;
tools/perf/util/scripting-engines/trace-event-python.c +2 -2
@@ -224,7 +224,7 @@ static void define_value(enum print_arg_type field_type, }static void define_values (enum print_arg_type field_type, -struct print_flag_sym *field, +struct tep_print_flag_sym *field,const char *ev_name,const char *field_name) {
@@ -266,7 +266,7 @@ static void define_field(enum print_arg_type field_type,static void define_event_symbols (struct tep_event_format *event,const char *ev_name, -struct print_arg *args) +struct tep_print_arg *args) {if (args ==NULL )return ;
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent, perf tools: Rename enum print_arg_type to enum tep_print_arg_type
In reply to Steven Rostedttools lib traceevent, perf tools: Rename enum print_arg_type to enum tep_print_arg_type
Commit-ID: 1e97216f20330fb001f57d0f6f48e76c060bfd16 Gitweb: https://git.kernel.org/tip/1e97216f20330fb001f57d0f6f48e76c060bfd16 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:50 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:17:44 -0300
tools lib traceevent, perf tools: Rename enum print_arg_type to enum tep_print_arg_type
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 enum print_arg_type to enum tep_print_arg_type and add prefix TEP_ to all its members.
--- tools/lib/traceevent/event-parse.c | 248 ++++++++++----------- tools/lib/traceevent/event-parse.h | 36 +-- .../perf/util/scripting-engines/trace-event-perl.c | 32 +-- .../util/scripting-engines/trace-event-python.c | 56 ++--- 4 files changed, 186 insertions(+), 186 deletions(-)
tools/lib/traceevent/event-parse.c +124 -124
@@ -802,52 +802,52 @@ static void free_arg(struct tep_print_arg *arg)return ;switch (arg->type) { -case PRINT_ATOM : +case TEP_PRINT_ATOM :free (arg->atom.atom);break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :free (arg->field.name);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS :free_arg (arg->flags.field);free (arg->flags.delim);free_flag_sym (arg->flags.flags);break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL :free_arg (arg->symbol.field);free_flag_sym (arg->symbol.symbols);break ; -case PRINT_HEX : -case PRINT_HEX_STR : +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR :free_arg (arg->hex.field);free_arg (arg->hex.size);break ; -case PRINT_INT_ARRAY : +case TEP_PRINT_INT_ARRAY :free_arg (arg->int_array.field);free_arg (arg->int_array.count);free_arg (arg->int_array.el_size);break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE :free (arg->typecast.type);free_arg (arg->typecast.item);break ; -case PRINT_STRING : -case PRINT_BSTRING : +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING :free (arg->string.string);break ; -case PRINT_BITMASK : +case TEP_PRINT_BITMASK :free (arg->bitmask.bitmask);break ; -case PRINT_DYNAMIC_ARRAY : -case PRINT_DYNAMIC_ARRAY_LEN : +case TEP_PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY_LEN :free (arg->dynarray.index);break ; -case PRINT_OP : +case TEP_PRINT_OP :free (arg->op.op);free_arg (arg->op.left);free_arg (arg->op.right);break ; -case PRINT_FUNC : +case TEP_PRINT_FUNC :while (arg->func.args) { farg = arg->func.args; arg->func.args = farg->next;
@@ -855,7 +855,7 @@ static void free_arg(struct tep_print_arg *arg) }break ; -case PRINT_NULL : +case TEP_PRINT_NULL :default :break ; }
@@ -1729,7 +1729,7 @@ process_cond(struct tep_event_format *event, struct tep_print_arg *top, char **t goto out_free; } - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.left = left; arg->op.right = right;
@@ -1859,7 +1859,7 @@ static int set_op_prio(struct tep_print_arg *arg) {/* single ops are the greatest */ -if (!arg->op.left || arg->op.left->type ==PRINT_NULL ) +if (!arg->op.left || arg->op.left->type ==TEP_PRINT_NULL ) arg->op.prio =0 ;else arg->op.prio =get_op_prio (arg->op.op);
@@ -1878,7 +1878,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok/* the op is passed in via tok */ token = *tok; -if (arg->type ==PRINT_OP && !arg->op.left) { +if (arg->type ==TEP_PRINT_OP && !arg->op.left) {/* handle single op */ if (token[1 ]) {do_warning_event (event,"bad op token %s" , token);
@@ -1901,7 +1901,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tokif (!left) goto out_warn_free; - left->type =PRINT_NULL ; + left->type =TEP_PRINT_NULL ; arg->op.left = left; right =alloc_arg ();
@@ -1923,7 +1923,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok/* copy the top arg to the left */ *left = *arg; - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left = left; arg->op.prio =0 ;
@@ -1957,7 +1957,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok/* copy the top arg to the left */ *left = *arg; - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left = left; arg->op.right =NULL ;
@@ -1977,7 +1977,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok type == TEP_EVENT_DELIM && (strcmp(token, ")") == 0)) {char *new_atom; -if (left->type !=PRINT_ATOM ) { +if (left->type !=TEP_PRINT_ATOM ) {do_warning_event (event,"bad pointer type" ); goto out_free; }
@@ -2007,7 +2007,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok goto out_free; } -if (right->type ==PRINT_OP && +if (right->type ==TEP_PRINT_OP &&get_op_prio (arg->op.op) <get_op_prio (right->op.op)) {struct tep_print_arg tmp;
@@ -2031,7 +2031,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok *left = *arg; - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left = left;
@@ -2084,7 +2084,7 @@ process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_ar goto out_free; field = token; - arg->type =PRINT_FIELD ; + arg->type =TEP_PRINT_FIELD ; arg->field.name = field;if (is_flag_field) {
@@ -2240,7 +2240,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)static unsigned long long eval_type (unsigned long long val,struct tep_print_arg *arg,int pointer) { -if (arg->type !=PRINT_TYPE ) { +if (arg->type !=TEP_PRINT_TYPE ) {do_warning ("expected type argument" );return 0 ; }
@@ -2254,16 +2254,16 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val)int ret =1 ;switch (arg->type) { -case PRINT_ATOM : +case TEP_PRINT_ATOM : *val =strtoll (arg->atom.atom,NULL ,0 );break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE : ret =arg_num_eval (arg->typecast.item, val);if (!ret)break ; *val =eval_type (*val, arg,0 );break ; -case PRINT_OP : +case TEP_PRINT_OP :switch (arg->op.op[0 ]) {case '|' : ret =arg_num_eval (arg->op.left, &left);
@@ -2366,7 +2366,7 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val)break ;case '-' :/* check for negative */ -if (arg->op.left->type ==PRINT_NULL ) +if (arg->op.left->type ==TEP_PRINT_NULL ) left =0 ;else ret =arg_num_eval (arg->op.left, &left);
@@ -2378,7 +2378,7 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val) *val = left - right;break ;case '+' : -if (arg->op.left->type ==PRINT_NULL ) +if (arg->op.left->type ==TEP_PRINT_NULL ) left =0 ;else ret =arg_num_eval (arg->op.left, &left);
@@ -2401,11 +2401,11 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val) }break ; -case PRINT_NULL : - case PRINT_FIELD ... PRINT_SYMBOL: -case PRINT_STRING : -case PRINT_BSTRING : -case PRINT_BITMASK : +case TEP_PRINT_NULL : + case TEP_PRINT_FIELD ... TEP_PRINT_SYMBOL: +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING : +case TEP_PRINT_BITMASK :default :do_warning ("invalid eval type %d" , arg->type); ret =0 ;
@@ -2420,21 +2420,21 @@ static char *arg_eval (struct tep_print_arg *arg)static char buf[20 ];switch (arg->type) { -case PRINT_ATOM : +case TEP_PRINT_ATOM :return arg->atom.atom; -case PRINT_TYPE : +case TEP_PRINT_TYPE :return arg_eval (arg->typecast.item); -case PRINT_OP : +case TEP_PRINT_OP :if (!arg_num_eval (arg, &val))break ;sprintf (buf,"%lld" , val);return buf; -case PRINT_NULL : - case PRINT_FIELD ... PRINT_SYMBOL: -case PRINT_STRING : -case PRINT_BSTRING : -case PRINT_BITMASK : +case TEP_PRINT_NULL : + case TEP_PRINT_FIELD ... TEP_PRINT_SYMBOL: +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING : +case TEP_PRINT_BITMASK :default :do_warning ("invalid eval type %d" , arg->type);break ;
@@ -2532,7 +2532,7 @@ process_flags(struct tep_event_format *event, struct tep_print_arg *arg, char **char *token =NULL ;memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_FLAGS ; + arg->type =TEP_PRINT_FLAGS ; field =alloc_arg ();if (!field) {
@@ -2585,7 +2585,7 @@ process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, charchar *token =NULL ;memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_SYMBOL ; + arg->type =TEP_PRINT_SYMBOL ; field =alloc_arg ();if (!field) {
@@ -2618,7 +2618,7 @@ out_free:static enum tep_event_type process_hex_common (struct tep_event_format *event,struct tep_print_arg *arg, -char **tok,enum print_arg_type type) +char **tok,enum tep_print_arg_type type) {memset (arg,0 ,sizeof (*arg)); arg->type = type;
@@ -2642,21 +2642,21 @@ out:static enum tep_event_type process_hex (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -return process_hex_common (event, arg, tok,PRINT_HEX ); +return process_hex_common (event, arg, tok,TEP_PRINT_HEX ); }static enum tep_event_type process_hex_str (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) { -return process_hex_common (event, arg, tok,PRINT_HEX_STR ); +return process_hex_common (event, arg, tok,TEP_PRINT_HEX_STR ); }static enum tep_event_type process_int_array (struct tep_event_format *event,struct tep_print_arg *arg,char **tok) {memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_INT_ARRAY ; + arg->type =TEP_PRINT_INT_ARRAY ;if (alloc_and_process_delim (event,"," , &arg->int_array.field)) goto out;
@@ -2688,7 +2688,7 @@ process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg,char *token;memset (arg,0 ,sizeof (*arg)); - arg->type =PRINT_DYNAMIC_ARRAY ; + arg->type =TEP_PRINT_DYNAMIC_ARRAY ;/* * The item within the parenthesis is another field that holds
@@ -2755,7 +2755,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg *if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; - arg->type =PRINT_DYNAMIC_ARRAY_LEN ; + arg->type =TEP_PRINT_DYNAMIC_ARRAY_LEN ;/* Find the field */ field =tep_find_field (event, token);
@@ -2814,8 +2814,8 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char **/* make this a typecast and contine */ /* prevous must be an atom */ -if (arg->type !=PRINT_ATOM ) { -do_warning_event (event,"previous needed to be PRINT_ATOM" ); +if (arg->type !=TEP_PRINT_ATOM ) { +do_warning_event (event,"previous needed to be TEP_PRINT_ATOM" ); goto out_free; }
@@ -2826,7 +2826,7 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char ** goto out_free; } - arg->type =PRINT_TYPE ; + arg->type =TEP_PRINT_TYPE ; arg->typecast.type = arg->atom.atom; arg->typecast.item = item_arg; type =process_arg_token (event, item_arg, &token, type);
@@ -2853,7 +2853,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct tep_print_argif (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; - arg->type =PRINT_STRING ; + arg->type =TEP_PRINT_STRING ; arg->string.string = token; arg->string.offset =-1 ;
@@ -2882,7 +2882,7 @@ process_bitmask(struct tep_event_format *event __maybe_unused, struct tep_print_if (read_expect_type (TEP_EVENT_ITEM , &token) <0 ) goto out_free; - arg->type =PRINT_BITMASK ; + arg->type =TEP_PRINT_BITMASK ; arg->bitmask.bitmask = token; arg->bitmask.offset =-1 ;
@@ -2943,7 +2943,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handlerchar *token;int i; - arg->type =PRINT_FUNC ; + arg->type =TEP_PRINT_FUNC ; arg->func.func = func; *tok =NULL ;
@@ -3096,13 +3096,13 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, type =read_token_item (&token); } - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ; arg->atom.atom = atom;break ;case TEP_EVENT_DQUOTE :case TEP_EVENT_SQUOTE : - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ; arg->atom.atom = token; type =read_token_item (&token);break ;
@@ -3114,7 +3114,7 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, }case TEP_EVENT_OP :/* handle single ops */ - arg->type =PRINT_OP ; + arg->type =TEP_PRINT_OP ; arg->op.op = token; arg->op.left =NULL ; type =process_op (event, arg, &token);
@@ -3533,12 +3533,12 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_prunsigned int field_size;switch (arg->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :/* ?? */ return 0 ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :return strtoull (arg->atom.atom,NULL ,0 ); -case PRINT_FIELD : +case TEP_PRINT_FIELD :if (!arg->field.field) { arg->field.field =tep_find_any_field (event, arg->field.name);if (!arg->field.field)
@@ -3549,27 +3549,27 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr val =tep_read_number (pevent, data + arg->field.field->offset, arg->field.field->size);break ; -case PRINT_FLAGS : -case PRINT_SYMBOL : -case PRINT_INT_ARRAY : -case PRINT_HEX : -case PRINT_HEX_STR : +case TEP_PRINT_FLAGS : +case TEP_PRINT_SYMBOL : +case TEP_PRINT_INT_ARRAY : +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR :break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE : val =eval_num_arg (data, size, event, arg->typecast.item);return eval_type (val, arg,0 ); -case PRINT_STRING : -case PRINT_BSTRING : -case PRINT_BITMASK : +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING : +case TEP_PRINT_BITMASK :return 0 ; -case PRINT_FUNC : { +case TEP_PRINT_FUNC : {struct trace_seq s;trace_seq_init (&s); val =process_defined_func (&s, data, size, event, arg);trace_seq_destroy (&s);return val; } -case PRINT_OP : +case TEP_PRINT_OP :if (strcmp (arg->op.op,"[" ) ==0 ) {/* * Arrays are special, since we don't want
@@ -3579,7 +3579,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr/* handle typecasts */ larg = arg->op.left; -while (larg->type ==PRINT_TYPE ) { +while (larg->type ==TEP_PRINT_TYPE ) {if (!typearg) typearg = larg; larg = larg->typecast.item;
@@ -3589,7 +3589,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr field_size = pevent->long_size;switch (larg->type) { -case PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY : offset =tep_read_number (pevent, data + larg->dynarray.field->offset, larg->dynarray.field->size);
@@ -3603,7 +3603,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr offset &=0xffff ; offset += right;break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :if (!larg->field.field) { larg->field.field =tep_find_any_field (event, larg->field.name);
@@ -3719,7 +3719,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr goto out_warning_op; }break ; -case PRINT_DYNAMIC_ARRAY_LEN : +case TEP_PRINT_DYNAMIC_ARRAY_LEN : offset =tep_read_number (pevent, data + arg->dynarray.field->offset, arg->dynarray.field->size);
@@ -3730,7 +3730,7 @@ eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_pr*/ val = (unsigned long long )(offset >>16 );break ; -case PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY :/* Without [], we pass the address to the dynamic data */ offset = tep_read_number(pevent, data + arg->dynarray.field->offset,
@@ -3877,13 +3877,13 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,int i, len;switch (arg->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :/* ?? */ return ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :print_str_to_seq (s, format, len_arg, arg->atom.atom);return ; -case PRINT_FIELD : +case TEP_PRINT_FIELD : field = arg->field.field;if (!field) { field =tep_find_any_field (event, arg->field.name);
@@ -3940,7 +3940,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,print_str_to_seq (s, format, len_arg, str);free (str);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS : val =eval_num_arg (data, size, event, arg->flags.field); print =0 ;for (flag = arg->flags.flags; flag; flag = flag->next) {
@@ -3963,7 +3963,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,trace_seq_printf (s,"0x%llx" , val); }break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL : val =eval_num_arg (data, size, event, arg->symbol.field);for (flag = arg->symbol.symbols; flag; flag = flag->next) { fval =eval_flag (flag->value);
@@ -3975,9 +3975,9 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (!flag)trace_seq_printf (s,"0x%llx" , val);break ; -case PRINT_HEX : -case PRINT_HEX_STR : -if (arg->hex.field->type ==PRINT_DYNAMIC_ARRAY ) { +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR : +if (arg->hex.field->type ==TEP_PRINT_DYNAMIC_ARRAY ) {unsigned long offset; offset = tep_read_number(pevent, data + arg->hex.field->dynarray.field->offset,
@@ -3996,17 +3996,17 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, } len =eval_num_arg (data, size, event, arg->hex.size);for (i =0 ; i < len; i++) { -if (i && arg->type ==PRINT_HEX ) +if (i && arg->type ==TEP_PRINT_HEX )trace_seq_putc (s,' ' );trace_seq_printf (s,"%02x" , hex[i]); }break ; -case PRINT_INT_ARRAY : { +case TEP_PRINT_INT_ARRAY : {void *num;int el_size; -if (arg->int_array.field->type ==PRINT_DYNAMIC_ARRAY ) { +if (arg->int_array.field->type ==TEP_PRINT_DYNAMIC_ARRAY ) {unsigned long offset;struct tep_format_field *field = arg->int_array.field->dynarray.field;
@@ -4050,9 +4050,9 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, }break ; } -case PRINT_TYPE : +case TEP_PRINT_TYPE :break ; -case PRINT_STRING : { +case TEP_PRINT_STRING : {int str_offset;if (arg->string.offset ==-1 ) {
@@ -4066,10 +4066,10 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,print_str_to_seq (s, format, len_arg, ((char *)data) + str_offset);break ; } -case PRINT_BSTRING : +case TEP_PRINT_BSTRING :print_str_to_seq (s, format, len_arg, arg->string.string);break ; -case PRINT_BITMASK : { +case TEP_PRINT_BITMASK : {int bitmask_offset;int bitmask_size;
@@ -4086,7 +4086,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, data + bitmask_offset, bitmask_size);break ; } -case PRINT_OP : +case TEP_PRINT_OP :/* * The only op for string should be ? : */
@@ -4100,7 +4100,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,print_str_arg (s, data, size, event, format, len_arg, arg->op.right->op.right);break ; -case PRINT_FUNC : +case TEP_PRINT_FUNC :process_defined_func (s, data, size, event, arg);break ;default :
@@ -4255,7 +4255,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s arg->next =NULL ; next = &arg->next; - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ;if (asprintf (&arg->atom.atom,"%lld" , ip) <0 ) goto out_free;
@@ -4343,7 +4343,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s goto out_free; } arg->next =NULL ; - arg->type =PRINT_ATOM ; + arg->type =TEP_PRINT_ATOM ;if (asprintf (&arg->atom.atom,"%lld" , val) <0 ) {free (arg); goto out_free;
@@ -4367,7 +4367,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s goto out_free; } arg->next =NULL ; - arg->type =PRINT_BSTRING ; + arg->type =TEP_PRINT_BSTRING ; arg->string.string =strdup (bptr);if (!arg->string.string) goto out_free;
@@ -4429,12 +4429,12 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,unsigned char *buf;const char *fmt ="%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ; -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return ; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return ;
@@ -4582,12 +4582,12 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, {unsigned char *buf; -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return 0 ; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return 0 ; }
@@ -4628,12 +4628,12 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, rc++; } -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return rc; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return rc; }
@@ -4686,12 +4686,12 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, } } -if (arg->type ==PRINT_FUNC ) { +if (arg->type ==TEP_PRINT_FUNC ) {process_defined_func (s, data, size, event, arg);return rc; } -if (arg->type !=PRINT_FIELD ) { +if (arg->type !=TEP_PRINT_FIELD ) {trace_seq_printf (s,"ARG TYPE NOT FIELD BUT %d" , arg->type);return rc; }
@@ -4967,7 +4967,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_eif (isalnum (ptr[1 ])) ptr++; -if (arg->type ==PRINT_BSTRING ) { +if (arg->type ==TEP_PRINT_BSTRING ) {trace_seq_puts (s, arg->string.string);break ; }
@@ -5739,16 +5739,16 @@ static void print_args(struct tep_print_arg *args)struct trace_seq s;switch (args->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :printf ("null" );break ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :printf ("%s" , args->atom.atom);break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :printf ("REC->%s" , args->field.name);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS :printf ("__print_flags(" );print_args (args->flags.field);printf (", %s, " , args->flags.delim);
@@ -5758,7 +5758,7 @@ static void print_args(struct tep_print_arg *args)trace_seq_destroy (&s);printf (")" );break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL :printf ("__print_symbolic(" );print_args (args->symbol.field);printf (", " );
@@ -5768,21 +5768,21 @@ static void print_args(struct tep_print_arg *args)trace_seq_destroy (&s);printf (")" );break ; -case PRINT_HEX : +case TEP_PRINT_HEX :printf ("__print_hex(" );print_args (args->hex.field);printf (", " );print_args (args->hex.size);printf (")" );break ; -case PRINT_HEX_STR : +case TEP_PRINT_HEX_STR :printf ("__print_hex_str(" );print_args (args->hex.field);printf (", " );print_args (args->hex.size);printf (")" );break ; -case PRINT_INT_ARRAY : +case TEP_PRINT_INT_ARRAY :printf ("__print_array(" );print_args (args->int_array.field);printf (", " );
@@ -5791,18 +5791,18 @@ static void print_args(struct tep_print_arg *args)print_args (args->int_array.el_size);printf (")" );break ; -case PRINT_STRING : -case PRINT_BSTRING : +case TEP_PRINT_STRING : +case TEP_PRINT_BSTRING :printf ("__get_str(%s)" , args->string.string);break ; -case PRINT_BITMASK : +case TEP_PRINT_BITMASK :printf ("__get_bitmask(%s)" , args->bitmask.bitmask);break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE :printf ("(%s)" , args->typecast.type);print_args (args->typecast.item);break ; -case PRINT_OP : +case TEP_PRINT_OP :if (strcmp (args->op.op,":" ) ==0 ) print_paren =0 ;if (print_paren)
@@ -6101,7 +6101,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, event->flags |=TEP_EVENT_FL_FAILED ;return TEP_ERRNO__OLD_FTRACE_ARG_FAILED ; } - arg->type =PRINT_FIELD ; + arg->type =TEP_PRINT_FIELD ; arg->field.name =strdup (field->name);if (!arg->field.name) { event->flags |=TEP_EVENT_FL_FAILED ;
tools/lib/traceevent/event-parse.h +18 -18
@@ -234,28 +234,28 @@ struct tep_print_arg_func {struct tep_print_arg *args; }; -enum print_arg_type { -PRINT_NULL , -PRINT_ATOM , -PRINT_FIELD , -PRINT_FLAGS , -PRINT_SYMBOL , -PRINT_HEX , -PRINT_INT_ARRAY , -PRINT_TYPE , -PRINT_STRING , -PRINT_BSTRING , -PRINT_DYNAMIC_ARRAY , -PRINT_OP , -PRINT_FUNC , -PRINT_BITMASK , -PRINT_DYNAMIC_ARRAY_LEN , -PRINT_HEX_STR , +enum tep_print_arg_type { +TEP_PRINT_NULL , +TEP_PRINT_ATOM , +TEP_PRINT_FIELD , +TEP_PRINT_FLAGS , +TEP_PRINT_SYMBOL , +TEP_PRINT_HEX , +TEP_PRINT_INT_ARRAY , +TEP_PRINT_TYPE , +TEP_PRINT_STRING , +TEP_PRINT_BSTRING , +TEP_PRINT_DYNAMIC_ARRAY , +TEP_PRINT_OP , +TEP_PRINT_FUNC , +TEP_PRINT_BITMASK , +TEP_PRINT_DYNAMIC_ARRAY_LEN , +TEP_PRINT_HEX_STR , };struct tep_print_arg {struct tep_print_arg *next; -enum print_arg_type type; +enum tep_print_arg_type type;union {struct tep_print_arg_atom atom;struct tep_print_arg_field field;
tools/perf/util/scripting-engines/trace-event-perl.c +16 -16
@@ -197,54 +197,54 @@ static void define_event_symbols(struct tep_event_format *event,return ;switch (args->type) { -case PRINT_NULL : +case TEP_PRINT_NULL :break ; -case PRINT_ATOM : +case TEP_PRINT_ATOM :define_flag_value (ev_name, cur_field_name,"0" , args->atom.atom); zero_flag_atom =0 ;break ; -case PRINT_FIELD : +case TEP_PRINT_FIELD :free (cur_field_name); cur_field_name =strdup (args->field.name);break ; -case PRINT_FLAGS : +case TEP_PRINT_FLAGS :define_event_symbols (event, ev_name, args->flags.field);define_flag_field (ev_name, cur_field_name, args->flags.delim);define_flag_values (args->flags.flags, ev_name, cur_field_name);break ; -case PRINT_SYMBOL : +case TEP_PRINT_SYMBOL :define_event_symbols (event, ev_name, args->symbol.field);define_symbolic_field (ev_name, cur_field_name);define_symbolic_values (args->symbol.symbols, ev_name, cur_field_name);break ; -case PRINT_HEX : -case PRINT_HEX_STR : +case TEP_PRINT_HEX : +case TEP_PRINT_HEX_STR :define_event_symbols (event, ev_name, args->hex.field);define_event_symbols (event, ev_name, args->hex.size);break ; -case PRINT_INT_ARRAY : +case TEP_PRINT_INT_ARRAY :define_event_symbols (event, ev_name, args->int_array.field);define_event_symbols (event, ev_name, args->int_array.count);define_event_symbols (event, ev_name, args->int_array.el_size);break ; -case PRINT_BSTRING : -case PRINT_DYNAMIC_ARRAY : -case PRINT_DYNAMIC_ARRAY_LEN : -case PRINT_STRING : -case PRINT_BITMASK : +case TEP_PRINT_BSTRING : +case TEP_PRINT_DYNAMIC_ARRAY : +case TEP_PRINT_DYNAMIC_ARRAY_LEN : +case TEP_PRINT_STRING : +case TEP_PRINT_BITMASK :break ; -case PRINT_TYPE : +case TEP_PRINT_TYPE :define_event_symbols (event, ev_name, args->typecast.item);break ; -case PRINT_OP : +case TEP_PRINT_OP :if (strcmp (args->op.op,":" ) ==0 ) zero_flag_atom =1 ;define_event_symbols (event, ev_name, args->op.left);define_event_symbols (event, ev_name, args->op.right);break ; -case PRINT_FUNC : +case TEP_PRINT_FUNC :default :pr_err ("Unsupported print arg type\n" );/* we should warn... */
tools/perf/util/scripting-engines/trace-event-python.c +28 -28
130 lines not on this page · raw message
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type
In reply to Steven Rostedttools lib traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type
Commit-ID: e906bb788f2c4e870787f09b831923ca893a4671 Gitweb: https://git.kernel.org/tip/e906bb788f2c4e870787f09b831923ca893a4671 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:51 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:19:44 -0300
tools lib traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type
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 adds prefix tep_ to enums filter_boolean_type, filter_op_type, filter_cmp_type and all enum's members
--- tools/lib/traceevent/event-parse.h | 46 ++++++------ tools/lib/traceevent/parse-filter.c | 144 ++++++++++++++++++------------------ 2 files changed, 95 insertions(+), 95 deletions(-)
tools/lib/traceevent/event-parse.h +23 -23
@@ -768,29 +768,29 @@ void tep_print_printk(struct tep_handle *pevent);/* ----------------------- filtering ----------------------- */ -enum filter_boolean_type { -FILTER_FALSE , -FILTER_TRUE , +enum tep_filter_boolean_type { +TEP_FILTER_FALSE , +TEP_FILTER_TRUE , }; -enum filter_op_type { -FILTER_OP_AND =1 , -FILTER_OP_OR , -FILTER_OP_NOT , +enum tep_filter_op_type { +TEP_FILTER_OP_AND =1 , +TEP_FILTER_OP_OR , +TEP_FILTER_OP_NOT , }; -enum filter_cmp_type { -FILTER_CMP_NONE , -FILTER_CMP_EQ , -FILTER_CMP_NE , -FILTER_CMP_GT , -FILTER_CMP_LT , -FILTER_CMP_GE , -FILTER_CMP_LE , -FILTER_CMP_MATCH , -FILTER_CMP_NOT_MATCH , -FILTER_CMP_REGEX , -FILTER_CMP_NOT_REGEX , +enum tep_filter_cmp_type { +TEP_FILTER_CMP_NONE , +TEP_FILTER_CMP_EQ , +TEP_FILTER_CMP_NE , +TEP_FILTER_CMP_GT , +TEP_FILTER_CMP_LT , +TEP_FILTER_CMP_GE , +TEP_FILTER_CMP_LE , +TEP_FILTER_CMP_MATCH , +TEP_FILTER_CMP_NOT_MATCH , +TEP_FILTER_CMP_REGEX , +TEP_FILTER_CMP_NOT_REGEX , };enum filter_exp_type {
@@ -828,7 +828,7 @@ enum filter_value_type {struct fliter_arg ;struct filter_arg_boolean { -enum filter_boolean_type value; +enum tep_filter_boolean_type value; };struct filter_arg_field {
@@ -844,7 +844,7 @@ struct filter_arg_value { };struct filter_arg_op { -enum filter_op_type type; +enum tep_filter_op_type type;struct filter_arg *left;struct filter_arg *right; };
@@ -856,13 +856,13 @@ struct filter_arg_exp { };struct filter_arg_num { -enum filter_cmp_type type; +enum tep_filter_cmp_type type;struct filter_arg *left;struct filter_arg *right; };struct filter_arg_str { -enum filter_cmp_type type; +enum tep_filter_cmp_type type;struct tep_format_field *field;char *val;char *buffer;
tools/lib/traceevent/parse-filter.c +72 -72
376 lines not on this page · raw message
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix tep_ to enums filter_{exp,arg}_type
In reply to Steven Rostedttools lib traceevent: Add prefix tep_ to enums filter_{exp,arg}_type
Commit-ID: 4746d22a4c1b12993540924f8cca12a256646614 Gitweb: https://git.kernel.org/tip/4746d22a4c1b12993540924f8cca12a256646614 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:52 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:20:51 -0300
tools lib traceevent: Add prefix tep_ to enums filter_{exp,arg}_type
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 adds prefix tep_ to enums filter_exp_type, filter_arg_type and all enum's members
--- tools/lib/traceevent/event-parse.h | 56 +++++----- tools/lib/traceevent/parse-filter.c | 210 ++++++++++++++++++------------------ 2 files changed, 133 insertions(+), 133 deletions(-)
tools/lib/traceevent/event-parse.h +28 -28
@@ -793,30 +793,30 @@ enum tep_filter_cmp_type { TEP_FILTER_CMP_NOT_REGEX, }; -enum filter_exp_type { -FILTER_EXP_NONE , -FILTER_EXP_ADD , -FILTER_EXP_SUB , -FILTER_EXP_MUL , -FILTER_EXP_DIV , -FILTER_EXP_MOD , -FILTER_EXP_RSHIFT , -FILTER_EXP_LSHIFT , -FILTER_EXP_AND , -FILTER_EXP_OR , -FILTER_EXP_XOR , -FILTER_EXP_NOT , -}; - -enum filter_arg_type { -FILTER_ARG_NONE , -FILTER_ARG_BOOLEAN , -FILTER_ARG_VALUE , -FILTER_ARG_FIELD , -FILTER_ARG_EXP , -FILTER_ARG_OP , -FILTER_ARG_NUM , -FILTER_ARG_STR , +enum tep_filter_exp_type { +TEP_FILTER_EXP_NONE , +TEP_FILTER_EXP_ADD , +TEP_FILTER_EXP_SUB , +TEP_FILTER_EXP_MUL , +TEP_FILTER_EXP_DIV , +TEP_FILTER_EXP_MOD , +TEP_FILTER_EXP_RSHIFT , +TEP_FILTER_EXP_LSHIFT , +TEP_FILTER_EXP_AND , +TEP_FILTER_EXP_OR , +TEP_FILTER_EXP_XOR , +TEP_FILTER_EXP_NOT , +}; + +enum tep_filter_arg_type { +TEP_FILTER_ARG_NONE , +TEP_FILTER_ARG_BOOLEAN , +TEP_FILTER_ARG_VALUE , +TEP_FILTER_ARG_FIELD , +TEP_FILTER_ARG_EXP , +TEP_FILTER_ARG_OP , +TEP_FILTER_ARG_NUM , +TEP_FILTER_ARG_STR , };enum filter_value_type {
@@ -850,9 +850,9 @@ struct filter_arg_op { };struct filter_arg_exp { -enum filter_exp_type type; -struct filter_arg *left; -struct filter_arg *right; +enum tep_filter_exp_type type; +struct filter_arg *left; +struct filter_arg *right; };struct filter_arg_num {
@@ -870,7 +870,7 @@ struct filter_arg_str { };struct filter_arg { -enum filter_arg_type type; +enum tep_filter_arg_type type;union {struct filter_arg_boolean boolean;struct filter_arg_field field;
tools/lib/traceevent/parse-filter.c +105 -105
553 lines not on this page · raw message
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix tep_ to struct filter_{arg,value_type}
In reply to Steven Rostedttools lib traceevent: Add prefix tep_ to struct filter_{arg,value_type}
Commit-ID: 0515ca53caa681ad945fbea218e691e8637b4d7d Gitweb: https://git.kernel.org/tip/0515ca53caa681ad945fbea218e691e8637b4d7d Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:53 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:22:29 -0300
tools lib traceevent: Add prefix tep_ to struct filter_{arg,value_type}
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 adds prefix tep_ to struct filter_arg, enum filter_value_type and all enum's members.
--- tools/lib/traceevent/event-parse.h | 28 ++++----- tools/lib/traceevent/parse-filter.c | 120 ++++++++++++++++++------------------ 2 files changed, 74 insertions(+), 74 deletions(-)
tools/lib/traceevent/event-parse.h +14 -14
@@ -819,13 +819,13 @@ enum tep_filter_arg_type { TEP_FILTER_ARG_STR, }; -enum filter_value_type { -FILTER_NUMBER , -FILTER_STRING , -FILTER_CHAR +enum tep_filter_value_type { +TEP_FILTER_NUMBER , +TEP_FILTER_STRING , +TEP_FILTER_CHAR }; -struct fliter_arg ; +struct tep_filter_arg ;struct filter_arg_boolean {enum tep_filter_boolean_type value;
@@ -836,7 +836,7 @@ struct filter_arg_field { };struct filter_arg_value { -enum filter_value_type type; +enum tep_filter_value_type type;union {char *str;unsigned long long val;
@@ -845,20 +845,20 @@ struct filter_arg_value {struct filter_arg_op {enum tep_filter_op_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_exp {enum tep_filter_exp_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_num {enum tep_filter_cmp_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_str {
@@ -869,7 +869,7 @@ struct filter_arg_str {regex_t reg; }; -struct filter_arg { +struct tep_filter_arg {enum tep_filter_arg_type type;union {struct filter_arg_boolean boolean;
@@ -885,7 +885,7 @@ struct filter_arg {struct filter_type {int event_id;struct tep_event_format *event; -struct filter_arg *filter; +struct tep_filter_arg *filter; };#define TEP_FILTER_ERROR_BUFSZ 1024
tools/lib/traceevent/parse-filter.c +60 -60
381 lines not on this page · raw message
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix tep_ to various structs filter_arg_*.
In reply to Steven Rostedttools lib traceevent: Add prefix tep_ to various structs filter_arg_*.
Commit-ID: 88e6c21a11c5464ebdaefeb18822ab55f37a6473 Gitweb: https://git.kernel.org/tip/88e6c21a11c5464ebdaefeb18822ab55f37a6473 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:54 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:27:52 -0300
tools lib traceevent: Add prefix tep_ to various structs filter_arg_*.
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 adds prefix tep_ to to various structs filter_arg_*..
--- tools/lib/traceevent/event-parse.h | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
tools/lib/traceevent/event-parse.h +24 -24
@@ -827,15 +827,15 @@ enum tep_filter_value_type {struct tep_filter_arg ; -struct filter_arg_boolean { +struct tep_filter_arg_boolean {enum tep_filter_boolean_type value; }; -struct filter_arg_field { -struct tep_format_field *field; +struct tep_filter_arg_field { +struct tep_format_field *field; }; -struct filter_arg_value { +struct tep_filter_arg_value {enum tep_filter_value_type type;union {char *str;
@@ -843,42 +843,42 @@ struct filter_arg_value { }; }; -struct filter_arg_op { -enum tep_filter_op_type type; -struct tep_filter_arg *left; -struct tep_filter_arg *right; +struct tep_filter_arg_op { +enum tep_filter_op_type type; +struct tep_filter_arg *left; +struct tep_filter_arg *right; }; -struct filter_arg_exp { +struct tep_filter_arg_exp {enum tep_filter_exp_type type;struct tep_filter_arg *left;struct tep_filter_arg *right; }; -struct filter_arg_num { +struct tep_filter_arg_num {enum tep_filter_cmp_type type; -struct tep_filter_arg *left; -struct tep_filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; }; -struct filter_arg_str { +struct tep_filter_arg_str {enum tep_filter_cmp_type type; -struct tep_format_field *field; -char *val; -char *buffer; -regex_t reg; +struct tep_format_field *field; +char *val; +char *buffer; +regex_t reg; };struct tep_filter_arg {enum tep_filter_arg_type type;union { -struct filter_arg_boolean boolean; -struct filter_arg_field field; -struct filter_arg_value value; -struct filter_arg_op op; -struct filter_arg_exp exp; -struct filter_arg_num num; -struct filter_arg_str str; +struct tep_filter_arg_boolean boolean; +struct tep_filter_arg_field field; +struct tep_filter_arg_value value; +struct tep_filter_arg_op op; +struct tep_filter_arg_exp exp; +struct tep_filter_arg_num num; +struct tep_filter_arg_str str; }; };
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix tep_ to structs filter_type and event_filter
In reply to Steven Rostedttools lib traceevent: Add prefix tep_ to structs filter_type and event_filter
Commit-ID: 9334c9616b71202c751a12edf5f83f51ec5a1663 Gitweb: https://git.kernel.org/tip/9334c9616b71202c751a12edf5f83f51ec5a1663 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:55 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:28:28 -0300
tools lib traceevent: Add prefix tep_ to structs filter_type and event_filter
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 adds prefix tep_ to structs filter_type and event_filter
--- tools/lib/traceevent/event-parse.h | 34 ++++++------- tools/lib/traceevent/parse-filter.c | 96 ++++++++++++++++++------------------- 2 files changed, 65 insertions(+), 65 deletions(-)
tools/lib/traceevent/event-parse.h +17 -17
@@ -882,7 +882,7 @@ struct tep_filter_arg { }; }; -struct filter_type { +struct tep_filter_type {int event_id;struct tep_event_format *event;struct tep_filter_arg *filter;
@@ -890,14 +890,14 @@ struct filter_type {#define TEP_FILTER_ERROR_BUFSZ 1024 -struct event_filter { +struct tep_event_filter {struct tep_handle *pevent;int filters; -struct filter_type *event_filters; +struct tep_filter_type *event_filters;char error_buffer[TEP_FILTER_ERROR_BUFSZ ]; }; -struct event_filter *tep_filter_alloc (struct tep_handle *pevent); +struct tep_event_filter *tep_filter_alloc (struct tep_handle *pevent);/* for backward compatibility */ #define FILTER_NONE TEP_ERRNO__NO_FILTER
@@ -911,39 +911,39 @@ enum filter_trivial_type { FILTER_TRIVIAL_BOTH, }; -enum tep_errno tep_filter_add_filter_str (struct event_filter *filter, +enum tep_errno tep_filter_add_filter_str (struct tep_event_filter *filter,const char *filter_str); -enum tep_errno tep_filter_match (struct event_filter *filter, +enum tep_errno tep_filter_match (struct tep_event_filter *filter,struct tep_record *record); -int tep_filter_strerror (struct event_filter *filter,enum tep_errno err, +int tep_filter_strerror (struct tep_event_filter *filter,enum tep_errno err,char *buf,size_t buflen); -int tep_event_filtered (struct event_filter *filter, +int tep_event_filtered (struct tep_event_filter *filter,int event_id); -void tep_filter_reset (struct event_filter *filter); +void tep_filter_reset (struct tep_event_filter *filter); -int tep_filter_clear_trivial (struct event_filter *filter, +int tep_filter_clear_trivial (struct tep_event_filter *filter,enum filter_trivial_type type); -void tep_filter_free (struct event_filter *filter); +void tep_filter_free (struct tep_event_filter *filter); -char *tep_filter_make_string (struct event_filter *filter,int event_id); +char *tep_filter_make_string (struct tep_event_filter *filter,int event_id); -int tep_filter_remove_event (struct event_filter *filter, +int tep_filter_remove_event (struct tep_event_filter *filter,int event_id); -int tep_filter_event_has_trivial (struct event_filter *filter, +int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id,enum filter_trivial_type type); -int tep_filter_copy (struct event_filter *dest,struct event_filter *source); +int tep_filter_copy (struct tep_event_filter *dest,struct tep_event_filter *source); -int tep_update_trivial (struct event_filter *dest,struct event_filter *source, +int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source,enum filter_trivial_type type); -int tep_filter_compare (struct event_filter *filter1,struct event_filter *filter2); +int tep_filter_compare (struct tep_event_filter *filter1,struct tep_event_filter *filter2);#endif /* _PARSE_EVENTS_H */
tools/lib/traceevent/parse-filter.c +48 -48
286 lines not on this page · raw message
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Rename struct plugin_list to struct tep_plugin_list
In reply to Steven Rostedttools lib traceevent: Rename struct plugin_list to struct tep_plugin_list
Commit-ID: 785be0c98d24aaf417588322c74999520ea790a4 Gitweb: https://git.kernel.org/tip/785be0c98d24aaf417588322c74999520ea790a4 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:56 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:29:26 -0300
tools lib traceevent: Rename struct plugin_list to struct tep_plugin_list
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 plugin_list to struct tep_plugin_list
--- tools/lib/traceevent/event-parse.h | 8 ++++---- tools/lib/traceevent/event-plugin.c | 18 +++++++++--------- tools/perf/util/trace-event.h | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-)
tools/lib/traceevent/event-parse.h +4 -4
@@ -389,12 +389,12 @@ enum tep_errno { };#undef _PE -struct plugin_list ; +struct tep_plugin_list ;#define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) -struct plugin_list *tep_load_plugins (struct tep_handle *pevent); -void tep_unload_plugins (struct plugin_list *plugin_list, +struct tep_plugin_list *tep_load_plugins (struct tep_handle *pevent); +void tep_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent);char **tep_plugin_list_options (void );void tep_plugin_free_options_list (char **list);
@@ -403,7 +403,7 @@ int tep_plugin_add_options(const char *name,void tep_plugin_remove_options (struct tep_plugin_option *options);void tep_print_plugins (struct trace_seq *s,const char *prefix,const char *suffix, -const struct plugin_list *list); +const struct tep_plugin_list *list);struct cmdline ;struct cmdline_list ;
tools/lib/traceevent/event-plugin.c +9 -9
@@ -31,8 +31,8 @@ static struct trace_plugin_options {char *value; } *trace_plugin_options; -struct plugin_list { -struct plugin_list *next; +struct tep_plugin_list { +struct tep_plugin_list *next;char *name;void *handle; };
@@ -259,7 +259,7 @@ void tep_plugin_remove_options(struct tep_plugin_option *options)*/ void tep_print_plugins (struct trace_seq *s,const char *prefix,const char *suffix, -const struct plugin_list *list) +const struct tep_plugin_list *list) {while (list) {trace_seq_printf (s,"%s%s%s" , prefix, list->name, suffix);
@@ -271,9 +271,9 @@ static void load_plugin(struct tep_handle *pevent, const char *path, const char *file, void *data) { - struct plugin_list **plugin_list = data; + struct tep_plugin_list **plugin_list = data;tep_plugin_load_func func; -struct plugin_list *list; +struct tep_plugin_list *list;const char *alias;char *plugin;void *handle;
@@ -417,20 +417,20 @@ load_plugins(struct tep_handle *pevent, const char *suffix,free (path); } -struct plugin_list * +struct tep_plugin_list *tep_load_plugins (struct tep_handle *pevent) { -struct plugin_list *list =NULL ; +struct tep_plugin_list *list =NULL ;load_plugins (pevent,".so" , load_plugin, &list);return list; }void -tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) +tep_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent) {tep_plugin_unload_func func; -struct plugin_list *list; +struct tep_plugin_list *list;while (plugin_list) { list = plugin_list;
tools/perf/util/trace-event.h +2 -2
@@ -11,11 +11,11 @@ struct perf_sample;union perf_event ;struct perf_tool ;struct thread ; -struct plugin_list ; +struct tep_plugin_list ;struct trace_event {struct tep_handle *pevent; -struct plugin_list *plugin_list; +struct tep_plugin_list *plugin_list; };int trace_event__init (struct trace_event *t);
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Rename data2host*() APIs
In reply to Steven Rostedttools lib traceevent: Rename data2host*() APIs
Commit-ID: 1affd34f192a516436a2e0cec15a97bc1001678a Gitweb: https://git.kernel.org/tip/1affd34f192a516436a2e0cec15a97bc1001678a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:57 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:30:06 -0300
tools lib traceevent: Rename data2host*() APIs
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 data2host*() APIs
--- tools/lib/traceevent/event-parse.c | 10 +++++----- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/perf/util/trace-event-read.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-)
tools/lib/traceevent/event-parse.c +5 -5
@@ -3331,11 +3331,11 @@ unsigned long long tep_read_number(struct tep_handle *pevent,case 1 :return *(unsigned char *)ptr;case 2 : -return data2host2 (pevent, ptr); +return tep_data2host2 (pevent, ptr);case 4 : -return data2host4 (pevent, ptr); +return tep_data2host4 (pevent, ptr);case 8 : -return data2host8 (pevent, ptr); +return tep_data2host8 (pevent, ptr);default :/* BUG! */ return 0 ;
@@ -4061,7 +4061,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset; } - str_offset =data2host4 (pevent, data + arg->string.offset); + str_offset =tep_data2host4 (pevent, data + arg->string.offset); str_offset &=0xffff ;print_str_to_seq (s, format, len_arg, ((char *)data) + str_offset);break ;
@@ -4079,7 +4079,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset; } - bitmask_offset =data2host4 (pevent, data + arg->bitmask.offset); + bitmask_offset =tep_data2host4 (pevent, data + arg->bitmask.offset); bitmask_size = bitmask_offset >>16 ; bitmask_offset &=0xffff ; print_bitmask_to_seq(pevent, s, format, len_arg,
tools/lib/traceevent/event-parse.h +7 -7
@@ -496,7 +496,7 @@ static inline void tep_set_flag(struct tep_handle *pevent, int flag) }static inline unsigned short -__data2host2 (struct tep_handle *pevent,unsigned short data) +__tep_data2host2 (struct tep_handle *pevent,unsigned short data) {unsigned short swap;
@@ -510,7 +510,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data) }static inline unsigned int -__data2host4 (struct tep_handle *pevent,unsigned int data) +__tep_data2host4 (struct tep_handle *pevent,unsigned int data) {unsigned int swap;
@@ -526,7 +526,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data) }static inline unsigned long long -__data2host8 (struct tep_handle *pevent,unsigned long long data) +__tep_data2host8 (struct tep_handle *pevent,unsigned long long data) {unsigned long long swap;
@@ -545,14 +545,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)return swap; } -#define data2host2 (pevent, ptr) __data2host2(pevent, *(unsigned short *)(ptr)) -#define data2host4 (pevent, ptr) __data2host4(pevent, *(unsigned int *)(ptr)) -#define data2host8 (pevent, ptr) \ +#define tep_data2host2 (pevent, ptr) __tep_data2host2(pevent, *(unsigned short *)(ptr)) +#define tep_data2host4 (pevent, ptr) __tep_data2host4(pevent, *(unsigned int *)(ptr)) +#define tep_data2host8 (pevent, ptr) \ ({ \ unsigned long long __val; \ \ memcpy(&__val, (ptr), sizeof(unsigned long long)); \ - __data2host8(pevent, __val); \ + __tep_data2host8(pevent, __val); \ })static inline int tep_host_bigendian (void )
tools/perf/util/trace-event-read.c +2 -2
@@ -102,7 +102,7 @@ static unsigned int read4(struct tep_handle *pevent)if (do_read (&data,4 ) <0 )return 0 ; -return __data2host4 (pevent, data); +return __tep_data2host4 (pevent, data); }static unsigned long long read8 (struct tep_handle *pevent)
@@ -111,7 +111,7 @@ static unsigned long long read8(struct tep_handle *pevent)if (do_read (&data,8 ) <0 )return 0 ; -return __data2host8 (pevent, data); +return __tep_data2host8 (pevent, data); }static char *read_string (void )
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/core] tools lib traceevent: Add prefix tep_ to enum filter_trivial_type
In reply to Steven Rostedttools lib traceevent: Add prefix tep_ to enum filter_trivial_type
Commit-ID: 035c450ffa0483e715fc7b14a2e8b744bf8a740a Gitweb: https://git.kernel.org/tip/035c450ffa0483e715fc7b14a2e8b744bf8a740a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 19 Sep 2018 14:56:58 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 19 Sep 2018 17:30:46 -0300
tools lib traceevent: Add prefix tep_ to enum filter_trivial_type
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 adds prefix tep_ to enum filter_trivial_type and all its members.
--- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/parse-filter.c | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-)
tools/lib/traceevent/event-parse.h +7 -7
@@ -905,10 +905,10 @@ struct tep_event_filter *tep_filter_alloc(struct tep_handle *pevent);#define FILTER_MISS TEP_ERRNO__FILTER_MISS#define FILTER_MATCH TEP_ERRNO__FILTER_MATCH -enum filter_trivial_type { -FILTER_TRIVIAL_FALSE , -FILTER_TRIVIAL_TRUE , -FILTER_TRIVIAL_BOTH , +enum tep_filter_trivial_type { +TEP_FILTER_TRIVIAL_FALSE , +TEP_FILTER_TRIVIAL_TRUE , +TEP_FILTER_TRIVIAL_BOTH , }; enum tep_errno tep_filter_add_filter_str(struct tep_event_filter *filter,
@@ -926,7 +926,7 @@ int tep_event_filtered(struct tep_event_filter *filter,void tep_filter_reset (struct tep_event_filter *filter);int tep_filter_clear_trivial (struct tep_event_filter *filter, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);void tep_filter_free (struct tep_event_filter *filter);
@@ -937,12 +937,12 @@ int tep_filter_remove_event(struct tep_event_filter *filter,int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);int tep_filter_copy (struct tep_event_filter *dest,struct tep_event_filter *source);int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);int tep_filter_compare (struct tep_event_filter *filter1,struct tep_event_filter *filter2);
tools/lib/traceevent/parse-filter.c +11 -11
@@ -1534,7 +1534,7 @@ int tep_filter_copy(struct tep_event_filter *dest, struct tep_event_filter *sour* events may have still been updated on error. */ int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_handle *src_pevent;struct tep_handle *dest_pevent;
@@ -1556,8 +1556,8 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s arg = filter_type->filter;if (arg->type !=TEP_FILTER_ARG_BOOLEAN )continue ; -if ((arg->boolean.value && type ==FILTER_TRIVIAL_FALSE ) || - (!arg->boolean.value && type ==FILTER_TRIVIAL_TRUE )) +if ((arg->boolean.value && type ==TEP_FILTER_TRIVIAL_FALSE ) || + (!arg->boolean.value && type ==TEP_FILTER_TRIVIAL_TRUE ))continue ; event = filter_type->event;
@@ -1593,7 +1593,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s* Returns 0 on success and -1 if there was a problem. */ int tep_filter_clear_trivial (struct tep_event_filter *filter, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_filter_type *filter_type;int count =0 ;
@@ -1614,11 +1614,11 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter,if (filter_type->filter->type !=TEP_FILTER_ARG_BOOLEAN )continue ;switch (type) { -case FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_FALSE :if (filter_type->filter->boolean.value)continue ;break ; -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_TRUE :if (!filter_type->filter->boolean.value)continue ;default :
@@ -1656,7 +1656,7 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter,*/ int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_filter_type *filter_type;
@@ -1672,10 +1672,10 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter,return 0 ;switch (type) { -case FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_FALSE :return !filter_type->filter->boolean.value; -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_TRUE :return filter_type->filter->boolean.value;default :return 1 ;
@@ -2409,8 +2409,8 @@ int tep_filter_compare(struct tep_event_filter *filter1, struct tep_event_filterif (filter_type1->filter->type != filter_type2->filter->type)break ;switch (filter_type1->filter->type) { -case FILTER_TRIVIAL_FALSE : -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_TRUE :/* trivial types just need the type compared */ continue ;default :