From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752993AbcFFOgs (ORCPT ); Mon, 6 Jun 2016 10:36:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:56870 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbcFFOgq (ORCPT ); Mon, 6 Jun 2016 10:36:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,427,1459839600"; d="scan'208";a="714685840" From: Andi Kleen To: acme@kernel.org Cc: linux-kernel@vger.kernel.org, jolsa@kernel.org, Andi Kleen Subject: [PATCH] perf test: Ignore .scale and other special files Date: Mon, 6 Jun 2016 07:36:06 -0700 Message-Id: <1465223766-29902-1-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 2.5.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen 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. Signed-off-by: Andi Kleen --- 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 7865f68dc0d8..b2a2c74136a5 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); -- 2.5.5