* [PATCH] Correctly handle symbols in VDSO
@ 2014-04-01 19:15 Vladimir Nikulichev
2014-04-07 6:14 ` Namhyung Kim
0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Nikulichev @ 2014-04-01 19:15 UTC (permalink / raw)
To: linux-perf-users, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo
pert-report doesn't resolve function names in VDSO:
$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
8.76%
0x7fff6b1fe861
__gettimeofday
ACE_OS::gettimeofday()
...
In this case symbol values should be adjusted the same way as for executables, relocatable objects and prelinked libraries.
After fix:
$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
8.76%
__vdso_gettimeofday
__gettimeofday
ACE_OS::gettimeofday()
...
---------------------------------------------------------------------------------------------------------------------------
perf tools: Adjust symbols in VDSO
Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com>
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 3b7dbf5..9c8b23b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -6,6 +6,7 @@
#include <inttypes.h>
#include "symbol.h"
+#include "vdso.h"
#include <symbol/kallsyms.h>
#include "debug.h"
@@ -618,6 +619,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
GElf_Shdr shdr;
ss->adjust_symbols = (ehdr.e_type == ET_EXEC ||
ehdr.e_type == ET_REL ||
+ (dso->symsrc_filename == NULL &&
+ is_vdso_map(dso->short_name)) ||
elf_section_by_name(elf, &ehdr, &shdr,
".gnu.prelink_undo",
NULL) != NULL);
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] Correctly handle symbols in VDSO 2014-04-01 19:15 [PATCH] Correctly handle symbols in VDSO Vladimir Nikulichev @ 2014-04-07 6:14 ` Namhyung Kim 2014-04-08 15:24 ` Vladimir Nikulichev 0 siblings, 1 reply; 6+ messages in thread From: Namhyung Kim @ 2014-04-07 6:14 UTC (permalink / raw) To: Vladimir Nikulichev Cc: linux-perf-users, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, Jiri Olsa Hi Vladimir, On Tue, 1 Apr 2014 23:15:14 +0400, Vladimir Nikulichev wrote: > pert-report doesn't resolve function names in VDSO: > > $ perf report --stdio -g flat,0.0,15,callee --sort pid > ... > 8.76% > 0x7fff6b1fe861 > __gettimeofday > ACE_OS::gettimeofday() > ... > > In this case symbol values should be adjusted the same way as for executables, relocatable objects and prelinked libraries. > > After fix: > > $ perf report --stdio -g flat,0.0,15,callee --sort pid > ... > 8.76% > __vdso_gettimeofday > __gettimeofday > ACE_OS::gettimeofday() > ... Tested-by: Namhyung Kim <namhyung@kernel.org> Just one question below.. > > --------------------------------------------------------------------------------------------------------------------------- > > perf tools: Adjust symbols in VDSO > > Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com> > > diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c > index 3b7dbf5..9c8b23b 100644 > --- a/tools/perf/util/symbol-elf.c > +++ b/tools/perf/util/symbol-elf.c > @@ -6,6 +6,7 @@ > #include <inttypes.h> > > #include "symbol.h" > +#include "vdso.h" > #include <symbol/kallsyms.h> > #include "debug.h" > > @@ -618,6 +619,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, > GElf_Shdr shdr; > ss->adjust_symbols = (ehdr.e_type == ET_EXEC || > ehdr.e_type == ET_REL || > + (dso->symsrc_filename == NULL && Is this really needed? Just checking is_vdso_map() seems to work well for me. Did you have a specific reason to add it? Thanks, Namhyung > + is_vdso_map(dso->short_name)) || > elf_section_by_name(elf, &ehdr, &shdr, > ".gnu.prelink_undo", > NULL) != NULL);-- > To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Correctly handle symbols in VDSO 2014-04-07 6:14 ` Namhyung Kim @ 2014-04-08 15:24 ` Vladimir Nikulichev 2014-04-08 15:41 ` Jiri Olsa 0 siblings, 1 reply; 6+ messages in thread From: Vladimir Nikulichev @ 2014-04-08 15:24 UTC (permalink / raw) To: Namhyung Kim Cc: linux-perf-users, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, Jiri Olsa Hi Namhyung, On Apr 7, 2014, at 10:14 AM, Namhyung Kim <namhyung@kernel.org> wrote: > Just one question below.. > >> >> --------------------------------------------------------------------------------------------------------------------------- >> >> perf tools: Adjust symbols in VDSO >> >> Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com> >> >> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c >> index 3b7dbf5..9c8b23b 100644 >> --- a/tools/perf/util/symbol-elf.c >> +++ b/tools/perf/util/symbol-elf.c >> @@ -6,6 +6,7 @@ >> #include <inttypes.h> >> >> #include "symbol.h" >> +#include "vdso.h" >> #include <symbol/kallsyms.h> >> #include "debug.h" >> >> @@ -618,6 +619,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, >> GElf_Shdr shdr; >> ss->adjust_symbols = (ehdr.e_type == ET_EXEC || >> ehdr.e_type == ET_REL || >> + (dso->symsrc_filename == NULL && > > Is this really needed? Just checking is_vdso_map() seems to work well > for me. Did you have a specific reason to add it? > Nothing specific, just to don't call string operations in most cases. But here it is only a matter of coding style, of course. Attaching shorter version of the patch. ---------------------------- perf tools: Adjust symbols in VDSO Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 3b7dbf5..6864661 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -6,6 +6,7 @@ #include <inttypes.h> #include "symbol.h" +#include "vdso.h" #include <symbol/kallsyms.h> #include "debug.h" @@ -618,6 +619,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, GElf_Shdr shdr; ss->adjust_symbols = (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL || + is_vdso_map(dso->short_name) || elf_section_by_name(elf, &ehdr, &shdr, ".gnu.prelink_undo", NULL) != NULL); ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Correctly handle symbols in VDSO 2014-04-08 15:24 ` Vladimir Nikulichev @ 2014-04-08 15:41 ` Jiri Olsa [not found] ` <A7CC2084-4F71-436C-9AEC-394F66A4981E@tbricks.com> 0 siblings, 1 reply; 6+ messages in thread From: Jiri Olsa @ 2014-04-08 15:41 UTC (permalink / raw) To: Vladimir Nikulichev Cc: Namhyung Kim, linux-perf-users, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, linux-kernel On Tue, Apr 08, 2014 at 07:24:22PM +0400, Vladimir Nikulichev wrote: > Hi Namhyung, > > On Apr 7, 2014, at 10:14 AM, Namhyung Kim <namhyung@kernel.org> wrote: > > > Just one question below.. > > > >> > >> --------------------------------------------------------------------------------------------------------------------------- > >> > >> perf tools: Adjust symbols in VDSO > >> > >> Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com> > >> > >> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c > >> index 3b7dbf5..9c8b23b 100644 > >> --- a/tools/perf/util/symbol-elf.c > >> +++ b/tools/perf/util/symbol-elf.c > >> @@ -6,6 +6,7 @@ > >> #include <inttypes.h> > >> > >> #include "symbol.h" > >> +#include "vdso.h" > >> #include <symbol/kallsyms.h> > >> #include "debug.h" > >> > >> @@ -618,6 +619,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, > >> GElf_Shdr shdr; > >> ss->adjust_symbols = (ehdr.e_type == ET_EXEC || > >> ehdr.e_type == ET_REL || > >> + (dso->symsrc_filename == NULL && > > > > Is this really needed? Just checking is_vdso_map() seems to work well > > for me. Did you have a specific reason to add it? > > > > Nothing specific, just to don't call string operations in most cases. But here it is only a matter of coding style, of course. > Attaching shorter version of the patch. > > ---------------------------- > > perf tools: Adjust symbols in VDSO hi, could you please put explanation from first email into the patch changelog? cc-ing lkml thanks, jirka ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <A7CC2084-4F71-436C-9AEC-394F66A4981E@tbricks.com>]
* Re: [PATCH] Correctly handle symbols in VDSO [not found] ` <A7CC2084-4F71-436C-9AEC-394F66A4981E@tbricks.com> @ 2014-04-09 15:35 ` Jiri Olsa 2014-04-09 16:13 ` Jiri Olsa 0 siblings, 1 reply; 6+ messages in thread From: Jiri Olsa @ 2014-04-09 15:35 UTC (permalink / raw) To: Vladimir Nikulichev Cc: Namhyung Kim, linux-perf-users, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, linux-kernel On Wed, Apr 09, 2014 at 10:46:13AM +0400, Vladimir Nikulichev wrote: > Hi, > > On Apr 8, 2014, at 7:41 PM, Jiri Olsa <jolsa@redhat.com> wrote: > > > hi, > > could you please put explanation from first email > > into the patch changelog? > > > > cc-ing lkml > > > > thanks, > > jirka > > > OK, pasting it together: ook hum, your email's encoding kills my 'git am' :-\ also 'perf tools: Adjust symbols in VDSO' should go into the email subject I processed this patch by hand this time thanks, jirka > > --------------------------------------------------------------------------------------------------------------------------- > > perf tools: Adjust symbols in VDSO > > pert-report doesn't resolve function names in VDSO: > > $ perf report --stdio -g flat,0.0,15,callee --sort pid > ... > 8.76% > 0x7fff6b1fe861 > __gettimeofday > ACE_OS::gettimeofday() > ... > > In this case symbol values should be adjusted the same way as for executables, relocatable objects and prelinked libraries. > > After fix: > > $ perf report --stdio -g flat,0.0,15,callee --sort pid > ... > 8.76% > __vdso_gettimeofday > __gettimeofday > ACE_OS::gettimeofday() > … > > Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com> > > diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c > index 3b7dbf5..6864661 100644 > --- a/tools/perf/util/symbol-elf.c > +++ b/tools/perf/util/symbol-elf.c > @@ -6,6 +6,7 @@ > #include <inttypes.h> > > #include "symbol.h" > +#include "vdso.h" > #include <symbol/kallsyms.h> > #include "debug.h" > > @@ -618,6 +619,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, > GElf_Shdr shdr; > ss->adjust_symbols = (ehdr.e_type == ET_EXEC || > ehdr.e_type == ET_REL || > + is_vdso_map(dso->short_name) || > elf_section_by_name(elf, &ehdr, &shdr, > ".gnu.prelink_undo", > NULL) != NULL); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Correctly handle symbols in VDSO 2014-04-09 15:35 ` Jiri Olsa @ 2014-04-09 16:13 ` Jiri Olsa 0 siblings, 0 replies; 6+ messages in thread From: Jiri Olsa @ 2014-04-09 16:13 UTC (permalink / raw) To: Vladimir Nikulichev Cc: Namhyung Kim, linux-perf-users, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, linux-kernel On Wed, Apr 09, 2014 at 05:35:46PM +0200, Jiri Olsa wrote: > On Wed, Apr 09, 2014 at 10:46:13AM +0400, Vladimir Nikulichev wrote: > > Hi, > > > > On Apr 8, 2014, at 7:41 PM, Jiri Olsa <jolsa@redhat.com> wrote: > > > > > hi, > > > could you please put explanation from first email > > > into the patch changelog? > > > > > > cc-ing lkml > > > > > > thanks, > > > jirka > > > > > > OK, pasting it together: > > ook > > hum, your email's encoding kills my 'git am' :-\ > also 'perf tools: Adjust symbols in VDSO' should go into the > email subject > > I processed this patch by hand this time actually I'll have to ask you to resend your patch with proper subject and coding, refer to: https://www.kernel.org/doc/Documentation/email-clients.txt "Emailed patches should be in ASCII or UTF-8 encoding only." Please CC lkml (linux-kernel@vger.kernel.org). Strangely enough, I don't see your patch there at the moment.. thanks, jirka ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-04-09 16:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-01 19:15 [PATCH] Correctly handle symbols in VDSO Vladimir Nikulichev
2014-04-07 6:14 ` Namhyung Kim
2014-04-08 15:24 ` Vladimir Nikulichev
2014-04-08 15:41 ` Jiri Olsa
[not found] ` <A7CC2084-4F71-436C-9AEC-394F66A4981E@tbricks.com>
2014-04-09 15:35 ` Jiri Olsa
2014-04-09 16:13 ` Jiri Olsa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).