* [PATCH] perf script: Show hw-cache events
@ 2018-06-08 11:02 Seeteena Thoufeek
2018-06-08 16:47 ` Arnaldo Carvalho de Melo
2018-06-14 6:24 ` [tip:perf/urgent] " tip-bot for Seeteena Thoufeek
0 siblings, 2 replies; 3+ messages in thread
From: Seeteena Thoufeek @ 2018-06-08 11:02 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin, jolsa, namhyung,
linux-kernel
Cc: s1seetee
perf script fails to report hardware cache events (PERF_TYPE_HW_CACHE)
where as perf report shows the samples. Fix it. Ex,
# perf record -e L1-dcache-loads ./a.out
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.008 MB perf.data (11 samples)]
Before patch:
# perf script | wc -l
0
After patch:
# perf script | wc -l
11
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
---
tools/perf/builtin-script.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index cefc881..9e94bb7 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -180,6 +180,18 @@ enum {
PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE
},
+ [PERF_TYPE_HW_CACHE] = {
+ .user_set = false,
+
+ .fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
+ PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
+ PERF_OUTPUT_EVNAME | PERF_OUTPUT_IP |
+ PERF_OUTPUT_SYM | PERF_OUTPUT_SYMOFFSET |
+ PERF_OUTPUT_DSO | PERF_OUTPUT_PERIOD,
+
+ .invalid_fields = PERF_OUTPUT_TRACE | PERF_OUTPUT_BPF_OUTPUT,
+ },
+
[PERF_TYPE_RAW] = {
.user_set = false,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf script: Show hw-cache events
2018-06-08 11:02 [PATCH] perf script: Show hw-cache events Seeteena Thoufeek
@ 2018-06-08 16:47 ` Arnaldo Carvalho de Melo
2018-06-14 6:24 ` [tip:perf/urgent] " tip-bot for Seeteena Thoufeek
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-06-08 16:47 UTC (permalink / raw)
To: Seeteena Thoufeek
Cc: peterz, mingo, alexander.shishkin, jolsa, namhyung, linux-kernel
Em Fri, Jun 08, 2018 at 04:32:28PM +0530, Seeteena Thoufeek escreveu:
> perf script fails to report hardware cache events (PERF_TYPE_HW_CACHE)
> where as perf report shows the samples. Fix it. Ex,
>
> # perf record -e L1-dcache-loads ./a.out
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.008 MB perf.data (11 samples)]
>
> Before patch:
> # perf script | wc -l
> 0
> After patch:
> # perf script | wc -l
> 11
Thanks, tested and applied.
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:perf/urgent] perf script: Show hw-cache events
2018-06-08 11:02 [PATCH] perf script: Show hw-cache events Seeteena Thoufeek
2018-06-08 16:47 ` Arnaldo Carvalho de Melo
@ 2018-06-14 6:24 ` tip-bot for Seeteena Thoufeek
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Seeteena Thoufeek @ 2018-06-14 6:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: hpa, peterz, namhyung, tglx, mingo, jolsa, linux-kernel, s1seetee,
alexander.shishkin, acme
Commit-ID: fad76d4333fe73cf3f73704aa34d4ce523b1c458
Gitweb: https://git.kernel.org/tip/fad76d4333fe73cf3f73704aa34d4ce523b1c458
Author: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
AuthorDate: Fri, 8 Jun 2018 16:32:28 +0530
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jun 2018 13:41:30 -0300
perf script: Show hw-cache events
'perf script' fails to report hardware cache events (PERF_TYPE_HW_CACHE)
where as 'perf report' shows the samples. Fix it. Ex,
# perf record -e L1-dcache-loads ./a.out
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.008 MB perf.data (11 samples)]
Before patch:
# perf script | wc -l
0
After patch:
# perf script | wc -l
11
Committer testing:
[root@jouet ~]# perf script | head -30 | tail
Timer 9803 [2] 8.963330: 1554 L1-dcache-loads: 7ffef89baae4 __vdso_clock_gettime+0xf4 ([vdso])
swapper 0 [2] 8.963343: 5626 L1-dcache-loads: ffffffffa66f4f6b cpuidle_not_av+0xb (/lib/modules/4.17.0-rc5/build/vmlinux)
firefox 4853 [2] 8.964070: 18935 L1-dcache-loads: 7f0b9a00dc30 xcb_poll_for_event+0x0 (/usr/lib64/libxcb.so.1.1.0)
Softwar~cTh 4928 [2] 8.964548: 15928 L1-dcache-loads: ffffffffa60d795c update_curr+0x10c (/lib/modules/4.17.0-rc5/build/vmlinux)
firefox 4853 [2] 8.964675: 14978 L1-dcache-loads: ffffffffa6897018 mutex_unlock+0x18 (/lib/modules/4.17.0-rc5/build/vmlinux)
gnome-shell 2026 [3] 8.964693: 50670 L1-dcache-loads: 7fa08854de6d g_source_iter_next+0x6d (/usr/lib64/libglib-2.0.so.0.5400.3)
Compositor 4929 [1] 8.964784: 71772 L1-dcache-loads: 7f0b936bf078 [unknown] (/usr/lib64/firefox/libxul.so)
Xwayland 2096 [2] 8.964919: 16799 L1-dcache-loads: 7f68ce2fcb8a glXGetCurrentContext+0x1a (/usr/lib64/libGLX.so.0.0.0)
gnome-shell 2026 [3] 8.964997: 50670 L1-dcache-loads: 7fa08854de6d g_source_iter_next+0x6d (/usr/lib64/libglib-2.0.so.0.5400.3)
[root@jouet ~]#
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1528455748-20087-1-git-send-email-s1seetee@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-script.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index b3bf35512d21..a31d7082188e 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -180,6 +180,18 @@ static struct {
PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE
},
+ [PERF_TYPE_HW_CACHE] = {
+ .user_set = false,
+
+ .fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
+ PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
+ PERF_OUTPUT_EVNAME | PERF_OUTPUT_IP |
+ PERF_OUTPUT_SYM | PERF_OUTPUT_SYMOFFSET |
+ PERF_OUTPUT_DSO | PERF_OUTPUT_PERIOD,
+
+ .invalid_fields = PERF_OUTPUT_TRACE | PERF_OUTPUT_BPF_OUTPUT,
+ },
+
[PERF_TYPE_RAW] = {
.user_set = false,
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-14 6:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-08 11:02 [PATCH] perf script: Show hw-cache events Seeteena Thoufeek
2018-06-08 16:47 ` Arnaldo Carvalho de Melo
2018-06-14 6:24 ` [tip:perf/urgent] " tip-bot for Seeteena Thoufeek
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.