diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-03-08 15:32:50 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-03-14 12:32:18 -0400 |
commit | e9baef0d86162add1205eb07bae08e9efc2f1ae0 (patch) | |
tree | 1b8143cd9d71bfa1bafdc3dec68207db66fda7af /tools/perf/scripts/python/call-graph-from-sql.py | |
parent | 567f6989fd2ac1078d6908fe1bb45932bbeb1b00 (diff) |
tracing: Combine enum and arrays into single macro in filter code
Instead of having a separate enum that is the index into another array, like
a string array, make a single macro that combines them into a single list,
and then the two can not get out of sync. This makes it easier to add and
remove items.
The macro trick is:
#define DOGS \
C( JACK, "Jack Russell") \
C( ITALIAN, "Italian Greyhound") \
C( GERMAN, "German Shepherd")
#undef C
#define C(a, b) a
enum { DOGS };
#undef C
#define C(a, b) b
static char dogs[] = { DOGS };
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-sql.py')
0 files changed, 0 insertions, 0 deletions