interfacing with perf counters on linux

264 views
Skip to first unread message

ymo

unread,
Oct 26, 2015, 1:21:55 PM10/26/15
to mechanical-sympathy

I am trying to find out if there is a lib in java or native that allows you to start/stop perf counters on a per block basis.
  1. Whats the "right" way to interface with perf (and perf counters in general) from java ? 
  2. Does the cpu support perf counters (for example cache miss) for a certain code block within a function ?
  3. If the cpu does not support this what is the least intrusive way to "query" the current counter before entering/exiting a code block ?
    1. similar to how one can the clock timer to store the state at entry/exit and figure know how long the actual code block took.

Jean-Philippe BEMPEL

unread,
Oct 27, 2015, 6:14:44 AM10/27/15
to mechanical-sympathy

ymo

unread,
Oct 28, 2015, 8:34:43 AM10/28/15
to mechanical-sympathy
Thank you so much for the great articles .. this is exactly what i needed )))

As you said "But the major flaw of this* approach is that you can only monitor program executed from command line and exiting in order to get results. It is limited to small program, namely micro-benchmark."
Beside this major difference do you know anything in perf that lippfm/overseer cannot do today  In terms of functionality ? 

*this refers to perf aproach

Jean-Philippe BEMPEL

unread,
Oct 28, 2015, 9:52:28 AM10/28/15
to mechanica...@googlegroups.com
My comment that is not quite correct/accurate as perf is capable to only monitor one thread through perf stat -t <tid>
Which is very interesting and you can attach at anytime to for example to avoid warmup phase.
But this is still limited if you want more precision to same set of methods for example.

--
You received this message because you are subscribed to a topic in the Google Groups "mechanical-sympathy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mechanical-sympathy/nQXhWxFljIM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages