From patchwork Tue Mar 13 12:04:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 131443 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp643470ljb; Tue, 13 Mar 2018 05:06:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELtwSCVViKyb/IWoDFd1f+iUD4OpC1+vnU8dThszdUCkadudVO36Sg7O3qQpo/2q/PisDUzj X-Received: by 10.98.63.75 with SMTP id m72mr395765pfa.122.1520942766079; Tue, 13 Mar 2018 05:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520942766; cv=none; d=google.com; s=arc-20160816; b=y/z9lymGOEsX3TV60C/tbsZvGcnkv1e97j3aquWQU2b2yRnb9t1XcdQTsXCrwTL0nD 7IigaeYUfPyvdWWo+9tFW7SFKcoQ3IroG3enhREqmigiuHoA/Ss3heD0d2YNWbm5MsoC PcVWQbYkTIhKjSiUJDm6hhedhxACKCLnILOjXCxjUEIBm/Hf9R2Q7Xx+rJiZfMS1JGJl rOmCoheP4YF8JEVONjHdDMjQHFcrW28j9JcdIj10Pqx6CnOX048gEUv91qjBiuJBN/Nt dXvwRT4kad8HNmFZ5WyrMgd6Gg2YBOACeZ5kCOEMzfPe54BiUI3IJkhx0RodqVGotNy8 nu1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=Vu0+mB8kYK9pH5trUxh3liUQcq4I15eYyKzTQXpUZbc=; b=yajPHbdB3js95qyKF9DMq53NgxHqIVROBNDE6o8Gq973+S/EYMsbkSWnUKncfVDNmr vJYn8KoOu+rS2mFvSqs8njML9PdZu/PPsO1+j7B5Nkbun6Jt098v4b7OP3oES6uXFXZd DMw6TwIxsbDcb/8iGYzQlT/lHW3wZH/S973+3xtP0AILsLOND8VkC6BMqZXPhG8AqF3e UGI9wFjcr5PKmYktAUI0NhJYjbHjbxwYGwPLz0sFiDveJ78gbm3xtgcLFx14ptUHLetL LFZpaSGXXiN5e8LBxToP8a2Dov3uhGO9KLt7nn8OE+iACaAznSxjObCYPUUo5KvSUo26 LJdQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e61-v6si49075plb.190.2018.03.13.05.06.05; Tue, 13 Mar 2018 05:06:06 -0700 (PDT) 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 S933225AbeCMMGC (ORCPT + 28 others); Tue, 13 Mar 2018 08:06:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:54698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933198AbeCMMF7 (ORCPT ); Tue, 13 Mar 2018 08:05:59 -0400 Received: from jouet.infradead.org (unknown [177.79.83.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41608204EF; Tue, 13 Mar 2018 12:05:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41608204EF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, John Garry , Alexander Shishkin , Andi Kleen , Ganapatrao Kulkarni , Namhyung Kim , Peter Zijlstra , Shaokun Zhang , Will Deacon , William Cohen , linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com, Arnaldo Carvalho de Melo Subject: [PATCH 11/31] perf vendor events: Drop incomplete multiple mapfile support Date: Tue, 13 Mar 2018 09:04:48 -0300 Message-Id: <20180313120508.29327-12-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313120508.29327-1-acme@kernel.org> References: <20180313120508.29327-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Garry Currently jevents supports multiple mapfiles, but this is only in the form where mapfile basename starts with 'mapfile.csv' At the moment, no architectures actually use multiple mapfiles, so drop the support for now. This patch also solves a nuisance where, when the mapfile is edited and the text editor may create a backup, jevents may use the backup, as shown: jevents: Many mapfiles? Using pmu-events/arch/arm64/mapfile.csv~, ignoring pmu-events/arch/arm64/mapfile.csv Signed-off-by: John Garry Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ganapatrao Kulkarni Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Shaokun Zhang Cc: Will Deacon Cc: William Cohen Cc: linux-arm-kernel@lists.infradead.org Cc: linuxarm@huawei.com Link: http://lkml.kernel.org/r/1520506716-197429-2-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/pmu-events/README | 5 ++--- tools/perf/pmu-events/jevents.c | 10 ++-------- 2 files changed, 4 insertions(+), 11 deletions(-) -- 2.14.3 diff --git a/tools/perf/pmu-events/README b/tools/perf/pmu-events/README index c2ee3e4417fe..2407abc1d441 100644 --- a/tools/perf/pmu-events/README +++ b/tools/perf/pmu-events/README @@ -11,9 +11,8 @@ tree tools/perf/pmu-events/arch/foo. - Regular files with '.json' extension in the name are assumed to be JSON files, each of which describes a set of PMU events. - - Regular files with basename starting with 'mapfile.csv' are assumed - to be a CSV file that maps a specific CPU to its set of PMU events. - (see below for mapfile format) + - The CSV file that maps a specific CPU to its set of PMU events is to + be named 'mapfile.csv' (see below for mapfile format). - Directories are traversed, but all other files are ignored. diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index b578aa26e375..9e0a21e74a67 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -798,16 +798,10 @@ static int process_one_file(const char *fpath, const struct stat *sb, * after processing all JSON files (so we can write out the * mapping table after all PMU events tables). * - * TODO: Allow for multiple mapfiles? Punt for now. */ if (level == 1 && is_file) { - if (!strncmp(bname, "mapfile.csv", 11)) { - if (mapfile) { - pr_info("%s: Many mapfiles? Using %s, ignoring %s\n", - prog, mapfile, fpath); - } else { - mapfile = strdup(fpath); - } + if (!strcmp(bname, "mapfile.csv")) { + mapfile = strdup(fpath); return 0; }