Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
"Misc fixes: a handful of AUX event handling related fixes, a Sparse
fix and two ABI fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/core: Fix missing static inline on perf_cgroup_switch()
perf/core: Consistently fail fork on allocation failures
perf/aux: Disallow aux_output for kernel events
perf/core: Reattach a misplaced comment
perf/aux: Fix the aux_output group inheritance fix
perf/core: Disallow uncore-cgroup events

+19 -4
+19 -4
kernel/events/core.c
··· 1031 1031 { 1032 1032 } 1033 1033 1034 - void 1034 + static inline void 1035 1035 perf_cgroup_switch(struct task_struct *task, struct task_struct *next) 1036 1036 { 1037 1037 } ··· 10535 10535 goto err_ns; 10536 10536 } 10537 10537 10538 + /* 10539 + * Disallow uncore-cgroup events, they don't make sense as the cgroup will 10540 + * be different on other CPUs in the uncore mask. 10541 + */ 10542 + if (pmu->task_ctx_nr == perf_invalid_context && cgroup_fd != -1) { 10543 + err = -EINVAL; 10544 + goto err_pmu; 10545 + } 10546 + 10538 10547 if (event->attr.aux_output && 10539 10548 !(pmu->capabilities & PERF_PMU_CAP_AUX_OUTPUT)) { 10540 10549 err = -EOPNOTSUPP; ··· 11332 11323 int err; 11333 11324 11334 11325 /* 11335 - * Get the target context (task or percpu): 11326 + * Grouping is not supported for kernel events, neither is 'AUX', 11327 + * make sure the caller's intentions are adjusted. 11336 11328 */ 11329 + if (attr->aux_output) 11330 + return ERR_PTR(-EINVAL); 11337 11331 11338 11332 event = perf_event_alloc(attr, cpu, task, NULL, NULL, 11339 11333 overflow_handler, context, -1); ··· 11348 11336 /* Mark owner so we could distinguish it from user events. */ 11349 11337 event->owner = TASK_TOMBSTONE; 11350 11338 11339 + /* 11340 + * Get the target context (task or percpu): 11341 + */ 11351 11342 ctx = find_get_context(event->pmu, task, event); 11352 11343 if (IS_ERR(ctx)) { 11353 11344 err = PTR_ERR(ctx); ··· 11802 11787 GFP_KERNEL); 11803 11788 if (!child_ctx->task_ctx_data) { 11804 11789 free_event(child_event); 11805 - return NULL; 11790 + return ERR_PTR(-ENOMEM); 11806 11791 } 11807 11792 } 11808 11793 ··· 11905 11890 if (IS_ERR(child_ctr)) 11906 11891 return PTR_ERR(child_ctr); 11907 11892 11908 - if (sub->aux_event == parent_event && 11893 + if (sub->aux_event == parent_event && child_ctr && 11909 11894 !perf_get_aux_event(child_ctr, leader)) 11910 11895 return -EINVAL; 11911 11896 }