Received: by 10.213.65.68 with SMTP id h4csp157293imn; Mon, 19 Mar 2018 23:24:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELthueVIhpcrCSM+ugtwcS61urbcfpHjgeRiKK/WYlR5qzNvV+btYNK/vHDa/FXq22QDJ7g2 X-Received: by 2002:a17:902:968a:: with SMTP id n10-v6mr9736774plp.397.1521527058648; Mon, 19 Mar 2018 23:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521527058; cv=none; d=google.com; s=arc-20160816; b=f0G57JTWuJ/jiptzEHORkUXx4la/PEJZ1fj5xV+b6aA0nmCXzEk/svPAN4rtCou9Nb ePTlfefUooU19BlcIj/llgod/izEZls/Dq9MLmlnbOequKVhzS5xSODeGynLndRxzy22 IP03fGC8b4bd6LJRiHCblBcZCIyGIDjjetajzSeHkV9z7OnutBFQ601vE/7wv8DpgqQW ILw67utmkZaCfQHEUbIpfy4zyIFgaA9rf7c5oGggLjhG/CoBEVW4nDg5as/T2Vy5g+xe ZtEStnl04amt+vNhHqjTqFxA2koTVs95xk7slu3BC1oO9+fzezi5StFY7gSO8dTGkf9o Wo8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=UJvek/4ty+0ErJLOImdcQB3irdKquIzcKu15/qGn9TU=; b=e+5XU5xXX0IsflOJB8Wx6jBzZs/t9xuz4gPq9k8y8bu/vbeKbLoQ2vKKZrLR3Ic55g ilAJ0e/GuRVTuUQ2tVPkg+NAMl91R4dfwZbyXWZkAzKtVJFjNuI1bprSfY0doO4KZYcI tbWDMBB5y6xpzdPGvDiRzsw3ZeJRQMaZNNZG/yL4z0RMK8atwh07DE6/a++hC1/RyEri un+A/POHEO/kI/1ChRCqw3AmERWGE5CQfvnuUnCJQVxvmNdIfTrwygq2itfU960TOEM6 JDP8A1CtSV723XBBryADgaM2QdchYuqeG/69I0KZdBFN0wRlzDSku3wsx3jCk5DqT6ah w2Tw== 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 i23-v6si298419pll.251.2018.03.19.23.24.05; Mon, 19 Mar 2018 23:24:18 -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 S1752061AbeCTGXL (ORCPT + 99 others); Tue, 20 Mar 2018 02:23:11 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47809 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbeCTGXF (ORCPT ); Tue, 20 Mar 2018 02:23:05 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2K6LOfq028701; Mon, 19 Mar 2018 23:21:24 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2K6LNuT028694; Mon, 19 Mar 2018 23:21:23 -0700 Date: Mon, 19 Mar 2018 23:21:23 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for John Garry Message-ID: Cc: john.garry@huawei.com, ak@linux.intel.com, mingo@kernel.org, jolsa@kernel.org, wcohen@redhat.com, linux-kernel@vger.kernel.org, will.deacon@arm.com, namhyung@kernel.org, acme@redhat.com, alexander.shishkin@linux.intel.com, zhangshaokun@hisilicon.com, peterz@infradead.org, ganapatrao.kulkarni@cavium.com, hpa@zytor.com, tglx@linutronix.de Reply-To: wcohen@redhat.com, jolsa@kernel.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, john.garry@huawei.com, mingo@kernel.org, ak@linux.intel.com, alexander.shishkin@linux.intel.com, acme@redhat.com, namhyung@kernel.org, tglx@linutronix.de, ganapatrao.kulkarni@cavium.com, hpa@zytor.com, zhangshaokun@hisilicon.com, peterz@infradead.org In-Reply-To: <1520506716-197429-2-git-send-email-john.garry@huawei.com> References: <1520506716-197429-2-git-send-email-john.garry@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf vendor events: Drop incomplete multiple mapfile support Git-Commit-ID: 4c0ab16052054946b7b28f8b0ceee57c10d64cc7 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4c0ab16052054946b7b28f8b0ceee57c10d64cc7 Gitweb: https://git.kernel.org/tip/4c0ab16052054946b7b28f8b0ceee57c10d64cc7 Author: John Garry AuthorDate: Thu, 8 Mar 2018 18:58:26 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 16 Mar 2018 13:53:55 -0300 perf vendor events: Drop incomplete multiple mapfile support 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(-) 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; }