Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933249AbbLOIJv (ORCPT ); Tue, 15 Dec 2015 03:09:51 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:54280 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933234AbbLOIJt (ORCPT ); Tue, 15 Dec 2015 03:09:49 -0500 From: Kaixu Xia To: , , , , CC: , , Subject: [PATCH] perf test: Fix the cmd string comparison in perf test 6 Date: Tue, 15 Dec 2015 08:09:12 +0000 Message-ID: <1450166952-20479-1-git-send-email-xiakaixu@huawei.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.566FCACA.001B,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e378b5522d749ff0f1683f5bdeac4d5c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1930 Lines: 57 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 --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/