perf parse-events: Remove unused macros __PERF_EVENT_FIELD()
authorChen Zhongjin <chenzhongjin@huawei.com>
Tue, 4 Oct 2022 11:59:25 +0000 (08:59 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 6 Oct 2022 11:03:52 +0000 (08:03 -0300)
Unused macros reported by [-Wunused-macros].

This macros were introduced as __PERF_COUNTER_FIELD and used for reading
the bit in config.

cdd6c482c9ff9c55 ("perf: Do the big rename: Performance Counters ->
Performance Events") Changes it to __PERF_EVENT_FIELD but at this commit
there is already nowhere else using these macros, also no macros called
PERF_EVENT_##name##_MASK/SHIFT.

Now we are not reading type or id from config. These macros are useless
and incomplete.

So removing them for code cleaning.

Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Florian Fischer <florian.fischer@muhq.space>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20220926031440.28275-5-chenzhongjin@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.c

index f3b2c2a..437389d 100644 (file)
@@ -150,14 +150,6 @@ struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = {
        },
 };
 
-#define __PERF_EVENT_FIELD(config, name) \
-       ((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT)
-
-#define PERF_EVENT_RAW(config)         __PERF_EVENT_FIELD(config, RAW)
-#define PERF_EVENT_CONFIG(config)      __PERF_EVENT_FIELD(config, CONFIG)
-#define PERF_EVENT_TYPE(config)                __PERF_EVENT_FIELD(config, TYPE)
-#define PERF_EVENT_ID(config)          __PERF_EVENT_FIELD(config, EVENT)
-
 bool is_event_supported(u8 type, u64 config)
 {
        bool ret = true;