From patchwork Fri Feb 23 16:05:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 129378 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp749464edc; Fri, 23 Feb 2018 07:16:18 -0800 (PST) X-Google-Smtp-Source: AH8x225FG0dUNqrMJ/hJ65sMViFXgJfCScXNkwRh/avwem6OBMmlvUiUxVsXLSVqrR5nQbcfRHJl X-Received: by 10.99.97.9 with SMTP id v9mr1678680pgb.373.1519398978364; Fri, 23 Feb 2018 07:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519398978; cv=none; d=google.com; s=arc-20160816; b=VlEDhuPrtdpQ//PBDp7kGBr+RB9UxhhQONirRd6xI+YZk/3pG3B86+Nj6ee4BL8/eL 87jcFbKxQyzdGd2BVqY4bpD/gOZSOsk+Qvyjd6UPQV6MCa5nEAijavc8XurU73hYZDn6 wa5O6fhUoujE0gtwZFlQR6fFxN/6FW3RFOJGWYL0NUGrzJ9jML4SGgOsIArA18f61HNR jALyolxodIhheJ0RU9SFqZ+sFEfPzoUB3zECJteEYCFk9lx5AFJqkurO05sXHAWQC9Nm i461ftNm6F0Wr9X4nKLEbNRzfrZwsQRt0/PuxOL98s9gdSWcV2jIP3lity/1aVOhBnMy rZkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=vyBbUkFPS348DmzbElxi0P5dt0F+La3szKjnLjX3h/8=; b=WblmiK1gXF3GdmErk5eXWadahnpjsqc+d/OoRSGLgGJ/fB2PrFn49zH1I8om9z2w0T FesV5iQN6tAl0pNaNYNVRwn7Ce4Z68HkwwLp1NgyeA7Hjg7h5mr4zBEvv2cIEnKaMQtA 4s4xHlVFrjsCsaPlJVx62LMJcqFOgENwVT5E/MmoBpfpDxpiKcGKZ1+8iCfluUtb+mRJ zaJrdYcAx8XyP78Xnk/ZScp9T1cncVuSkIuOH3iP/kIo8FDbpitnK3U4Ur8/sz9UIXOr zLj5PEXWhPQzjQtYpmuWOC91VeVl/y2vmS5uJ2aU+JfoPd5t7xL/pyqIzbyR3xs/QLf0 AbOw== 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 73si1033911pfu.71.2018.02.23.07.16.18; Fri, 23 Feb 2018 07:16:18 -0800 (PST) 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 S1751928AbeBWPQC (ORCPT + 28 others); Fri, 23 Feb 2018 10:16:02 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:39956 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751912AbeBWPO1 (ORCPT ); Fri, 23 Feb 2018 10:14:27 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C73075E693F33; Fri, 23 Feb 2018 23:14:19 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Fri, 23 Feb 2018 23:14:11 +0800 From: John Garry To: , , , , , , , , , CC: , , , , "John Garry" Subject: [PATCH v2 01/11] perf vendor events: drop incomplete multiple mapfile support Date: Sat, 24 Feb 2018 00:05:22 +0800 Message-ID: <1519401932-205051-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519401932-205051-1-git-send-email-john.garry@huawei.com> References: <1519401932-205051-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/perf/pmu-events/README | 5 ++--- tools/perf/pmu-events/jevents.c | 10 ++-------- 2 files changed, 4 insertions(+), 11 deletions(-) -- 1.9.1 diff --git a/tools/perf/pmu-events/README b/tools/perf/pmu-events/README index c2ee3e4..2407abc 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 b578aa2..9e0a21e 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; }