diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/events/core.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 440eefc67397..647698f91988 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -2970,6 +2970,22 @@ out: | |||
| 2970 | local_irq_restore(flags); | 2970 | local_irq_restore(flags); |
| 2971 | } | 2971 | } |
| 2972 | 2972 | ||
| 2973 | void perf_event_exec(void) | ||
| 2974 | { | ||
| 2975 | struct perf_event_context *ctx; | ||
| 2976 | int ctxn; | ||
| 2977 | |||
| 2978 | rcu_read_lock(); | ||
| 2979 | for_each_task_context_nr(ctxn) { | ||
| 2980 | ctx = current->perf_event_ctxp[ctxn]; | ||
| 2981 | if (!ctx) | ||
| 2982 | continue; | ||
| 2983 | |||
| 2984 | perf_event_enable_on_exec(ctx); | ||
| 2985 | } | ||
| 2986 | rcu_read_unlock(); | ||
| 2987 | } | ||
| 2988 | |||
| 2973 | /* | 2989 | /* |
| 2974 | * Cross CPU call to read the hardware event | 2990 | * Cross CPU call to read the hardware event |
| 2975 | */ | 2991 | */ |
| @@ -5057,18 +5073,6 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event) | |||
| 5057 | void perf_event_comm(struct task_struct *task) | 5073 | void perf_event_comm(struct task_struct *task) |
| 5058 | { | 5074 | { |
| 5059 | struct perf_comm_event comm_event; | 5075 | struct perf_comm_event comm_event; |
| 5060 | struct perf_event_context *ctx; | ||
| 5061 | int ctxn; | ||
| 5062 | |||
| 5063 | rcu_read_lock(); | ||
| 5064 | for_each_task_context_nr(ctxn) { | ||
| 5065 | ctx = task->perf_event_ctxp[ctxn]; | ||
| 5066 | if (!ctx) | ||
| 5067 | continue; | ||
| 5068 | |||
| 5069 | perf_event_enable_on_exec(ctx); | ||
| 5070 | } | ||
| 5071 | rcu_read_unlock(); | ||
| 5072 | 5076 | ||
| 5073 | if (!atomic_read(&nr_comm_events)) | 5077 | if (!atomic_read(&nr_comm_events)) |
| 5074 | return; | 5078 | return; |
