perf tools: Fix symbol and object code resolution for vdso32 and vdsox32
Adrian Hunter
reviewercover 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
Adrian Hunter
reviewerPATCH 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.
--- tools/perf/tests/kmod-path.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
tools/perf/tests/kmod-path.c +16 -0
@@ -127,6 +127,22 @@ int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_unM ("[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
tip-bot for Adrian Hunter
merge bot[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.
--- tools/perf/tests/kmod-path.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
tools/perf/tests/kmod-path.c +16 -0
@@ -127,6 +127,22 @@ int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_unM ("[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 );
Adrian Hunter
reviewerPATCH 2/2 perf tools: Fix symbol and object code resolution for vdso32 and vdsox32
In reply to Adrian HunterFix __kmod_path__parse() so that perf tools does not treat vdso32 and vdsox32 as kernel modules and fail to find the object.
--- tools/perf/util/dso.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/dso.c +2 -0
@@ -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
tip-bot for Adrian Hunter
merge botperf 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.
--- tools/perf/util/dso.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/dso.c +2 -0
@@ -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;
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 vdsox32tools/perf/tests/kmod-path.c | 16 ++++++++++++++++ tools/perf/util/dso.c | 2 ++ 2 files changed, 18 insertions(+)Regards
Adrian