Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ac5e7f84 authored by Stephane Eranian's avatar Stephane Eranian Committed by Arnaldo Carvalho de Melo
Browse files

perf symbols: Fix bug in usage of the basename() function



The basename() implementation varies a lot between systems.

The Linux man page says: "basename may modify the content of the path,
so it may be desirable to pass a copy when calling the function".

On some other systems, the returned address may come from an internal
buffer which can be reused in subsequent calls, thus the results should
also be copied.

The dso__set_basename() function was not doing this causing problems
on some systems with wrong library names being shown by perf report,
such as on Android systems.

This patch fixes the problem.
The patch is relative to tip.git.

In v2, we clean up the comments based on Ingo's feedback.

Reported-by: default avatarBen Cheng <bccheng@google.com>
Signed-off-by: default avatarStephane Eranian <eranian@google.com>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Ben Cheng <bccheng@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131205182642.GA14614@quad


[ v3: Fixed up wrt allocated flag now being set in dso__set_short_name ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7d2a5122
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment