From patchwork Tue Feb 27 22:34:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Agustin Vega-Frias X-Patchwork-Id: 10246279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C099B60208 for ; Tue, 27 Feb 2018 22:44:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADAB0289E8 for ; Tue, 27 Feb 2018 22:44:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A240828AF2; Tue, 27 Feb 2018 22:44:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E3DF289E8 for ; Tue, 27 Feb 2018 22:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=p4N+OjXB9v837+e5MkHl1Eiz6fxij4nblNzULou76i0=; b=MOw7jAC1SFqFEMPWiARDebCE2Q MUzFhEjCPzk5ExX2jpO11jRRwUiewZR0SPQ4l+sewA8XkjI9SQcdOX/hSrYPIRvNJxGttGknzPTU5 b7+qFZueZNUBdF9C9VwfnOWeZezac+yd1105ZdsDgiicdo6JGqqD6RFw8cv2FkFfXd1iVJYhgo+lV 5XjsNE4BPMapiaL1E3QamPlFNCZOL/UNGbaYxTSeuZ1CDe3lmJuRkAznQNCXr/U/7uLOb/l9kXXYN b+0pFnSr50NMH7kHmUflZsDBNyFL9ZbhUtIn0ZVmNXQJya4DZZdbi+6EclXYO478qgtP2OwtSbgPD SuIMuq3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqnyS-000673-5V; Tue, 27 Feb 2018 22:43:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqnyP-00060k-Fl for linux-arm-kernel@bombadil.infradead.org; Tue, 27 Feb 2018 22:43:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=u4b6EHc2GodON7qAccESMyUTIzV/89Fg+IbQ6y1P1SE=; b=bgPxoF1WcW2D0MZNNjlUYc3Jm G5DpxKr8SuQF+ME+1OiTlHfa+qiZG87LRK9Xz46gPeeQb8pnHolcrqX0bEiRfHwxbeUreniEcNELT CNLRKctfHiL+Fk09VLX+JvPMn60NCrReYnP7bL5517gS0HqprSiEBtTftR3HabWZvPBRExHm0JF3w V/fsi+inaNrFCPlCWS1H3AF2Cp7Pk7f0oPd/NzX6r6gllzjq9GI2TAEwe+P9AwiAzqE+bi5wwIk3f NT+c4x/UJcwB4DoliZ+HkU4gcsa+BcdbIhAJiE0uJVldXYwbBzJgqNcw5uy0dWBpOrimZytyKlaD9 +yvtMivLQ==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqnqI-0008Cp-RO for linux-arm-kernel@lists.infradead.org; Tue, 27 Feb 2018 22:35:28 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E992A6109C; Tue, 27 Feb 2018 22:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519770915; bh=S6QXlE+531/uBZfB+Dhs8ZVyT1dTkyXXm16dBpBq23M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=omQo5M3KUkLCOszcTkIGuplDhvYHB8lwLWVIh5pMKHWAiZhEFyWGkO3rCtgUAW9gV WuU3WPTgFQ0f0jEbGujNAkNWsODTAc7b98KgOEP4t6s961Pwj8eHu8gqpKj67lKLCp +0cxrQ34r+FvYf3tHKuAKesxBURoyI8PE3ztZzWw= Received: from azshara.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: agustinv@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C868F60F91; Tue, 27 Feb 2018 22:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519770915; bh=S6QXlE+531/uBZfB+Dhs8ZVyT1dTkyXXm16dBpBq23M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=omQo5M3KUkLCOszcTkIGuplDhvYHB8lwLWVIh5pMKHWAiZhEFyWGkO3rCtgUAW9gV WuU3WPTgFQ0f0jEbGujNAkNWsODTAc7b98KgOEP4t6s961Pwj8eHu8gqpKj67lKLCp +0cxrQ34r+FvYf3tHKuAKesxBURoyI8PE3ztZzWw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C868F60F91 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=agustinv@codeaurora.org From: Agustin Vega-Frias To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Andi Kleen , Alexander Shishkin , Jiri Olsa , Namhyung Kim Subject: [RFC 3/3] perf pmu: Restore auto-merging of PMU events created by prefix match Date: Tue, 27 Feb 2018 17:34:08 -0500 Message-Id: <1519770848-26738-4-git-send-email-agustinv@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519770848-26738-1-git-send-email-agustinv@codeaurora.org> References: <1519770848-26738-1-git-send-email-agustinv@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180227_223527_174006_C8379957 X-CRM114-Status: GOOD ( 13.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: timur@codeaurora.org, agustinv@codeaurora.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This was disabled when auto-merging of non-alias events was disabled in commit 63ce844 (perf stat: Only auto-merge events that are PMU aliases). Signed-off-by: Agustin Vega-Frias --- tools/perf/util/parse-events.c | 13 +++---------- tools/perf/util/parse-events.h | 2 +- tools/perf/util/parse-events.y | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index bafc91e..4e80ca3 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1217,7 +1217,7 @@ int parse_events_add_numeric(struct parse_events_state *parse_state, get_config_name(head_config), &config_terms); } -static int __parse_events_add_pmu(struct parse_events_state *parse_state, +int parse_events_add_pmu(struct parse_events_state *parse_state, struct list_head *list, char *name, struct list_head *head_config, bool auto_merge_stats) { @@ -1287,13 +1287,6 @@ static int __parse_events_add_pmu(struct parse_events_state *parse_state, return evsel ? 0 : -ENOMEM; } -int parse_events_add_pmu(struct parse_events_state *parse_state, - struct list_head *list, char *name, - struct list_head *head_config) -{ - return __parse_events_add_pmu(parse_state, list, name, head_config, false); -} - int parse_events_multi_pmu_add(struct parse_events_state *parse_state, char *str, struct list_head **listp) { @@ -1323,8 +1316,8 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state, return -1; list_add_tail(&term->list, head); - if (!__parse_events_add_pmu(parse_state, list, - pmu->name, head, true)) { + if (!parse_events_add_pmu(parse_state, list, + pmu->name, head, true)) { pr_debug("%s -> %s/%s/\n", str, pmu->name, alias->str); ok++; diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 88108cd..5015cfd 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -167,7 +167,7 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx, void *ptr, char *type, u64 len); int parse_events_add_pmu(struct parse_events_state *parse_state, struct list_head *list, char *name, - struct list_head *head_config); + struct list_head *head_config, bool auto_merge_stats); int parse_events_multi_pmu_add(struct parse_events_state *parse_state, char *str, diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index c528469..b51278f 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -232,7 +232,7 @@ PE_NAME opt_event_config YYABORT; ALLOC_LIST(list); - if (parse_events_add_pmu(_parse_state, list, $1, $2)) { + if (parse_events_add_pmu(_parse_state, list, $1, $2, false)) { struct perf_pmu *pmu = NULL; int ok = 0; @@ -245,7 +245,7 @@ PE_NAME opt_event_config if (!strncmp($1, name, strlen($1)) || !fnmatch($1, name, 0)) { if (parse_events_copy_term_list(orig_terms, &terms)) YYABORT; - if (!parse_events_add_pmu(_parse_state, list, pmu->name, terms)) + if (!parse_events_add_pmu(_parse_state, list, pmu->name, terms, true)) ok++; parse_events_terms__delete(terms); }