* Re: perf tools miscellaneous questions
[not found] ` <fa.AGo9lmnVDcmFVUpOFG/kfd1aYfI@ifi.uio.no>
@ 2010-11-04 8:34 ` Francis Moreau
0 siblings, 0 replies; 16+ messages in thread
From: Francis Moreau @ 2010-11-04 8:34 UTC (permalink / raw)
To: Reid Kleckner
Cc: Frederic Weisbecker, linux-kernel, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Stephane Eranian, linux-perf-users
Reid Kleckner <reid.kleckner@gmail.com> writes:
> On Wed, Nov 3, 2010 at 5:43 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote:
>>> What's exactly the 'cache-misses' event ? does it include both instructions
>>> _and_ data cache misses ? both L1 and L2 caches ?
>>>
>
>>> I was expecting so but the following command makes me wondering:
>>>
>>> $ perf stat -e cache-misses:u,l1d-loads-misses:u true
>>> Performance counter stats for 'true':
>>>
>>> 763 cache-misses
>>> 874 L1-dcache-load-misses
>>>
>>> 0.000916609 seconds time elapsed
>>>
>>> Here cache-misses < L1-dcache-load-misses.
>>
>>
>>
>> Dunno, will let others answer.
>
> I think it corresponds to last level cache misses, which makes sense
> here. The difference in the two numbers represents hits to L2 (and L3
> if it exists).
How could I know the number of cache level on my cpu ?
I tried:
$ perf stat -e cache-misses:u,l1d-loads-misses:u true
Performance counter stats for 'true':
802 cache-misses
937 L1-dcache-load-misses
0.000996578 seconds time elapsed
$ perf stat -e cache-misses:u,L2-loads-misses:u true
Performance counter stats for 'true':
788 cache-misses
95 LLC-load-misses
0.001025423 seconds time elapsed
So it looks like you're right: in my case I have this cache
configuration:
--
Francis
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: perf tools miscellaneous questions
[not found] ` <fa.13KEqWk+Dk+jLLdFlAoZtQ2Vjuw@ifi.uio.no>
[not found] ` <fa.AGo9lmnVDcmFVUpOFG/kfd1aYfI@ifi.uio.no>
@ 2010-11-04 8:52 ` Francis Moreau
2010-11-07 21:40 ` Frederic Weisbecker
1 sibling, 1 reply; 16+ messages in thread
From: Francis Moreau @ 2010-11-04 8:52 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: linux-kernel, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Stephane Eranian, linux-perf-users
Frederic Weisbecker <fweisbec@gmail.com> writes:
> On Wed, Nov 03, 2010 at 08:28:59PM +0100, Francis Moreau wrote:
>> Hello,
>>
>> I'm trying to use perf-tools and also to learn some internals about
>> them. So I prefer to ask all of them in one email.
>>
>> The first one is about the list of pre-defined events given by
>> perf-list. I couldn't find any documentations that describes these
>> events so excuse me if the question is stupid.
>
>
>
> Sorry about that. We indeed need to improve a lot the documentation.
> May be this particular part could come with the future sysfs exposure
> of the events.
>
No problem, but yes this part should be documented somewhere. And I
think the syntax of event too, specially the modifier like 'u' or 'p'.
>>
>> What's the difference between 'cpu-clock' and 'task-clock' event ?
>
>
> cpu-clock is based on the total time spent on the cpu. task-clock is
> based only on the time spent on the profiled task, so that doesn't count
> time spent on other tasks, it has a per thread granularity.
Ok, so 'cpu-clock' could have been named 'proc-clock' even though a task
is a processus on Linux.
[...]
>> The last question is about the source code annotation done by
>> perf-report. I'm using it to locate the place in my code that generates
>> the most data cache miss events. I can read this during a perf-report
>> session:
>>
>> [...]
>> 0.00 : df215: c3 retq
>> 0.00 : df216: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
>> 0.00 : df21d: 00 00 00
>> 10.00 : df220: 48 8b 75 00 mov 0x0(%rbp),%rsi
>> 80.00 : df224: 48 89 df mov %rbx,%rdi
>> 0.00 : df227: 41 ff d4 callq *%r12
>> 0.00 : df22a: 85 c0 test %eax,%eax
>> [...]
>>
>> If I read the output correctly, most of the dcache misses are coming from
>> 'mov %rbx, %rdi', and AFAIK this intruction can't generate any dcache
>> miss. What am I missing ?
>
>
> Perhaps you need pebs to get the very precise location on your event.
>
> perf stat -e cache-misses:up,l1d-loads-misses:up true
>
>
> I think the more you add 'p', the more precise it is.
> Like:
>
> perf stat -e cache-misses:uppp,l1d-loads-misses:uppp true
>
> Not sure how much it will accept though :)
Well it doesn't want one actually:
$ perf stat -v -e cache-misses:up true
Error: counter 0, sys_perf_event_open() syscall returned with -1 (No
space left on device)
No permission to collect stats.
Consider tweaking /proc/sys/kernel/perf_event_paranoid.
Where can I find a description of PEB ?
Thanks
--
Francis
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: perf tools miscellaneous questions
2010-11-04 8:52 ` Francis Moreau
@ 2010-11-07 21:40 ` Frederic Weisbecker
2010-11-09 11:07 ` Francis Moreau
0 siblings, 1 reply; 16+ messages in thread
From: Frederic Weisbecker @ 2010-11-07 21:40 UTC (permalink / raw)
To: Francis Moreau
Cc: linux-kernel, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Stephane Eranian, linux-perf-users
On Thu, Nov 04, 2010 at 09:52:09AM +0100, Francis Moreau wrote:
> Frederic Weisbecker <fweisbec@gmail.com> writes:
>
> > On Wed, Nov 03, 2010 at 08:28:59PM +0100, Francis Moreau wrote:
> >> Hello,
> >>
> >> I'm trying to use perf-tools and also to learn some internals about
> >> them. So I prefer to ask all of them in one email.
> >>
> >> The first one is about the list of pre-defined events given by
> >> perf-list. I couldn't find any documentations that describes these
> >> events so excuse me if the question is stupid.
> >
> >
> >
> > Sorry about that. We indeed need to improve a lot the documentation.
> > May be this particular part could come with the future sysfs exposure
> > of the events.
> >
>
> No problem, but yes this part should be documented somewhere. And I
> think the syntax of event too, specially the modifier like 'u' or 'p'.
Ah that is documented in "man perf-list".
>
> >>
> >> What's the difference between 'cpu-clock' and 'task-clock' event ?
> >
> >
> > cpu-clock is based on the total time spent on the cpu. task-clock is
> > based only on the time spent on the profiled task, so that doesn't count
> > time spent on other tasks, it has a per thread granularity.
>
> Ok, so 'cpu-clock' could have been named 'proc-clock' even though a task
> is a processus on Linux.
Well, this is a matter of opinion probably, I think cpu-clock defines
better its role.
>
> [...]
>
> >> The last question is about the source code annotation done by
> >> perf-report. I'm using it to locate the place in my code that generates
> >> the most data cache miss events. I can read this during a perf-report
> >> session:
> >>
> >> [...]
> >> 0.00 : df215: c3 retq
> >> 0.00 : df216: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
> >> 0.00 : df21d: 00 00 00
> >> 10.00 : df220: 48 8b 75 00 mov 0x0(%rbp),%rsi
> >> 80.00 : df224: 48 89 df mov %rbx,%rdi
> >> 0.00 : df227: 41 ff d4 callq *%r12
> >> 0.00 : df22a: 85 c0 test %eax,%eax
> >> [...]
> >>
> >> If I read the output correctly, most of the dcache misses are coming from
> >> 'mov %rbx, %rdi', and AFAIK this intruction can't generate any dcache
> >> miss. What am I missing ?
> >
> >
> > Perhaps you need pebs to get the very precise location on your event.
> >
> > perf stat -e cache-misses:up,l1d-loads-misses:up true
> >
> >
> > I think the more you add 'p', the more precise it is.
> > Like:
> >
> > perf stat -e cache-misses:uppp,l1d-loads-misses:uppp true
> >
> > Not sure how much it will accept though :)
>
> Well it doesn't want one actually:
>
> $ perf stat -v -e cache-misses:up true
> Error: counter 0, sys_perf_event_open() syscall returned with -1 (No
> space left on device)
> No permission to collect stats.
> Consider tweaking /proc/sys/kernel/perf_event_paranoid.
>
> Where can I find a description of PEB ?
I have the same problem. But running perf record with this :p
works for me. Which is what we want: pebs is useful for sampling,
not counting-only.
Ah and that won't work if you don't run some intel CPU I think.
Check you have PEBS support in /proc/cpuinfo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: perf tools miscellaneous questions
2010-11-07 21:40 ` Frederic Weisbecker
@ 2010-11-09 11:07 ` Francis Moreau
0 siblings, 0 replies; 16+ messages in thread
From: Francis Moreau @ 2010-11-09 11:07 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: linux-kernel, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Stephane Eranian, linux-perf-users
Frederic Weisbecker <fweisbec@gmail.com> writes:
> On Thu, Nov 04, 2010 at 09:52:09AM +0100, Francis Moreau wrote:
[...]
>>
>> No problem, but yes this part should be documented somewhere. And I
>> think the syntax of event too, specially the modifier like 'u' or 'p'.
>
> Ah that is documented in "man perf-list".
Ok, after updating my 3 weeks old kernel, modifiers are now documented.
But I failed to generate it:
XMLTO perf-record.1
xmlto: /home/fmoreau/linux-2.6/tools/perf/Documentation/perf-record.xml does not validate (status 3)
BTW, what does 'skid' mean ? s(?) k(?) instruction delay ?
[...]
> I have the same problem. But running perf record with this :p works
> for me. Which is what we want: pebs is useful for sampling, not
> counting-only.
That makes sense but I still have a problem:
$ perf record -e cache-misses:p -p $(pgrep test)
Error: perfcounter syscall returned with -1 (No space left on device)
Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?
> Ah and that won't work if you don't run some intel CPU I think. Check
> you have PEBS support in /proc/cpuinfo
It seems so:
$ grep -qi pebs /proc/cpuinfo && echo pebs
pebs
Thanks
--
Francis
^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <fa.SSgtQesEhEQa5DUYUwBV3fWtoV4@ifi.uio.no>]
[parent not found: <fa.eqFHAk86WhpTuYclHhngn7QZr8Y@ifi.uio.no>]
[parent not found: <fa.AyvjD8RxwvZsnL5ZXcZ+OzALKY8@ifi.uio.no>]
* perf tools miscellaneous questions
@ 2010-11-03 19:28 Francis Moreau
2010-11-03 21:43 ` Frederic Weisbecker
0 siblings, 1 reply; 16+ messages in thread
From: Francis Moreau @ 2010-11-03 19:28 UTC (permalink / raw)
To: linux-kernel
Hello,
I'm trying to use perf-tools and also to learn some internals about
them. So I prefer to ask all of them in one email.
The first one is about the list of pre-defined events given by
perf-list. I couldn't find any documentations that describes these
events so excuse me if the question is stupid.
What's the difference between 'cpu-clock' and 'task-clock' event ?
What's exactly the 'cache-misses' event ? does it include both instructions
_and_ data cache misses ? both L1 and L2 caches ?
I was expecting so but the following command makes me wondering:
$ perf stat -e cache-misses:u,l1d-loads-misses:u true
Performance counter stats for 'true':
763 cache-misses
874 L1-dcache-load-misses
0.000916609 seconds time elapsed
Here cache-misses < L1-dcache-load-misses.
The last question is about the source code annotation done by
perf-report. I'm using it to locate the place in my code that generates
the most data cache miss events. I can read this during a perf-report
session:
[...]
0.00 : df215: c3 retq
0.00 : df216: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
0.00 : df21d: 00 00 00
10.00 : df220: 48 8b 75 00 mov 0x0(%rbp),%rsi
80.00 : df224: 48 89 df mov %rbx,%rdi
0.00 : df227: 41 ff d4 callq *%r12
0.00 : df22a: 85 c0 test %eax,%eax
[...]
If I read the output correctly, most of the dcache misses are coming from
'mov %rbx, %rdi', and AFAIK this intruction can't generate any dcache
miss. What am I missing ?
Thanks.
--
Francis
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: perf tools miscellaneous questions
2010-11-03 19:28 Francis Moreau
@ 2010-11-03 21:43 ` Frederic Weisbecker
2010-11-03 22:15 ` Reid Kleckner
0 siblings, 1 reply; 16+ messages in thread
From: Frederic Weisbecker @ 2010-11-03 21:43 UTC (permalink / raw)
To: Francis Moreau
Cc: linux-kernel, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Stephane Eranian, linux-perf-users
On Wed, Nov 03, 2010 at 08:28:59PM +0100, Francis Moreau wrote:
> Hello,
>
> I'm trying to use perf-tools and also to learn some internals about
> them. So I prefer to ask all of them in one email.
>
> The first one is about the list of pre-defined events given by
> perf-list. I couldn't find any documentations that describes these
> events so excuse me if the question is stupid.
Sorry about that. We indeed need to improve a lot the documentation.
May be this particular part could come with the future sysfs exposure
of the events.
>
> What's the difference between 'cpu-clock' and 'task-clock' event ?
cpu-clock is based on the total time spent on the cpu. task-clock is
based only on the time spent on the profiled task, so that doesn't count
time spent on other tasks, it has a per thread granularity.
(I might be somehow wrong in my explanation).
>
> What's exactly the 'cache-misses' event ? does it include both instructions
> _and_ data cache misses ? both L1 and L2 caches ?
>
> I was expecting so but the following command makes me wondering:
>
> $ perf stat -e cache-misses:u,l1d-loads-misses:u true
> Performance counter stats for 'true':
>
> 763 cache-misses
> 874 L1-dcache-load-misses
>
> 0.000916609 seconds time elapsed
>
> Here cache-misses < L1-dcache-load-misses.
Dunno, will let others answer.
> The last question is about the source code annotation done by
> perf-report. I'm using it to locate the place in my code that generates
> the most data cache miss events. I can read this during a perf-report
> session:
>
> [...]
> 0.00 : df215: c3 retq
> 0.00 : df216: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
> 0.00 : df21d: 00 00 00
> 10.00 : df220: 48 8b 75 00 mov 0x0(%rbp),%rsi
> 80.00 : df224: 48 89 df mov %rbx,%rdi
> 0.00 : df227: 41 ff d4 callq *%r12
> 0.00 : df22a: 85 c0 test %eax,%eax
> [...]
>
> If I read the output correctly, most of the dcache misses are coming from
> 'mov %rbx, %rdi', and AFAIK this intruction can't generate any dcache
> miss. What am I missing ?
Perhaps you need pebs to get the very precise location on your event.
perf stat -e cache-misses:up,l1d-loads-misses:up true
I think the more you add 'p', the more precise it is.
Like:
perf stat -e cache-misses:uppp,l1d-loads-misses:uppp true
Not sure how much it will accept though :)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: perf tools miscellaneous questions
2010-11-03 21:43 ` Frederic Weisbecker
@ 2010-11-03 22:15 ` Reid Kleckner
0 siblings, 0 replies; 16+ messages in thread
From: Reid Kleckner @ 2010-11-03 22:15 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Francis Moreau, linux-kernel, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Stephane Eranian, linux-perf-users
On Wed, Nov 3, 2010 at 5:43 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote:
>> What's exactly the 'cache-misses' event ? does it include both instructions
>> _and_ data cache misses ? both L1 and L2 caches ?
>>
>> I was expecting so but the following command makes me wondering:
>>
>> $ perf stat -e cache-misses:u,l1d-loads-misses:u true
>> Performance counter stats for 'true':
>>
>> 763 cache-misses
>> 874 L1-dcache-load-misses
>>
>> 0.000916609 seconds time elapsed
>>
>> Here cache-misses < L1-dcache-load-misses.
>
>
>
> Dunno, will let others answer.
I think it corresponds to last level cache misses, which makes sense
here. The difference in the two numbers represents hits to L2 (and L3
if it exists).
Reid
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-11-09 11:07 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <fa.yHA7Aw03llqLWxPVYRnHvK5/dT8@ifi.uio.no>
[not found] ` <fa.13KEqWk+Dk+jLLdFlAoZtQ2Vjuw@ifi.uio.no>
[not found] ` <fa.AGo9lmnVDcmFVUpOFG/kfd1aYfI@ifi.uio.no>
2010-11-04 8:34 ` perf tools miscellaneous questions Francis Moreau
2010-11-04 8:52 ` Francis Moreau
2010-11-07 21:40 ` Frederic Weisbecker
2010-11-09 11:07 ` Francis Moreau
[not found] <fa.SSgtQesEhEQa5DUYUwBV3fWtoV4@ifi.uio.no>
[not found] ` <fa.dD5ur5Phqa1TLmYBE2NVKCQMjTw@ifi.uio.no>
[not found] ` <fa.Xj1lA7n6nIJYL40CeRDpQzSKlfc@ifi.uio.no>
[not found] ` <fa.xcyA+VzIXesq6qsPU6ADM4xdCKY@ifi.uio.no>
[not found] ` <fa.MOg61Pcfdp2SJnwM2GFdOxP+xt0@ifi.uio.no>
[not found] ` <fa.4sHfhlc/fMhpYgKda4IfUHZ7jMY@ifi.uio.no>
2010-11-05 12:38 ` Francis Moreau
2010-11-05 14:02 ` Vince Weaver
2010-11-06 14:44 ` Francis Moreau
2010-11-06 20:50 ` Vince Weaver
2010-11-06 20:52 ` Vince Weaver
2010-11-08 19:43 ` Francis Moreau
[not found] <fa.eqFHAk86WhpTuYclHhngn7QZr8Y@ifi.uio.no>
[not found] ` <fa.X++YRAJg+rmPtm3nmroZZoNU7u8@ifi.uio.no>
[not found] ` <fa.Elk8wOfBHRdKtkHIjP9hOtzVCgQ@ifi.uio.no>
[not found] ` <fa.U3fdWUGXguguIIyQ4v66/uKOhus@ifi.uio.no>
[not found] ` <fa.YTQQoGhoS6d3BaZXcZMN+l9TojQ@ifi.uio.no>
2010-11-04 20:58 ` Francis Moreau
2010-11-04 22:28 ` Victor Jimenez
[not found] <fa.AyvjD8RxwvZsnL5ZXcZ+OzALKY8@ifi.uio.no>
[not found] ` <fa.wlHJxDLDciTHF6/icJo+JfjJPus@ifi.uio.no>
[not found] ` <fa.8PQyp14JyjNgKJB4NUWsi+YoZBM@ifi.uio.no>
[not found] ` <fa.ZajcSOe/t8/XBoLV1hZ7SjSJvtI@ifi.uio.no>
2010-11-04 8:45 ` Francis Moreau
2010-11-03 19:28 Francis Moreau
2010-11-03 21:43 ` Frederic Weisbecker
2010-11-03 22:15 ` Reid Kleckner
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®