From patchwork Tue Dec 15 08:09:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaixu Xia X-Patchwork-Id: 58379 Delivered-To: patch@linaro.org Received: by 10.112.129.4 with SMTP id ns4csp46633lbb; Tue, 15 Dec 2015 00:10:40 -0800 (PST) X-Received: by 10.98.80.135 with SMTP id g7mr42807993pfj.83.1450167040673; Tue, 15 Dec 2015 00:10:40 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uk9si260801pac.166.2015.12.15.00.10.39; Tue, 15 Dec 2015 00:10:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933250AbbLOIJv (ORCPT + 28 others); 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 Received: from 172.24.1.47 (EHLO szxeml427-hub.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BSU21093; Tue, 15 Dec 2015 16:09:41 +0800 (CST) Received: from euler.hulk-profiling (10.107.193.250) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.235.1; Tue, 15 Dec 2015 16:09:17 +0800 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 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/ 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)