* Port the period data column to centos6.7 for perf script
@ 2017-09-15 2:37 yuzhoujian
0 siblings, 0 replies; 3+ messages in thread
From: yuzhoujian @ 2017-09-15 2:37 UTC (permalink / raw)
To: yuzhoujian; +Cc: linux-perf-users, linux-kernel
Hi, all.
I want to draw off-cpu flamegraph using perf script on centos6.7
(kernel version, 2.6.32-573), and I found perf script lacks the
period data column on that version. I found two related patches,
and modifed builin-script.c in reference to those patches.
perf script:Add period data column authorJiri Olsa 2014-08-25 16:45:42 +0200
commit535aeaae7de821ba5d43ee2a204ee667ca95aae4
perf script: Add period as a default output column
commite8564b710c6df2c3aeb56c507c22f4bcfa4c0b2d)
I used the new complied perf to record some hardware event, like cycles,
and the result displays the period data column. But when I record some
tracepoint events, like sched:sched_stat_sleep, sched:sched_switch, I
found the period data column is always 1. I checked the code(kernel/event/core.c),
and found that the data->period is assigned nr in the function named perf_swevent_event.
I tracked this function, and found the function call flow:
perf_trace_buf_submit--->perf_tp_event---->perf_swevent_event.
The function perf_trace_buf_submit is in the ftrace_event.h files, so the period data
column for tracepoint events is calulated in the frace subsystem? What is the real
meaning of the period field and how to calculate it ? Can you give me some tips for
poring this field on the old kernel?
Thanks,
Wind Yu.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Port the period data column to centos6.7 for perf script
[not found] <CAHCio2j0TO0dQtr1Dk+v0=k_1pzwzqhZCJBkUTHCKqFgNGdoBg@mail.gmail.com>
@ 2017-09-15 4:21 ` Andi Kleen
2017-09-15 10:16 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2017-09-15 4:21 UTC (permalink / raw)
To: 禹舟键
Cc: peterz, mingo, alexander.shishkin, jolsa, David Ahern, namhyung,
Wind Yu, Milian Wolff, sj38.park, tardyp, linux-perf-users,
linux-kernel, acme
On Fri, Sep 15, 2017 at 10:24:15AM +0800, 禹舟键 wrote:
> Hi, all.
> I want to draw off-cpu flamegraph using perf script on centos6.7(kernel
> version, 2.6.32-573), and I found perf script lacks the period data column
> on that version. IÂ found two related patches, and modifed
> builin-script.c in reference to those patches.
> perf script:Add period data column authorJiri Olsa 2014-08-25 16:45:42
> +0200 commit535aeaae7de821ba5d43ee2a204ee667ca95aae4
> perf script: Add period as a default output column
> commite8564b710c6df2c3aeb56c507c22f4bcfa4c0b2d)
>
I would just compile the newer perf binary for Centos6 and use that. It should
work with older kernels too. That's much easier than backporting, and you get
many more features.
-Andi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Port the period data column to centos6.7 for perf script
2017-09-15 4:21 ` Port the period data column to centos6.7 for perf script Andi Kleen
@ 2017-09-15 10:16 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-09-15 10:16 UTC (permalink / raw)
To: 禹舟键
Cc: Andi Kleen, peterz, mingo, alexander.shishkin, jolsa, David Ahern,
namhyung, Wind Yu, Milian Wolff, sj38.park, tardyp,
linux-perf-users, linux-kernel
Em Thu, Sep 14, 2017 at 09:21:54PM -0700, Andi Kleen escreveu:
> On Fri, Sep 15, 2017 at 10:24:15AM +0800, 禹舟键 wrote:
> > Hi, all.
> > I want to draw off-cpu flamegraph using perf script on centos6.7(kernel
> > version, 2.6.32-573), and I found perf script lacks the period data column
> > on that version. IÂ found two related patches, and modifed
> > builin-script.c in reference to those patches.
> > perf script:Add period data column authorJiri Olsa 2014-08-25 16:45:42
> > +0200 commit535aeaae7de821ba5d43ee2a204ee667ca95aae4
> > perf script: Add period as a default output column
> > commite8564b710c6df2c3aeb56c507c22f4bcfa4c0b2d)
> I would just compile the newer perf binary for Centos6 and use that. It should
> work with older kernels too. That's much easier than backporting, and you get
> many more features.
yeah, look at the Dockerfile I use to build it for that OS:
[acme@jouet 6]$ cat Dockerfile
# docker.io/acmel/linux-perf-tools-build-centos:6
FROM docker.io/centos:6
MAINTAINER Arnaldo Carvalho de Melo <acme@kernel.org>
RUN yum -y update && \
yum -y install make gcc flex bison bc elfutils-libelf-devel elfutils-devel \
libunwind-devel audit-libs-devel openssl-devel slang-devel \
gtk2-devel perl-ExtUtils-Embed python-devel binutils-devel \
systemtap-sdt-devel xz-devel numactl-devel && \
yum -y clean all && \
rm -rf /usr/share/doc /usr/share/gtk-doc /usr/share/man && \
mkdir -m 777 -p /tmp/build/perf /tmp/build/objtool && \
groupadd -r perfbuilder && \
useradd -m -r -g perfbuilder perfbuilder
USER perfbuilder
ENTRYPOINT make -C /git/linux/tools/perf O=/tmp/build/perf && \
rm -rf /tmp/build/perf/{.[^.]*,*} && \
make NO_LIBELF=1 -C /git/linux/tools/perf O=/tmp/build/perf && \
make -C /git/linux/tools/objtool O=/tmp/build/objtool
[acme@jouet 6]$
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-15 10:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHCio2j0TO0dQtr1Dk+v0=k_1pzwzqhZCJBkUTHCKqFgNGdoBg@mail.gmail.com>
2017-09-15 4:21 ` Port the period data column to centos6.7 for perf script Andi Kleen
2017-09-15 10:16 ` Arnaldo Carvalho de Melo
2017-09-15 2:37 yuzhoujian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).