From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E333DC31E4D for ; Fri, 14 Jun 2019 14:47:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B86DD21721 for ; Fri, 14 Jun 2019 14:47:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DRYd8mKw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="DBSwzm54" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B86DD21721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QmMU1v6dY75Qr2WMgnM59qKANK8/mA99fGRrzoLJOqw=; b=DRYd8mKwKLW1ZI KvlOrFtHvHFQZMUD2SCpMDvDx4a1ZKHx9qfwz0gWj0kuUUK1O2fnBd/HegWnYngpqN9ynaXXaXt3C GXMUsH/qH+WRytdv6ksJLgPyiarcUa1q9Dk4sh8AJDlkh+OnDbzxR5FulCzEtbMtkaO6f1ebMvpp3 hOT9S6raZJMuiTYRYlPA9OZJNtiiRP/NJiICtShYRN0NipTDvSfRZQwByBjtS58Z7P5ik7eJ95b3Z pfUYORMsK0RVgaBQjl8wWexJKqiVZoNQNeTrOSgsBl8JccoKjPxDhQ6H0PKeQcBnhP7U9VpOv0Bkz IGg6lHjo+4bIPQo0p+eQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbnUR-0001jr-VF; Fri, 14 Jun 2019 14:47:39 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbnU2-0001Gt-RR for linux-arm-kernel@bombadil.infradead.org; Fri, 14 Jun 2019 14:47:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: 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=eto68beFTMuFiXin5hRYooxdWER5uQTswdUxEzMWaWA=; b=DBSwzm54pOyV8n25mD2a3wO+S 18o8yGYyLI51UTQBautY5GV45uh/2R7pJ4NJs5GU3Uf8KHOLJMgC4RB6SLZWEUJpaecD8Ovbaq2SW xYj/BjggESR++454UQsUCz4YbFKQCO8kBuYg8OczWY9S5H/PZOD2w0YxeDUt0VAfPffy8FFQfquFq gA4ZftJWbIyzLJTApeMN6PRa0QBOJfP3+i6oupWGT6oAoOqjwvzEhXb+emrJxriPLBz0dhOMwZAUy 57aUPQityaS15rf4H4yey68+/94B/aZEHc4U1LxSjAppUhsmxQZnePmIJEB+KN8rDWU2YD0PDT3LX hHZL9r8zw==; Received: from [179.240.172.117] (helo=quaco.ghostprotocols.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hbnU0-0000H2-Qu; Fri, 14 Jun 2019 14:47:13 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 262DC41149; Fri, 14 Jun 2019 11:46:56 -0300 (-03) Date: Fri, 14 Jun 2019 11:46:56 -0300 From: Arnaldo Carvalho de Melo To: John Garry Subject: Re: [PATCH v2 1/5] perf pmu: Fix uncore PMU alias list for ARM64 Message-ID: <20190614144656.GF1402@kernel.org> References: <1560521283-73314-1-git-send-email-john.garry@huawei.com> <1560521283-73314-2-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1560521283-73314-2-git-send-email-john.garry@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, brueckner@linux.ibm.com, mathieu.poirier@linaro.org, peterz@infradead.org, ben@decadent.org.uk, tmricht@linux.ibm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linuxarm@huawei.com, zhangshaokun@hisilicon.com, alexander.shishkin@linux.intel.com, mingo@redhat.com, namhyung@kernel.org, jolsa@redhat.com, linux-arm-kernel@lists.infradead.org, kan.liang@linux.intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Fri, Jun 14, 2019 at 10:07:59PM +0800, John Garry escreveu: > In commit 292c34c10249 ("perf pmu: Fix core PMU alias list for X86 > platform"), we fixed the issue of CPU events being aliased to uncore > events. > > Fix this same issue for ARM64, since the said commit left the (broken) > behaviour untouched for ARM64. So I added: Cc: stable@vger.kernel.org Fixes: 292c34c10249 ("perf pmu: Fix core PMU alias list for X86 platform") So that the stable trees get this fix and add it to the versions where it should have been together with the x86 fix, ok? - Arnaldo > Signed-off-by: John Garry > --- > tools/perf/util/pmu.c | 28 ++++++++++++---------------- > 1 file changed, 12 insertions(+), 16 deletions(-) > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index f2eff272279b..7e7299fee550 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -709,9 +709,7 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) > { > int i; > struct pmu_events_map *map; > - struct pmu_event *pe; > const char *name = pmu->name; > - const char *pname; > > map = perf_pmu__find_map(pmu); > if (!map) > @@ -722,28 +720,26 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) > */ > i = 0; > while (1) { > + const char *cpu_name = is_arm_pmu_core(name) ? name : "cpu"; > + struct pmu_event *pe = &map->table[i++]; > + const char *pname = pe->pmu ? pe->pmu : cpu_name; > > - pe = &map->table[i++]; > if (!pe->name) { > if (pe->metric_group || pe->metric_name) > continue; > break; > } > > - if (!is_arm_pmu_core(name)) { > - pname = pe->pmu ? pe->pmu : "cpu"; > - > - /* > - * uncore alias may be from different PMU > - * with common prefix > - */ > - if (pmu_is_uncore(name) && > - !strncmp(pname, name, strlen(pname))) > - goto new_alias; > + /* > + * uncore alias may be from different PMU > + * with common prefix > + */ > + if (pmu_is_uncore(name) && > + !strncmp(pname, name, strlen(pname))) > + goto new_alias; > > - if (strcmp(pname, name)) > - continue; > - } > + if (strcmp(pname, name)) > + continue; > > new_alias: > pr_err("%s new_alias name=%s pe->name=%s\n", __func__, name, pe->name); > -- > 2.17.1 -- - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8959DC46477 for ; Fri, 14 Jun 2019 14:47:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DECC2133D for ; Fri, 14 Jun 2019 14:47:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f7jc810v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728762AbfFNOrE (ORCPT ); Fri, 14 Jun 2019 10:47:04 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45883 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728233AbfFNOrD (ORCPT ); Fri, 14 Jun 2019 10:47:03 -0400 Received: by mail-qk1-f193.google.com with SMTP id s22so1793701qkj.12 for ; Fri, 14 Jun 2019 07:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eto68beFTMuFiXin5hRYooxdWER5uQTswdUxEzMWaWA=; b=f7jc810vzETNFtoXuRS8MZGA64WEjhN1C4sf8wmEdEWkwM4Dcr53aH+Hri7YujTW0x B9rRRD9XyZuOam3GWo9voiNVb3yGAfFIFCS4DFiXsLJGbGQLpiM9je5wMe3vOKMJ3/Ih uDag2RsWOXt1dIOQJabdX/+GtmFZ/7oFIU9fMhoP3nHJV01lPSBxsfeteyvJ0ecic+gO cRGJPw2z5xFrf104TKtMYS7EZx5w+cvYnlb8IIeqbhG6ocIJkOX6WbWbyeflV/U0gYJN A1DfpvP6XrieQohpZI5LjYZm6R7zjHJ6V0Ez/2z4fp0Zm4N+h8DmXT/qGbb3es1S3alz RqXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eto68beFTMuFiXin5hRYooxdWER5uQTswdUxEzMWaWA=; b=XGszRwt2kBX4Y/GlR/OrvfHHk8sNVVOybYkz2cLGy7qDfyDmPW208B/3ECuUCNYVNh 0vL3gZeroSMAlMshz911Tw1fz7p+gGsHuK9dsBJH45klO5bSCN09wlKz4idp7BvsroWJ 2kV1Bsb5vKJvVPAw+WaotPVpbv+/n92MHQTtNZPjEZtEaryUgzGbvMD/mRhKsa0bc8SR 9bCR/wM1OiO3gBaObxbabciE0SFXzYKQxRiIEneOZYMEBcQgFZAKB1sZ74aA70ByBVQd Tz3osp4DAF6WaWrHsiJDThPCAteWlfCSZRgOxzc3FxR2HvdcY2pn5OCULxB94Q6zbedZ tviQ== X-Gm-Message-State: APjAAAVx51WrESf0NOB6FcMezysmB9dTexa4FO4JQqbsz0TSUfs9BcjY +qPChIN72vAO/Qdw3RmyEkc= X-Google-Smtp-Source: APXvYqyhHcWq1P1FF+Xkd+IYAcISgd96Zi2ZTLPk8SBAh1/jiUvJyvpag+WdQb+wknmrFfZaHYjJYA== X-Received: by 2002:a37:aa8e:: with SMTP id t136mr9707415qke.222.1560523622785; Fri, 14 Jun 2019 07:47:02 -0700 (PDT) Received: from quaco.ghostprotocols.net (179-240-172-117.3g.claro.net.br. [179.240.172.117]) by smtp.gmail.com with ESMTPSA id s134sm1857501qke.51.2019.06.14.07.47.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 07:47:02 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 262DC41149; Fri, 14 Jun 2019 11:46:56 -0300 (-03) Date: Fri, 14 Jun 2019 11:46:56 -0300 To: John Garry Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, tmricht@linux.ibm.com, brueckner@linux.ibm.com, kan.liang@linux.intel.com, ben@decadent.org.uk, mathieu.poirier@linaro.org, mark.rutland@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linuxarm@huawei.com, linux-arm-kernel@lists.infradead.org, zhangshaokun@hisilicon.com Subject: Re: [PATCH v2 1/5] perf pmu: Fix uncore PMU alias list for ARM64 Message-ID: <20190614144656.GF1402@kernel.org> References: <1560521283-73314-1-git-send-email-john.garry@huawei.com> <1560521283-73314-2-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1560521283-73314-2-git-send-email-john.garry@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jun 14, 2019 at 10:07:59PM +0800, John Garry escreveu: > In commit 292c34c10249 ("perf pmu: Fix core PMU alias list for X86 > platform"), we fixed the issue of CPU events being aliased to uncore > events. > > Fix this same issue for ARM64, since the said commit left the (broken) > behaviour untouched for ARM64. So I added: Cc: stable@vger.kernel.org Fixes: 292c34c10249 ("perf pmu: Fix core PMU alias list for X86 platform") So that the stable trees get this fix and add it to the versions where it should have been together with the x86 fix, ok? - Arnaldo > Signed-off-by: John Garry > --- > tools/perf/util/pmu.c | 28 ++++++++++++---------------- > 1 file changed, 12 insertions(+), 16 deletions(-) > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index f2eff272279b..7e7299fee550 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -709,9 +709,7 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) > { > int i; > struct pmu_events_map *map; > - struct pmu_event *pe; > const char *name = pmu->name; > - const char *pname; > > map = perf_pmu__find_map(pmu); > if (!map) > @@ -722,28 +720,26 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) > */ > i = 0; > while (1) { > + const char *cpu_name = is_arm_pmu_core(name) ? name : "cpu"; > + struct pmu_event *pe = &map->table[i++]; > + const char *pname = pe->pmu ? pe->pmu : cpu_name; > > - pe = &map->table[i++]; > if (!pe->name) { > if (pe->metric_group || pe->metric_name) > continue; > break; > } > > - if (!is_arm_pmu_core(name)) { > - pname = pe->pmu ? pe->pmu : "cpu"; > - > - /* > - * uncore alias may be from different PMU > - * with common prefix > - */ > - if (pmu_is_uncore(name) && > - !strncmp(pname, name, strlen(pname))) > - goto new_alias; > + /* > + * uncore alias may be from different PMU > + * with common prefix > + */ > + if (pmu_is_uncore(name) && > + !strncmp(pname, name, strlen(pname))) > + goto new_alias; > > - if (strcmp(pname, name)) > - continue; > - } > + if (strcmp(pname, name)) > + continue; > > new_alias: > pr_err("%s new_alias name=%s pe->name=%s\n", __func__, name, pe->name); > -- > 2.17.1 -- - Arnaldo