Received: by 10.223.185.116 with SMTP id b49csp5498960wrg; Tue, 27 Feb 2018 14:36:11 -0800 (PST) X-Google-Smtp-Source: AH8x225kCwsiV8DMZnnNxRHCOZQxOoijWxyX5iJc3NhTYT7P5qcfrHva+sH3rVPZf2pQd6A6dArw X-Received: by 10.99.117.10 with SMTP id q10mr12452687pgc.423.1519770971653; Tue, 27 Feb 2018 14:36:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519770971; cv=none; d=google.com; s=arc-20160816; b=FkWxg2olR/Zjp1uC9Qtlg/VcFp3ENVFxK54TXH0nni6aNxaPXPiLJ/gcEyXhzMOXVS Cfoidl3EFkuoGKyYcxEqYHfgSv3VqCH441KH5Irm5X2k8Py64iiLZDAGKRng4dFB15+z W8FzrbDzn29RUzyLl+DTtkcd+vO5j19dNlvTz3lFUTi0wygSarEhtEX5S6beEmtIpDT6 Hr8WTvkAy89DnO6BiZz89ZeMgUpNLPx4pcRCNemgKCGftH5j/SqZCHcNjDy9i0SbtHTQ JlHTsJlVWhk9fPY8tHnqTy3EUdOC4kiITS08/tom8pksuIIZvlvgF5HpDYRlrAuWM82v S+ZA== 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:dkim-signature:dkim-signature :arc-authentication-results; bh=u4b6EHc2GodON7qAccESMyUTIzV/89Fg+IbQ6y1P1SE=; b=d4NZST9OzYlQoMet8wFNHbMUDLl00wbeypEaDGrANjqEglMLet48GxRplLCSEWUo0q B4JbxndiUj3S2BSyZRr4S+i279Buvog5fLkN/DYrvcranMWC9/iWAEu60qMnAvbqKxPC UHH+5HdHDCzs3U9kiCLAqOmGT6w7j7Yg18x+/hcUpLK/5Qg+H2yCRfe4YZwQPCKKe2xO xwMnSzE/06xB1102+pC5bMt1XUOh1N14M/P/h8kEwEPJEo4pv1hZ1TV6DrjYM9fCl1VL wjyP75hO9RwG4gnMWFa7tRcvkULO+djaxZioge+fGsVyqnvWQmFIujiKhN/oCelLtM+H eqdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=omQo5M3K; dkim=pass header.i=@codeaurora.org header.s=default header.b=omQo5M3K; 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 p91-v6si135233plb.352.2018.02.27.14.35.56; Tue, 27 Feb 2018 14:36:11 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=omQo5M3K; dkim=pass header.i=@codeaurora.org header.s=default header.b=omQo5M3K; 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 S1752062AbeB0WfT (ORCPT + 99 others); Tue, 27 Feb 2018 17:35:19 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:45804 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbeB0WfQ (ORCPT ); Tue, 27 Feb 2018 17:35:16 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D0F9C60F91; 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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 Cc: timur@codeaurora.org, agustinv@codeaurora.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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); } -- 2.7.4