Received: by 10.223.185.116 with SMTP id b49csp6170337wrg; Thu, 8 Mar 2018 03:04:02 -0800 (PST) X-Google-Smtp-Source: AG47ELurgtc9ari4jT/XvsfRGpiUfsGXNzFkRdRzy/WaiAx42UQRTx9vbyWXU8lAXJKUPOhZRi94 X-Received: by 10.99.102.5 with SMTP id a5mr20854892pgc.452.1520507042016; Thu, 08 Mar 2018 03:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520507041; cv=none; d=google.com; s=arc-20160816; b=O4bE9VDT/xQfv6MTK0syULqGl5sEdm53H01ZIGs6OCKykGU/KkyIJ3nggUMe6PAS28 PRh5ipUjnz9z9DiLuS1/dix1Vkg/ZHVCh7OeDjY02d7/bZwGBmSX+sGv7wpOKR7uxrS0 EkW+TBDxLtct4oK2RTVKMPRJFWaR2dc+Hd1tCFqoE8DxdwxoUU4RytfjQA7R7ojYHQoK uqoajuuEbExqPh33edm1zYBhvjj2xfliKDGPEVY1TaUFgnEF4FefK5xkagEh4pCyF5Y8 V3hepUf0eJ1FD4hmaut2eD7jsEm+3nkmCCTpVlRwyv+ChwNyGCDecVZCO973Bz8F4M81 ZSRg== 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=R3OjjB28Eu4KhpjEN9cWhzSD3x3cfWjq2XOka+McKPDt9YLldY0C+neCPJZyJo/n/J yxcDQqD8xLiOZpxWfOfSixrux9SohVfwIIjMu02WsVLt4T+OMyxLZYiIIakQFKvCZX0F V5rYPW/uMtQIZLKIDBNCKVZ3cn/ZDaSC/StgkpLws+QthbHkfdbZg9f/cwgHTZSI0l18 kUwjXs/Wz8dbtSqPGcCe/mws+TBI2WSIxVTkLuRXw7yS3qYxT9zobt8n0+yX7zA0ui7s kTLg9Q5gfYWKqwzdM9CAK7js1HVewLILKOdQJxzt1JHv8cbdyxSeERvktopDvLyGdwkx aqxQ== 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 59-v6si12818264pla.754.2018.03.08.03.03.47; Thu, 08 Mar 2018 03:04:01 -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 S966125AbeCHLCB (ORCPT + 99 others); Thu, 8 Mar 2018 06:02:01 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6179 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755736AbeCHK7p (ORCPT ); Thu, 8 Mar 2018 05:59:45 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C876EB76D89DD; Thu, 8 Mar 2018 18:59:30 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Thu, 8 Mar 2018 18:59:24 +0800 From: John Garry To: , , , , , , , , , CC: , , , , "John Garry" Subject: [PATCH v3 01/11] perf vendor events: drop incomplete multiple mapfile support Date: Thu, 8 Mar 2018 18:58:26 +0800 Message-ID: <1520506716-197429-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520506716-197429-1-git-send-email-john.garry@huawei.com> References: <1520506716-197429-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain 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(-) 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; } -- 1.9.1