mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
perf: Support only inheriting events if cloned with CLONE_THREAD
Adds bit perf_event_attr::inherit_thread, to restricting inheriting events only if the child was cloned with CLONE_THREAD. This option supports the case where an event is supposed to be process-wide only (including subthreads), but should not propagate beyond the current process's shared environment. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/lkml/YBvj6eJR%2FDY2TsEB@hirez.programming.kicks-ass.net/
This commit is contained in:
parent
47f661eca0
commit
2b26f0aa00
4 changed files with 20 additions and 11 deletions
|
@ -2078,7 +2078,7 @@ static __latent_entropy struct task_struct *copy_process(
|
|||
if (retval)
|
||||
goto bad_fork_cleanup_policy;
|
||||
|
||||
retval = perf_event_init_task(p);
|
||||
retval = perf_event_init_task(p, clone_flags);
|
||||
if (retval)
|
||||
goto bad_fork_cleanup_policy;
|
||||
retval = audit_alloc(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue