Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5797105rwb; Tue, 22 Nov 2022 05:10:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5r2OfmfCAHgSl+kZu72pVilhcI3+GhKR7TYuGt275qWvqBOPTpUkNd1uyf6+pkg7di1nwP X-Received: by 2002:a63:2306:0:b0:46f:918e:7339 with SMTP id j6-20020a632306000000b0046f918e7339mr3568812pgj.429.1669122624849; Tue, 22 Nov 2022 05:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669122624; cv=none; d=google.com; s=arc-20160816; b=UrunSXO/E1HJJkupB+3Savb+fRZEQGAsWdrqpAT2e07X8XslH+P/68tnBw/ldXUqOM 4meT1Twm0nOBYArcdb0R4v7MjmlgHvTUp8nr2hYJO6zmeF2lUTbAPP1m8+hLq8ERIBMe VVOG8SpF3ypbldYMIsV71GwBbGepCKAebCOgFAWs78sRrbDiZl1rw4EyPqOfCzTNlZP9 uNLXHtZB0o1sC/dSI03YWIBAcNflA2+x1c10GlIx54nkk+qeSbxt6Ecoua/3ZW11ipRr elBOLM7lHH1U/tCFlPLHd5bD52q4nPZzD80gi2aAmtlfui7s5PRJxZ2hRMa3fsq9Tm4x FOcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=ZqpXAMDsMAB59HjkANxGugcqsHT0OpJ6HhWDrpNqiMc=; b=iuI1DGdKYvvxVmHlZk+37ZxTsiTKKAdEs5PCtzMjZ08K130qvGLCpAQNvPNxu7XNBk mXXYMoUtrb7T6z84ghcb4YvkgF5LoPBuDPHIp0YI5jiLB0SD6nZGHF2BD76DJAdqPwsy BIat+OgIp1ZGNavvNaCqAM9O+qNah/EzrDs5RO74sValQj3nYiQj/9NmSo69GSIZixOx UuY6/QLxfSBwZvLfAM20YurJ+kl/lvEC5Ouw+mK9x5PaOhF+BHO/wzqGodYhiR7THFtG EOWEYXS+vJGyezAOD+dJyi4pOzZ19eQrr0Dy60hMSjEFe7eXnXw2Gkb+SVyJnnHh7XCR 4c/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a17090a0c0900b00212d47deabesi12255398pjs.60.2022.11.22.05.10.13; Tue, 22 Nov 2022 05:10:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233613AbiKVMLT (ORCPT + 90 others); Tue, 22 Nov 2022 07:11:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233616AbiKVMLM (ORCPT ); Tue, 22 Nov 2022 07:11:12 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F064877B; Tue, 22 Nov 2022 04:11:10 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NGjld0LlWz8RV7H; Tue, 22 Nov 2022 20:11:09 +0800 (CST) Received: from szxlzmapp04.zte.com.cn ([10.5.231.166]) by mse-fl1.zte.com.cn with SMTP id 2AMCAvUB099604; Tue, 22 Nov 2022 20:10:57 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Tue, 22 Nov 2022 20:11:00 +0800 (CST) Date: Tue, 22 Nov 2022 20:11:00 +0800 (CST) X-Zmail-TransId: 2b04637cbc54ffffffffd22e5c5b X-Mailer: Zmail v1.0 Message-ID: <202211222011006572179@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIHBlcmYgc3RhdDogdXNlIHN5c2ZzX3N0cmVxKCkgaW5zdGVhZCBvZiBzdHJuY21wKCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2AMCAvUB099604 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 637CBC5D.000 by FangMail milter! X-FangMail-Envelope: 1669119069/4NGjld0LlWz8RV7H/637CBC5D.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 637CBC5D.000/4NGjld0LlWz8RV7H X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Panda Replace the open-code with sysfs_streq(). Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- tools/perf/util/stat-display.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index f5501760ff2e..1fd9f7e9d2a1 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -463,7 +463,7 @@ static bool valid_only_metric(const char *unit) static const char *fixunit(char *buf, struct evsel *evsel, const char *unit) { - if (!strncmp(unit, "of all", 6)) { + if (sysfs_streq(unit, "of all")) { snprintf(buf, 1024, "%s %s", evsel__name(evsel), unit); return buf; @@ -767,8 +767,7 @@ static void uniquify_event_name(struct evsel *counter) int ret = 0; if (counter->uniquified_name || counter->use_config_name || - !counter->pmu_name || !strncmp(counter->name, counter->pmu_name, - strlen(counter->pmu_name))) + !counter->pmu_name || sysfs_streq(counter->name, counter->pmu_name)) return; config = strchr(counter->name, '/'); -- 2.15.2