Skip to contentSkip to conversation

perf tools: Fix symbol and object code resolution for vdso32 and vdsox32

PATCH Applied Adrian Hunter 3 participants 6 messages Jun 4, 2018 – Jun 7, 2018 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

cover perf tools: Fix symbol and object code resolution for vdso32 and vdsox32

Hi

Here are a couple of small fixes for tracing 32-bit binaries on a 64-bit kernel.

Adrian Hunter (2):
perf tests kmod-path: Add tests for vdso32 and vdsox32
perf tools: Fix symbol and object code resolution for vdso32 and vdsox32

 tools/perf/tests/kmod-path.c | 16 ++++++++++++++++
 tools/perf/util/dso.c        |  2 ++
 2 files changed, 18 insertions(+)

Regards
Adrian

author reviewer
#1 lore raw

PATCH 1/2 perf tests kmod-path: Add tests for vdso32 and vdsox32

Add tests for vdso32 and vdsox32. This will cause the overall test to fail because __kmod_path__parse() does not handle vdso32 or vdsox32.

Fixes 1f121b03d058 ("perf tools: Deal with kernel module names in '[]' correctly")
---
 tools/perf/tests/kmod-path.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
tools/perf/tests/kmod-path.c +16 -0
index 8e57d46109de..148dd31cc201 100644
@@ -127,6 +127,22 @@ int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_un
 	M("[vdso]", PERF_RECORD_MISC_KERNEL, false);
 	M("[vdso]", PERF_RECORD_MISC_USER, false);
 
+	T("[vdso32]", true      , true     , false, false, "[vdso32]", NULL);
+	T("[vdso32]", false     , true     , false, false, NULL    , NULL);
+	T("[vdso32]", true      , false    , false, false, "[vdso32]", NULL);
+	T("[vdso32]", false     , false    , false, false, NULL    , NULL);
+	M("[vdso32]", PERF_RECORD_MISC_CPUMODE_UNKNOWN, false);
+	M("[vdso32]", PERF_RECORD_MISC_KERNEL, false);
+	M("[vdso32]", PERF_RECORD_MISC_USER, false);
+
+	T("[vdsox32]", true      , true     , false, false, "[vdsox32]", NULL);
+	T("[vdsox32]", false     , true     , false, false, NULL    , NULL);
+	T("[vdsox32]", true      , false    , false, false, "[vdsox32]", NULL);
+	T("[vdsox32]", false     , false    , false, false, NULL    , NULL);
+	M("[vdsox32]", PERF_RECORD_MISC_CPUMODE_UNKNOWN, false);
+	M("[vdsox32]", PERF_RECORD_MISC_KERNEL, false);
+	M("[vdsox32]", PERF_RECORD_MISC_USER, false);
+
 	/* path         alloc_name  alloc_ext  kmod   comp   name          ext */
 	T("[vsyscall]", true      , true     , false, false, "[vsyscall]", NULL);
 	T("[vsyscall]", false     , true     , false, false, NULL        , NULL);
Signature · 1 line
1.9.1
#2 lore raw

[tip:perf/urgent] perf tests kmod-path: Add tests for vdso32 and vdsox32

perf tests kmod-path: Add tests for vdso32 and vdsox32
Commit-ID:  dcaeae4e2c266452e04dc3d83b10469be9fe419e
Gitweb:     https://git.kernel.org/tip/dcaeae4e2c266452e04dc3d83b10469be9fe419e
Author:     Adrian Hunter <[email protected]>
AuthorDate: Mon, 4 Jun 2018 15:56:53 +0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 6 Jun 2018 12:52:03 -0300

perf tests kmod-path: Add tests for vdso32 and vdsox32

Add tests for vdso32 and vdsox32. This will cause the overall test to fail because __kmod_path__parse() does not handle vdso32 or vdsox32.

Fixes 1f121b03d058 ("perf tools: Deal with kernel module names in '[]' correctly")
Cc Jiri Olsa <[email protected]>
Cc Wang Nan <[email protected]>
---
 tools/perf/tests/kmod-path.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
tools/perf/tests/kmod-path.c +16 -0
index 8e57d46109de..148dd31cc201 100644
@@ -127,6 +127,22 @@ int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_un
 	M("[vdso]", PERF_RECORD_MISC_KERNEL, false);
 	M("[vdso]", PERF_RECORD_MISC_USER, false);
 
