lkml.org 
[lkml]   [2015]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf test: Fix the cmd string comparison in perf test 6
Date
The Sleep command is "sleep.coreutils" in Yocto project, so
the command mmap filename is "sleep.coreutils" in perf test
6. Strncmp() can get the right result.

Before:
# perf test -v 6
6: Validate PERF_RECORD_* events & perf_sample fields :
--- start ---
test child forked, pid 31717
mmap size 1052672B
588401125676220 0 PERF_RECORD_SAMPLE
...
588402126709180 0 PERF_RECORD_EXIT(31718:31718):(31718:31718)
PERF_RECORD_MMAP for sleep missing!
test child finished with -1
---- end ----
Validate PERF_RECORD_* events & perf_sample fields: FAILED!

After:
# perf test -v 6
6: Validate PERF_RECORD_* events & perf_sample fields :
--- start ---
test child forked, pid 31725
mmap size 1052672B
588588715789540 0 PERF_RECORD_SAMPLE
...
588589716825180 0 PERF_RECORD_EXIT(31726:31726):(31726:31726)
test child finished with 0
---- end ----
Validate PERF_RECORD_* events & perf_sample fields: Ok

Signed-off-by: Kaixu Xia <xiakaixu@huawei.com>
---
tools/perf/tests/perf-record.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 7a228a2..080f41b 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -240,7 +240,7 @@ int test__PERF_RECORD(void)
bname = strrchr(mmap_filename, '/');
if (bname != NULL) {
if (!found_cmd_mmap)
- found_cmd_mmap = !strcmp(bname + 1, cmd);
+ found_cmd_mmap = !strncmp(bname + 1, cmd, 5);
if (!found_libc_mmap)
found_libc_mmap = !strncmp(bname + 1, "libc", 4);
if (!found_ld_mmap)
--
1.8.3.4


\
 
 \ /
  Last update: 2015-12-15 09:41    [W:0.037 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site