From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2 -tip] perf_counter: parse-events.c define separate declarations for H/W and S/W events
Date: Mon, 22 Jun 2009 16:43:14 +0530 [thread overview]
Message-ID: <1245669194.17153.6.camel@localhost.localdomain> (raw)
Define separate declarations for H/W and S/W events to :
1. shorten name to save some space so that we can add more members
2. Fix alignment
3. Avoid declaring HARDWARE/SOFTWARE again and again.
Removed unused CR(x, y)
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
tools/perf/util/parse-events.c | 42 ++++++++++++++++++++--------------------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 35d04da..12abab3 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -18,30 +18,30 @@ struct event_symbol {
char *symbol;
};
-#define C(x, y) .type = PERF_TYPE_##x, .config = PERF_COUNT_##y
-#define CR(x, y) .type = PERF_TYPE_##x, .config = y
+#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
+#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
static struct event_symbol event_symbols[] = {
- { C(HARDWARE, HW_CPU_CYCLES), "cpu-cycles", },
- { C(HARDWARE, HW_CPU_CYCLES), "cycles", },
- { C(HARDWARE, HW_INSTRUCTIONS), "instructions", },
- { C(HARDWARE, HW_CACHE_REFERENCES), "cache-references", },
- { C(HARDWARE, HW_CACHE_MISSES), "cache-misses", },
- { C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branch-instructions", },
- { C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branches", },
- { C(HARDWARE, HW_BRANCH_MISSES), "branch-misses", },
- { C(HARDWARE, HW_BUS_CYCLES), "bus-cycles", },
-
- { C(SOFTWARE, SW_CPU_CLOCK), "cpu-clock", },
- { C(SOFTWARE, SW_TASK_CLOCK), "task-clock", },
- { C(SOFTWARE, SW_PAGE_FAULTS), "page-faults", },
- { C(SOFTWARE, SW_PAGE_FAULTS), "faults", },
- { C(SOFTWARE, SW_PAGE_FAULTS_MIN), "minor-faults", },
- { C(SOFTWARE, SW_PAGE_FAULTS_MAJ), "major-faults", },
- { C(SOFTWARE, SW_CONTEXT_SWITCHES), "context-switches", },
- { C(SOFTWARE, SW_CONTEXT_SWITCHES), "cs", },
- { C(SOFTWARE, SW_CPU_MIGRATIONS), "cpu-migrations", },
- { C(SOFTWARE, SW_CPU_MIGRATIONS), "migrations", },
+ { CHW(CPU_CYCLES), "cpu-cycles", },
+ { CHW(CPU_CYCLES), "cycles", },
+ { CHW(INSTRUCTIONS), "instructions", },
+ { CHW(CACHE_REFERENCES), "cache-references", },
+ { CHW(CACHE_MISSES), "cache-misses", },
+ { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", },
+ { CHW(BRANCH_INSTRUCTIONS), "branches", },
+ { CHW(BRANCH_MISSES), "branch-misses", },
+ { CHW(BUS_CYCLES), "bus-cycles", },
+
+ { CSW(CPU_CLOCK), "cpu-clock", },
+ { CSW(TASK_CLOCK), "task-clock", },
+ { CSW(PAGE_FAULTS), "page-faults", },
+ { CSW(PAGE_FAULTS), "faults", },
+ { CSW(PAGE_FAULTS_MIN), "minor-faults", },
+ { CSW(PAGE_FAULTS_MAJ), "major-faults", },
+ { CSW(CONTEXT_SWITCHES), "context-switches", },
+ { CSW(CONTEXT_SWITCHES), "cs", },
+ { CSW(CPU_MIGRATIONS), "cpu-migrations", },
+ { CSW(CPU_MIGRATIONS), "migrations", },
};
#define __PERF_COUNTER_FIELD(config, name) \
--
1.6.0.6
next reply other threads:[~2009-06-22 11:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-22 11:13 Jaswinder Singh Rajput [this message]
2009-06-22 11:14 ` [PATCH 2/2 -tip] perf_counter: parse-events.c introduce alias member in event_symbol Jaswinder Singh Rajput
2009-06-22 11:32 ` Ingo Molnar
2009-06-22 13:00 ` Jaswinder Singh Rajput
2009-06-22 13:23 ` Jaswinder Singh Rajput
2009-06-22 14:10 ` Ingo Molnar
2009-06-22 19:55 ` Jaswinder Singh Rajput
2009-06-22 20:07 ` Jaswinder Singh Rajput
2009-06-23 8:27 ` Ingo Molnar
2009-06-23 8:24 ` Ingo Molnar
2009-06-23 14:02 ` Jaswinder Singh Rajput
2009-06-24 8:48 ` Ingo Molnar
2009-06-22 11:38 ` [tip:perfcounters/urgent] perf_counter tools: Introduce " tip-bot for Jaswinder Singh Rajput
2009-06-22 11:38 ` [tip:perfcounters/urgent] perf_counter tools: Define separate declarations for H/W and S/W events tip-bot for Jaswinder Singh Rajput
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=1245669194.17153.6.camel@localhost.localdomain \
--to=jaswinder@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.