lkml.org 
[lkml]   [2022]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next 4/5] perf: Remove unused macros __PERF_EVENT_FIELD
Em Mon, Sep 26, 2022 at 11:14:39AM +0800, Chen Zhongjin escreveu:
> Unused macros reported by [-Wunused-macros].
>
> This macros were introduced as __PERF_COUNTER_FIELD and used for
> reading the bit in config.
>
> 'cdd6c482c9ff ("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.

Thanks, applied.

- Arnaldo


> Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
> ---
> tools/perf/util/parse-events.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index f05e15acd33f..3ed914882b96 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -149,14 +149,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)
> -
> const char *event_type(int type)
> {
> switch (type) {
> --
> 2.17.1

--

- Arnaldo

\
 
 \ /
  Last update: 2022-09-26 21:49    [W:1.849 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site