Re: perf_counters issue with enable_on_exec

From: Paul Mackerras
Date: Mon Aug 24 2009 - 18:22:35 EST


stephane eranian writes:

> I am running into an issue trying to use enable_on_exec
> in per-thread mode with an event group.
>
> My understanding is that enable_on_exec allows activation
> of an event on first exec. This is useful for tools monitoring
> other tasks and which you invoke as: tool my_program. In
> other words, the tool forks+execs my_program. This option
> allows developers to setup the events after the fork (to get
> the pid) but before the exec(). Only execution after the exec
> is monitored. This alleviates the need to use the
> ptrace(PTRACE_TRACEME) call.
>
> My understanding is that an event group is scheduled only
> if all events in the group are active (disabled=0). Thus, one

Not quite - if the leader is disabled then none of the group goes on.
If the leader is enabled then it and any other group members that are
enabled go on. If a non-leader member is disabled then it doesn't go
on but it doesn't stop other members from going on.

Paul.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/