Hi,

> You certainly don't need to modify the code of the child processes.
> In the handler you can read the counter of the child processes. But
> for the read to succeed, you need to stop the child. This can currently
> be accomplished using ptrace and in particular PTRACE_ATTACH.
> So you issue this call, wait (WUNTRACED) until this is effective, then you
> call pfm_read_pmds(). When you are done, simply PTRACE_DETACH
> the child.
>

Thanks.

I guess the pfmon source code for the --follow-all option is a good
example. The problem is that in my case I cannot stop the child with
ptrace() because the handler-thread forks in a hook-method that is not
implemented by me. So I have no access to the child.

Another option that I though of is to attach to the *thread* after it
is created and then implement pfmon's --follow-all option. But I guess
attach() does not work for threads, right?

Cheers,
Andrej

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to