From: Andi Kleen <andi@firstfloor.org>
To: jolsa@redhat.com
Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org, acme@infradead.org
Subject: perf: Add support for full Intel event lists v7
Date: Fri, 11 Jul 2014 16:59:14 -0700 [thread overview]
Message-ID: <1405123165-22666-1-git-send-email-andi@firstfloor.org> (raw)
All feedback addressed. Hopefully ready for merge now.
[v2: Review feedback addressed and some minor improvements]
[v3: More review feedback addressed and handle test failures better.
Ported to latest tip/core.]
[v4: Addressed Namhyung's feedback]
[v5: Rebase to latest tree. Minor description update.]
[v6: Rebase. Add acked by from Namhyung and address feedback. Some minor
fixes. Should be good to go now I hope. The period patch was dropped,
as that is already handled. I added an extra patch for a --quiet argument
for perf list]
[v7: Address Jiri's feedback. Various changes and some patches
were split. perf download uses curl now instead of wget.]
perf has high level events which are useful in many cases. However
there are some tuning situations where low level events in the CPU
are needed. Traditionally this required specifying the event in
raw form (very awkward) or using non standard frontends
like ocperf or patching in libpfm.
Intel CPUs can have very large event files (Haswell has ~336 core events,
much more if you add uncore or all the offcore combinations), which is too
large to describe through the kernel interface. It would require tying up
significant amounts of unswappable memory for this.
oprofile always had separate event list files that were maintained by
the CPU vendors. The oprofile events were shipped with the tool.
The Intel events get updated regularly, for example to add references
to the specification updates or add new events.
Unfortunately oprofile usually did not keep up with these updates,
so the events in oprofile were often out of date. In addition
it ties up quite a bit of disk space, mostly for CPUs you don't have.
This patch kit implements another mechanism that avoids these problems.
Intel releases the event lists for CPUs in a standardized JSON format
on a download server.
I implemented an automatic downloader to get the event file for the
current CPU. The events are stored in ~/.cache/pmu-events.
Then perf adds a parser that converts the JSON format into perf event
aliases, which then can be used directly as any other perf event.
The parsing is done using a simple existing JSON library.
The events are still abstracted for perf, but the abstraction mechanism is
through the downloaded file instead of through the kernel.
The JSON format and perf parser has some minor Intelisms, but they
are simple and small and optional. It's easy to extend, so it would be
possible to use it for other CPUs too, add different pmu attributes, and
add new download sites to the downloader tool.
Currently only core events are supported, uncore may come at a later
point. No kernel changes, all code in perf user tools only.
Some of the parser files are partially shared with separate event parser
library and are thus 2-clause BSD licensed.
Patches also available from
git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc perf/json
Example output:
% perf download
Downloading models file
Downloading readme.txt
Downloading events file
% perf list
...
br_inst_exec.all_branches [Speculative and retired
branches]
br_inst_exec.all_conditional [Speculative and retired
macro-conditional
branches]
br_inst_exec.all_direct_jmp [Speculative and retired
macro-unconditional
branches excluding
calls and indirects]
... 333 more new events ...
% perf stat -e br_inst_exec.all_direct_jmp true
Performance counter stats for 'true':
6,817 cpu/br_inst_exec.all_direct_jmp/
0.003503212 seconds time elapsed
One nice feature is that a pointer to the specification update is now
included in the description, which will hopefully clear up many problems:
% perf list
...
mem_load_uops_l3_hit_retired.xsnp_hit [Retired load uops which
data sources were L3
and cross-core snoop
hits in on-pkg core
cache. Supports address
when precise. Spec
update: HSM26, HSM30
(Precise event)]
...
-Andi
next reply other threads:[~2014-07-12 0:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 23:59 Andi Kleen [this message]
2014-07-11 23:59 ` [PATCH 01/11] perf, tools: Add jsmn `jasmine' JSON parser Andi Kleen
2014-07-11 23:59 ` [PATCH 02/11] perf, tools: Add support for text descriptions of events and alias add Andi Kleen
2014-07-11 23:59 ` [PATCH 03/11] perf, tools, list: Update perf list to output descriptions Andi Kleen
2014-07-11 23:59 ` [PATCH 04/11] perf, tools: Allow events with dot Andi Kleen
2014-07-11 23:59 ` [PATCH 05/11] perf, tools: Add support for reading JSON event files Andi Kleen
2014-07-18 5:29 ` Michael Ellerman
2014-07-18 17:40 ` Andi Kleen
2014-07-11 23:59 ` [PATCH 06/11] perf, tools: Automatically look for event file name for cpu Andi Kleen
2014-07-18 6:43 ` Michael Ellerman
2014-07-11 23:59 ` [PATCH 07/11] perf, tools: Add perf download to download event files Andi Kleen
2014-07-18 6:28 ` Michael Ellerman
2014-07-11 23:59 ` [PATCH 08/11] perf, tools: Query terminal width and use in perf list Andi Kleen
2014-07-11 23:59 ` [PATCH 09/11] perf, tools: Add a new pmu interface to iterate over all events Andi Kleen
2014-07-11 23:59 ` [PATCH 10/11] perf, tools, test: Add test case for alias and JSON parsing Andi Kleen
2014-07-12 23:10 ` Jiri Olsa
2014-07-12 23:49 ` Andi Kleen
2014-07-13 20:09 ` Jiri Olsa
2014-07-14 1:44 ` Andi Kleen
2014-07-11 23:59 ` [PATCH 11/11] perf, tools: Add a --no-desc flag to perf list Andi Kleen
2014-07-18 8:57 ` perf: Add support for full Intel event lists v7 Michael Ellerman
-- strict thread matches above, loose matches on Subject: below --
2014-06-27 23:15 Andi Kleen
2014-07-08 18:43 ` Sukadev Bhattiprolu
2014-07-08 19:28 ` Andi Kleen
2014-07-08 21:49 ` Sukadev Bhattiprolu
2014-07-09 22:18 ` Jiri Olsa
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=1405123165-22666-1-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=acme@infradead.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.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
Powered by JetHome