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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4804BC05027 for ; Thu, 26 Jan 2023 14:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjAZOUa (ORCPT ); Thu, 26 Jan 2023 09:20:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjAZOU2 (ORCPT ); Thu, 26 Jan 2023 09:20:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C4C5B95; Thu, 26 Jan 2023 06:20:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D4F71617FE; Thu, 26 Jan 2023 14:20:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14CF4C433EF; Thu, 26 Jan 2023 14:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674742812; bh=0gXWAG3HpQenfONyLXdhDKUli2Bo4Uhdo9PrFLTy79U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Di5FbnDS9IrLIy3Qguh0lMbFBe4bJSqS/l3RAASfKfNH1svLVK5jIH4Wjx0Qm7lcs p1ANYjqQnfYnxcGRR3hAFwSmbx7h+hpr8Z4tZZTDzQROrpG0qD7Vaf1OfCZ9Uvs+AG tdF/Segi7SvyPLuSXD0gaULEqWFYRz58MyilF5I8LCXgmljMCMVU+uTw4Baa1b6Bwl 5GxnpltqOr4V//yI/aBZ83AFdyOWCWdjAHpgSqID/KujYWxtJTWL2Wkt69aTbBzjLW 9TdyQMIjh6spUOVsL5qyxZ5sUEJYrdkLy4Vjaqr6j9W9qsu8+p6CBUrtcOxOt3BjVS +L/UXKiSp2Oiw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 71802405BE; Thu, 26 Jan 2023 11:20:09 -0300 (-03) Date: Thu, 26 Jan 2023 11:20:09 -0300 From: Arnaldo Carvalho de Melo To: John Garry Cc: Ian Rogers , Will Deacon , James Clark , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kan Liang , Kim Phillips , Florian Fischer , Ravi Bangoria , Xing Zhengjun , Rob Herring , Kang Minchul , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Sandipan Das , Jing Zhang , linuxppc-dev@lists.ozlabs.org, Kajol Jain , Stephane Eranian , Perry Taylor , Caleb Biggers Subject: Re: [PATCH v4 11/12] perf jevents: Add model list option Message-ID: References: <20230126011854.198243-1-irogers@google.com> <20230126011854.198243-12-irogers@google.com> <10ae719f-2549-a367-2d2b-48671a00135e@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10ae719f-2549-a367-2d2b-48671a00135e@oracle.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Thu, Jan 26, 2023 at 01:44:39PM +0000, John Garry escreveu: > On 26/01/2023 01:18, Ian Rogers wrote: > > This allows the set of generated jevents events and metrics be limited > > to a subset of the model names. Appropriate if trying to minimize the > > binary size where only a set of models are possible. > > > > Signed-off-by: Ian Rogers > > Thanks for this: > > Reviewed-by: John Garry Thanks for reviewing the series John, I see there are a few patches for which you didn't provide your Reviewed-by, are you planning to review those as well? - Arnaldo > > --- > > tools/perf/pmu-events/Build | 3 ++- > > tools/perf/pmu-events/jevents.py | 14 ++++++++++++++ > > 2 files changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build > > index 15b9e8fdbffa..a14de24ecb69 100644 > > --- a/tools/perf/pmu-events/Build > > +++ b/tools/perf/pmu-events/Build > > @@ -10,6 +10,7 @@ JEVENTS_PY = pmu-events/jevents.py > > ifeq ($(JEVENTS_ARCH),) > > JEVENTS_ARCH=$(SRCARCH) > > endif > > +JEVENTS_MODEL ?= all > > # > > # Locate/process JSON files in pmu-events/arch/ > > @@ -23,5 +24,5 @@ $(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c > > else > > $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY) pmu-events/metric.py > > $(call rule_mkdir) > > - $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) pmu-events/arch $@ > > + $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS_MODEL) pmu-events/arch $@ > > endif > > diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py > > index 627ee817f57f..2bcd07ce609f 100755 > > --- a/tools/perf/pmu-events/jevents.py > > +++ b/tools/perf/pmu-events/jevents.py > > @@ -599,6 +599,8 @@ const struct pmu_events_map pmu_events_map[] = { > > else: > > metric_tblname = 'NULL' > > metric_size = '0' > > + if event_size == '0' and metric_size == '0': > > + continue > > cpuid = row[0].replace('\\', '\\\\') > > _args.output_file.write(f"""{{ > > \t.arch = "{arch}", > > @@ -888,12 +890,24 @@ def main() -> None: > > action: Callable[[Sequence[str], os.DirEntry], None]) -> None: > > """Replicate the directory/file walking behavior of C's file tree walk.""" > > for item in os.scandir(path): > > + if _args.model != 'all' and item.is_dir(): > > + # Check if the model matches one in _args.model. > > + if len(parents) == _args.model.split(',')[0].count('/'): > > + # We're testing the correct directory. > > + item_path = '/'.join(parents) + ('/' if len(parents) > 0 else '') + item.name > > + if 'test' not in item_path and item_path not in _args.model.split(','): > > + continue > > action(parents, item) > > if item.is_dir(): > > ftw(item.path, parents + [item.name], action) > > ap = argparse.ArgumentParser() > > ap.add_argument('arch', help='Architecture name like x86') > > + ap.add_argument('model', help='''Select a model such as skylake to > > +reduce the code size. Normally set to "all". For architectures like > > +ARM64 with an implementor/model, the model must include the implementor > > mega-nit: /s/ARM64/arm64/ > > it just makes grepping easier (without -i, of course) > > > +such as "arm/cortex-a34".''', > > + default='all') > > ap.add_argument( > > 'starting_dir', > > type=dir_path, > -- - Arnaldo 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4944C54E94 for ; Thu, 26 Jan 2023 14:21:14 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4P2jYj2QWPz3fCg for ; Fri, 27 Jan 2023 01:21:13 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Di5FbnDS; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=acme@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Di5FbnDS; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4P2jXb5dPJz3cd9 for ; Fri, 27 Jan 2023 01:20:15 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CDF686156F; Thu, 26 Jan 2023 14:20:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14CF4C433EF; Thu, 26 Jan 2023 14:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674742812; bh=0gXWAG3HpQenfONyLXdhDKUli2Bo4Uhdo9PrFLTy79U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Di5FbnDS9IrLIy3Qguh0lMbFBe4bJSqS/l3RAASfKfNH1svLVK5jIH4Wjx0Qm7lcs p1ANYjqQnfYnxcGRR3hAFwSmbx7h+hpr8Z4tZZTDzQROrpG0qD7Vaf1OfCZ9Uvs+AG tdF/Segi7SvyPLuSXD0gaULEqWFYRz58MyilF5I8LCXgmljMCMVU+uTw4Baa1b6Bwl 5GxnpltqOr4V//yI/aBZ83AFdyOWCWdjAHpgSqID/KujYWxtJTWL2Wkt69aTbBzjLW 9TdyQMIjh6spUOVsL5qyxZ5sUEJYrdkLy4Vjaqr6j9W9qsu8+p6CBUrtcOxOt3BjVS +L/UXKiSp2Oiw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 71802405BE; Thu, 26 Jan 2023 11:20:09 -0300 (-03) Date: Thu, 26 Jan 2023 11:20:09 -0300 From: Arnaldo Carvalho de Melo To: John Garry Subject: Re: [PATCH v4 11/12] perf jevents: Add model list option Message-ID: References: <20230126011854.198243-1-irogers@google.com> <20230126011854.198243-12-irogers@google.com> <10ae719f-2549-a367-2d2b-48671a00135e@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10ae719f-2549-a367-2d2b-48671a00135e@oracle.com> X-Url: http://acmel.wordpress.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Ian Rogers , Sandipan Das , Peter Zijlstra , Perry Taylor , Stephane Eranian , linux-kernel@vger.kernel.org, James Clark , Kim Phillips , Will Deacon , Kan Liang , Rob Herring , Alexander Shishkin , Ingo Molnar , Xing Zhengjun , Kang Minchul , Mike Leach , Kajol Jain , Namhyung Kim , Caleb Biggers , linux-arm-kernel@lists.infradead.org, Ravi Bangoria , Florian Fischer , Adrian Hunter , linux-perf-users@vger.kernel.org, Jiri Olsa , Leo Yan , linuxppc-dev@lists.ozlabs.org, Jing Zhang Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Em Thu, Jan 26, 2023 at 01:44:39PM +0000, John Garry escreveu: > On 26/01/2023 01:18, Ian Rogers wrote: > > This allows the set of generated jevents events and metrics be limited > > to a subset of the model names. Appropriate if trying to minimize the > > binary size where only a set of models are possible. > > > > Signed-off-by: Ian Rogers > > Thanks for this: > > Reviewed-by: John Garry Thanks for reviewing the series John, I see there are a few patches for which you didn't provide your Reviewed-by, are you planning to review those as well? - Arnaldo > > --- > > tools/perf/pmu-events/Build | 3 ++- > > tools/perf/pmu-events/jevents.py | 14 ++++++++++++++ > > 2 files changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build > > index 15b9e8fdbffa..a14de24ecb69 100644 > > --- a/tools/perf/pmu-events/Build > > +++ b/tools/perf/pmu-events/Build > > @@ -10,6 +10,7 @@ JEVENTS_PY = pmu-events/jevents.py > > ifeq ($(JEVENTS_ARCH),) > > JEVENTS_ARCH=$(SRCARCH) > > endif > > +JEVENTS_MODEL ?= all > > # > > # Locate/process JSON files in pmu-events/arch/ > > @@ -23,5 +24,5 @@ $(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c > > else > > $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY) pmu-events/metric.py > > $(call rule_mkdir) > > - $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) pmu-events/arch $@ > > + $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS_MODEL) pmu-events/arch $@ > > endif > > diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py > > index 627ee817f57f..2bcd07ce609f 100755 > > --- a/tools/perf/pmu-events/jevents.py > > +++ b/tools/perf/pmu-events/jevents.py > > @@ -599,6 +599,8 @@ const struct pmu_events_map pmu_events_map[] = { > > else: > > metric_tblname = 'NULL' > > metric_size = '0' > > + if event_size == '0' and metric_size == '0': > > + continue > > cpuid = row[0].replace('\\', '\\\\') > > _args.output_file.write(f"""{{ > > \t.arch = "{arch}", > > @@ -888,12 +890,24 @@ def main() -> None: > > action: Callable[[Sequence[str], os.DirEntry], None]) -> None: > > """Replicate the directory/file walking behavior of C's file tree walk.""" > > for item in os.scandir(path): > > + if _args.model != 'all' and item.is_dir(): > > + # Check if the model matches one in _args.model. > > + if len(parents) == _args.model.split(',')[0].count('/'): > > + # We're testing the correct directory. > > + item_path = '/'.join(parents) + ('/' if len(parents) > 0 else '') + item.name > > + if 'test' not in item_path and item_path not in _args.model.split(','): > > + continue > > action(parents, item) > > if item.is_dir(): > > ftw(item.path, parents + [item.name], action) > > ap = argparse.ArgumentParser() > > ap.add_argument('arch', help='Architecture name like x86') > > + ap.add_argument('model', help='''Select a model such as skylake to > > +reduce the code size. Normally set to "all". For architectures like > > +ARM64 with an implementor/model, the model must include the implementor > > mega-nit: /s/ARM64/arm64/ > > it just makes grepping easier (without -i, of course) > > > +such as "arm/cortex-a34".''', > > + default='all') > > ap.add_argument( > > 'starting_dir', > > type=dir_path, > -- - Arnaldo 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BB6BDC05027 for ; Thu, 26 Jan 2023 14:21:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=5+tfp2/oOVd5JH2abFezfELZharAeTbLga0joic8eCQ=; b=MPA7R6sLrdijtX +foIgSdqLWn7JqJSAG/NM2v6NYjWi3HsS9PhMY3GTBuD9xgWI3TnunTLo40slToMMbTDXZNOZD/jQ NlKtk/P9AQEYxFxH7sqF39M3FjoHnPyoWa2Gfk7siYp0YCHct2/t5BSvmEIolWDIPH46ObvZPOo9E WNi9T0L4mfLTLTHC1qpamfQTw4fnW3iZ8XIDvadSoz/xrdKvXJGvwvlWdO1YHiSmQzmChJKYp7D/N HZWapiFS8wz5V6URL3qV/QDYuBK1jGI8Wdh6MH4kTuTWPw4WPH+P8qnkpZ6j4EGknqsQrcwAZw+uH gXa/l8hPoCG57gAAPpUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pL36t-00BAVw-Qc; Thu, 26 Jan 2023 14:20:15 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pL36r-00BAVQ-F1 for linux-arm-kernel@bombadil.infradead.org; Thu, 26 Jan 2023 14:20:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=LtkFRlf4RTw73vcNqQOPrIsFHc5NES7ftBDbEvp5lHc=; b=qNpkzBcCsKQGDAEtUn5i4D9P4v 7W0C2bKxQWqE0xAlw0r5Bl588hrstUQoAiJQDde2zgvM9SOgcn4f1Ke2TB5LI9j655v+Vti3nnW1c IHFWXF+QjIgju3syoK22ZkLHOpjaWg2BIojaujRXGmaG3IcwczmzI9NBy2WUoAUQZ6RU7yETL9xGX yWr1kyKIUuf9QDHuSbg4WHmFTb/wfmuWn7r+ed3/uw5pvCCD5FArpP8tigiKWm/Kdxk8nmD63XHl1 ijAmYeZBAzWArkL6nZ0WxdowyXRfw/KmDZvDKeytVFER0y4UK7RPSG+GIGT0tJFELSIqyjvznKEsV +CiU6/ZA==; Received: from [187.19.237.165] (helo=quaco.ghostprotocols.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pL36K-002TRH-1X; Thu, 26 Jan 2023 14:19:40 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 71802405BE; Thu, 26 Jan 2023 11:20:09 -0300 (-03) Date: Thu, 26 Jan 2023 11:20:09 -0300 From: Arnaldo Carvalho de Melo To: John Garry Cc: Ian Rogers , Will Deacon , James Clark , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kan Liang , Kim Phillips , Florian Fischer , Ravi Bangoria , Xing Zhengjun , Rob Herring , Kang Minchul , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Sandipan Das , Jing Zhang , linuxppc-dev@lists.ozlabs.org, Kajol Jain , Stephane Eranian , Perry Taylor , Caleb Biggers Subject: Re: [PATCH v4 11/12] perf jevents: Add model list option Message-ID: References: <20230126011854.198243-1-irogers@google.com> <20230126011854.198243-12-irogers@google.com> <10ae719f-2549-a367-2d2b-48671a00135e@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <10ae719f-2549-a367-2d2b-48671a00135e@oracle.com> X-Url: http://acmel.wordpress.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Thu, Jan 26, 2023 at 01:44:39PM +0000, John Garry escreveu: > On 26/01/2023 01:18, Ian Rogers wrote: > > This allows the set of generated jevents events and metrics be limited > > to a subset of the model names. Appropriate if trying to minimize the > > binary size where only a set of models are possible. > > > > Signed-off-by: Ian Rogers > > Thanks for this: > > Reviewed-by: John Garry Thanks for reviewing the series John, I see there are a few patches for which you didn't provide your Reviewed-by, are you planning to review those as well? - Arnaldo > > --- > > tools/perf/pmu-events/Build | 3 ++- > > tools/perf/pmu-events/jevents.py | 14 ++++++++++++++ > > 2 files changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build > > index 15b9e8fdbffa..a14de24ecb69 100644 > > --- a/tools/perf/pmu-events/Build > > +++ b/tools/perf/pmu-events/Build > > @@ -10,6 +10,7 @@ JEVENTS_PY = pmu-events/jevents.py > > ifeq ($(JEVENTS_ARCH),) > > JEVENTS_ARCH=$(SRCARCH) > > endif > > +JEVENTS_MODEL ?= all > > # > > # Locate/process JSON files in pmu-events/arch/ > > @@ -23,5 +24,5 @@ $(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c > > else > > $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY) pmu-events/metric.py > > $(call rule_mkdir) > > - $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) pmu-events/arch $@ > > + $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS_MODEL) pmu-events/arch $@ > > endif > > diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py > > index 627ee817f57f..2bcd07ce609f 100755 > > --- a/tools/perf/pmu-events/jevents.py > > +++ b/tools/perf/pmu-events/jevents.py > > @@ -599,6 +599,8 @@ const struct pmu_events_map pmu_events_map[] = { > > else: > > metric_tblname = 'NULL' > > metric_size = '0' > > + if event_size == '0' and metric_size == '0': > > + continue > > cpuid = row[0].replace('\\', '\\\\') > > _args.output_file.write(f"""{{ > > \t.arch = "{arch}", > > @@ -888,12 +890,24 @@ def main() -> None: > > action: Callable[[Sequence[str], os.DirEntry], None]) -> None: > > """Replicate the directory/file walking behavior of C's file tree walk.""" > > for item in os.scandir(path): > > + if _args.model != 'all' and item.is_dir(): > > + # Check if the model matches one in _args.model. > > + if len(parents) == _args.model.split(',')[0].count('/'): > > + # We're testing the correct directory. > > + item_path = '/'.join(parents) + ('/' if len(parents) > 0 else '') + item.name > > + if 'test' not in item_path and item_path not in _args.model.split(','): > > + continue > > action(parents, item) > > if item.is_dir(): > > ftw(item.path, parents + [item.name], action) > > ap = argparse.ArgumentParser() > > ap.add_argument('arch', help='Architecture name like x86') > > + ap.add_argument('model', help='''Select a model such as skylake to > > +reduce the code size. Normally set to "all". For architectures like > > +ARM64 with an implementor/model, the model must include the implementor > > mega-nit: /s/ARM64/arm64/ > > it just makes grepping easier (without -i, of course) > > > +such as "arm/cortex-a34".''', > > + default='all') > > ap.add_argument( > > 'starting_dir', > > type=dir_path, > -- - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel