History

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.

Tzvetomir Stoyanov (VMware) committed 8 years ago

Commit bb39ccb1 parent 2c92f9811 files · +87 −87Browse files

Unified · Split

11 files
  1. tools/lib/traceevent/event-parse.c +24 −24
  2. tools/lib/traceevent/event-parse.h +9 −9
  3. tools/lib/traceevent/parse-filter.c +4 −4
  4. tools/perf/builtin-trace.c +1 −1
  5. tools/perf/tests/evsel-tp-sched.c +1 −1
  6. tools/perf/util/data-convert-bt.c +17 −17
  7. tools/perf/util/evsel.c +1 −1
  8. tools/perf/util/python.c +6 −6
  9. tools/perf/util/scripting-engines/trace-event-perl.c +9 −9
  10. tools/perf/util/scripting-engines/trace-event-python.c +13 −13
  11. tools/perf/util/sort.c +2 −2
tools/lib/traceevent/event-parse.c+24−24
@@ -1301,7 +1301,7 @@ static int event_read_id(void) · 1300 unmodified lines
13011301
13021302 static int field_is_string(struct tep_format_field *field)
13031303 {
1304− if ((field->flags & FIELD_IS_ARRAY) &&
1304+ if ((field->flags & TEP_FIELD_IS_ARRAY) &&
13051305 (strstr(field->type, "char") || strstr(field->type, "u8") ||
13061306 strstr(field->type, "s8")))
13071307 return 1;
@@ -1328,7 +1328,7 @@ static int field_is_long(struct tep_format_field *field) · 20 unmodified lines
13281328
13291329 static unsigned int type_size(const char *name)
13301330 {
1331− /* This covers all FIELD_IS_STRING types. */
1331+ /* This covers all TEP_FIELD_IS_STRING types. */
13321332 static struct {
13331333 const char *type;
13341334 unsigned int size;
@@ -1416,7 +1416,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f · 81 unmodified lines
14161416 type == EVENT_OP && strcmp(token, ".") == 0)) {
14171417
14181418 if (strcmp(token, "*") == 0)
1419− field->flags |= FIELD_IS_POINTER;
1419+ field->flags |= TEP_FIELD_IS_POINTER;
14201420
14211421 if (field->type) {
14221422 char *new_type;
@@ -1455,7 +1455,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f · 32 unmodified lines
14551455 char *new_brackets;
14561456 int len;
14571457
1458− field->flags |= FIELD_IS_ARRAY;
1458+ field->flags |= TEP_FIELD_IS_ARRAY;
14591459
14601460 type = read_token(&token);
14611461
@@ -1544,11 +1544,11 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f · 82 unmodified lines
15441544 }
15451545
15461546 if (field_is_string(field))
1547− field->flags |= FIELD_IS_STRING;
1547+ field->flags |= TEP_FIELD_IS_STRING;
15481548 if (field_is_dynamic(field))
1549− field->flags |= FIELD_IS_DYNAMIC;
1549+ field->flags |= TEP_FIELD_IS_DYNAMIC;
15501550 if (field_is_long(field))
1551− field->flags |= FIELD_IS_LONG;
1551+ field->flags |= TEP_FIELD_IS_LONG;
15521552
15531553 if (test_type_token(type, token, EVENT_OP, ";"))
15541554 goto fail;
@@ -1597,7 +1597,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f · 42 unmodified lines
15971597 goto fail;
15981598
15991599 if (strtoul(token, NULL, 0))
1600− field->flags |= FIELD_IS_SIGNED;
1600+ field->flags |= TEP_FIELD_IS_SIGNED;
16011601
16021602 free_token(token);
16031603 if (read_expected(EVENT_OP, ";") < 0)
@@ -1609,14 +1609,14 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f · 5 unmodified lines
16091609
16101610 free_token(token);
16111611
1612− if (field->flags & FIELD_IS_ARRAY) {
1612+ if (field->flags & TEP_FIELD_IS_ARRAY) {
16131613 if (field->arraylen)
16141614 field->elementsize = field->size / field->arraylen;
1615− else if (field->flags & FIELD_IS_DYNAMIC)
1615+ else if (field->flags & TEP_FIELD_IS_DYNAMIC)
16161616 field->elementsize = size_dynamic;
1617− else if (field->flags & FIELD_IS_STRING)
1617+ else if (field->flags & TEP_FIELD_IS_STRING)
16181618 field->elementsize = 1;
1619− else if (field->flags & FIELD_IS_LONG)
1619+ else if (field->flags & TEP_FIELD_IS_LONG)
16201620 field->elementsize = event->pevent ?
16211621 event->pevent->long_size :
16221622 sizeof(long);
@@ -2089,11 +2089,11 @@ process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *a · 466 unmodified lines
20892089
20902090 if (is_flag_field) {
20912091 arg->field.field = tep_find_any_field(event, arg->field.name);
2092− arg->field.field->flags |= FIELD_IS_FLAG;
2092+ arg->field.field->flags |= TEP_FIELD_IS_FLAG;
20932093 is_flag_field = 0;
20942094 } else if (is_symbolic_field) {
20952095 arg->field.field = tep_find_any_field(event, arg->field.name);
2096− arg->field.field->flags |= FIELD_IS_SYMBOLIC;
2096+ arg->field.field->flags |= TEP_FIELD_IS_SYMBOLIC;
20972097 is_symbolic_field = 0;
20982098 }
20992099
@@ -3901,7 +3901,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, · 1801 unmodified lines
39013901 * and the size is the same as long_size, assume that it
39023902 * is a pointer.
39033903 */
3904− if (!(field->flags & FIELD_IS_ARRAY) &&
3904+ if (!(field->flags & TEP_FIELD_IS_ARRAY) &&
39053905 field->size == pevent->long_size) {
39063906
39073907 /* Handle heterogeneous recording and processing
@@ -4794,16 +4794,16 @@ void tep_print_field(struct trace_seq *s, void *data, · 886 unmodified lines
47944794 unsigned int offset, len, i;
47954795 struct tep_handle *pevent = field->event->pevent;
47964796
4797− if (field->flags & FIELD_IS_ARRAY) {
4797+ if (field->flags & TEP_FIELD_IS_ARRAY) {
47984798 offset = field->offset;
47994799 len = field->size;
4800− if (field->flags & FIELD_IS_DYNAMIC) {
4800+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
48014801 val = tep_read_number(pevent, data + offset, len);
48024802 offset = val;
48034803 len = offset >> 16;
48044804 offset &= 0xffff;
48054805 }
4806− if (field->flags & FIELD_IS_STRING &&
4806+ if (field->flags & TEP_FIELD_IS_STRING &&
48074807 is_printable_array(data + offset, len)) {
48084808 trace_seq_printf(s, "%s", (char *)data + offset);
48094809 } else {
@@ -4815,21 +4815,21 @@ void tep_print_field(struct trace_seq *s, void *data, · 5 unmodified lines
48154815 *((unsigned char *)data + offset + i));
48164816 }
48174817 trace_seq_putc(s, ']');
4818− field->flags &= ~FIELD_IS_STRING;
4818+ field->flags &= ~TEP_FIELD_IS_STRING;
48194819 }
48204820 } else {
48214821 val = tep_read_number(pevent, data + field->offset,
48224822 field->size);
4823− if (field->flags & FIELD_IS_POINTER) {
4823+ if (field->flags & TEP_FIELD_IS_POINTER) {
48244824 trace_seq_printf(s, "0x%llx", val);
4825− } else if (field->flags & FIELD_IS_SIGNED) {
4825+ } else if (field->flags & TEP_FIELD_IS_SIGNED) {
48264826 switch (field->size) {
48274827 case 4:
48284828 /*
48294829 * If field is long then print it in hex.
48304830 * A long usually stores pointers.
48314831 */
4832− if (field->flags & FIELD_IS_LONG)
4832+ if (field->flags & TEP_FIELD_IS_LONG)
48334833 trace_seq_printf(s, "0x%x", (int)val);
48344834 else
48354835 trace_seq_printf(s, "%d", (int)val);
@@ -4844,7 +4844,7 @@ void tep_print_field(struct trace_seq *s, void *data, · 8 unmodified lines
48444844 trace_seq_printf(s, "%lld", val);
48454845 }
48464846 } else {
4847− if (field->flags & FIELD_IS_LONG)
4847+ if (field->flags & TEP_FIELD_IS_LONG)
48484848 trace_seq_printf(s, "0x%llx", val);
48494849 else
48504850 trace_seq_printf(s, "%llu", val);
@@ -6288,7 +6288,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, · 1437 unmodified lines
62886288 len = &dummy;
62896289
62906290 offset = field->offset;
6291− if (field->flags & FIELD_IS_DYNAMIC) {
6291+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
62926292 offset = tep_read_number(event->pevent,
62936293 data + offset, field->size);
62946294 *len = offset >> 16;
tools/lib/traceevent/event-parse.h+9−9
@@ -130,15 +130,15 @@ struct tep_plugin_option { · 129 unmodified lines
130130 #define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)
131131 #define TEP_PLUGIN_ALIAS_NAME MAKE_STR(TEP_PLUGIN_ALIAS)
132132
133−enum format_flags {
134− FIELD_IS_ARRAY = 1,
135− FIELD_IS_POINTER = 2,
136− FIELD_IS_SIGNED = 4,
137− FIELD_IS_STRING = 8,
138− FIELD_IS_DYNAMIC = 16,
139− FIELD_IS_LONG = 32,
140− FIELD_IS_FLAG = 64,
141− FIELD_IS_SYMBOLIC = 128,
133+enum tep_format_flags {
134+ TEP_FIELD_IS_ARRAY = 1,
135+ TEP_FIELD_IS_POINTER = 2,
136+ TEP_FIELD_IS_SIGNED = 4,
137+ TEP_FIELD_IS_STRING = 8,
138+ TEP_FIELD_IS_DYNAMIC = 16,
139+ TEP_FIELD_IS_LONG = 32,
140+ TEP_FIELD_IS_FLAG = 64,
141+ TEP_FIELD_IS_SYMBOLIC = 128,
142142 };
143143
144144 struct tep_format_field {
tools/lib/traceevent/parse-filter.c+4−4
@@ -1716,7 +1716,7 @@ get_value(struct tep_event_format *event, · 1715 unmodified lines
17161716
17171717 tep_read_number_field(field, record->data, &val);
17181718
1719− if (!(field->flags & FIELD_IS_SIGNED))
1719+ if (!(field->flags & TEP_FIELD_IS_SIGNED))
17201720 return val;
17211721
17221722 switch (field->size) {
@@ -1867,11 +1867,11 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco · 144 unmodified lines
18671867 char hex[64];
18681868
18691869 /* If the field is not a string convert it */
1870− if (arg->str.field->flags & FIELD_IS_STRING) {
1870+ if (arg->str.field->flags & TEP_FIELD_IS_STRING) {
18711871 val = record->data + arg->str.field->offset;
18721872 size = arg->str.field->size;
18731873
1874− if (arg->str.field->flags & FIELD_IS_DYNAMIC) {
1874+ if (arg->str.field->flags & TEP_FIELD_IS_DYNAMIC) {
18751875 addr = *(unsigned int *)val;
18761876 val = record->data + (addr & 0xffff);
18771877 size = addr >> 16;
@@ -1893,7 +1893,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco · 15 unmodified lines
18931893 pevent = event->pevent;
18941894 addr = get_value(event, arg->str.field, record);
18951895
1896− if (arg->str.field->flags & (FIELD_IS_POINTER | FIELD_IS_LONG))
1896+ if (arg->str.field->flags & (TEP_FIELD_IS_POINTER | TEP_FIELD_IS_LONG))
18971897 /* convert to a kernel symbol */
18981898 val = tep_find_function(pevent, addr);
18991899
tools/perf/builtin-trace.c+1−1
@@ -1293,7 +1293,7 @@ static int syscall__set_arg_fmts(struct syscall *sc) · 1292 unmodified lines
12931293 strcmp(field->name, "path") == 0 ||
12941294 strcmp(field->name, "pathname") == 0))
12951295 sc->arg_fmt[idx].scnprintf = SCA_FILENAME;
1296− else if (field->flags & FIELD_IS_POINTER)
1296+ else if (field->flags & TEP_FIELD_IS_POINTER)
12971297 sc->arg_fmt[idx].scnprintf = syscall_arg__scnprintf_hex;
12981298 else if (strcmp(field->type, "pid_t") == 0)
12991299 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, · 16 unmodified lines
1717 return -1;
1818 }
1919
20− is_signed = !!(field->flags | FIELD_IS_SIGNED);
20+ is_signed = !!(field->flags | TEP_FIELD_IS_SIGNED);
2121 if (should_be_signed && !is_signed) {
2222 pr_debug("%s: \"%s\" signedness(%d) is wrong, should be %d\n",
2323 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) · 185 unmodified lines
186186 {
187187 unsigned long flags = field->flags;
188188
189− if (flags & FIELD_IS_STRING)
189+ if (flags & TEP_FIELD_IS_STRING)
190190 return cw->data.string;
191191
192− if (!(flags & FIELD_IS_SIGNED)) {
192+ if (!(flags & TEP_FIELD_IS_SIGNED)) {
193193 /* unsigned long are mostly pointers */
194− if (flags & FIELD_IS_LONG || flags & FIELD_IS_POINTER)
194+ if (flags & TEP_FIELD_IS_LONG || flags & TEP_FIELD_IS_POINTER)
195195 return cw->data.u64_hex;
196196 }
197197
198− if (flags & FIELD_IS_SIGNED) {
198+ if (flags & TEP_FIELD_IS_SIGNED) {
199199 if (field->size == 8)
200200 return cw->data.s64;
201201 else
@@ -304,10 +304,10 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 102 unmodified lines
304304 name = fmtf->alias;
305305 offset = fmtf->offset;
306306 len = fmtf->size;
307− if (flags & FIELD_IS_STRING)
308− flags &= ~FIELD_IS_ARRAY;
307+ if (flags & TEP_FIELD_IS_STRING)
308+ flags &= ~TEP_FIELD_IS_ARRAY;
309309
310− if (flags & FIELD_IS_DYNAMIC) {
310+ if (flags & TEP_FIELD_IS_DYNAMIC) {
311311 unsigned long long tmp_val;
312312
313313 tmp_val = tep_read_number(fmtf->event->pevent,
@@ -317,7 +317,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 3 unmodified lines
317317 offset &= 0xffff;
318318 }
319319
320− if (flags & FIELD_IS_ARRAY) {
320+ if (flags & TEP_FIELD_IS_ARRAY) {
321321
322322 type = bt_ctf_event_class_get_field_by_name(
323323 event_class, name);
@@ -338,7 +338,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 14 unmodified lines
338338 type = get_tracepoint_field_type(cw, fmtf);
339339
340340 for (i = 0; i < n_items; i++) {
341− if (flags & FIELD_IS_ARRAY)
341+ if (flags & TEP_FIELD_IS_ARRAY)
342342 field = bt_ctf_field_array_get_field(array_field, i);
343343 else
344344 field = bt_ctf_field_create(type);
@@ -348,7 +348,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 3 unmodified lines
348348 return -1;
349349 }
350350
351− if (flags & FIELD_IS_STRING)
351+ if (flags & TEP_FIELD_IS_STRING)
352352 ret = string_set_value(field, data + offset + i * len);
353353 else {
354354 unsigned long long value_int;
@@ -357,7 +357,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 2 unmodified lines
357357 fmtf->event->pevent,
358358 data + offset + i * len, len);
359359
360− if (!(flags & FIELD_IS_SIGNED))
360+ if (!(flags & TEP_FIELD_IS_SIGNED))
361361 ret = bt_ctf_field_unsigned_integer_set_value(
362362 field, value_int);
363363 else
@@ -369,7 +369,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 5 unmodified lines
369369 pr_err("failed to set file value %s\n", name);
370370 goto err_put_field;
371371 }
372− if (!(flags & FIELD_IS_ARRAY)) {
372+ if (!(flags & TEP_FIELD_IS_ARRAY)) {
373373 ret = bt_ctf_event_set_payload(event, name, field);
374374 if (ret) {
375375 pr_err("failed to set payload %s\n", name);
@@ -378,7 +378,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 2 unmodified lines
378378 }
379379 bt_ctf_field_put(field);
380380 }
381− if (flags & FIELD_IS_ARRAY) {
381+ if (flags & TEP_FIELD_IS_ARRAY) {
382382 ret = bt_ctf_event_set_payload(event, name, array_field);
383383 if (ret) {
384384 pr_err("Failed add payload array %s\n", name);
@@ -1030,15 +1030,15 @@ static int add_tracepoint_fields_types(struct ctf_writer *cw, · 645 unmodified lines
10301030 * type and don't care that it is an array. What we don't
10311031 * support is an array of strings.
10321032 */
1033− if (flags & FIELD_IS_STRING)
1034− flags &= ~FIELD_IS_ARRAY;
1033+ if (flags & TEP_FIELD_IS_STRING)
1034+ flags &= ~TEP_FIELD_IS_ARRAY;
10351035
1036− if (flags & FIELD_IS_ARRAY)
1036+ if (flags & TEP_FIELD_IS_ARRAY)
10371037 type = bt_ctf_field_type_array_create(type, field->arraylen);
10381038
10391039 ret = event_class_add_field(event_class, type, field);
10401040
1041− if (flags & FIELD_IS_ARRAY)
1041+ if (flags & TEP_FIELD_IS_ARRAY)
10421042 bt_ctf_field_type_put(type);
10431043
10441044 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, · 2697 unmodified lines
26982698
26992699 offset = field->offset;
27002700
2701− if (field->flags & FIELD_IS_DYNAMIC) {
2701+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
27022702 offset = *(int *)(sample->raw_data + field->offset);
27032703 offset &= 0xffff;
27042704 }
tools/perf/util/python.c+6−6
@@ -348,28 +348,28 @@ tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field) · 347 unmodified lines
348348 unsigned long long val;
349349 unsigned int offset, len;
350350
351− if (field->flags & FIELD_IS_ARRAY) {
351+ if (field->flags & TEP_FIELD_IS_ARRAY) {
352352 offset = field->offset;
353353 len = field->size;
354− if (field->flags & FIELD_IS_DYNAMIC) {
354+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
355355 val = tep_read_number(pevent, data + offset, len);
356356 offset = val;
357357 len = offset >> 16;
358358 offset &= 0xffff;
359359 }
360− if (field->flags & FIELD_IS_STRING &&
360+ if (field->flags & TEP_FIELD_IS_STRING &&
361361 is_printable_array(data + offset, len)) {
362362 ret = _PyUnicode_FromString((char *)data + offset);
363363 } else {
364364 ret = PyByteArray_FromStringAndSize((const char *) data + offset, len);
365− field->flags &= ~FIELD_IS_STRING;
365+ field->flags &= ~TEP_FIELD_IS_STRING;
366366 }
367367 } else {
368368 val = tep_read_number(pevent, data + field->offset,
369369 field->size);
370− if (field->flags & FIELD_IS_POINTER)
370+ if (field->flags & TEP_FIELD_IS_POINTER)
371371 ret = PyLong_FromUnsignedLong((unsigned long) val);
372− else if (field->flags & FIELD_IS_SIGNED)
372+ else if (field->flags & TEP_FIELD_IS_SIGNED)
373373 ret = PyLong_FromLong((long) val);
374374 else
375375 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, · 387 unmodified lines
388388 /* common fields other than pid can be accessed via xsub fns */
389389
390390 for (field = event->format.fields; field; field = field->next) {
391− if (field->flags & FIELD_IS_STRING) {
391+ if (field->flags & TEP_FIELD_IS_STRING) {
392392 int offset;
393− if (field->flags & FIELD_IS_DYNAMIC) {
393+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
394394 offset = *(int *)(data + field->offset);
395395 offset &= 0xffff;
396396 } else
@@ -399,7 +399,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, · 2 unmodified lines
399399 } else { /* FIELD_IS_NUMERIC */
400400 val = read_size(event, data + field->offset,
401401 field->size);
402− if (field->flags & FIELD_IS_SIGNED) {
402+ if (field->flags & TEP_FIELD_IS_SIGNED) {
403403 XPUSHs(sv_2mortal(newSViv(val)));
404404 } else {
405405 XPUSHs(sv_2mortal(newSVuv(val)));
@@ -646,11 +646,11 @@ sub print_backtrace\n\ · 240 unmodified lines
646646 count++;
647647
648648 fprintf(ofp, "%s=", f->name);
649− if (f->flags & FIELD_IS_STRING ||
650− f->flags & FIELD_IS_FLAG ||
651− f->flags & FIELD_IS_SYMBOLIC)
649+ if (f->flags & TEP_FIELD_IS_STRING ||
650+ f->flags & TEP_FIELD_IS_FLAG ||
651+ f->flags & TEP_FIELD_IS_SYMBOLIC)
652652 fprintf(ofp, "%%s");
653− else if (f->flags & FIELD_IS_SIGNED)
653+ else if (f->flags & TEP_FIELD_IS_SIGNED)
654654 fprintf(ofp, "%%d");
655655 else
656656 fprintf(ofp, "%%u");
@@ -668,7 +668,7 @@ sub print_backtrace\n\ · 11 unmodified lines
668668 if (++count % 5 == 0)
669669 fprintf(ofp, "\n\t ");
670670
671− if (f->flags & FIELD_IS_FLAG) {
671+ if (f->flags & TEP_FIELD_IS_FLAG) {
672672 if ((count - 1) % 5 != 0) {
673673 fprintf(ofp, "\n\t ");
674674 count = 4;
@@ -678,7 +678,7 @@ sub print_backtrace\n\ · 3 unmodified lines
678678 event->name);
679679 fprintf(ofp, "\"%s\", $%s)", f->name,
680680 f->name);
681− } else if (f->flags & FIELD_IS_SYMBOLIC) {
681+ } else if (f->flags & TEP_FIELD_IS_SYMBOLIC) {
682682 if ((count - 1) % 5 != 0) {
683683 fprintf(ofp, "\n\t ");
684684 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, · 334 unmodified lines
335335 static PyObject *get_field_numeric_entry(struct tep_event_format *event,
336336 struct tep_format_field *field, void *data)
337337 {
338− bool is_array = field->flags & FIELD_IS_ARRAY;
338+ bool is_array = field->flags & TEP_FIELD_IS_ARRAY;
339339 PyObject *obj = NULL, *list = NULL;
340340 unsigned long long val;
341341 unsigned int item_size, n_items, i;
@@ -353,7 +353,7 @@ static PyObject *get_field_numeric_entry(struct tep_event_format *event, · 11 unmodified lines
353353
354354 val = read_size(event, data + field->offset + i * item_size,
355355 item_size);
356− if (field->flags & FIELD_IS_SIGNED) {
356+ if (field->flags & TEP_FIELD_IS_SIGNED) {
357357 if ((long long)val >= LONG_MIN &&
358358 (long long)val <= LONG_MAX)
359359 obj = _PyLong_FromLong(val);
@@ -867,22 +867,22 @@ static void python_process_tracepoint(struct perf_sample *sample, · 507 unmodified lines
867867 unsigned int offset, len;
868868 unsigned long long val;
869869
870− if (field->flags & FIELD_IS_ARRAY) {
870+ if (field->flags & TEP_FIELD_IS_ARRAY) {
871871 offset = field->offset;
872872 len = field->size;
873− if (field->flags & FIELD_IS_DYNAMIC) {
873+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
874874 val = tep_read_number(scripting_context->pevent,
875875 data + offset, len);
876876 offset = val;
877877 len = offset >> 16;
878878 offset &= 0xffff;
879879 }
880− if (field->flags & FIELD_IS_STRING &&
880+ if (field->flags & TEP_FIELD_IS_STRING &&
881881 is_printable_array(data + offset, len)) {
882882 obj = _PyUnicode_FromString((char *) data + offset);
883883 } else {
884884 obj = PyByteArray_FromStringAndSize((const char *) data + offset, len);
885− field->flags &= ~FIELD_IS_STRING;
885+ field->flags &= ~TEP_FIELD_IS_STRING;
886886 }
887887 } else { /* FIELD_IS_NUMERIC */
888888 obj = get_field_numeric_entry(event, field, data);
@@ -1686,12 +1686,12 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile · 797 unmodified lines
16861686 count++;
16871687
16881688 fprintf(ofp, "%s=", f->name);
1689− if (f->flags & FIELD_IS_STRING ||
1690− f->flags & FIELD_IS_FLAG ||
1691− f->flags & FIELD_IS_ARRAY ||
1692− f->flags & FIELD_IS_SYMBOLIC)
1689+ if (f->flags & TEP_FIELD_IS_STRING ||
1690+ f->flags & TEP_FIELD_IS_FLAG ||
1691+ f->flags & TEP_FIELD_IS_ARRAY ||
1692+ f->flags & TEP_FIELD_IS_SYMBOLIC)
16931693 fprintf(ofp, "%%s");
1694− else if (f->flags & FIELD_IS_SIGNED)
1694+ else if (f->flags & TEP_FIELD_IS_SIGNED)
16951695 fprintf(ofp, "%%d");
16961696 else
16971697 fprintf(ofp, "%%u");
@@ -1709,7 +1709,7 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile · 11 unmodified lines
17091709 if (++count % 5 == 0)
17101710 fprintf(ofp, "\n\t\t");
17111711
1712− if (f->flags & FIELD_IS_FLAG) {
1712+ if (f->flags & TEP_FIELD_IS_FLAG) {
17131713 if ((count - 1) % 5 != 0) {
17141714 fprintf(ofp, "\n\t\t");
17151715 count = 4;
@@ -1719,7 +1719,7 @@ static int python_generate_script(struct tep_handle *pevent, const char *outfile · 3 unmodified lines
17191719 event->name);
17201720 fprintf(ofp, "\"%s\", %s)", f->name,
17211721 f->name);
1722− } else if (f->flags & FIELD_IS_SYMBOLIC) {
1722+ } else if (f->flags & TEP_FIELD_IS_SYMBOLIC) {
17231723 if ((count - 1) % 5 != 0) {
17241724 fprintf(ofp, "\n\t\t");
17251725 count = 4;
tools/perf/util/sort.c+2−2
@@ -1899,7 +1899,7 @@ static int hde_width(struct hpp_dynamic_entry *hde) · 1898 unmodified lines
18991899 if (namelen > len)
19001900 len = namelen;
19011901
1902− if (!(hde->field->flags & FIELD_IS_STRING)) {
1902+ if (!(hde->field->flags & TEP_FIELD_IS_STRING)) {
19031903 /* length for print hex numbers */
19041904 fieldlen = hde->field->size * 2 + 2;
19051905 }
@@ -2071,7 +2071,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, · 165 unmodified lines
20712071 }
20722072
20732073 field = hde->field;
2074− if (field->flags & FIELD_IS_DYNAMIC) {
2074+ if (field->flags & TEP_FIELD_IS_DYNAMIC) {
20752075 unsigned long long dyn;
20762076
20772077 tep_read_number_field(field, a->raw_data, &dyn);