lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 15 Dec 2015 08:09:12 +0000
From:	Kaixu Xia <xiakaixu@...wei.com>
To:	<acme@...nel.org>, <mingo@...nel.org>, <jolsa@...hat.com>,
	<namhyung@...nel.org>, <masami.hiramatsu.pt@...achi.com>
CC:	<xiakaixu@...wei.com>, <linux-kernel@...r.kernel.org>,
	<wangnan0@...wei.com>
Subject: [PATCH] perf test: Fix the cmd string comparison in perf test 6

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@...wei.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