From: Chen Zhongjin <chenzhongjin@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-perf-users@vger.kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
<jolsa@kernel.org>, <namhyung@kernel.org>, <irogers@google.com>,
<john.garry@huawei.com>, <adrian.hunter@intel.com>,
<ak@linux.intel.com>, <florian.fischer@muhq.space>,
<chenzhongjin@huawei.com>
Subject: [PATCH -next 4/5] perf: Remove unused macros __PERF_EVENT_FIELD
Date: Mon, 26 Sep 2022 11:14:39 +0800 [thread overview]
Message-ID: <20220926031440.28275-5-chenzhongjin@huawei.com> (raw)
In-Reply-To: <20220926031440.28275-1-chenzhongjin@huawei.com>
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.
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
next prev parent reply other threads:[~2022-09-26 3:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 3:14 [PATCH -next 0/5] perf: Minor fixes and cleanup Chen Zhongjin
2022-09-26 3:14 ` [PATCH -next 1/5] perf: Fix show_arg_names not working for tp arg names Chen Zhongjin
2022-09-26 19:50 ` Arnaldo Carvalho de Melo
2022-09-26 3:14 ` [PATCH -next 2/5] perf: Fix incorrectly parsed flags in filter Chen Zhongjin
2022-09-26 19:51 ` Arnaldo Carvalho de Melo
2022-09-26 3:14 ` [PATCH -next 3/5] perf: Remove duplicate errbuf Chen Zhongjin
2022-09-26 19:54 ` Arnaldo Carvalho de Melo
2022-09-27 1:20 ` Chen Zhongjin
2022-09-26 3:14 ` Chen Zhongjin [this message]
2022-09-26 19:48 ` [PATCH -next 4/5] perf: Remove unused macros __PERF_EVENT_FIELD Arnaldo Carvalho de Melo
2022-09-26 3:14 ` [PATCH -next 5/5] perf: Remove unused macro K Chen Zhongjin
2022-09-26 19:47 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220926031440.28275-5-chenzhongjin@huawei.com \
--to=chenzhongjin@huawei.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=florian.fischer@muhq.space \
--cc=irogers@google.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®