perf evsel: Enable type checking for perf_evsel_config_term types
authorAndi Kleen <[email protected]>
Fri, 20 Oct 2017 20:27:54 +0000 (13:27 -0700)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 16 Nov 2017 17:49:51 +0000 (14:49 -0300)
commitd0565132605f454179699a1b8a3276fc0f8cc87b
tree589c4a7c13975a40b66d91604dd39cf796fa68d9
parentc2f1cead19b628d7a23d2cfc43e444af669f9eab
perf evsel: Enable type checking for perf_evsel_config_term types

Use a typed enum for the perf_evsel_config_term type enum.  This allows
gcc to do much stronger type checks, and also check for missing case
statements.

I removed the unused _MAX member from the number.

It found one missing case. I'm not sure it's a real problem, so I just
turned it into a BUG_ON for now.

Signed-off-by: Andi Kleen <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ Renamed the enum name to term_type as per jolsa's request ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/evsel.c
tools/perf/util/evsel.h