* [lttng-dev] Reading cache misses in Userspace?
@ 2013-01-05 19:47 Alexander Kampmann
2013-01-07 13:47 ` Mathieu Desnoyers
2013-01-07 18:15 ` Yannick Brosseau
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Kampmann @ 2013-01-05 19:47 UTC (permalink / raw)
hey,
I would like to find out which part of my application causes most cache
misses. So I tried to add userspace events to my application. I hoped
LTTng would give me some mean of determining between which tracepoints
the most cache misses occur.
I started a session like that:
sudo lttng create session
sudo lttng enable-event -a -u
sudo lttng add-context -u -t perf:LLC-load-misses -t
perf:LLC-store-misses -t perf:LLC-prefetch-misses
I get:
Error: perf:LLC-prefetch-misses: UST invalid context
Error: perf:LLC-store-misses: UST invalid context
Error: perf:LLC-load-misses: UST invalid context
Does this mean I can not add perf:LLC-* context to my userspace events?
Is there any way to figure out which part of my application causes cache
misses?
If I use
sudo lttng add-context -k -t perf:LLC-load-misses -t
perf:LLC-store-misses -t perf:LLC-prefetch-misses
instead, I don't get an error, but the babeltrace output does not
contain any cache miss counts as well.
I would appreciate any help,
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] Reading cache misses in Userspace?
2013-01-05 19:47 [lttng-dev] Reading cache misses in Userspace? Alexander Kampmann
@ 2013-01-07 13:47 ` Mathieu Desnoyers
2013-01-07 18:15 ` Yannick Brosseau
1 sibling, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2013-01-07 13:47 UTC (permalink / raw)
* Alexander Kampmann (alexander.kampmann at gmx.de) wrote:
> hey,
>
> I would like to find out which part of my application causes most cache
> misses. So I tried to add userspace events to my application. I hoped
> LTTng would give me some mean of determining between which tracepoints
> the most cache misses occur.
>
> I started a session like that:
>
> sudo lttng create session
> sudo lttng enable-event -a -u
> sudo lttng add-context -u -t perf:LLC-load-misses -t
> perf:LLC-store-misses -t perf:LLC-prefetch-misses
>
> I get:
>
> Error: perf:LLC-prefetch-misses: UST invalid context
> Error: perf:LLC-store-misses: UST invalid context
> Error: perf:LLC-load-misses: UST invalid context
>
> Does this mean I can not add perf:LLC-* context to my userspace events?
> Is there any way to figure out which part of my application causes cache
> misses?
Currently, perf counters are only for kernel tracing (-k domain). We
envision using those counters from user-space when Linux kernel support
will be there.
>
> If I use
>
> sudo lttng add-context -k -t perf:LLC-load-misses -t
> perf:LLC-store-misses -t perf:LLC-prefetch-misses
>
> instead, I don't get an error, but the babeltrace output does not
> contain any cache miss counts as well.
Does it contain _any_ performance counters at all ?
Did you ensure that you issue add-context before you start tracing ?
How many performance counters does your machine have ? Shown by dmesg,
e.g.:
dmesg |grep "generic reg"
Thanks,
Mathieu
>
> I would appreciate any help,
>
> Alex
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] Reading cache misses in Userspace?
2013-01-05 19:47 [lttng-dev] Reading cache misses in Userspace? Alexander Kampmann
2013-01-07 13:47 ` Mathieu Desnoyers
@ 2013-01-07 18:15 ` Yannick Brosseau
2013-01-07 19:10 ` Matthew Khouzam
1 sibling, 1 reply; 4+ messages in thread
From: Yannick Brosseau @ 2013-01-07 18:15 UTC (permalink / raw)
On 2013-01-05 14:47, Alexander Kampmann wrote:
> hey,
>
> I would like to find out which part of my application causes most
> cache misses. So I tried to add userspace events to my application. I
> hoped LTTng would give me some mean of determining between which
> tracepoints the most cache misses occur.
>
> I started a session like that:
>
> sudo lttng create session
> sudo lttng enable-event -a -u
> sudo lttng add-context -u -t perf:LLC-load-misses -t
> perf:LLC-store-misses -t perf:LLC-prefetch-misses
>
> I get:
>
> Error: perf:LLC-prefetch-misses: UST invalid context
> Error: perf:LLC-store-misses: UST invalid context
> Error: perf:LLC-load-misses: UST invalid context
>
> Does this mean I can not add perf:LLC-* context to my userspace
> events? Is there any way to figure out which part of my application
> causes cache misses?
>
> If I use
>
> sudo lttng add-context -k -t perf:LLC-load-misses -t
> perf:LLC-store-misses -t perf:LLC-prefetch-misses
>
> instead, I don't get an error, but the babeltrace output does not
> contain any cache miss counts as well.
This context will be added to kernel events only, so you will need to
active some kernel event to see them.
sudo lttng enable-event -a -k would do the trick. You can also only
activate some events to reduce the size of the trace. The sched* events
and maybe the syscall would be interesting to place the perf counter to
some specific place of the application.
Yannick
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] Reading cache misses in Userspace?
2013-01-07 18:15 ` Yannick Brosseau
@ 2013-01-07 19:10 ` Matthew Khouzam
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Khouzam @ 2013-01-07 19:10 UTC (permalink / raw)
Hi,
This may be redundant, but if you enable kernel tracing, you can still
do your user space tracing and then correlate both of them to see what
was done when your cache misses go through the roof.
So that would be:
lttng create-session mySession
lttng enlable-event -a -k
lttng add-context -k perf:LLC-load-misses ...
lttng enable-event -a -u
lttng start
./yourapp
lttng stop
lttng destroy
Good luck,
Matthew
On 13-01-07 01:15 PM, Yannick Brosseau wrote:
> On 2013-01-05 14:47, Alexander Kampmann wrote:
>> hey,
>>
>> I would like to find out which part of my application causes most
>> cache misses. So I tried to add userspace events to my application. I
>> hoped LTTng would give me some mean of determining between which
>> tracepoints the most cache misses occur.
>>
>> I started a session like that:
>>
>> sudo lttng create session
>> sudo lttng enable-event -a -u
>> sudo lttng add-context -u -t perf:LLC-load-misses -t
>> perf:LLC-store-misses -t perf:LLC-prefetch-misses
>>
>> I get:
>>
>> Error: perf:LLC-prefetch-misses: UST invalid context
>> Error: perf:LLC-store-misses: UST invalid context
>> Error: perf:LLC-load-misses: UST invalid context
>>
>> Does this mean I can not add perf:LLC-* context to my userspace
>> events? Is there any way to figure out which part of my application
>> causes cache misses?
>>
>> If I use
>>
>> sudo lttng add-context -k -t perf:LLC-load-misses -t
>> perf:LLC-store-misses -t perf:LLC-prefetch-misses
>>
>> instead, I don't get an error, but the babeltrace output does not
>> contain any cache miss counts as well.
> This context will be added to kernel events only, so you will need to
> active some kernel event to see them.
> sudo lttng enable-event -a -k would do the trick. You can also only
> activate some events to reduce the size of the trace. The sched* events
> and maybe the syscall would be interesting to place the perf counter to
> some specific place of the application.
>
> Yannick
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-07 19:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-05 19:47 [lttng-dev] Reading cache misses in Userspace? Alexander Kampmann
2013-01-07 13:47 ` Mathieu Desnoyers
2013-01-07 18:15 ` Yannick Brosseau
2013-01-07 19:10 ` Matthew Khouzam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox