* perf, tools: Event files for Intel x86
@ 2015-05-21 4:11 Andi Kleen
2015-05-21 4:11 ` [PATCH 1/6] perf, tools: Handle header line in mapfile Andi Kleen
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel
This patchkit extends Sukadev builtin event list patches for Intel x86.
With that perf can build in event lists.
This also adds some missing features from the older JSON patchkits,
in particular the ability to print descriptions.
I am not posting the actual event files, because they are gigantic
(several MB) but you can get them from git here:
git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git perf/builtion-json-1
Currently only core events are included, not uncore.
-Andi
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/6] perf, tools: Handle header line in mapfile
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
@ 2015-05-21 4:11 ` Andi Kleen
2015-05-21 4:11 ` [PATCH 2/6] perf, tools: Allow events with dot Andi Kleen
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Support a header line in the mapfile.csv, to match the existing
mapfiles
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/pmu-events/jevents.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 3afa6e9..0ad5574 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -453,6 +453,8 @@ static int process_mapfile(FILE *outfp, char *fpath)
if (line[0] == '#')
continue;
+ if (!strncmp(line, "Family", 6))
+ continue;
if (line[strlen(line)-1] != '\n') {
/* TODO Deal with lines longer than 16K */
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/6] perf, tools: Allow events with dot
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
2015-05-21 4:11 ` [PATCH 1/6] perf, tools: Handle header line in mapfile Andi Kleen
@ 2015-05-21 4:11 ` Andi Kleen
2015-05-21 4:11 ` [PATCH 3/6] perf, tools: Support CPU id matching for x86 Andi Kleen
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel, Andi Kleen
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.
V2: Add the dot to name too, to handle events outside cpu//
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Andi Kleen <ak@linux.intel.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 09e738f..13cef3c 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] 11+ messages in thread
* [PATCH 3/6] perf, tools: Support CPU id matching for x86
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
2015-05-21 4:11 ` [PATCH 1/6] perf, tools: Handle header line in mapfile Andi Kleen
2015-05-21 4:11 ` [PATCH 2/6] perf, tools: Allow events with dot Andi Kleen
@ 2015-05-21 4:11 ` Andi Kleen
2015-05-21 4:11 ` [PATCH 4/6] perf, tools: Support alias descriptions Andi Kleen
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Implement the code to match CPU types to mapfile types for x86
based on CPUID. This extends an existing similar function,
but changes it to use the x86 mapfile cpu description.
This allows to resolve event lists generated by jevents.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/arch/x86/util/header.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
index 146d12a..28d8c08 100644
--- a/tools/perf/arch/x86/util/header.c
+++ b/tools/perf/arch/x86/util/header.c
@@ -19,8 +19,8 @@ cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,
: "a" (op));
}
-int
-get_cpuid(char *buffer, size_t sz)
+static int
+__get_cpuid(char *buffer, size_t sz, const char *fmt)
{
unsigned int a, b, c, d, lvl;
int family = -1, model = -1, step = -1;
@@ -48,7 +48,7 @@ get_cpuid(char *buffer, size_t sz)
if (family >= 0x6)
model += ((a >> 16) & 0xf) << 4;
}
- nb = scnprintf(buffer, sz, "%s,%u,%u,%u$", vendor, family, model, step);
+ nb = scnprintf(buffer, sz, fmt, vendor, family, model, step);
/* look for end marker to ensure the entire data fit */
if (strchr(buffer, '$')) {
@@ -57,3 +57,20 @@ get_cpuid(char *buffer, size_t sz)
}
return -1;
}
+
+int
+get_cpuid(char *buffer, size_t sz)
+{
+ return __get_cpuid(buffer, sz, "%s,%u,%u,%u$");
+}
+
+bool arch_pmu_events_match_cpu(const char *vfm,
+ const char *version __maybe_unused,
+ const char *type __maybe_unused)
+{
+ char buf[128];
+
+ if (__get_cpuid(buf, sizeof buf, "%s-%u-%X$") < 0)
+ return false;
+ return !strcmp(vfm, buf);
+}
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/6] perf, tools: Support alias descriptions
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
` (2 preceding siblings ...)
2015-05-21 4:11 ` [PATCH 3/6] perf, tools: Support CPU id matching for x86 Andi Kleen
@ 2015-05-21 4:11 ` Andi Kleen
2015-05-21 4:11 ` [PATCH 5/6] perf, tools: Query terminal width and use in perf list Andi Kleen
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Add support to print alias descriptions in perf list, which
are taken from the generated event files.
The sorting code is changed to put the events with descriptions
at the end. The descriptions are printed as possibly multiple word
wrapped lines.
Example output:
% perf list
...
arith.fpu_div
[Divide operations executed]
arith.fpu_div_active
[Cycles when divider is busy executing divide operations]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/pmu.c | 84 +++++++++++++++++++++++++++++++++++++++------------
tools/perf/util/pmu.h | 1 +
2 files changed, 65 insertions(+), 20 deletions(-)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 99af5d4..a90a8ee 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -232,10 +232,7 @@ static int __perf_pmu__new_alias(struct list_head *list, char *name, char *dir,
perf_pmu__parse_snapshot(alias, dir, name);
}
- /*
- * TODO: pickup description from Andi's patchset
- */
- //alias->desc = desc ? strdpu(desc) : NULL;
+ alias->desc = desc ? strdup(desc) : NULL;
list_add_tail(&alias->list, list);
@@ -982,11 +979,42 @@ static char *format_alias_or(char *buf, int len, struct perf_pmu *pmu,
return buf;
}
-static int cmp_string(const void *a, const void *b)
+struct pair {
+ char *name;
+ char *desc;
+};
+
+static int cmp_pair(const void *a, const void *b)
{
- const char * const *as = a;
- const char * const *bs = b;
- return strcmp(*as, *bs);
+ const struct pair *as = a;
+ const struct pair *bs = b;
+
+ /* Put extra events last */
+ if (!!as->desc != !!bs->desc)
+ return !!as->desc - !!bs->desc;
+ return strcmp(as->name, bs->name);
+}
+
+static void wordwrap(char *s, int start, int max, int corr)
+{
+ int column = start;
+ int n;
+
+ while (*s) {
+ int wlen = strcspn(s, " \t");
+
+ if (column + wlen >= max && column > start) {
+ printf("\n%*s", start, "");
+ column = start + corr;
+ }
+ n = printf("%s%.*s", column > start ? " " : "", wlen, s);
+ if (n <= 0)
+ break;
+ s += wlen;
+ column += n;
+ while (isspace(*s))
+ s++;
+ }
}
void print_pmu_events(const char *event_glob, bool name_only)
@@ -996,7 +1024,9 @@ void print_pmu_events(const char *event_glob, bool name_only)
char buf[1024];
int printed = 0;
int len, j;
- char **aliases;
+ struct pair *aliases;
+ int numdesc = 0;
+ int columns = 78;
pmu = NULL;
len = 0;
@@ -1006,14 +1036,15 @@ void print_pmu_events(const char *event_glob, bool name_only)
if (pmu->selectable)
len++;
}
- aliases = zalloc(sizeof(char *) * len);
+ aliases = zalloc(sizeof(struct pair) * len);
if (!aliases)
goto out_enomem;
pmu = NULL;
j = 0;
while ((pmu = perf_pmu__scan(pmu)) != NULL) {
list_for_each_entry(alias, &pmu->aliases, list) {
- char *name = format_alias(buf, sizeof(buf), pmu, alias);
+ char *name = alias->desc ? alias->name :
+ format_alias(buf, sizeof(buf), pmu, alias);
bool is_cpu = !strcmp(pmu->name, "cpu");
if (event_glob != NULL &&
@@ -1022,37 +1053,50 @@ void print_pmu_events(const char *event_glob, bool name_only)
event_glob))))
continue;
- if (is_cpu && !name_only)
+ if (is_cpu && !name_only && !alias->desc)
name = format_alias_or(buf, sizeof(buf), pmu, alias);
- aliases[j] = strdup(name);
- if (aliases[j] == NULL)
- goto out_enomem;
+ aliases[j].name = name;
+ if (is_cpu && !name_only && !alias->desc)
+ aliases[j].name = format_alias_or(buf, sizeof(buf),
+ pmu, alias);
+ aliases[j].name = strdup(aliases[j].name);
+ /* failure harmless */
+ aliases[j].desc = alias->desc;
j++;
}
if (pmu->selectable) {
char *s;
if (asprintf(&s, "%s//", pmu->name) < 0)
goto out_enomem;
- aliases[j] = s;
+ aliases[j].name = s;
j++;
}
}
len = j;
- qsort(aliases, len, sizeof(char *), cmp_string);
+ qsort(aliases, len, sizeof(struct pair), cmp_pair);
for (j = 0; j < len; j++) {
if (name_only) {
- printf("%s ", aliases[j]);
+ printf("%s ", aliases[j].name);
continue;
}
- printf(" %-50s [Kernel PMU event]\n", aliases[j]);
+ if (aliases[j].desc) {
+ if (numdesc++ == 0)
+ printf("\n");
+ printf(" %-50s\n", aliases[j].name);
+ printf("%*s", 8, "[");
+ wordwrap(aliases[j].desc, 8, columns, 0);
+ printf("]\n");
+ } else
+ printf(" %-50s [Kernel PMU event]\n", aliases[j].name);
+ free(aliases[j].name);
printed++;
}
if (printed)
printf("\n");
out_free:
for (j = 0; j < len; j++)
- zfree(&aliases[j]);
+ zfree(&aliases[j].name);
zfree(&aliases);
return;
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 7b9c8cf..e7b1010 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -38,6 +38,7 @@ struct perf_pmu_info {
struct perf_pmu_alias {
char *name;
+ char *desc;
struct list_head terms; /* HEAD struct parse_events_term -> list */
struct list_head list; /* ELEM */
char unit[UNIT_MAX_LEN+1];
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/6] perf, tools: Query terminal width and use in perf list
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
` (3 preceding siblings ...)
2015-05-21 4:11 ` [PATCH 4/6] perf, tools: Support alias descriptions Andi Kleen
@ 2015-05-21 4:11 ` Andi Kleen
2015-05-21 4:11 ` [PATCH 6/6] perf, tools: Add a --no-desc flag to " Andi Kleen
2015-05-22 15:02 ` perf, tools: Event files for Intel x86 Jiri Olsa
6 siblings, 0 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Automatically adapt the now wider and word wrapped perf list
output to wider terminals. This requires querying the terminal
before the auto pager takes over, and exporting this
information from the pager subsystem.
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/cache.h | 1 +
tools/perf/util/pager.c | 15 +++++++++++++++
tools/perf/util/pmu.c | 3 ++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index fbcca21..edf0398 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -33,6 +33,7 @@ extern void setup_pager(void);
extern const char *pager_program;
extern int pager_in_use(void);
extern int pager_use_color;
+int pager_get_columns(void);
char *alias_lookup(const char *alias);
int split_cmdline(char *cmdline, const char ***argv);
diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
index 31ee02d..9761202 100644
--- a/tools/perf/util/pager.c
+++ b/tools/perf/util/pager.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "run-command.h"
#include "sigchain.h"
+#include <sys/ioctl.h>
/*
* This is split up from the rest of git so that we can do
@@ -8,6 +9,7 @@
*/
static int spawned_pager;
+static int pager_columns;
static void pager_preexec(void)
{
@@ -47,9 +49,12 @@ static void wait_for_pager_signal(int signo)
void setup_pager(void)
{
const char *pager = getenv("PERF_PAGER");
+ struct winsize sz;
if (!isatty(1))
return;
+ if (ioctl(1, TIOCGWINSZ, &sz) == 0)
+ pager_columns = sz.ws_col;
if (!pager) {
if (!pager_program)
perf_config(perf_default_config, NULL);
@@ -98,3 +103,13 @@ int pager_in_use(void)
env = getenv("PERF_PAGER_IN_USE");
return env ? perf_config_bool("PERF_PAGER_IN_USE", env) : 0;
}
+
+int pager_get_columns(void)
+{
+ char *s;
+
+ s = getenv("COLUMNS");
+ if (s)
+ return atoi(s);
+ return (pager_columns ? pager_columns : 80) - 2;
+}
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index a90a8ee..a34cbdb 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -13,6 +13,7 @@
#include "pmu-events/pmu-events.h" // Move to global file???
#include "cpumap.h"
#include "header.h"
+#include "cache.h"
struct perf_pmu_format {
char *name;
@@ -1026,7 +1027,7 @@ void print_pmu_events(const char *event_glob, bool name_only)
int len, j;
struct pair *aliases;
int numdesc = 0;
- int columns = 78;
+ int columns = pager_get_columns();
pmu = NULL;
len = 0;
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/6] perf, tools: Add a --no-desc flag to perf list
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
` (4 preceding siblings ...)
2015-05-21 4:11 ` [PATCH 5/6] perf, tools: Query terminal width and use in perf list Andi Kleen
@ 2015-05-21 4:11 ` Andi Kleen
2015-05-22 15:02 ` perf, tools: Event files for Intel x86 Jiri Olsa
6 siblings, 0 replies; 11+ messages in thread
From: Andi Kleen @ 2015-05-21 4:11 UTC (permalink / raw)
To: sukadev; +Cc: jolsa, acme, namhyung, linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Add a --no-desc flag to perf list to not print the event descriptions
that were earlier added for JSON events. This may be useful to
get a less crowded listing.
It's still default to print descriptions as that is the more useful
default for most users.
v2: Rename --quiet to --no-desc. Add option to man page.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/Documentation/perf-list.txt | 8 +++++++-
tools/perf/builtin-list.c | 12 ++++++++----
tools/perf/util/parse-events.c | 4 ++--
tools/perf/util/parse-events.h | 2 +-
tools/perf/util/pmu.c | 4 ++--
tools/perf/util/pmu.h | 2 +-
6 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
index bada893..9507552 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -8,13 +8,19 @@ perf-list - List all symbolic event types
SYNOPSIS
--------
[verse]
-'perf list' [hw|sw|cache|tracepoint|pmu|event_glob]
+'perf list' [--no-desc] [hw|sw|cache|tracepoint|pmu|event_glob]
DESCRIPTION
-----------
This command displays the symbolic event types which can be selected in the
various perf commands with the -e option.
+OPTIONS
+-------
+--no-desc::
+Don't print descriptions.
+
+
[[EVENT_MODIFIERS]]
EVENT MODIFIERS
---------------
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index af5bd05..3f058f7 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -16,16 +16,20 @@
#include "util/pmu.h"
#include "util/parse-options.h"
+static bool desc_flag = true;
+
int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
{
int i;
bool raw_dump = false;
struct option list_options[] = {
OPT_BOOLEAN(0, "raw-dump", &raw_dump, "Dump raw events"),
+ OPT_BOOLEAN('d', "desc", &desc_flag,
+ "Print extra event descriptions. --no-desc to not print."),
OPT_END()
};
const char * const list_usage[] = {
- "perf list [hw|sw|cache|tracepoint|pmu|event_glob]",
+ "perf list [--no-desc] [hw|sw|cache|tracepoint|pmu|event_glob]",
NULL
};
@@ -40,7 +44,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
printf("\nList of pre-defined events (to be used in -e):\n\n");
if (argc == 0) {
- print_events(NULL, raw_dump);
+ print_events(NULL, raw_dump, !desc_flag);
return 0;
}
@@ -59,13 +63,13 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
strcmp(argv[i], "hwcache") == 0)
print_hwcache_events(NULL, raw_dump);
else if (strcmp(argv[i], "pmu") == 0)
- print_pmu_events(NULL, raw_dump);
+ print_pmu_events(NULL, raw_dump, !desc_flag);
else {
char *sep = strchr(argv[i], ':'), *s;
int sep_idx;
if (sep == NULL) {
- print_events(argv[i], raw_dump);
+ print_events(argv[i], raw_dump, !desc_flag);
continue;
}
sep_idx = sep - argv[i];
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 80a50fd..750dbd7 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1527,7 +1527,7 @@ out_enomem:
/*
* Print the help text for the event symbols:
*/
-void print_events(const char *event_glob, bool name_only)
+void print_events(const char *event_glob, bool name_only, bool quiet_flag)
{
print_symbol_events(event_glob, PERF_TYPE_HARDWARE,
event_symbols_hw, PERF_COUNT_HW_MAX, name_only);
@@ -1537,7 +1537,7 @@ void print_events(const char *event_glob, bool name_only)
print_hwcache_events(event_glob, name_only);
- print_pmu_events(event_glob, name_only);
+ print_pmu_events(event_glob, name_only, quiet_flag);
if (event_glob != NULL)
return;
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index e236f1b..9f2b57d 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -127,7 +127,7 @@ void parse_events_update_lists(struct list_head *list_event,
void parse_events_evlist_error(struct parse_events_evlist *data,
int idx, const char *str);
-void print_events(const char *event_glob, bool name_only);
+void print_events(const char *event_glob, bool name_only, bool quiet);
struct event_symbol {
const char *symbol;
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index a34cbdb..4376182 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1018,7 +1018,7 @@ static void wordwrap(char *s, int start, int max, int corr)
}
}
-void print_pmu_events(const char *event_glob, bool name_only)
+void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag)
{
struct perf_pmu *pmu;
struct perf_pmu_alias *alias;
@@ -1081,7 +1081,7 @@ void print_pmu_events(const char *event_glob, bool name_only)
printf("%s ", aliases[j].name);
continue;
}
- if (aliases[j].desc) {
+ if (aliases[j].desc && !quiet_flag) {
if (numdesc++ == 0)
printf("\n");
printf(" %-50s\n", aliases[j].name);
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index e7b1010..9966c1a 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -69,7 +69,7 @@ int perf_pmu__format_parse(char *dir, struct list_head *head);
struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
-void print_pmu_events(const char *event_glob, bool name_only);
+void print_pmu_events(const char *event_glob, bool name_only, bool quiet);
bool pmu_have_event(const char *pname, const char *name);
int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt,
--
2.1.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: perf, tools: Event files for Intel x86
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
` (5 preceding siblings ...)
2015-05-21 4:11 ` [PATCH 6/6] perf, tools: Add a --no-desc flag to " Andi Kleen
@ 2015-05-22 15:02 ` Jiri Olsa
2015-05-22 15:20 ` Andi Kleen
2015-05-22 16:00 ` Sukadev Bhattiprolu
6 siblings, 2 replies; 11+ messages in thread
From: Jiri Olsa @ 2015-05-22 15:02 UTC (permalink / raw)
To: Andi Kleen; +Cc: sukadev, acme, namhyung, linux-kernel
On Wed, May 20, 2015 at 09:11:27PM -0700, Andi Kleen wrote:
> This patchkit extends Sukadev builtin event list patches for Intel x86.
> With that perf can build in event lists.
Sukadev,
could you please pick it up fr your next patchset version,
so we have only single patchset?
>
> This also adds some missing features from the older JSON patchkits,
> in particular the ability to print descriptions.
>
> I am not posting the actual event files, because they are gigantic
> (several MB) but you can get them from git here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git perf/builtion-json-1
>
> Currently only core events are included, not uncore.
hum, not sure how you guys want to handle this, but it'd be nice
to have all the bits in one place.. Could one of you guys please
arrange branch with all this?
thanks,
jirka
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: perf, tools: Event files for Intel x86
2015-05-22 15:02 ` perf, tools: Event files for Intel x86 Jiri Olsa
@ 2015-05-22 15:20 ` Andi Kleen
2015-05-22 17:27 ` Jiri Olsa
2015-05-22 16:00 ` Sukadev Bhattiprolu
1 sibling, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2015-05-22 15:20 UTC (permalink / raw)
To: Jiri Olsa; +Cc: Andi Kleen, sukadev, acme, namhyung, linux-kernel
> > Currently only core events are included, not uncore.
>
> hum, not sure how you guys want to handle this, but it'd be nice
> to have all the bits in one place.. Could one of you guys please
> arrange branch with all this?
I would suggest to handle the code together in a single branch.
And then handle the events separately per architecture, just as pull
requests without posting. I doubt anyone on linux-kernel would be happy
about getting that large files in mail; in fact the list software
may not allow it.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: perf, tools: Event files for Intel x86
2015-05-22 15:02 ` perf, tools: Event files for Intel x86 Jiri Olsa
2015-05-22 15:20 ` Andi Kleen
@ 2015-05-22 16:00 ` Sukadev Bhattiprolu
1 sibling, 0 replies; 11+ messages in thread
From: Sukadev Bhattiprolu @ 2015-05-22 16:00 UTC (permalink / raw)
To: Jiri Olsa; +Cc: Andi Kleen, acme, namhyung, linux-kernel
Jiri Olsa [jolsa@redhat.com] wrote:
| On Wed, May 20, 2015 at 09:11:27PM -0700, Andi Kleen wrote:
| > This patchkit extends Sukadev builtin event list patches for Intel x86.
| > With that perf can build in event lists.
|
| Sukadev,
| could you please pick it up fr your next patchset version,
| so we have only single patchset?
Sure.
|
| >
| > This also adds some missing features from the older JSON patchkits,
| > in particular the ability to print descriptions.
| >
| > I am not posting the actual event files, because they are gigantic
| > (several MB) but you can get them from git here:
| >
| > git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git perf/builtion-json-1
| >
| > Currently only core events are included, not uncore.
|
| hum, not sure how you guys want to handle this, but it'd be nice
| to have all the bits in one place.. Could one of you guys please
| arrange branch with all this?
Are you referring to the patches or the Intel JSON files? For the
latter, I would leave it to Andi to checkin the files.
|
| thanks,
| jirka
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: perf, tools: Event files for Intel x86
2015-05-22 15:20 ` Andi Kleen
@ 2015-05-22 17:27 ` Jiri Olsa
0 siblings, 0 replies; 11+ messages in thread
From: Jiri Olsa @ 2015-05-22 17:27 UTC (permalink / raw)
To: Andi Kleen; +Cc: sukadev, acme, namhyung, linux-kernel
On Fri, May 22, 2015 at 05:20:11PM +0200, Andi Kleen wrote:
> > > Currently only core events are included, not uncore.
> >
> > hum, not sure how you guys want to handle this, but it'd be nice
> > to have all the bits in one place.. Could one of you guys please
> > arrange branch with all this?
>
> I would suggest to handle the code together in a single branch.
> And then handle the events separately per architecture, just as pull
> requests without posting. I doubt anyone on linux-kernel would be happy
> about getting that large files in mail; in fact the list software
> may not allow it.
sounds good
jirka
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-05-22 17:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-21 4:11 perf, tools: Event files for Intel x86 Andi Kleen
2015-05-21 4:11 ` [PATCH 1/6] perf, tools: Handle header line in mapfile Andi Kleen
2015-05-21 4:11 ` [PATCH 2/6] perf, tools: Allow events with dot Andi Kleen
2015-05-21 4:11 ` [PATCH 3/6] perf, tools: Support CPU id matching for x86 Andi Kleen
2015-05-21 4:11 ` [PATCH 4/6] perf, tools: Support alias descriptions Andi Kleen
2015-05-21 4:11 ` [PATCH 5/6] perf, tools: Query terminal width and use in perf list Andi Kleen
2015-05-21 4:11 ` [PATCH 6/6] perf, tools: Add a --no-desc flag to " Andi Kleen
2015-05-22 15:02 ` perf, tools: Event files for Intel x86 Jiri Olsa
2015-05-22 15:20 ` Andi Kleen
2015-05-22 17:27 ` Jiri Olsa
2015-05-22 16:00 ` Sukadev Bhattiprolu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox