From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422990AbcFHIio (ORCPT ); Wed, 8 Jun 2016 04:38:44 -0400 Received: from terminus.zytor.com ([198.137.202.10]:53704 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161014AbcFHIil (ORCPT ); Wed, 8 Jun 2016 04:38:41 -0400 Date: Wed, 8 Jun 2016 01:38:25 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, ak@linux.intel.com, acme@redhat.com, tglx@linutronix.de, mingo@kernel.org, jolsa@kernel.org Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@redhat.com, ak@linux.intel.com, hpa@zytor.com, jolsa@kernel.org In-Reply-To: <1465223766-29902-1-git-send-email-andi@firstfloor.org> References: <1465223766-29902-1-git-send-email-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf test: Ignore .scale and other special files Git-Commit-ID: 17a2634bcb88e52bd637fdaa47d7ff0bddb0188f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 17a2634bcb88e52bd637fdaa47d7ff0bddb0188f Gitweb: http://git.kernel.org/tip/17a2634bcb88e52bd637fdaa47d7ff0bddb0188f Author: Andi Kleen AuthorDate: Mon, 6 Jun 2016 07:36:06 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 6 Jun 2016 12:11:14 -0300 perf test: Ignore .scale and other special files 'perf test' tries to parse all entries in /sys/devices/cpu/events/. Ignore the special entries like '.scale', which cannot be directly parsed as an event. This patch assumes all files containing a '.' are special and can be ignored. Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Andi Kleen Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1465223766-29902-1-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/parse-events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 7865f68..b2a2c74 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1783,8 +1783,8 @@ static int test_pmu_events(void) struct evlist_test e; char name[MAX_NAME]; - if (!strcmp(ent->d_name, ".") || - !strcmp(ent->d_name, "..")) + /* Names containing . are special and cannot be used directly */ + if (strchr(ent->d_name, '.')) continue; snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);