Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608880

[tip:perf/core] perf pmu: Special case uncore_ prefix

From tip-bot for Andi Kleen <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:perf/core] perf pmu: Special case uncore_ prefix
Date 2017-03-24 20:00 +0100
Message-ID <toCBj-5D8-15@gated-at.bofh.it> (permalink)
References <tnc6e-1uQ-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  a820e33547aee9fd0460106c1fc577a125c23975
Gitweb:     http://git.kernel.org/tip/a820e33547aee9fd0460106c1fc577a125c23975
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Mon, 20 Mar 2017 13:17:04 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 21 Mar 2017 16:10:59 -0300

perf pmu: Special case uncore_ prefix

Special case uncore_ prefix in PMU match, to allow for shorter event
uncore specifications.

Before:

  perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1

After

  perf stat -a -e cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1

Committer tests:

   # perf list uncore

  List of pre-defined events (to be used in -e):

    uncore_cbox_0/clockticks/                       [Kernel PMU event]
    uncore_cbox_1/clockticks/                       [Kernel PMU event]
    uncore_imc/data_reads/                          [Kernel PMU event]
    uncore_imc/data_writes/                         [Kernel PMU event]

  # perf stat -a -e cbox_0/clockticks/ sleep 1

   Performance counter stats for 'system wide':

  281,474,976,653,084      cbox_0/clockticks/

       1.000870129 seconds time elapsed

  #

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/r/20170320201711.14142-7-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 20935b17..04fd8c9 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -239,6 +239,9 @@ PE_NAME opt_event_config
 		while ((pmu = perf_pmu__scan(pmu)) != NULL) {
 			char *name = pmu->name;
 
+			if (!strncmp(name, "uncore_", 7) &&
+			    strncmp($1, "uncore_", 7))
+				name += 7;
 			if (!strncmp($1, name, strlen($1))) {
 				if (parse_events_copy_term_list(orig_terms, &terms))
 					YYABORT;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

perf: Improve support for uncore JSON event lists Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:20 +0100
  [PATCH 12/13] perf, tools: Add support for MetricName JSON attribute Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:20 +0100
    [tip:perf/core] perf pmu: Add support for MetricName JSON attribute tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  [PATCH 03/13] perf, tools, stat: Handle partially bad results with merging Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:20 +0100
    [tip:perf/core] perf stat: Handle partially bad results with  merging tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 19:50 +0100
  [PATCH 04/13] perf, tools: Factor out PMU matching in parser Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:20 +0100
    [tip:perf/core] perf tools: Factor out PMU matching in parser tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  [PATCH 02/13] perf, tools, stat: Collapse identically named events Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:30 +0100
    [tip:perf/core] perf stat: Collapse identically named events tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  [PATCH 01/13] perf, tools, stat: Factor out callback for collecting event values Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:30 +0100
    [tip:perf/core] perf stat: Factor out callback for collecting event  values tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 19:50 +0100
  [PATCH 06/13] perf, tools: Special case uncore_ prefix Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:30 +0100
    [tip:perf/core] perf pmu: Special case uncore_ prefix tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  [PATCH 10/13] perf, tools, stat: Output JSON MetricExpr metric Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:30 +0100
    Re: [PATCH 10/13] perf, tools, stat: Output JSON MetricExpr metric Jiri Olsa <jolsa@redhat.com> - 2017-03-21 15:50 +0100
      Re: [PATCH 10/13] perf, tools, stat: Output JSON MetricExpr metric Andi Kleen <andi@firstfloor.org> - 2017-03-21 16:50 +0100
        Re: [PATCH 10/13] perf, tools, stat: Output JSON MetricExpr metric Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 20:50 +0100
          Re: [PATCH 10/13] perf, tools, stat: Output JSON MetricExpr metric Andi Kleen <ak@linux.intel.com> - 2017-03-21 21:00 +0100
    [tip:perf/core] perf stat: Output JSON MetricExpr metric tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  [PATCH 13/13] perf, tools, list: Move extra details printing to new option Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:30 +0100
    [tip:perf/core] perf list: Move extra details printing to new  option tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  [PATCH 07/13] perf, tools: Add a simple expression parser for JSON Andi Kleen <andi@firstfloor.org> - 2017-03-20 21:30 +0100
    Re: [PATCH 07/13] perf, tools: Add a simple expression parser for  JSON Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 20:20 +0100
      Re: [PATCH 07/13] perf, tools: Add a simple expression parser for  JSON Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 20:20 +0100
        Build errors, was Re: [PATCH 07/13] perf, tools: Add a simple  expression parser for JSON Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 23:10 +0100
    [tip:perf/core] perf tools: Add a simple expression parser for JSON tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-03-24 20:00 +0100
  Re: perf: Improve support for uncore JSON event lists Jiri Olsa <jolsa@redhat.com> - 2017-03-21 15:50 +0100
    Re: perf: Improve support for uncore JSON event lists Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 21:00 +0100

csiph-web