Skip to content

Commit 0ca9b67

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Thomas Gleixner: "Mostly updates to the perf tool plus two fixes to the kernel core code: - Handle tracepoint filters correctly for inherited events (Peter Zijlstra) - Prevent a deadlock in perf_lock_task_context (Paul McKenney) - Add missing newlines to some pr_err() calls (Arnaldo Carvalho de Melo) - Print full source file paths when using 'perf annotate --print-line --full-paths' (Michael Petlan) - Fix 'perf probe -d' when just one out of uprobes and kprobes is enabled (Wang Nan) - Add compiler.h to list.h to fix 'make perf-tar-src-pkg' generated tarballs, i.e. out of tree building (Arnaldo Carvalho de Melo) - Add the llvm-src-base.c and llvm-src-kbuild.c files, generated by the 'perf test' LLVM entries, when running it in-tree, to .gitignore (Yunlong Song) - libbpf error reporting improvements, using a strerror interface to more precisely tell the user about problems with the provided scriptlet, be it in C or as a ready made object file (Wang Nan) - Do not be case sensitive when searching for matching 'perf test' entries (Arnaldo Carvalho de Melo) - Inform the user about objdump failures in 'perf annotate' (Andi Kleen) - Improve the LLVM 'perf test' entry, introduce a new ones for BPF and kbuild tests to check the environment used by clang to compile .c scriptlets (Wang Nan)" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits) perf/x86/intel/rapl: Remove the unused RAPL_EVENT_DESC() macro tools include: Add compiler.h to list.h perf probe: Verify parameters in two functions perf session: Add missing newlines to some pr_err() calls perf annotate: Support full source file paths for srcline fix perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore perf: Fix inherited events vs. tracepoint filters perf: Disable IRQs across RCU RS CS that acquires scheduler lock perf test: Do not be case sensitive when searching for matching tests perf test: Add 'perf test BPF' perf test: Enhance the LLVM tests: add kbuild test perf test: Enhance the LLVM test: update basic BPF test program perf bpf: Improve BPF related error messages perf tools: Make fetch_kernel_version() publicly available bpf tools: Add new API bpf_object__get_kversion() bpf tools: Improve libbpf error reporting perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy perf annotate: Inform the user about objdump failures in --stdio perf stat: Make stat options global perf sched latency: Fix thread pid reuse issue ...
2 parents 051b29f + 41ac18e commit 0ca9b67

37 files changed

+947
-292
lines changed

arch/x86/kernel/cpu/perf_event_intel_rapl.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ static ssize_t __rapl_##_var##_show(struct kobject *kobj, \
107107
static struct kobj_attribute format_attr_##_var = \
108108
__ATTR(_name, 0444, __rapl_##_var##_show, NULL)
109109

110-
#define RAPL_EVENT_DESC(_name, _config) \
111-
{ \
112-
.attr = __ATTR(_name, 0444, rapl_event_show, NULL), \
113-
.config = _config, \
114-
}
115-
116110
#define RAPL_CNTR_WIDTH 32 /* 32-bit rapl counters */
117111

118112
#define RAPL_EVENT_ATTR_STR(_name, v, str) \

kernel/events/core.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,13 +1050,13 @@ perf_lock_task_context(struct task_struct *task, int ctxn, unsigned long *flags)
10501050
/*
10511051
* One of the few rules of preemptible RCU is that one cannot do
10521052
* rcu_read_unlock() while holding a scheduler (or nested) lock when
1053-
* part of the read side critical section was preemptible -- see
1053+
* part of the read side critical section was irqs-enabled -- see
10541054
* rcu_read_unlock_special().
10551055
*
10561056
* Since ctx->lock nests under rq->lock we must ensure the entire read
1057-
* side critical section is non-preemptible.
1057+
* side critical section has interrupts disabled.
10581058
*/
1059-
preempt_disable();
1059+
local_irq_save(*flags);
10601060
rcu_read_lock();
10611061
ctx = rcu_dereference(task->perf_event_ctxp[ctxn]);
10621062
if (ctx) {
@@ -1070,21 +1070,22 @@ perf_lock_task_context(struct task_struct *task, int ctxn, unsigned long *flags)
10701070
* if so. If we locked the right context, then it
10711071
* can't get swapped on us any more.
10721072
*/
1073-
raw_spin_lock_irqsave(&ctx->lock, *flags);
1073+
raw_spin_lock(&ctx->lock);
10741074
if (ctx != rcu_dereference(task->perf_event_ctxp[ctxn])) {
1075-
raw_spin_unlock_irqrestore(&ctx->lock, *flags);
1075+
raw_spin_unlock(&ctx->lock);
10761076
rcu_read_unlock();
1077-
preempt_enable();
1077+
local_irq_restore(*flags);
10781078
goto retry;
10791079
}
10801080

10811081
if (!atomic_inc_not_zero(&ctx->refcount)) {
1082-
raw_spin_unlock_irqrestore(&ctx->lock, *flags);
1082+
raw_spin_unlock(&ctx->lock);
10831083
ctx = NULL;
10841084
}
10851085
}
10861086
rcu_read_unlock();
1087-
preempt_enable();
1087+
if (!ctx)
1088+
local_irq_restore(*flags);
10881089
return ctx;
10891090
}
10901091

@@ -6913,6 +6914,10 @@ static int perf_tp_filter_match(struct perf_event *event,
69136914
{
69146915
void *record = data->raw->data;
69156916

6917+
/* only top level events have filters set */
6918+
if (event->parent)
6919+
event = event->parent;
6920+
69166921
if (likely(!event->filter) || filter_match_preds(event->filter, record))
69176922
return 1;
69186923
return 0;

tools/include/linux/list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <linux/compiler.h>
12
#include <linux/kernel.h>
23
#include <linux/types.h>
34

tools/lib/bpf/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
libbpf_version.h
2-
FEATURE-DUMP
2+
FEATURE-DUMP.libbpf

tools/lib/bpf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ config-clean:
180180
clean:
181181
$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
182182
$(RM) LIBBPF-CFLAGS
183-
$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP
183+
$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
184184

185185

186186

0 commit comments

Comments
 (0)