+	T("[vdso32]", true      , true     , false, false, "[vdso32]", NULL);
+	T("[vdso32]", false     , true     , false, false, NULL    , NULL);
+	T("[vdso32]", true      , false    , false, false, "[vdso32]", NULL);
+	T("[vdso32]", false     , false    , false, false, NULL    , NULL);
+	M("[vdso32]", PERF_RECORD_MISC_CPUMODE_UNKNOWN, false);
+	M("[vdso32]", PERF_RECORD_MISC_KERNEL, false);
+	M("[vdso32]", PERF_RECORD_MISC_USER, false);
+
+	T("[vdsox32]", true      , true     , false, false, "[vdsox32]", NULL);
+	T("[vdsox32]", false     , true     , false, false, NULL    , NULL);
+	T("[vdsox32]", true      , false    , false, false, "[vdsox32]", NULL);
+	T("[vdsox32]", false     , false    , false, false, NULL    , NULL);
+	M("[vdsox32]", PERF_RECORD_MISC_CPUMODE_UNKNOWN, false);
+	M("[vdsox32]", PERF_RECORD_MISC_KERNEL, false);
+	M("[vdsox32]", PERF_RECORD_MISC_USER, false);
+
 	/* path         alloc_name  alloc_ext  kmod   comp   name          ext */
 	T("[vsyscall]", true      , true     , false, false, "[vsyscall]", NULL);
 	T("[vsyscall]", false     , true     , false, false, NULL        , NULL);
author reviewer
#3 lore raw

PATCH 2/2 perf tools: Fix symbol and object code resolution for vdso32 and vdsox32

In reply to Adrian Hunter

Fix __kmod_path__parse() so that perf tools does not treat vdso32 and vdsox32 as kernel modules and fail to find the object.

Fixes 1f121b03d058 ("perf tools: Deal with kernel module names in '[]' correctly")
---
 tools/perf/util/dso.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/dso.c +2 -0
index cdfc2e5f55f5..51cf82cf1882 100644
@@ -354,6 +354,8 @@ int __kmod_path__parse(struct kmod_path *m, const char *path,
 		if ((strncmp(name, "[kernel.kallsyms]", 17) == 0) ||
 		    (strncmp(name, "[guest.kernel.kallsyms", 22) == 0) ||
 		    (strncmp(name, "[vdso]", 6) == 0) ||
+		    (strncmp(name, "[vdso32]", 8) == 0) ||
+		    (strncmp(name, "[vdsox32]", 9) == 0) ||
 		    (strncmp(name, "[vsyscall]", 10) == 0)) {
 			m->kmod = false;
 
Signature · 1 line
1.9.1
#4 lore raw
perf tools: Fix symbol and object code resolution for vdso32 and vdsox32
Commit-ID:  aef4feace285f27c8ed35830a5d575bec7f3e90a
Gitweb:     https://git.kernel.org/tip/aef4feace285f27c8ed35830a5d575bec7f3e90a
Author:     Adrian Hunter <[email protected]>
AuthorDate: Mon, 4 Jun 2018 15:56:54 +0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 6 Jun 2018 12:52:04 -0300

perf tools: Fix symbol and object code resolution for vdso32 and vdsox32

Fix __kmod_path__parse() so that perf tools does not treat vdso32 and vdsox32 as kernel modules and fail to find the object.

Cc Jiri Olsa <[email protected]>
Cc Wang Nan <[email protected]>
Fixes 1f121b03d058 ("perf tools: Deal with kernel module names in '[]' correctly")
---
 tools/perf/util/dso.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/dso.c +2 -0
index cdfc2e5f55f5..51cf82cf1882 100644
@@ -354,6 +354,8 @@ int __kmod_path__parse(struct kmod_path *m, const char *path,
 		if ((strncmp(name, "[kernel.kallsyms]", 17) == 0) ||
 		    (strncmp(name, "[guest.kernel.kallsyms", 22) == 0) ||
 		    (strncmp(name, "[vdso]", 6) == 0) ||
+		    (strncmp(name, "[vdso32]", 8) == 0) ||
+		    (strncmp(name, "[vdsox32]", 9) == 0) ||
 		    (strncmp(name, "[vsyscall]", 10) == 0)) {
 			m->kmod = false;
 
maintainer Applied
#5 lore raw
In reply to Adrian Hunter

Em Mon, Jun 04, 2018 at 03:56:52PM +0300, Adrian Hunter escreveu:

Quoted 4 lines

Hi

Here are a couple of small fixes for tracing 32-bit binaries on a 64-bit kernel.

Thanks, applied both to both perf/urgent and perf/core.

- Arnaldo

Quoted 12 lines

Adrian Hunter (2):
perf tests kmod-path: Add tests for vdso32 and vdsox32
perf tools: Fix symbol and object code resolution for vdso32 and vdsox32

 tools/perf/tests/kmod-path.c | 16 ++++++++++++++++
 tools/perf/util/dso.c        |  2 ++
 2 files changed, 18 insertions(+)

Regards
Adrian