Hi,

I am trying to use perfrmon and libpfm with the Pin Instrumentation system.
http://rogue.colorado.edu/Pin/index.html
Pin is a dynamic Binary Instrumentation framework which allows users
to write custom instrumentation and analysis routines for a binary.

I am using Pin to setup a perfrmon context and a signal handler to
handle SIGIO signals on PMU buffer overflows. Pin can setup these
things in the same address space as the binary.

I am using the SIGIO mechanism because it appears to the most
lightweight way of gathering PMU data when the process is running. The
reason for using Pin with perfmon is also to monitor a binary without
recompiling it.

The problem I am facing is that although the PMU send buffer overflow
signals during the period that Pin is setting up the binary to
execute. It stops working before the code from the target binary
executes.

I have experimented to check if it is a problem with the signal
handling, but that doesnt seem to be the case because signals are
still caught while the target binary is running. Its just that the PMU
information stops.

I have tried counting simple things such as the number of retired
instructions from the PMU but that too stops showing up. ( But binary
continues to execute. )

I am not sure if the problem lies with Pin or in the way Pin interacts
with perfmon functionality and the creation of the PMU context. Pin
works by execing the target binary ( the one being monitored ) and
then ptracing to take control of its execution. It then injects itself
in the binary's address space and then interacts with the binary in
its own address space. It can at a later point allow the binary to
execute, independent of itself.

Sorry to write a long mail, which is mostly not about perfmon, but any
clues or questions which can help me figure out what I can do get
perfmon to work along with Pin will be greatly appreciated.

Thanks,
rahul

--
The World's Greatest Dream Machine

_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to