* [PATCH 05/13] perf pmu: Use __weak definition from <linux/compiler.h>
2015-06-23 21:47 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2015-06-23 21:47 ` Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 06/13] perf pmu: Split perf_pmu__new_alias() Arnaldo Carvalho de Melo
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-23 21:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Sukadev Bhattiprolu, Andi Kleen,
Madhavan Srinivasan, Michael Ellerman, Namhyung Kim, linuxppc-dev,
Arnaldo Carvalho de Melo
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Jiri Olsa pointed out, that the <linux/compiler.h> defines the attribute
'__weak'. We might as well use that.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1433921123-25327-4-git-send-email-sukadev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/pmu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 0fcc624eb767..c6b16b1db6d0 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1,4 +1,5 @@
#include <linux/list.h>
+#include <linux/compiler.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
@@ -436,7 +437,7 @@ static struct cpu_map *pmu_cpumask(const char *name)
return cpus;
}
-struct perf_event_attr *__attribute__((weak))
+struct perf_event_attr * __weak
perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
{
return NULL;
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 06/13] perf pmu: Split perf_pmu__new_alias()
2015-06-23 21:47 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 05/13] perf pmu: Use __weak definition from <linux/compiler.h> Arnaldo Carvalho de Melo
@ 2015-06-23 21:47 ` Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 07/13] perf tools: Allow events with dot Arnaldo Carvalho de Melo
2015-06-25 7:31 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
3 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-23 21:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Sukadev Bhattiprolu, Andi Kleen,
Madhavan Srinivasan, Michael Ellerman, Namhyung Kim, linuxppc-dev,
Arnaldo Carvalho de Melo
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Separate the event parsing code in perf_pmu__new_alias() out into a
separate function __perf_pmu__new_alias() so that code can be called
indepdently.
This is based on an earlier patch from Andi Kleen.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1433921123-25327-5-git-send-email-sukadev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/pmu.c | 42 +++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index c6b16b1db6d0..7bcb8c315615 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -206,17 +206,12 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias,
return 0;
}
-static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FILE *file)
+static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
+ char *desc __maybe_unused, char *val)
{
struct perf_pmu_alias *alias;
- char buf[256];
int ret;
- ret = fread(buf, 1, sizeof(buf), file);
- if (ret == 0)
- return -EINVAL;
- buf[ret] = 0;
-
alias = malloc(sizeof(*alias));
if (!alias)
return -ENOMEM;
@@ -226,26 +221,43 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI
alias->unit[0] = '\0';
alias->per_pkg = false;
- ret = parse_events_terms(&alias->terms, buf);
+ ret = parse_events_terms(&alias->terms, val);
if (ret) {
+ pr_err("Cannot parse alias %s: %d\n", val, ret);
free(alias);
return ret;
}
alias->name = strdup(name);
- /*
- * load unit name and scale if available
- */
- perf_pmu__parse_unit(alias, dir, name);
- perf_pmu__parse_scale(alias, dir, name);
- perf_pmu__parse_per_pkg(alias, dir, name);
- perf_pmu__parse_snapshot(alias, dir, name);
+ if (dir) {
+ /*
+ * load unit name and scale if available
+ */
+ perf_pmu__parse_unit(alias, dir, name);
+ perf_pmu__parse_scale(alias, dir, name);
+ perf_pmu__parse_per_pkg(alias, dir, name);
+ perf_pmu__parse_snapshot(alias, dir, name);
+ }
list_add_tail(&alias->list, list);
return 0;
}
+static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FILE *file)
+{
+ char buf[256];
+ int ret;
+
+ ret = fread(buf, 1, sizeof(buf), file);
+ if (ret == 0)
+ return -EINVAL;
+
+ buf[ret] = 0;
+
+ return __perf_pmu__new_alias(list, dir, name, NULL, buf);
+}
+
static inline bool pmu_alias_info_file(char *name)
{
size_t len;
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 07/13] perf tools: Allow events with dot
2015-06-23 21:47 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 05/13] perf pmu: Use __weak definition from <linux/compiler.h> Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 06/13] perf pmu: Split perf_pmu__new_alias() Arnaldo Carvalho de Melo
@ 2015-06-23 21:47 ` Arnaldo Carvalho de Melo
2015-06-25 7:31 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
3 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-23 21:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Andi Kleen, Madhavan Srinivasan, Michael Ellerman,
linuxppc-dev, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo
From: Andi Kleen <ak@linux.intel.com>
The Intel events use a dot to separate event name and unit mask. Allow
dot in names in the scanner, and remove special handling of dot as EOF.
Also remove the hack in jevents to replace dot with underscore. This way
dotted events can be specified directly by the user.
I'm not fully sure this change to the scanner is correct (what was the
dot special case good for?), but I haven't found anything that breaks
with it so far at least.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1433921123-25327-8-git-send-email-sukadev@linux.vnet.ibm.com
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events.l | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 09e738fe9ea2..13cef3c65565 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -119,8 +119,8 @@ event [^,{}/]+
num_dec [0-9]+
num_hex 0x[a-fA-F0-9]+
num_raw_hex [a-fA-F0-9]+
-name [a-zA-Z_*?][a-zA-Z0-9_*?]*
-name_minus [a-zA-Z_*?][a-zA-Z0-9\-_*?]*
+name [a-zA-Z_*?][a-zA-Z0-9_*?.]*
+name_minus [a-zA-Z_*?][a-zA-Z0-9\-_*?.]*
/* If you add a modifier you need to update check_modifier() */
modifier_event [ukhpGHSDI]+
modifier_bp [rwx]{1,3}
@@ -165,7 +165,6 @@ modifier_bp [rwx]{1,3}
return PE_EVENT_NAME;
}
-. |
<<EOF>> {
BEGIN(INITIAL);
REWIND(0);
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT PULL 00/13] perf/core improvements and fixes
2015-06-23 21:47 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2015-06-23 21:47 ` [PATCH 07/13] perf tools: Allow events with dot Arnaldo Carvalho de Melo
@ 2015-06-25 7:31 ` Ingo Molnar
2015-06-25 13:48 ` Arnaldo Carvalho de Melo
3 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2015-06-25 7:31 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Andi Kleen, David Ahern, He Kuang,
Jiri Olsa, linuxppc-dev, Lukas Wunner, Madhavan Srinivasan,
Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
Stephane Eranian, Sukadev Bhattiprolu, Wang Nan,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit a9a3cd900fbbcbf837d65653105e7bfc583ced09:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-06-20 01:11:11 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>
> for you to fetch changes up to 83b2ea257eb1d43e52f76d756722aeb899a2852c:
>
> perf tools: Allow auxtrace data alignment (2015-06-23 18:28:37 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Move toggling event logic from 'perf top' and into hists browser, allowing
> freeze/unfreeze with event lists with more than one entry (Namhyung Kim)
>
> - Add missing newlines when dumping PERF_RECORD_FINISHED_ROUND and
> showing the Aggregated stats in 'perf report -D' (Adrian Hunter)
>
> Infrastructure:
>
> - Allow auxtrace data alignment (Adrian Hunter)
>
> - Allow events with dot (Andi Kleen)
>
> - Fix failure to 'perf probe' events on arm (He Kuang)
>
> - Add testing for Makefile.perf (Jiri Olsa)
>
> - Add test for make install with prefix (Jiri Olsa)
>
> - Fix single target build dependency check (Jiri Olsa)
>
> - Access thread_map entries via accessors, prep patch to hold more info per
> entry, for ongoing 'perf stat --per-thread' work (Jiri Olsa)
>
> - Use __weak definition from compiler.h (Sukadev Bhattiprolu)
>
> - Split perf_pmu__new_alias() (Sukadev Bhattiprolu)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (3):
> perf session: Print a newline when dumping PERF_RECORD_FINISHED_ROUND
> perf tools: Print a newline before dumping Aggregated stats
> perf tools: Allow auxtrace data alignment
>
> Andi Kleen (1):
> perf tools: Allow events with dot
>
> He Kuang (1):
> perf probe: Fix failure to probe events on arm
>
> Jiri Olsa (5):
> perf tests: Add testing for Makefile.perf
> perf tests: Add test for make install with prefix
> perf build: Fix single target build dependency check
> perf thread_map: Don't access the array entries directly
> perf thread_map: Change map entries into a struct
>
> Namhyung Kim (1):
> perf top: Move toggling event logic into hists browser
>
> Sukadev Bhattiprolu (2):
> perf pmu: Use __weak definition from <linux/compiler.h>
> perf pmu: Split perf_pmu__new_alias()
>
> tools/perf/Makefile | 4 +--
> tools/perf/builtin-top.c | 24 ++-------------
> tools/perf/builtin-trace.c | 4 +--
> tools/perf/tests/make | 31 ++++++++++++++++++--
> tools/perf/tests/openat-syscall-tp-fields.c | 2 +-
> tools/perf/ui/browsers/hists.c | 19 ++++++++++--
> tools/perf/util/auxtrace.c | 11 +++++--
> tools/perf/util/auxtrace.h | 1 +
> tools/perf/util/event.c | 6 ++--
> tools/perf/util/evlist.c | 4 +--
> tools/perf/util/evsel.c | 2 +-
> tools/perf/util/parse-events.l | 5 ++--
> tools/perf/util/pmu.c | 45 +++++++++++++++++++----------
> tools/perf/util/probe-event.c | 6 +++-
> tools/perf/util/session.c | 4 ++-
> tools/perf/util/thread_map.c | 24 ++++++++-------
> tools/perf/util/thread_map.h | 16 +++++++++-
> 17 files changed, 136 insertions(+), 72 deletions(-)
Pulled, thanks a lot Arnaldo!
Btw., one small thing I noticed about the status line in perf top: if I ever use
'f' to freeze/unfreeze events, the following message:
Press 'f' to disable the events or 'h' to see other hotkeys
sticks around forever, even after I look into annotation and exit it, etc.
So I don't mind some default, helpful message there (such as 'Press 'h' to see
hotkeys'), but it appears this particular message is context and usage sensitive,
which wasn't really the goal, right?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL 00/13] perf/core improvements and fixes
2015-06-25 7:31 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
@ 2015-06-25 13:48 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-25 13:48 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Adrian Hunter, Andi Kleen, David Ahern, He Kuang,
Jiri Olsa, linuxppc-dev, Lukas Wunner, Madhavan Srinivasan,
Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
Stephane Eranian, Sukadev Bhattiprolu, Wang Nan
Em Thu, Jun 25, 2015 at 09:31:41AM +0200, Ingo Molnar escreveu:
> Pulled, thanks a lot Arnaldo!
>
> Btw., one small thing I noticed about the status line in perf top: if I ever use
> 'f' to freeze/unfreeze events, the following message:
>
> Press 'f' to disable the events or 'h' to see other hotkeys
>
> sticks around forever, even after I look into annotation and exit it, etc.
> So I don't mind some default, helpful message there (such as 'Press 'h' to see
> hotkeys'), but it appears this particular message is context and usage sensitive,
> which wasn't really the goal, right?
Agreed, some more work is needed to change that message in more places,
will do it eventually.
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread