diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-03-03 01:17:53 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-03 01:17:53 -0500 |
commit | 94ac003b665fc04f13a7ab3b2be896b9b9503451 (patch) | |
tree | 1fdaaf514ed20dfd1f3657693a55ab1547f1a656 /tools/perf/util/probe-event.c | |
parent | 788b94ba6c223d4ce955218d59075cd1edb92692 (diff) | |
parent | ae536acfacb65a4a9858c32b12361e09f84f4157 (diff) |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
User visible changes:
- Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)
- 'perf record' Documentation fixes (Namhyung Kim)
- Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)
Infrastructure changes:
- Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)
- Reference count struct thread (Arnaldo Carvalho de Melo)
- Don't keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)
- Initialize cpu set in pthread_attr_setaffinity_np() feature test (Adrian Hunter)
- Only include tsc file for x86 (David Ahern)
- Compare JOBS to 0 after grep (David Ahern)
- Improve feature detection messages (Ingo Molnar)
- Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)
- Remove bias offset to find probe point by address (Masami Hiramatsu)
- Fix build error on ARCH=i386/x86_64/sparc64 (Namhyung Kim)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r-- | tools/perf/util/probe-event.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 7c0e765fa2e3..1c570c2fa7cc 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -2199,6 +2199,27 @@ static int get_new_event_name(char *buf, size_t len, const char *base, | |||
2199 | return ret; | 2199 | return ret; |
2200 | } | 2200 | } |
2201 | 2201 | ||
2202 | /* Warn if the current kernel's uprobe implementation is old */ | ||
2203 | static void warn_uprobe_event_compat(struct probe_trace_event *tev) | ||
2204 | { | ||
2205 | int i; | ||
2206 | char *buf = synthesize_probe_trace_command(tev); | ||
2207 | |||
2208 | /* Old uprobe event doesn't support memory dereference */ | ||
2209 | if (!tev->uprobes || tev->nargs == 0 || !buf) | ||
2210 | goto out; | ||
2211 | |||
2212 | for (i = 0; i < tev->nargs; i++) | ||
2213 | if (strglobmatch(tev->args[i].value, "[$@+-]*")) { | ||
2214 | pr_warning("Please upgrade your kernel to at least " | ||
2215 | "3.14 to have access to feature %s\n", | ||
2216 | tev->args[i].value); | ||
2217 | break; | ||
2218 | } | ||
2219 | out: | ||
2220 | free(buf); | ||
2221 | } | ||
2222 | |||
2202 | static int __add_probe_trace_events(struct perf_probe_event *pev, | 2223 | static int __add_probe_trace_events(struct perf_probe_event *pev, |
2203 | struct probe_trace_event *tevs, | 2224 | struct probe_trace_event *tevs, |
2204 | int ntevs, bool allow_suffix) | 2225 | int ntevs, bool allow_suffix) |
@@ -2295,6 +2316,8 @@ static int __add_probe_trace_events(struct perf_probe_event *pev, | |||
2295 | */ | 2316 | */ |
2296 | allow_suffix = true; | 2317 | allow_suffix = true; |
2297 | } | 2318 | } |
2319 | if (ret == -EINVAL && pev->uprobes) | ||
2320 | warn_uprobe_event_compat(tev); | ||
2298 | 2321 | ||
2299 | /* Note that it is possible to skip all events because of blacklist */ | 2322 | /* Note that it is possible to skip all events because of blacklist */ |
2300 | if (ret >= 0 && tev->event) { | 2323 | if (ret >= 0 && tev->event) { |