Skip to content

Commit

Permalink
Merge tag 'perf-urgent-for-mingo-20160818' of git://git.kernel.org/pu…
Browse files Browse the repository at this point in the history
…b/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

- Do not access outside hw cache name arrays (Arnaldo Carvalho de Melo)

- Use addr_location::addr instead of ip for entries when unwinding using
  DWARF CFI, fixing the "srcline" information for userspace application
  callchains (Milian Wolff)

- Reinstate strlcpy() header guard with __UCLIBC__, fixing the build
  with uclibc, detected when building for the ARC architecture (Vineet Gupta)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Aug 18, 2016
2 parents 71e7bc2 + c53412e commit de737f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion tools/include/linux/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ void *memdup(const void *src, size_t len);

int strtobool(const char *s, bool *res);

#ifdef __GLIBC__
/*
* glibc based builds needs the extern while uClibc doesn't.
* However uClibc headers also define __GLIBC__ hence the hack below
*/
#if defined(__GLIBC__) && !defined(__UCLIBC__)
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif

Expand Down
6 changes: 3 additions & 3 deletions tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,17 +507,17 @@ static int __perf_evsel__hw_cache_name(u64 config, char *bf, size_t size)
u8 op, result, type = (config >> 0) & 0xff;
const char *err = "unknown-ext-hardware-cache-type";

if (type > PERF_COUNT_HW_CACHE_MAX)
if (type >= PERF_COUNT_HW_CACHE_MAX)
goto out_err;

op = (config >> 8) & 0xff;
err = "unknown-ext-hardware-cache-op";
if (op > PERF_COUNT_HW_CACHE_OP_MAX)
if (op >= PERF_COUNT_HW_CACHE_OP_MAX)
goto out_err;

result = (config >> 16) & 0xff;
err = "unknown-ext-hardware-cache-result";
if (result > PERF_COUNT_HW_CACHE_RESULT_MAX)
if (result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
goto out_err;

err = "invalid-cache";
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/unwind-libdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static int entry(u64 ip, struct unwind_info *ui)
if (__report_module(&al, ip, ui))
return -1;

e->ip = ip;
e->ip = al.addr;
e->map = al.map;
e->sym = al.sym;

Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/unwind-libunwind-local.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static int entry(u64 ip, struct thread *thread,
thread__find_addr_location(thread, PERF_RECORD_MISC_USER,
MAP__FUNCTION, ip, &al);

e.ip = ip;
e.ip = al.addr;
e.map = al.map;
e.sym = al.sym;

Expand Down

0 comments on commit de737f3

Please sign in to comment.