diff options
author | 2018-03-08 15:32:50 -0500 | |
---|---|---|
committer | 2018-03-14 12:32:18 -0400 | |
commit | e9baef0d86162add1205eb07bae08e9efc2f1ae0 (patch) | |
tree | 1b8143cd9d71bfa1bafdc3dec68207db66fda7af /tools/perf/scripts/python/export-to-postgresql.py | |
parent | tracing: Embed replace_filter_string() helper function (diff) | |
download | linux-rng-e9baef0d86162add1205eb07bae08e9efc2f1ae0.tar.xz linux-rng-e9baef0d86162add1205eb07bae08e9efc2f1ae0.zip |
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/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions