* [GIT PULL 00/20] perf/core improvements and fixes @ 2012-07-05 15:44 Arnaldo Carvalho de Melo 2012-07-05 15:44 ` [PATCH 01/20] tools lib traceevent: Let filtering numbers by string use function names Arnaldo Carvalho de Melo ` (20 more replies) 0 siblings, 21 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:44 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Borislav Petkov, Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa, Johannes Berg, Namhyung Kim, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Huewe, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Ulrich Drepper, Wolfgang Mauerer, arnaldo.melo, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, this one contains my first merge, a pull request by Namhyung, please check if everything is OK, Thanks, - Arnaldo The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3: perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83: Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: . Preparatory patches to use hw events in PMU syntax, from Jiri Olsa . Remaining backport of trace-cmd's libparseevent, from Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (1): Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core Jiri Olsa (4): perf test: Use ARRAY_SIZE in parse events tests perf tools: Add empty rule for new line in event syntax parsing perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens perf tools: Split event symbols arrays to hw and sw parts Namhyung Kim (10): tools lib traceevent: Fix printk_cmp() tools lib traceevent: Introduce extend_token() tools lib traceevent: Handle strdup failure cases tools lib traceevent: Handle realloc() failure path tools lib traceevent: Pass string type argument to args tools lib traceevent: Do not call add_event() again if allocation failed tools lib traceevent: Fix some comments tools lib traceevent: Check result of malloc() during reading token tools lib traceevent: Check return value of arg_to_str() tools lib traceevent: Cleanup realloc use Peter Huewe (1): tools lib traceevent: Add missing break in make_bprint_args Steven Rostedt (4): tools lib traceevent: Let filtering numbers by string use function names tools lib traceevent: Add support for "%.*s" in bprintk events tools lib traceevent: Add support to show migrate disable counter tools lib traceevent: Fix %pM print format arg handling Wolfgang Mauerer (1): tools lib traceevent: Fix trace_printk for long integers tools/lib/traceevent/event-parse.c | 287 +++++++++++++++++++++++------------ tools/lib/traceevent/parse-filter.c | 86 +++++++---- tools/perf/util/parse-events-test.c | 29 ++-- tools/perf/util/parse-events.c | 174 ++++++++++++++------- tools/perf/util/parse-events.l | 3 +- tools/perf/util/parse-events.y | 15 +- 6 files changed, 391 insertions(+), 203 deletions(-) ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 01/20] tools lib traceevent: Let filtering numbers by string use function names 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2012-07-05 15:44 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 02/20] tools lib traceevent: Add support for "%.*s" in bprintk events Arnaldo Carvalho de Melo ` (19 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:44 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Steven Rostedt, Steven Rostedt, Namhyung Kim From: Steven Rostedt <srostedt@redhat.com> As a pointer can be converted into a function name, let the filters work with the function name as well as with the pointer number. If the comparison expects a string, then convert numbers into functions, but only when the number is the same size as a long. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-oxsa1qkr2eq7u8d7r0aapedu@git.kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/parse-filter.c | 45 +++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index dfcfe2c..80d872a 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -1710,18 +1710,43 @@ static int test_num(struct event_format *event, static const char *get_field_str(struct filter_arg *arg, struct pevent_record *record) { - const char *val = record->data + arg->str.field->offset; + struct event_format *event; + struct pevent *pevent; + unsigned long long addr; + const char *val = NULL; + char hex[64]; - /* - * We need to copy the data since we can't be sure the field - * is null terminated. - */ - if (*(val + arg->str.field->size - 1)) { - /* copy it */ - memcpy(arg->str.buffer, val, arg->str.field->size); - /* the buffer is already NULL terminated */ - val = arg->str.buffer; + /* If the field is not a string convert it */ + if (arg->str.field->flags & FIELD_IS_STRING) { + val = record->data + arg->str.field->offset; + + /* + * We need to copy the data since we can't be sure the field + * is null terminated. + */ + if (*(val + arg->str.field->size - 1)) { + /* copy it */ + memcpy(arg->str.buffer, val, arg->str.field->size); + /* the buffer is already NULL terminated */ + val = arg->str.buffer; + } + + } else { + event = arg->str.field->event; + pevent = event->pevent; + addr = get_value(event, arg->str.field, record); + + if (arg->str.field->flags & (FIELD_IS_POINTER | FIELD_IS_LONG)) + /* convert to a kernel symbol */ + val = pevent_find_function(pevent, addr); + + if (val == NULL) { + /* just use the hex of the string name */ + snprintf(hex, 64, "0x%llx", addr); + val = hex; + } } + return val; } -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 02/20] tools lib traceevent: Add support for "%.*s" in bprintk events 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo 2012-07-05 15:44 ` [PATCH 01/20] tools lib traceevent: Let filtering numbers by string use function names Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 03/20] tools lib traceevent: Add support to show migrate disable counter Arnaldo Carvalho de Melo ` (18 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Steven Rostedt, Steven Rostedt, Namhyung Kim From: Steven Rostedt <srostedt@redhat.com> The arg notation of '*' in bprintks is not handled by the parser. Implement it so that they show up properly in the output and do not kill the tracer from reporting events. Reported-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-t0ctq7t1xz3ud6wv4v886jou@git.kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 83f0a8a..0644c2a 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -3370,7 +3370,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, break; } case PRINT_BSTRING: - trace_seq_printf(s, format, arg->string.string); + print_str_to_seq(s, format, len_arg, arg->string.string); break; case PRINT_OP: /* @@ -3471,6 +3471,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc unsigned long long ip, val; char *ptr; void *bptr; + int vsize; field = pevent->bprint_buf_field; ip_field = pevent->bprint_ip_field; @@ -3519,6 +3520,8 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc goto process_again; case '0' ... '9': goto process_again; + case '.': + goto process_again; case 'p': ls = 1; /* fall through */ @@ -3526,23 +3529,29 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc case 'u': case 'x': case 'i': - /* the pointers are always 4 bytes aligned */ - bptr = (void *)(((unsigned long)bptr + 3) & - ~3); switch (ls) { case 0: - ls = 4; + vsize = 4; break; case 1: - ls = pevent->long_size; + vsize = pevent->long_size; break; case 2: - ls = 8; + vsize = 8; default: + vsize = ls; /* ? */ break; } - val = pevent_read_number(pevent, bptr, ls); - bptr += ls; + /* fall through */ + case '*': + if (*ptr == '*') + vsize = 4; + + /* the pointers are always 4 bytes aligned */ + bptr = (void *)(((unsigned long)bptr + 3) & + ~3); + val = pevent_read_number(pevent, bptr, vsize); + bptr += vsize; arg = alloc_arg(); arg->next = NULL; arg->type = PRINT_ATOM; @@ -3550,6 +3559,13 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc sprintf(arg->atom.atom, "%lld", val); *next = arg; next = &arg->next; + /* + * The '*' case means that an arg is used as the length. + * We need to continue to figure out for what. + */ + if (*ptr == '*') + goto process_again; + break; case 's': arg = alloc_arg(); -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 03/20] tools lib traceevent: Add support to show migrate disable counter 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo 2012-07-05 15:44 ` [PATCH 01/20] tools lib traceevent: Let filtering numbers by string use function names Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 02/20] tools lib traceevent: Add support for "%.*s" in bprintk events Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 04/20] tools lib traceevent: Fix %pM print format arg handling Arnaldo Carvalho de Melo ` (17 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Steven Rostedt, Steven Rostedt, Namhyung Kim From: Steven Rostedt <srostedt@redhat.com> The RT kernel added a migrate disable counter in all events. Add support to show this in the latency format. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-l6ulxyda952g7kua4pfsh73k@git.kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 57 ++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 0644c2a..872dd35 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -2884,7 +2884,7 @@ static int get_common_info(struct pevent *pevent, event = pevent->events[0]; field = pevent_find_common_field(event, type); if (!field) - die("field '%s' not found", type); + return -1; *offset = field->offset; *size = field->size; @@ -2935,15 +2935,16 @@ static int parse_common_flags(struct pevent *pevent, void *data) static int parse_common_lock_depth(struct pevent *pevent, void *data) { - int ret; - - ret = __parse_common(pevent, data, - &pevent->ld_size, &pevent->ld_offset, - "common_lock_depth"); - if (ret < 0) - return -1; + return __parse_common(pevent, data, + &pevent->ld_size, &pevent->ld_offset, + "common_lock_depth"); +} - return ret; +static int parse_common_migrate_disable(struct pevent *pevent, void *data) +{ + return __parse_common(pevent, data, + &pevent->ld_size, &pevent->ld_offset, + "common_migrate_disable"); } static int events_id_cmp(const void *a, const void *b); @@ -3988,10 +3989,13 @@ void pevent_data_lat_fmt(struct pevent *pevent, struct trace_seq *s, struct pevent_record *record) { static int check_lock_depth = 1; + static int check_migrate_disable = 1; static int lock_depth_exists; + static int migrate_disable_exists; unsigned int lat_flags; unsigned int pc; int lock_depth; + int migrate_disable; int hardirq; int softirq; void *data = record->data; @@ -3999,18 +4003,26 @@ void pevent_data_lat_fmt(struct pevent *pevent, lat_flags = parse_common_flags(pevent, data); pc = parse_common_pc(pevent, data); /* lock_depth may not always exist */ - if (check_lock_depth) { - struct format_field *field; - struct event_format *event; - - check_lock_depth = 0; - event = pevent->events[0]; - field = pevent_find_common_field(event, "common_lock_depth"); - if (field) - lock_depth_exists = 1; - } if (lock_depth_exists) lock_depth = parse_common_lock_depth(pevent, data); + else if (check_lock_depth) { + lock_depth = parse_common_lock_depth(pevent, data); + if (lock_depth < 0) + check_lock_depth = 0; + else + lock_depth_exists = 1; + } + + /* migrate_disable may not always exist */ + if (migrate_disable_exists) + migrate_disable = parse_common_migrate_disable(pevent, data); + else if (check_migrate_disable) { + migrate_disable = parse_common_migrate_disable(pevent, data); + if (migrate_disable < 0) + check_migrate_disable = 0; + else + migrate_disable_exists = 1; + } hardirq = lat_flags & TRACE_FLAG_HARDIRQ; softirq = lat_flags & TRACE_FLAG_SOFTIRQ; @@ -4029,6 +4041,13 @@ void pevent_data_lat_fmt(struct pevent *pevent, else trace_seq_putc(s, '.'); + if (migrate_disable_exists) { + if (migrate_disable < 0) + trace_seq_putc(s, '.'); + else + trace_seq_printf(s, "%d", migrate_disable); + } + if (lock_depth_exists) { if (lock_depth < 0) trace_seq_putc(s, '.'); -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 04/20] tools lib traceevent: Fix %pM print format arg handling 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (2 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 03/20] tools lib traceevent: Add support to show migrate disable counter Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 05/20] tools lib traceevent: Fix trace_printk for long integers Arnaldo Carvalho de Melo ` (16 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Steven Rostedt, Steven Rostedt, Namhyung Kim From: Steven Rostedt <srostedt@redhat.com> When %pM is used, the arg value must be a 6 byte character that will be printed as a 6 byte MAC address. But the code does a break over the main code which updates the current processing arg to point to the next arg. If there are other print arguments after a %pM, they will be off by one. The next arg will still be processing the %pM arg. Reported-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-q3g0n1espikynsdkpbi6ue6t@git.kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 872dd35..da06c33 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -3858,6 +3858,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event } else if (*(ptr+1) == 'M' || *(ptr+1) == 'm') { print_mac_arg(s, *(ptr+1), data, size, event, arg); ptr++; + arg = arg->next; break; } -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 05/20] tools lib traceevent: Fix trace_printk for long integers 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (3 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 04/20] tools lib traceevent: Fix %pM print format arg handling Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 06/20] tools lib traceevent: Fix printk_cmp() Arnaldo Carvalho de Melo ` (15 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Wolfgang Mauerer, Steven Rostedt, Namhyung Kim From: Wolfgang Mauerer <wolfgang.mauerer@siemens.com> On 32 bit systems, a conversion of the trace_printk format string "%lu" -> "%llu" is intended (similar for %lx etc.) when a trace was taken on a machine with 64 bit long integers. However, the current code computes the bogus transformation "%lu" -> "%u". Fix this. Besides that, the transformation is only required on systems that don't use 64 bits for long integers natively. Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1332411501-8059-3-git-send-email-wolfgang.mauerer@siemens.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index da06c33..ddee5a8 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -3895,14 +3895,15 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event break; } } - if (pevent->long_size == 8 && ls) { + if (pevent->long_size == 8 && ls && + sizeof(long) != 8) { char *p; ls = 2; /* make %l into %ll */ p = strchr(format, 'l'); if (p) - memmove(p, p+1, strlen(p)+1); + memmove(p+1, p, strlen(p)+1); else if (strcmp(format, "%p") == 0) strcpy(format, "0x%llx"); } -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 06/20] tools lib traceevent: Fix printk_cmp() 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (4 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 05/20] tools lib traceevent: Fix trace_printk for long integers Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 07/20] tools lib traceevent: Introduce extend_token() Arnaldo Carvalho de Melo ` (14 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> The printk_cmp function should use printk_map instead of func_map. Also rename the variables for consistency. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1333940074-19052-3-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index ddee5a8..7815b8d 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -511,12 +511,12 @@ struct printk_list { static int printk_cmp(const void *a, const void *b) { - const struct func_map *fa = a; - const struct func_map *fb = b; + const struct printk_map *pa = a; + const struct printk_map *pb = b; - if (fa->addr < fb->addr) + if (pa->addr < pb->addr) return -1; - if (fa->addr > fb->addr) + if (pa->addr > pb->addr) return 1; return 0; -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 07/20] tools lib traceevent: Introduce extend_token() 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (5 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 06/20] tools lib traceevent: Fix printk_cmp() Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 08/20] tools lib traceevent: Handle strdup failure cases Arnaldo Carvalho de Melo ` (13 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> The __read_token() function has some duplicated code to handle internal buffer overflow. Factor them out to new extend_token(). According to the man pages of realloc/free(3), they can handle NULL pointer input so that it can be ended up to compact the code. Also handle error path correctly. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1333940074-19052-4-git-send-email-namhyung.kim@lge.com [rostedt@goodmis.org: added some extra whitespace] Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 50 +++++++++++++++++------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 7815b8d..768fab5 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -781,6 +781,25 @@ int pevent_peek_char(void) return __peek_char(); } +static int extend_token(char **tok, char *buf, int size) +{ + char *newtok = realloc(*tok, size); + + if (!newtok) { + free(*tok); + *tok = NULL; + return -1; + } + + if (!*tok) + strcpy(newtok, buf); + else + strcat(newtok, buf); + *tok = newtok; + + return 0; +} + static enum event_type force_token(const char *str, char **tok); static enum event_type __read_token(char **tok) @@ -865,17 +884,10 @@ static enum event_type __read_token(char **tok) do { if (i == (BUFSIZ - 1)) { buf[i] = 0; - if (*tok) { - *tok = realloc(*tok, tok_size + BUFSIZ); - if (!*tok) - return EVENT_NONE; - strcat(*tok, buf); - } else - *tok = strdup(buf); + tok_size += BUFSIZ; - if (!*tok) + if (extend_token(tok, buf, tok_size) < 0) return EVENT_NONE; - tok_size += BUFSIZ; i = 0; } last_ch = ch; @@ -914,17 +926,10 @@ static enum event_type __read_token(char **tok) while (get_type(__peek_char()) == type) { if (i == (BUFSIZ - 1)) { buf[i] = 0; - if (*tok) { - *tok = realloc(*tok, tok_size + BUFSIZ); - if (!*tok) - return EVENT_NONE; - strcat(*tok, buf); - } else - *tok = strdup(buf); + tok_size += BUFSIZ; - if (!*tok) + if (extend_token(tok, buf, tok_size) < 0) return EVENT_NONE; - tok_size += BUFSIZ; i = 0; } ch = __read_char(); @@ -933,14 +938,7 @@ static enum event_type __read_token(char **tok) out: buf[i] = 0; - if (*tok) { - *tok = realloc(*tok, tok_size + i); - if (!*tok) - return EVENT_NONE; - strcat(*tok, buf); - } else - *tok = strdup(buf); - if (!*tok) + if (extend_token(tok, buf, tok_size + i + 1) < 0) return EVENT_NONE; if (type == EVENT_ITEM) { -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 08/20] tools lib traceevent: Handle strdup failure cases 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (6 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 07/20] tools lib traceevent: Introduce extend_token() Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 09/20] tools lib traceevent: Handle realloc() failure path Arnaldo Carvalho de Melo ` (12 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> There were some places didn't check return value of the strdup and had unneeded/duplicated checks. Fix it. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1333940074-19052-5-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 768fab5..cd334d5 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -467,8 +467,10 @@ int pevent_register_function(struct pevent *pevent, char *func, item->mod = NULL; item->addr = addr; - pevent->funclist = item; + if (!item->func || (mod && !item->mod)) + die("malloc func"); + pevent->funclist = item; pevent->func_count++; return 0; @@ -583,10 +585,13 @@ int pevent_register_print_string(struct pevent *pevent, char *fmt, item = malloc_or_die(sizeof(*item)); item->next = pevent->printklist; - pevent->printklist = item; item->printk = strdup(fmt); item->addr = addr; + if (!item->printk) + die("malloc fmt"); + + pevent->printklist = item; pevent->printk_count++; return 0; @@ -2150,6 +2155,8 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char ** if (value == NULL) goto out_free; field->value = strdup(value); + if (field->value == NULL) + goto out_free; free_arg(arg); arg = alloc_arg(); @@ -2163,6 +2170,8 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char ** if (value == NULL) goto out_free; field->str = strdup(value); + if (field->str == NULL) + goto out_free; free_arg(arg); arg = NULL; @@ -3433,6 +3442,9 @@ process_defined_func(struct trace_seq *s, void *data, int size, string = malloc_or_die(sizeof(*string)); string->next = strings; string->str = strdup(str.buffer); + if (!string->str) + die("malloc str"); + strings = string; trace_seq_destroy(&str); break; @@ -3571,6 +3583,8 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc arg->next = NULL; arg->type = PRINT_BSTRING; arg->string.string = strdup(bptr); + if (!arg->string.string) + break; bptr += strlen(bptr) + 1; *next = arg; next = &arg->next; @@ -4666,6 +4680,8 @@ int pevent_parse_event(struct pevent *pevent, die("failed to read event id"); event->system = strdup(sys); + if (!event->system) + die("failed to allocate system"); /* Add pevent to event so that it can be referenced */ event->pevent = pevent; @@ -4707,6 +4723,10 @@ int pevent_parse_event(struct pevent *pevent, list = &arg->next; arg->type = PRINT_FIELD; arg->field.name = strdup(field->name); + if (!arg->field.name) { + do_warning("failed to allocate field name"); + goto event_failed; + } arg->field.field = field; } return 0; @@ -5050,6 +5070,11 @@ int pevent_register_event_handler(struct pevent *pevent, if (sys_name) handle->sys_name = strdup(sys_name); + if ((event_name && !handle->event_name) || + (sys_name && !handle->sys_name)) { + die("Failed to allocate event/sys name"); + } + handle->func = func; handle->next = pevent->handlers; pevent->handlers = handle; -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 09/20] tools lib traceevent: Handle realloc() failure path 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (7 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 08/20] tools lib traceevent: Handle strdup failure cases Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 10/20] tools lib traceevent: Pass string type argument to args Arnaldo Carvalho de Melo ` (11 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> The realloc can fail so that we should handle it properly. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1333940074-19052-7-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 76 ++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index cd334d5..05eb6b4 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -1264,9 +1264,15 @@ static int event_read_fields(struct event_format *event, struct format_field **f field->flags |= FIELD_IS_POINTER; if (field->type) { - field->type = realloc(field->type, - strlen(field->type) + - strlen(last_token) + 2); + char *new_type; + new_type = realloc(field->type, + strlen(field->type) + + strlen(last_token) + 2); + if (!new_type) { + free(last_token); + goto fail; + } + field->type = new_type; strcat(field->type, " "); strcat(field->type, last_token); free(last_token); @@ -1291,6 +1297,7 @@ static int event_read_fields(struct event_format *event, struct format_field **f if (strcmp(token, "[") == 0) { enum event_type last_type = type; char *brackets = token; + char *new_brackets; int len; field->flags |= FIELD_IS_ARRAY; @@ -1310,9 +1317,14 @@ static int event_read_fields(struct event_format *event, struct format_field **f len = 1; last_type = type; - brackets = realloc(brackets, - strlen(brackets) + - strlen(token) + len); + new_brackets = realloc(brackets, + strlen(brackets) + + strlen(token) + len); + if (!new_brackets) { + free(brackets); + goto fail; + } + brackets = new_brackets; if (len == 2) strcat(brackets, " "); strcat(brackets, token); @@ -1328,7 +1340,12 @@ static int event_read_fields(struct event_format *event, struct format_field **f free_token(token); - brackets = realloc(brackets, strlen(brackets) + 2); + new_brackets = realloc(brackets, strlen(brackets) + 2); + if (!new_brackets) { + free(brackets); + goto fail; + } + brackets = new_brackets; strcat(brackets, "]"); /* add brackets to type */ @@ -1339,10 +1356,16 @@ static int event_read_fields(struct event_format *event, struct format_field **f * the format: type [] item; */ if (type == EVENT_ITEM) { - field->type = realloc(field->type, - strlen(field->type) + - strlen(field->name) + - strlen(brackets) + 2); + char *new_type; + new_type = realloc(field->type, + strlen(field->type) + + strlen(field->name) + + strlen(brackets) + 2); + if (!new_type) { + free(brackets); + goto fail; + } + field->type = new_type; strcat(field->type, " "); strcat(field->type, field->name); free_token(field->name); @@ -1350,9 +1373,15 @@ static int event_read_fields(struct event_format *event, struct format_field **f field->name = token; type = read_token(&token); } else { - field->type = realloc(field->type, - strlen(field->type) + - strlen(brackets) + 1); + char *new_type; + new_type = realloc(field->type, + strlen(field->type) + + strlen(brackets) + 1); + if (!new_type) { + free(brackets); + goto fail; + } + field->type = new_type; strcat(field->type, brackets); } free(brackets); @@ -1735,10 +1764,16 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) /* could just be a type pointer */ if ((strcmp(arg->op.op, "*") == 0) && type == EVENT_DELIM && (strcmp(token, ")") == 0)) { + char *new_atom; + if (left->type != PRINT_ATOM) die("bad pointer type"); - left->atom.atom = realloc(left->atom.atom, + new_atom = realloc(left->atom.atom, strlen(left->atom.atom) + 3); + if (!new_atom) + goto out_free; + + left->atom.atom = new_atom; strcat(left->atom.atom, " *"); free(arg->op.op); *arg = *left; @@ -2597,7 +2632,16 @@ process_arg_token(struct event_format *event, struct print_arg *arg, } /* atoms can be more than one token long */ while (type == EVENT_ITEM) { - atom = realloc(atom, strlen(atom) + strlen(token) + 2); + char *new_atom; + new_atom = realloc(atom, + strlen(atom) + strlen(token) + 2); + if (!new_atom) { + free(atom); + *tok = NULL; + free_token(token); + return EVENT_ERROR; + } + atom = new_atom; strcat(atom, " "); strcat(atom, token); free_token(token); -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 10/20] tools lib traceevent: Pass string type argument to args 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (8 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 09/20] tools lib traceevent: Handle realloc() failure path Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 11/20] tools lib traceevent: Do not call add_event() again if allocation failed Arnaldo Carvalho de Melo ` (10 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Namhyung Kim, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> It seems PEVENT_FUNC_ARG_STRING missed passing the allocated string to the args array. Fix it. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1335157118-14658-7-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 05eb6b4..337ca02 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -3489,6 +3489,7 @@ process_defined_func(struct trace_seq *s, void *data, int size, if (!string->str) die("malloc str"); + args[i] = (unsigned long long)string->str; strings = string; trace_seq_destroy(&str); break; -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 11/20] tools lib traceevent: Do not call add_event() again if allocation failed 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (9 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 10/20] tools lib traceevent: Pass string type argument to args Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 12/20] tools lib traceevent: Fix some comments Arnaldo Carvalho de Melo ` (9 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Namhyung Kim, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> When memory allocation for the field name is failed, do not goto event_failed since we added the event already. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1335157118-14658-8-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 337ca02..99b0cd4 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -4770,7 +4770,8 @@ int pevent_parse_event(struct pevent *pevent, arg->field.name = strdup(field->name); if (!arg->field.name) { do_warning("failed to allocate field name"); - goto event_failed; + event->flags |= EVENT_FL_FAILED; + return -1; } arg->field.field = field; } -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 12/20] tools lib traceevent: Fix some comments 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (10 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 11/20] tools lib traceevent: Do not call add_event() again if allocation failed Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 13/20] tools lib traceevent: Check result of malloc() during reading token Arnaldo Carvalho de Melo ` (8 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Namhyung Kim, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> Update and add missing argument descriptions and fix some typo on function comments. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1335157118-14658-9-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 99b0cd4..8630160 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -4037,8 +4037,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event * pevent_data_lat_fmt - parse the data for the latency format * @pevent: a handle to the pevent * @s: the trace_seq to write to - * @data: the raw data to read from - * @size: currently unused. + * @record: the record to read from * * This parses out the Latency format (interrupts disabled, * need rescheduling, in hard/soft interrupt, preempt count @@ -4173,10 +4172,7 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid) * pevent_data_comm_from_pid - parse the data into the print format * @s: the trace_seq to write to * @event: the handle to the event - * @cpu: the cpu the event was recorded on - * @data: the raw data - * @size: the size of the raw data - * @nsecs: the timestamp of the event + * @record: the record to read from * * This parses the raw @data using the given @event information and * writes the print format into the trace_seq. @@ -4944,7 +4940,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, * @record: The record with the field name. * @err: print default error if failed. * - * Returns: 0 on success, -1 field not fould, or 1 if buffer is full. + * Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ int pevent_print_num_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, @@ -4986,11 +4982,12 @@ static void free_func_handle(struct pevent_function_handler *func) * pevent_register_print_function - register a helper function * @pevent: the handle to the pevent * @func: the function to process the helper function + * @ret_type: the return type of the helper function * @name: the name of the helper function * @parameters: A list of enum pevent_func_arg_type * * Some events may have helper functions in the print format arguments. - * This allows a plugin to dynmically create a way to process one + * This allows a plugin to dynamically create a way to process one * of these functions. * * The @parameters is a variable list of pevent_func_arg_type enums that @@ -5061,12 +5058,13 @@ int pevent_register_print_function(struct pevent *pevent, } /** - * pevent_register_event_handle - register a way to parse an event + * pevent_register_event_handler - register a way to parse an event * @pevent: the handle to the pevent * @id: the id of the event to register * @sys_name: the system name the event belongs to * @event_name: the name of the event * @func: the function to call to parse the event information + * @context: the data to be passed to @func * * This function allows a developer to override the parsing of * a given event. If for some reason the default print format -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 13/20] tools lib traceevent: Check result of malloc() during reading token 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (11 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 12/20] tools lib traceevent: Fix some comments Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 14/20] tools lib traceevent: Check return value of arg_to_str() Arnaldo Carvalho de Melo ` (7 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Namhyung Kim, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> The malloc can fail so the return value should be checked. For now, just use malloc_or_die(). Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1335157118-14658-10-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/parse-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 80d872a..d54c2b4 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -96,7 +96,7 @@ static enum event_type read_token(char **tok) (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) && pevent_peek_char() == '~') { /* append it */ - *tok = malloc(3); + *tok = malloc_or_die(3); sprintf(*tok, "%c%c", *token, '~'); free_token(token); /* Now remove the '~' from the buffer */ -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 14/20] tools lib traceevent: Check return value of arg_to_str() 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (12 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 13/20] tools lib traceevent: Check result of malloc() during reading token Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 15/20] tools lib traceevent: Add missing break in make_bprint_args Arnaldo Carvalho de Melo ` (6 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Namhyung Kim, Arnaldo Carvalho de Melo, Borislav Petkov, David Ahern, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> The arg_to_str() can fail so we should handle that case properly. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1335157118-14658-12-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/parse-filter.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index d54c2b4..f020ac6 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -2026,11 +2026,13 @@ static char *exp_to_str(struct event_filter *filter, struct filter_arg *arg) char *lstr; char *rstr; char *op; - char *str; + char *str = NULL; int len; lstr = arg_to_str(filter, arg->exp.left); rstr = arg_to_str(filter, arg->exp.right); + if (!lstr || !rstr) + goto out; switch (arg->exp.type) { case FILTER_EXP_ADD: @@ -2070,6 +2072,7 @@ static char *exp_to_str(struct event_filter *filter, struct filter_arg *arg) len = strlen(op) + strlen(lstr) + strlen(rstr) + 4; str = malloc_or_die(len); snprintf(str, len, "%s %s %s", lstr, op, rstr); +out: free(lstr); free(rstr); @@ -2086,6 +2089,8 @@ static char *num_to_str(struct event_filter *filter, struct filter_arg *arg) lstr = arg_to_str(filter, arg->num.left); rstr = arg_to_str(filter, arg->num.right); + if (!lstr || !rstr) + goto out; switch (arg->num.type) { case FILTER_CMP_EQ: @@ -2122,6 +2127,7 @@ static char *num_to_str(struct event_filter *filter, struct filter_arg *arg) break; } +out: free(lstr); free(rstr); return str; @@ -2272,7 +2278,12 @@ int pevent_filter_compare(struct event_filter *filter1, struct event_filter *fil /* The best way to compare complex filters is with strings */ str1 = arg_to_str(filter1, filter_type1->filter); str2 = arg_to_str(filter2, filter_type2->filter); - result = strcmp(str1, str2) != 0; + if (str1 && str2) + result = strcmp(str1, str2) != 0; + else + /* bail out if allocation fails */ + result = 1; + free(str1); free(str2); if (result) -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 15/20] tools lib traceevent: Add missing break in make_bprint_args 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (13 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 14/20] tools lib traceevent: Check return value of arg_to_str() Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 16/20] tools lib traceevent: Cleanup realloc use Arnaldo Carvalho de Melo ` (5 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Peter Huewe, Steven Rostedt, Namhyung Kim From: Peter Huewe <peterhuewe@gmx.de> In the current code we assign vsize=8 and then fall through to the default and assign vsize=1. -> probably the break is missing here, otherwise we can remove the case. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-3fxjy46h2tr9pl0spv7tems6@git.kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 8630160..f880db4 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -3594,6 +3594,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc break; case 2: vsize = 8; + break; default: vsize = ls; /* ? */ break; -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 16/20] tools lib traceevent: Cleanup realloc use 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (14 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 15/20] tools lib traceevent: Add missing break in make_bprint_args Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 17/20] perf test: Use ARRAY_SIZE in parse events tests Arnaldo Carvalho de Melo ` (4 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Frederic Weisbecker, Ulrich Drepper, Steven Rostedt, Namhyung Kim From: Namhyung Kim <namhyung.kim@lge.com> The if branch is completely unnecessary since 'realloc' can handle NULL pointers for the first parameter. This patch is just an adoption of Ulrich Drepper's recent patch on perf tools. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ulrich Drepper <drepper@gmail.com> Link: http://lkml.kernel.org/r/1335230984-7613-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/lib/traceevent/event-parse.c | 8 ++------ tools/lib/traceevent/parse-filter.c | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index f880db4..5f34aa3 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -633,12 +633,8 @@ static void add_event(struct pevent *pevent, struct event_format *event) { int i; - if (!pevent->events) - pevent->events = malloc_or_die(sizeof(event)); - else - pevent->events = - realloc(pevent->events, sizeof(event) * - (pevent->nr_events + 1)); + pevent->events = realloc(pevent->events, sizeof(event) * + (pevent->nr_events + 1)); if (!pevent->events) die("Can not allocate events"); diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index f020ac6..ad17855 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -148,17 +148,11 @@ add_filter_type(struct event_filter *filter, int id) if (filter_type) return filter_type; - if (!filter->filters) - filter->event_filters = - malloc_or_die(sizeof(*filter->event_filters)); - else { - filter->event_filters = - realloc(filter->event_filters, - sizeof(*filter->event_filters) * - (filter->filters + 1)); - if (!filter->event_filters) - die("Could not allocate filter"); - } + filter->event_filters = realloc(filter->event_filters, + sizeof(*filter->event_filters) * + (filter->filters + 1)); + if (!filter->event_filters) + die("Could not allocate filter"); for (i = 0; i < filter->filters; i++) { if (filter->event_filters[i].event_id > id) @@ -1480,7 +1474,7 @@ void pevent_filter_clear_trivial(struct event_filter *filter, { struct filter_type *filter_type; int count = 0; - int *ids; + int *ids = NULL; int i; if (!filter->filters) @@ -1504,10 +1498,8 @@ void pevent_filter_clear_trivial(struct event_filter *filter, default: break; } - if (count) - ids = realloc(ids, sizeof(*ids) * (count + 1)); - else - ids = malloc(sizeof(*ids)); + + ids = realloc(ids, sizeof(*ids) * (count + 1)); if (!ids) die("Can't allocate ids"); ids[count++] = filter_type->event_id; -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 17/20] perf test: Use ARRAY_SIZE in parse events tests 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (15 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 16/20] tools lib traceevent: Cleanup realloc use Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 18/20] perf tools: Add empty rule for new line in event syntax parsing Arnaldo Carvalho de Melo ` (3 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Corey Ashford, Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@redhat.com> Use ARRAY_SIZE instead of defining the sizes separately for each test arrays. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1341352848-11833-10-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events-test.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c index dd0c306..1b997d2 100644 --- a/tools/perf/util/parse-events-test.c +++ b/tools/perf/util/parse-events-test.c @@ -634,8 +634,6 @@ static struct test__event_st test__events[] = { }, }; -#define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) - static struct test__event_st test__events_pmu[] = { [0] = { .name = "cpu/config=10,config1,config2=3,period=1000/u", @@ -647,9 +645,6 @@ static struct test__event_st test__events_pmu[] = { }, }; -#define TEST__EVENTS_PMU_CNT (sizeof(test__events_pmu) / \ - sizeof(struct test__event_st)) - struct test__term { const char *str; __u32 type; @@ -765,21 +760,17 @@ int parse_events__test(void) { int ret; - do { - ret = test_events(test__events, TEST__EVENTS_CNT); - if (ret) - break; - - if (test_pmu()) { - ret = test_events(test__events_pmu, - TEST__EVENTS_PMU_CNT); - if (ret) - break; - } +#define TEST_EVENTS(tests) \ +do { \ + ret = test_events(tests, ARRAY_SIZE(tests)); \ + if (ret) \ + return ret; \ +} while (0) - ret = test_terms(test__terms, TEST__TERMS_CNT); + TEST_EVENTS(test__events); - } while (0); + if (test_pmu()) + TEST_EVENTS(test__events_pmu); - return ret; + return test_terms(test__terms, ARRAY_SIZE(test__terms)); } -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 18/20] perf tools: Add empty rule for new line in event syntax parsing 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (16 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 17/20] perf test: Use ARRAY_SIZE in parse events tests Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 19/20] perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens Arnaldo Carvalho de Melo ` (2 subsequent siblings) 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Corey Ashford, Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@redhat.com> The flex generator prints out each input character that is ignored by lex rules. Since the alias processing, we can have '\n' characters on input. We need to assign empty rule to it, so it's not printed out. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1341352848-11833-2-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.l | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index a066894..6cbe092 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -152,6 +152,7 @@ r{num_raw_hex} { return raw(yyscanner); } , { return ','; } : { return ':'; } = { return '='; } +\n { } <mem>{ {modifier_bp} { return str(yyscanner, PE_MODIFIER_BP); } -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 19/20] perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (17 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 18/20] perf tools: Add empty rule for new line in event syntax parsing Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 20/20] perf tools: Split event symbols arrays to hw and sw parts Arnaldo Carvalho de Melo 2012-07-06 8:22 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Corey Ashford, Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@redhat.com> Spliting PE_VALUE_SYM token to PE_VALUE_SYM_HW and PE_VALUE_SYM_SW tokens to separate hardware and software symbols. This will be useful in upcomming patch where we want to be able to parse out only hardware events. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1341352848-11833-6-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.l | 2 +- tools/perf/util/parse-events.y | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 6cbe092..384ca74 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -56,7 +56,7 @@ static int sym(yyscan_t scanner, int type, int config) YYSTYPE *yylval = parse_events_get_lval(scanner); yylval->num = (type << 16) + config; - return PE_VALUE_SYM; + return type == PERF_TYPE_HARDWARE ? PE_VALUE_SYM_HW : PE_VALUE_SYM_SW; } static int term(yyscan_t scanner, int type) diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 9525c45..2bc5fbf 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -26,14 +26,15 @@ do { \ %} %token PE_START_EVENTS PE_START_TERMS -%token PE_VALUE PE_VALUE_SYM PE_RAW PE_TERM +%token PE_VALUE PE_VALUE_SYM_HW PE_VALUE_SYM_SW PE_RAW PE_TERM %token PE_NAME %token PE_MODIFIER_EVENT PE_MODIFIER_BP %token PE_NAME_CACHE_TYPE PE_NAME_CACHE_OP_RESULT %token PE_PREFIX_MEM PE_PREFIX_RAW %token PE_ERROR %type <num> PE_VALUE -%type <num> PE_VALUE_SYM +%type <num> PE_VALUE_SYM_HW +%type <num> PE_VALUE_SYM_SW %type <num> PE_RAW %type <num> PE_TERM %type <str> PE_NAME @@ -41,6 +42,7 @@ do { \ %type <str> PE_NAME_CACHE_OP_RESULT %type <str> PE_MODIFIER_EVENT %type <str> PE_MODIFIER_BP +%type <num> value_sym %type <head> event_config %type <term> event_term %type <head> event_pmu @@ -109,8 +111,13 @@ PE_NAME '/' event_config '/' $$ = list; } +value_sym: +PE_VALUE_SYM_HW +| +PE_VALUE_SYM_SW + event_legacy_symbol: -PE_VALUE_SYM '/' event_config '/' +value_sym '/' event_config '/' { struct parse_events_data__events *data = _data; struct list_head *list = NULL; @@ -123,7 +130,7 @@ PE_VALUE_SYM '/' event_config '/' $$ = list; } | -PE_VALUE_SYM sep_slash_dc +value_sym sep_slash_dc { struct parse_events_data__events *data = _data; struct list_head *list = NULL; -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 20/20] perf tools: Split event symbols arrays to hw and sw parts 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (18 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 19/20] perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens Arnaldo Carvalho de Melo @ 2012-07-05 15:45 ` Arnaldo Carvalho de Melo 2012-07-06 8:22 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar 20 siblings, 0 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-07-05 15:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Corey Ashford, Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@redhat.com> It'll be convenient in upcoming patch to access hw event symbols strings via enum perf_hw_id indexes. In order not to duplicate the data, creating two separate arrays: event_symbols_hw for enum perf_hw_id events event_symbols_sw for enum perf_sw_ids events Changing the current event list code to follow the change. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1341352848-11833-7-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.c | 174 +++++++++++++++++++++++++++------------- 1 file changed, 117 insertions(+), 57 deletions(-) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 1dc44dc..1aa721d 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -19,8 +19,6 @@ #define MAX_NAME_LEN 100 struct event_symbol { - u8 type; - u64 config; const char *symbol; const char *alias; }; @@ -30,30 +28,86 @@ extern int parse_events_debug; #endif int parse_events_parse(void *data, void *scanner); -#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x -#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x - -static struct event_symbol event_symbols[] = { - { CHW(CPU_CYCLES), "cpu-cycles", "cycles" }, - { CHW(STALLED_CYCLES_FRONTEND), "stalled-cycles-frontend", "idle-cycles-frontend" }, - { CHW(STALLED_CYCLES_BACKEND), "stalled-cycles-backend", "idle-cycles-backend" }, - { CHW(INSTRUCTIONS), "instructions", "" }, - { CHW(CACHE_REFERENCES), "cache-references", "" }, - { CHW(CACHE_MISSES), "cache-misses", "" }, - { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" }, - { CHW(BRANCH_MISSES), "branch-misses", "" }, - { CHW(BUS_CYCLES), "bus-cycles", "" }, - { CHW(REF_CPU_CYCLES), "ref-cycles", "" }, - - { CSW(CPU_CLOCK), "cpu-clock", "" }, - { CSW(TASK_CLOCK), "task-clock", "" }, - { CSW(PAGE_FAULTS), "page-faults", "faults" }, - { CSW(PAGE_FAULTS_MIN), "minor-faults", "" }, - { CSW(PAGE_FAULTS_MAJ), "major-faults", "" }, - { CSW(CONTEXT_SWITCHES), "context-switches", "cs" }, - { CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" }, - { CSW(ALIGNMENT_FAULTS), "alignment-faults", "" }, - { CSW(EMULATION_FAULTS), "emulation-faults", "" }, +static struct event_symbol event_symbols_hw[PERF_COUNT_HW_MAX] = { + [PERF_COUNT_HW_CPU_CYCLES] = { + .symbol = "cpu-cycles", + .alias = "cycles", + }, + [PERF_COUNT_HW_INSTRUCTIONS] = { + .symbol = "instructions", + .alias = "", + }, + [PERF_COUNT_HW_CACHE_REFERENCES] = { + .symbol = "cache-references", + .alias = "", + }, + [PERF_COUNT_HW_CACHE_MISSES] = { + .symbol = "cache-misses", + .alias = "", + }, + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { + .symbol = "branch-instructions", + .alias = "branches", + }, + [PERF_COUNT_HW_BRANCH_MISSES] = { + .symbol = "branch-misses", + .alias = "", + }, + [PERF_COUNT_HW_BUS_CYCLES] = { + .symbol = "bus-cycles", + .alias = "", + }, + [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = { + .symbol = "stalled-cycles-frontend", + .alias = "idle-cycles-frontend", + }, + [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = { + .symbol = "stalled-cycles-backend", + .alias = "idle-cycles-backend", + }, + [PERF_COUNT_HW_REF_CPU_CYCLES] = { + .symbol = "ref-cycles", + .alias = "", + }, +}; + +static struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = { + [PERF_COUNT_SW_CPU_CLOCK] = { + .symbol = "cpu-clock", + .alias = "", + }, + [PERF_COUNT_SW_TASK_CLOCK] = { + .symbol = "task-clock", + .alias = "", + }, + [PERF_COUNT_SW_PAGE_FAULTS] = { + .symbol = "page-faults", + .alias = "faults", + }, + [PERF_COUNT_SW_CONTEXT_SWITCHES] = { + .symbol = "context-switches", + .alias = "cs", + }, + [PERF_COUNT_SW_CPU_MIGRATIONS] = { + .symbol = "cpu-migrations", + .alias = "migrations", + }, + [PERF_COUNT_SW_PAGE_FAULTS_MIN] = { + .symbol = "minor-faults", + .alias = "", + }, + [PERF_COUNT_SW_PAGE_FAULTS_MAJ] = { + .symbol = "major-faults", + .alias = "", + }, + [PERF_COUNT_SW_ALIGNMENT_FAULTS] = { + .symbol = "alignment-faults", + .alias = "", + }, + [PERF_COUNT_SW_EMULATION_FAULTS] = { + .symbol = "emulation-faults", + .alias = "", + }, }; #define __PERF_EVENT_FIELD(config, name) \ @@ -824,16 +878,13 @@ int is_valid_tracepoint(const char *event_string) return 0; } -void print_events_type(u8 type) +static void __print_events_type(u8 type, struct event_symbol *syms, + unsigned max) { - struct event_symbol *syms = event_symbols; - unsigned int i; char name[64]; + unsigned i; - for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { - if (type != syms->type) - continue; - + for (i = 0; i < max ; i++, syms++) { if (strlen(syms->alias)) snprintf(name, sizeof(name), "%s OR %s", syms->symbol, syms->alias); @@ -845,6 +896,14 @@ void print_events_type(u8 type) } } +void print_events_type(u8 type) +{ + if (type == PERF_TYPE_SOFTWARE) + __print_events_type(type, event_symbols_sw, PERF_COUNT_SW_MAX); + else + __print_events_type(type, event_symbols_hw, PERF_COUNT_HW_MAX); +} + int print_hwcache_events(const char *event_glob) { unsigned int type, op, i, printed = 0; @@ -872,26 +931,13 @@ int print_hwcache_events(const char *event_glob) return printed; } -/* - * Print the help text for the event symbols: - */ -void print_events(const char *event_glob) +static void print_symbol_events(const char *event_glob, unsigned type, + struct event_symbol *syms, unsigned max) { - unsigned int i, type, prev_type = -1, printed = 0, ntypes_printed = 0; - struct event_symbol *syms = event_symbols; + unsigned i, printed = 0; char name[MAX_NAME_LEN]; - printf("\n"); - printf("List of pre-defined events (to be used in -e):\n"); - - for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { - type = syms->type; - - if (type != prev_type && printed) { - printf("\n"); - printed = 0; - ntypes_printed++; - } + for (i = 0; i < max; i++, syms++) { if (event_glob != NULL && !(strglobmatch(syms->symbol, event_glob) || @@ -902,17 +948,31 @@ void print_events(const char *event_glob) snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias); else strncpy(name, syms->symbol, MAX_NAME_LEN); - printf(" %-50s [%s]\n", name, - event_type_descriptors[type]); - prev_type = type; - ++printed; + printf(" %-50s [%s]\n", name, event_type_descriptors[type]); + + printed++; } - if (ntypes_printed) { - printed = 0; + if (printed) printf("\n"); - } +} + +/* + * Print the help text for the event symbols: + */ +void print_events(const char *event_glob) +{ + + printf("\n"); + printf("List of pre-defined events (to be used in -e):\n"); + + print_symbol_events(event_glob, PERF_TYPE_HARDWARE, + event_symbols_hw, PERF_COUNT_HW_MAX); + + print_symbol_events(event_glob, PERF_TYPE_SOFTWARE, + event_symbols_sw, PERF_COUNT_SW_MAX); + print_hwcache_events(event_glob); if (event_glob != NULL) -- 1.7.9.2.358.g22243 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (19 preceding siblings ...) 2012-07-05 15:45 ` [PATCH 20/20] perf tools: Split event symbols arrays to hw and sw parts Arnaldo Carvalho de Melo @ 2012-07-06 8:22 ` Ingo Molnar 20 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2012-07-06 8:22 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Borislav Petkov, Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa, Johannes Berg, Namhyung Kim, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Huewe, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Ulrich Drepper, Wolfgang Mauerer, arnaldo.melo, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > Hi Ingo, > > Please consider pulling, this one contains my first > merge, a pull request by Namhyung, please check if everything > is OK, > > Thanks, > > - Arnaldo > > The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3: > > perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo > > for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83: > > Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300) > > ---------------------------------------------------------------- > > perf/core improvements and fixes: > > . Preparatory patches to use hw events in PMU syntax, from Jiri Olsa > > . Remaining backport of trace-cmd's libparseevent, from Namhyung Kim > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (1): > Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core > > Jiri Olsa (4): > perf test: Use ARRAY_SIZE in parse events tests > perf tools: Add empty rule for new line in event syntax parsing > perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens > perf tools: Split event symbols arrays to hw and sw parts > > Namhyung Kim (10): > tools lib traceevent: Fix printk_cmp() > tools lib traceevent: Introduce extend_token() > tools lib traceevent: Handle strdup failure cases > tools lib traceevent: Handle realloc() failure path > tools lib traceevent: Pass string type argument to args > tools lib traceevent: Do not call add_event() again if allocation failed > tools lib traceevent: Fix some comments > tools lib traceevent: Check result of malloc() during reading token > tools lib traceevent: Check return value of arg_to_str() > tools lib traceevent: Cleanup realloc use > > Peter Huewe (1): > tools lib traceevent: Add missing break in make_bprint_args > > Steven Rostedt (4): > tools lib traceevent: Let filtering numbers by string use function names > tools lib traceevent: Add support for "%.*s" in bprintk events > tools lib traceevent: Add support to show migrate disable counter > tools lib traceevent: Fix %pM print format arg handling > > Wolfgang Mauerer (1): > tools lib traceevent: Fix trace_printk for long integers > > tools/lib/traceevent/event-parse.c | 287 +++++++++++++++++++++++------------ > tools/lib/traceevent/parse-filter.c | 86 +++++++---- > tools/perf/util/parse-events-test.c | 29 ++-- > tools/perf/util/parse-events.c | 174 ++++++++++++++------- > tools/perf/util/parse-events.l | 3 +- > tools/perf/util/parse-events.y | 15 +- > 6 files changed, 391 insertions(+), 203 deletions(-) Pulled, thanks a lot Arnaldo! The commits from Namhyung Kim are looking good as well. Thanks, Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2012-09-11 23:52 Arnaldo Carvalho de Melo 2012-09-13 15:15 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-11 23:52 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern, Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg, Peter Zijlstra, Stephane Eranian, Steven Rostedt, arnaldo.melo, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best Regards, - Arnaldo The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99: perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300) ---------------------------------------------------------------- perf/core improvements and fixes . Remove die()/exit() calls from several tools. . Add missing perf_regs.h file to MANIFEST . Clean up and improve 'perf sched' performance by elliminating lots of needless calls to libtraceevent. . More patches to make perf build on Android, from Irina Tirdea . Resolve vdso callchains, from Jiri Olsa Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (9): perf test: Remove die() calls perf sched: Remove die() calls perf kmem: Remove die() calls perf tools: Add missing perf_regs.h file to MANIFEST perf sched: Remove unused thread parameter perf sched: Use perf_tool as ancestor perf evsel: Introduce perf_evsel__{str,int}val methods perf sched: Use perf_evsel__{int,str}val perf sched: Don't read all tracepoint variables in advance Irina Tirdea (5): perf tools: include wrapper for magic.h perf tools: Update types definitions for Android perf tools: include __WORDSIZE definition perf tools: fix ALIGN redefinition in system headers perf tools: Use __maybe_used for unused variables Jiri Olsa (4): perf tools: Do backtrace post unwind only if we regs and stack were captured perf tools: Add memdup function perf symbols: Make dsos__find function globally available perf tools: Back [vdso] DSO with real data tools/lib/traceevent/event-parse.c | 8 +- tools/lib/traceevent/event-parse.h | 4 +- tools/perf/MANIFEST | 1 + tools/perf/Makefile | 3 + tools/perf/bench/bench.h | 3 +- tools/perf/bench/mem-memcpy.c | 2 +- tools/perf/bench/mem-memset.c | 2 +- tools/perf/bench/sched-messaging.c | 2 +- tools/perf/bench/sched-pipe.c | 6 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-bench.c | 2 +- tools/perf/builtin-buildid-cache.c | 10 +- tools/perf/builtin-buildid-list.c | 3 +- tools/perf/builtin-diff.c | 4 +- tools/perf/builtin-evlist.c | 2 +- tools/perf/builtin-help.c | 2 +- tools/perf/builtin-inject.c | 24 +- tools/perf/builtin-kmem.c | 130 +- tools/perf/builtin-kvm.c | 2 +- tools/perf/builtin-list.c | 2 +- tools/perf/builtin-lock.c | 4 +- tools/perf/builtin-probe.c | 24 +- tools/perf/builtin-record.c | 10 +- tools/perf/builtin-report.c | 11 +- tools/perf/builtin-sched.c | 1446 +++++++++----------- tools/perf/builtin-script.c | 29 +- tools/perf/builtin-stat.c | 40 +- tools/perf/builtin-test.c | 23 +- tools/perf/builtin-timechart.c | 30 +- tools/perf/builtin-top.c | 7 +- tools/perf/ui/browser.c | 7 +- tools/perf/ui/browsers/annotate.c | 6 +- tools/perf/ui/gtk/browser.c | 5 +- tools/perf/ui/gtk/setup.c | 2 +- tools/perf/ui/gtk/util.c | 4 +- tools/perf/ui/helpline.c | 2 +- tools/perf/ui/helpline.h | 8 +- tools/perf/ui/hist.c | 21 +- tools/perf/ui/tui/setup.c | 4 +- tools/perf/util/alias.c | 3 +- tools/perf/util/annotate.c | 6 +- tools/perf/util/annotate.h | 13 +- tools/perf/util/build-id.c | 11 +- tools/perf/util/cache.h | 6 +- tools/perf/util/callchain.c | 6 +- tools/perf/util/cgroup.c | 4 +- tools/perf/util/config.c | 6 +- tools/perf/util/debug.h | 9 +- tools/perf/util/event.c | 29 +- tools/perf/util/event.h | 2 +- tools/perf/util/evsel.c | 35 + tools/perf/util/evsel.h | 7 + tools/perf/util/header.c | 177 ++- tools/perf/util/header.h | 2 +- tools/perf/util/help.c | 3 +- tools/perf/util/hist.c | 2 +- tools/perf/util/hist.h | 32 +- tools/perf/util/include/linux/bitops.h | 4 + tools/perf/util/include/linux/compiler.h | 8 +- tools/perf/util/include/linux/kernel.h | 13 +- tools/perf/util/include/linux/magic.h | 12 + tools/perf/util/include/linux/string.h | 2 + tools/perf/util/include/linux/types.h | 8 + tools/perf/util/intlist.c | 4 +- tools/perf/util/map.c | 12 +- tools/perf/util/map.h | 2 +- tools/perf/util/parse-events-test.c | 6 +- tools/perf/util/parse-events.c | 7 +- tools/perf/util/parse-events.l | 2 +- tools/perf/util/parse-events.y | 4 +- tools/perf/util/parse-options.c | 3 +- tools/perf/util/perf_regs.h | 2 +- tools/perf/util/pmu.y | 6 +- tools/perf/util/probe-event.c | 21 +- tools/perf/util/probe-finder.c | 4 +- tools/perf/util/python.c | 8 +- .../perf/util/scripting-engines/trace-event-perl.c | 8 +- .../util/scripting-engines/trace-event-python.c | 10 +- tools/perf/util/session.c | 61 +- tools/perf/util/sort.c | 14 +- tools/perf/util/string.c | 18 +- tools/perf/util/symbol-minimal.c | 28 +- tools/perf/util/symbol.c | 6 +- tools/perf/util/symbol.h | 8 +- tools/perf/util/trace-event-parse.c | 4 +- tools/perf/util/trace-event-scripting.c | 33 +- tools/perf/util/unwind.c | 36 +- tools/perf/util/unwind.h | 11 +- tools/perf/util/util.h | 2 +- tools/perf/util/vdso.c | 111 ++ tools/perf/util/vdso.h | 18 + tools/perf/util/wrapper.c | 3 +- 92 files changed, 1518 insertions(+), 1231 deletions(-) create mode 100644 tools/perf/util/include/linux/magic.h create mode 100644 tools/perf/util/vdso.c create mode 100644 tools/perf/util/vdso.h ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2012-09-11 23:52 Arnaldo Carvalho de Melo @ 2012-09-13 15:15 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2012-09-13 15:15 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, David Ahern, Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg, Peter Zijlstra, Stephane Eranian, Steven Rostedt, arnaldo.melo, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > Hi Ingo, > > Please consider pulling, > > Best Regards, > > - Arnaldo > > The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo > > for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99: > > perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes > > . Remove die()/exit() calls from several tools. > > . Add missing perf_regs.h file to MANIFEST > > . Clean up and improve 'perf sched' performance by elliminating lots of > needless calls to libtraceevent. > > . More patches to make perf build on Android, from Irina Tirdea > > . Resolve vdso callchains, from Jiri Olsa > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (9): > perf test: Remove die() calls > perf sched: Remove die() calls > perf kmem: Remove die() calls > perf tools: Add missing perf_regs.h file to MANIFEST > perf sched: Remove unused thread parameter > perf sched: Use perf_tool as ancestor > perf evsel: Introduce perf_evsel__{str,int}val methods > perf sched: Use perf_evsel__{int,str}val > perf sched: Don't read all tracepoint variables in advance > > Irina Tirdea (5): > perf tools: include wrapper for magic.h > perf tools: Update types definitions for Android > perf tools: include __WORDSIZE definition > perf tools: fix ALIGN redefinition in system headers > perf tools: Use __maybe_used for unused variables > > Jiri Olsa (4): > perf tools: Do backtrace post unwind only if we regs and stack were captured > perf tools: Add memdup function > perf symbols: Make dsos__find function globally available > perf tools: Back [vdso] DSO with real data > > tools/lib/traceevent/event-parse.c | 8 +- > tools/lib/traceevent/event-parse.h | 4 +- > tools/perf/MANIFEST | 1 + > tools/perf/Makefile | 3 + > tools/perf/bench/bench.h | 3 +- > tools/perf/bench/mem-memcpy.c | 2 +- > tools/perf/bench/mem-memset.c | 2 +- > tools/perf/bench/sched-messaging.c | 2 +- > tools/perf/bench/sched-pipe.c | 6 +- > tools/perf/builtin-annotate.c | 2 +- > tools/perf/builtin-bench.c | 2 +- > tools/perf/builtin-buildid-cache.c | 10 +- > tools/perf/builtin-buildid-list.c | 3 +- > tools/perf/builtin-diff.c | 4 +- > tools/perf/builtin-evlist.c | 2 +- > tools/perf/builtin-help.c | 2 +- > tools/perf/builtin-inject.c | 24 +- > tools/perf/builtin-kmem.c | 130 +- > tools/perf/builtin-kvm.c | 2 +- > tools/perf/builtin-list.c | 2 +- > tools/perf/builtin-lock.c | 4 +- > tools/perf/builtin-probe.c | 24 +- > tools/perf/builtin-record.c | 10 +- > tools/perf/builtin-report.c | 11 +- > tools/perf/builtin-sched.c | 1446 +++++++++----------- > tools/perf/builtin-script.c | 29 +- > tools/perf/builtin-stat.c | 40 +- > tools/perf/builtin-test.c | 23 +- > tools/perf/builtin-timechart.c | 30 +- > tools/perf/builtin-top.c | 7 +- > tools/perf/ui/browser.c | 7 +- > tools/perf/ui/browsers/annotate.c | 6 +- > tools/perf/ui/gtk/browser.c | 5 +- > tools/perf/ui/gtk/setup.c | 2 +- > tools/perf/ui/gtk/util.c | 4 +- > tools/perf/ui/helpline.c | 2 +- > tools/perf/ui/helpline.h | 8 +- > tools/perf/ui/hist.c | 21 +- > tools/perf/ui/tui/setup.c | 4 +- > tools/perf/util/alias.c | 3 +- > tools/perf/util/annotate.c | 6 +- > tools/perf/util/annotate.h | 13 +- > tools/perf/util/build-id.c | 11 +- > tools/perf/util/cache.h | 6 +- > tools/perf/util/callchain.c | 6 +- > tools/perf/util/cgroup.c | 4 +- > tools/perf/util/config.c | 6 +- > tools/perf/util/debug.h | 9 +- > tools/perf/util/event.c | 29 +- > tools/perf/util/event.h | 2 +- > tools/perf/util/evsel.c | 35 + > tools/perf/util/evsel.h | 7 + > tools/perf/util/header.c | 177 ++- > tools/perf/util/header.h | 2 +- > tools/perf/util/help.c | 3 +- > tools/perf/util/hist.c | 2 +- > tools/perf/util/hist.h | 32 +- > tools/perf/util/include/linux/bitops.h | 4 + > tools/perf/util/include/linux/compiler.h | 8 +- > tools/perf/util/include/linux/kernel.h | 13 +- > tools/perf/util/include/linux/magic.h | 12 + > tools/perf/util/include/linux/string.h | 2 + > tools/perf/util/include/linux/types.h | 8 + > tools/perf/util/intlist.c | 4 +- > tools/perf/util/map.c | 12 +- > tools/perf/util/map.h | 2 +- > tools/perf/util/parse-events-test.c | 6 +- > tools/perf/util/parse-events.c | 7 +- > tools/perf/util/parse-events.l | 2 +- > tools/perf/util/parse-events.y | 4 +- > tools/perf/util/parse-options.c | 3 +- > tools/perf/util/perf_regs.h | 2 +- > tools/perf/util/pmu.y | 6 +- > tools/perf/util/probe-event.c | 21 +- > tools/perf/util/probe-finder.c | 4 +- > tools/perf/util/python.c | 8 +- > .../perf/util/scripting-engines/trace-event-perl.c | 8 +- > .../util/scripting-engines/trace-event-python.c | 10 +- > tools/perf/util/session.c | 61 +- > tools/perf/util/sort.c | 14 +- > tools/perf/util/string.c | 18 +- > tools/perf/util/symbol-minimal.c | 28 +- > tools/perf/util/symbol.c | 6 +- > tools/perf/util/symbol.h | 8 +- > tools/perf/util/trace-event-parse.c | 4 +- > tools/perf/util/trace-event-scripting.c | 33 +- > tools/perf/util/unwind.c | 36 +- > tools/perf/util/unwind.h | 11 +- > tools/perf/util/util.h | 2 +- > tools/perf/util/vdso.c | 111 ++ > tools/perf/util/vdso.h | 18 + > tools/perf/util/wrapper.c | 3 +- > 92 files changed, 1518 insertions(+), 1231 deletions(-) > create mode 100644 tools/perf/util/include/linux/magic.h > create mode 100644 tools/perf/util/vdso.c > create mode 100644 tools/perf/util/vdso.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2013-12-13 15:11 Arnaldo Carvalho de Melo 2013-12-16 13:54 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2013-12-13 15:11 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian, Steven Rostedt, Arnaldo Carvalho de Melo From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Hi Ingo, Please consider pulling, Regards, - Arnaldo The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63: perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c: tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Fixes: . Fix inverted error verification bug in thread__fork, from David Ahern. New features: . Shell completion for 'perf kvm', from Ramkumar Ramachandra. Refactorings: . Get rid of panic() like calls in libtraceevent, from Namyung Kim. . Start carving out symbol parsing routines from perf, just moving routines to topic files in tools/lib/symbol/, tools that want to use it need to integrate it directly, i.e. no tools/lib/symbol/Makefile is provided. . Assorted refactoring patches, moving code around and adding utility evlist methods that will be used in the IPT patchset, from Adrian Hunter. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (5): perf tools: Add perf_event_paranoid() perf header: Allow header->data_offset to be predetermined perf evlist: Add can_select_event() method perf tools: Move mem_bswap32/64 to util.c perf evlist: Add perf_evlist__to_front() Arnaldo Carvalho de Melo (1): tools lib symbol: Start carving out symbol parsing routines from perf David Ahern (1): perf tools: Fix inverted error verification bug in thread__fork Namhyung Kim (12): tools lib traceevent: Get rid of malloc_or_die() in show_error() tools lib traceevent: Get rid of die in add_filter_type() tools lib traceevent: Get rid of malloc_or_die() allocate_arg() tools lib traceevent: Get rid of malloc_or_die() in read_token() tools lib traceevent: Get rid of malloc_or_die() in find_event() tools lib traceevent: Get rid of die() in add_right() tools lib traceevent: Make add_left() return pevent_errno tools lib traceevent: Get rid of die() in reparent_op_arg() tools lib traceevent: Refactor create_arg_item() tools lib traceevent: Refactor process_filter() tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno tools lib traceevent: Refactor pevent_filter_match() to get rid of die() Ramkumar Ramachandra (1): perf completion: Complete 'perf kvm' tools/lib/symbol/kallsyms.c | 58 +++++ tools/lib/symbol/kallsyms.h | 24 ++ tools/lib/traceevent/event-parse.h | 43 ++- tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++-------------- tools/perf/MANIFEST | 2 + tools/perf/Makefile.perf | 5 + tools/perf/perf-completion.sh | 4 + tools/perf/util/event.c | 1 + tools/perf/util/evlist.c | 20 +- tools/perf/util/evlist.h | 5 + tools/perf/util/header.c | 3 +- tools/perf/util/machine.c | 1 + tools/perf/util/record.c | 37 +++ tools/perf/util/session.c | 21 -- tools/perf/util/session.h | 2 - tools/perf/util/symbol-elf.c | 1 + tools/perf/util/symbol.c | 69 +---- tools/perf/util/symbol.h | 3 - tools/perf/util/thread.c | 2 +- tools/perf/util/util.c | 41 +++ tools/perf/util/util.h | 4 + 21 files changed, 550 insertions(+), 303 deletions(-) create mode 100644 tools/lib/symbol/kallsyms.c create mode 100644 tools/lib/symbol/kallsyms.h ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2013-12-13 15:11 Arnaldo Carvalho de Melo @ 2013-12-16 13:54 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2013-12-16 13:54 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian, Steven Rostedt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> > > Hi Ingo, > > Please consider pulling, > > Regards, > > - Arnaldo > > The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63: > > perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo > > for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c: > > tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > Fixes: > > . Fix inverted error verification bug in thread__fork, from David Ahern. > > New features: > > . Shell completion for 'perf kvm', from Ramkumar Ramachandra. > > Refactorings: > > . Get rid of panic() like calls in libtraceevent, from Namyung Kim. > > . Start carving out symbol parsing routines from perf, just moving routines to > topic files in tools/lib/symbol/, tools that want to use it need to integrate > it directly, i.e. no tools/lib/symbol/Makefile is provided. > > . Assorted refactoring patches, moving code around and adding > utility evlist methods that will be used in the IPT patchset, > from Adrian Hunter. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (5): > perf tools: Add perf_event_paranoid() > perf header: Allow header->data_offset to be predetermined > perf evlist: Add can_select_event() method > perf tools: Move mem_bswap32/64 to util.c > perf evlist: Add perf_evlist__to_front() > > Arnaldo Carvalho de Melo (1): > tools lib symbol: Start carving out symbol parsing routines from perf > > David Ahern (1): > perf tools: Fix inverted error verification bug in thread__fork > > Namhyung Kim (12): > tools lib traceevent: Get rid of malloc_or_die() in show_error() > tools lib traceevent: Get rid of die in add_filter_type() > tools lib traceevent: Get rid of malloc_or_die() allocate_arg() > tools lib traceevent: Get rid of malloc_or_die() in read_token() > tools lib traceevent: Get rid of malloc_or_die() in find_event() > tools lib traceevent: Get rid of die() in add_right() > tools lib traceevent: Make add_left() return pevent_errno > tools lib traceevent: Get rid of die() in reparent_op_arg() > tools lib traceevent: Refactor create_arg_item() > tools lib traceevent: Refactor process_filter() > tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno > tools lib traceevent: Refactor pevent_filter_match() to get rid of die() > > Ramkumar Ramachandra (1): > perf completion: Complete 'perf kvm' > > tools/lib/symbol/kallsyms.c | 58 +++++ > tools/lib/symbol/kallsyms.h | 24 ++ > tools/lib/traceevent/event-parse.h | 43 ++- > tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++-------------- > tools/perf/MANIFEST | 2 + > tools/perf/Makefile.perf | 5 + > tools/perf/perf-completion.sh | 4 + > tools/perf/util/event.c | 1 + > tools/perf/util/evlist.c | 20 +- > tools/perf/util/evlist.h | 5 + > tools/perf/util/header.c | 3 +- > tools/perf/util/machine.c | 1 + > tools/perf/util/record.c | 37 +++ > tools/perf/util/session.c | 21 -- > tools/perf/util/session.h | 2 - > tools/perf/util/symbol-elf.c | 1 + > tools/perf/util/symbol.c | 69 +---- > tools/perf/util/symbol.h | 3 - > tools/perf/util/thread.c | 2 +- > tools/perf/util/util.c | 41 +++ > tools/perf/util/util.h | 4 + > 21 files changed, 550 insertions(+), 303 deletions(-) > create mode 100644 tools/lib/symbol/kallsyms.c > create mode 100644 tools/lib/symbol/kallsyms.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2014-09-17 21:24 Arnaldo Carvalho de Melo 2014-09-19 5:15 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Yarygin, Anton Blanchard, Avi Kivity, Chanho Park, Christian Borntraeger, Corey Ashford, David Ahern, david lerner, Don Zickus, Frederic Weisbecker, Jean Pihet, Jiri Olsa, John Spencer, Kyle McMartin, linux-perf-users, Masami Hiramatsu, Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit c88f2096136416b261bd3647cc260935f6e95805: perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +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 e5685730e2c620f97bc12380e9370e857e5bd7a7: perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: o Add +field argument support for --sort option (Jiri Olsa) o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu) o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard) o Add path to Ubuntu kernel debuginfo file (Anton Blanchard) o Disable kernel symbol demangling by default (Avi Kivity) Infrastructure: o More intel PT prep work, from Adrian Hunter, including: - Let a user specify a PMU event without any config terms - Add perf-with-kcore script - Let default config be defined for a PMU - Add perf_pmu__scan_file() o "perf kvm stat report" improvements by Alexander Yarygin: o Save pid string in opts.target.pid o Enable the target.system_wide flag o Unify the title bar output o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard) o Allow to specify lib compile variable for spec usage (Jiri Olsa) o Fix build on ARM (Stephane Eranian) o Fix build on powerpc when DWARF support is disabled (Anton Blanchard) o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo) o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo) Chanho Park (1): perf tools: define _DEFAULT_SOURCE for glibc_2.20 o Allow to specify lib compile variable for spec usage (Jiri Olsa) o Fix GNU-only grep usage in Makefile (John Spencer) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (4): perf tools: Let a user specify a PMU event without any config terms perf tools: Add perf-with-kcore script perf tools: Let default config be defined for a PMU perf tools: Add perf_pmu__scan_file() Alexander Yarygin (3): perf kvm stat report: Save pid string in opts.target.pid perf kvm stat report: Enable the target.system_wide flag perf kvm stat report: Unify the title bar output Anton Blanchard (3): perf tools powerpc: Fix build issue when DWARF support is disabled perf symbols: Ignore stripped vmlinux and fallback to kallsyms perf symbols: Add path to Ubuntu kernel debuginfo file Arnaldo Carvalho de Melo (2): perf tools: Don't include sys/poll.h directly perf record: Use ring buffer consume method to look like other tools Avi Kivity (1): perf tools: Disable kernel symbol demangling by default Chanho Park (1): perf tools: define _DEFAULT_SOURCE for glibc_2.20 Jiri Olsa (2): perf tools: Add +field argument support for --sort option perf tools: Allow to specify lib compile variable for spec usage John Spencer (1): perf tools: Fix GNU-only grep usage in Makefile Masami Hiramatsu (2): perf probe: Do not access kallsyms when analyzing user binaries perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name Stephane Eranian (1): perf tool: fix compilation for ARM tools/perf/.gitignore | 1 + tools/perf/Documentation/perf-probe.txt | 3 + tools/perf/Documentation/perf-report.txt | 3 + tools/perf/Documentation/perf-top.txt | 3 + tools/perf/Makefile.perf | 5 +- tools/perf/arch/arm/tests/dwarf-unwind.c | 1 + tools/perf/arch/arm/util/unwind-libunwind.c | 1 + tools/perf/arch/powerpc/Makefile | 2 +- tools/perf/bench/sched-messaging.c | 2 +- tools/perf/builtin-kvm.c | 23 +-- tools/perf/builtin-probe.c | 5 +- tools/perf/builtin-record.c | 8 +- tools/perf/builtin-report.c | 2 + tools/perf/builtin-top.c | 4 +- tools/perf/config/Makefile | 12 +- tools/perf/config/utilities.mak | 2 +- tools/perf/perf-with-kcore.sh | 259 ++++++++++++++++++++++++++++ tools/perf/tests/pmu.c | 2 +- tools/perf/util/kvm-stat.h | 1 - tools/perf/util/parse-events.c | 13 +- tools/perf/util/parse-events.y | 10 ++ tools/perf/util/pmu.c | 79 +++++++-- tools/perf/util/pmu.h | 12 +- tools/perf/util/probe-event.c | 9 +- tools/perf/util/probe-event.h | 3 +- tools/perf/util/probe-finder.c | 16 +- tools/perf/util/sort.c | 37 +++- tools/perf/util/symbol-elf.c | 15 +- tools/perf/util/symbol.c | 9 +- tools/perf/util/symbol.h | 1 + tools/perf/util/util.h | 4 +- 31 files changed, 487 insertions(+), 60 deletions(-) create mode 100644 tools/perf/perf-with-kcore.sh ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2014-09-17 21:24 Arnaldo Carvalho de Melo @ 2014-09-19 5:15 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2014-09-19 5:15 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Yarygin, Anton Blanchard, Avi Kivity, Chanho Park, Christian Borntraeger, Corey Ashford, David Ahern, david lerner, Don Zickus, Frederic Weisbecker, Jean Pihet, Jiri Olsa, John Spencer, Kyle McMartin, linux-perf-users, Masami Hiramatsu, Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit c88f2096136416b261bd3647cc260935f6e95805: > > perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +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 e5685730e2c620f97bc12380e9370e857e5bd7a7: > > perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > o Add +field argument support for --sort option (Jiri Olsa) > > o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu) > > o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard) > > o Add path to Ubuntu kernel debuginfo file (Anton Blanchard) > > o Disable kernel symbol demangling by default (Avi Kivity) > > Infrastructure: > > o More intel PT prep work, from Adrian Hunter, including: > > - Let a user specify a PMU event without any config terms > - Add perf-with-kcore script > - Let default config be defined for a PMU > - Add perf_pmu__scan_file() > > o "perf kvm stat report" improvements by Alexander Yarygin: > o Save pid string in opts.target.pid > o Enable the target.system_wide flag > o Unify the title bar output > > o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard) > > o Allow to specify lib compile variable for spec usage (Jiri Olsa) > > o Fix build on ARM (Stephane Eranian) > > o Fix build on powerpc when DWARF support is disabled (Anton Blanchard) > > o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo) > > o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo) > > Chanho Park (1): > perf tools: define _DEFAULT_SOURCE for glibc_2.20 > > o Allow to specify lib compile variable for spec usage (Jiri Olsa) > > o Fix GNU-only grep usage in Makefile (John Spencer) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (4): > perf tools: Let a user specify a PMU event without any config terms > perf tools: Add perf-with-kcore script > perf tools: Let default config be defined for a PMU > perf tools: Add perf_pmu__scan_file() > > Alexander Yarygin (3): > perf kvm stat report: Save pid string in opts.target.pid > perf kvm stat report: Enable the target.system_wide flag > perf kvm stat report: Unify the title bar output > > Anton Blanchard (3): > perf tools powerpc: Fix build issue when DWARF support is disabled > perf symbols: Ignore stripped vmlinux and fallback to kallsyms > perf symbols: Add path to Ubuntu kernel debuginfo file > > Arnaldo Carvalho de Melo (2): > perf tools: Don't include sys/poll.h directly > perf record: Use ring buffer consume method to look like other tools > > Avi Kivity (1): > perf tools: Disable kernel symbol demangling by default > > Chanho Park (1): > perf tools: define _DEFAULT_SOURCE for glibc_2.20 > > Jiri Olsa (2): > perf tools: Add +field argument support for --sort option > perf tools: Allow to specify lib compile variable for spec usage > > John Spencer (1): > perf tools: Fix GNU-only grep usage in Makefile > > Masami Hiramatsu (2): > perf probe: Do not access kallsyms when analyzing user binaries > perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name > > Stephane Eranian (1): > perf tool: fix compilation for ARM > > tools/perf/.gitignore | 1 + > tools/perf/Documentation/perf-probe.txt | 3 + > tools/perf/Documentation/perf-report.txt | 3 + > tools/perf/Documentation/perf-top.txt | 3 + > tools/perf/Makefile.perf | 5 +- > tools/perf/arch/arm/tests/dwarf-unwind.c | 1 + > tools/perf/arch/arm/util/unwind-libunwind.c | 1 + > tools/perf/arch/powerpc/Makefile | 2 +- > tools/perf/bench/sched-messaging.c | 2 +- > tools/perf/builtin-kvm.c | 23 +-- > tools/perf/builtin-probe.c | 5 +- > tools/perf/builtin-record.c | 8 +- > tools/perf/builtin-report.c | 2 + > tools/perf/builtin-top.c | 4 +- > tools/perf/config/Makefile | 12 +- > tools/perf/config/utilities.mak | 2 +- > tools/perf/perf-with-kcore.sh | 259 ++++++++++++++++++++++++++++ > tools/perf/tests/pmu.c | 2 +- > tools/perf/util/kvm-stat.h | 1 - > tools/perf/util/parse-events.c | 13 +- > tools/perf/util/parse-events.y | 10 ++ > tools/perf/util/pmu.c | 79 +++++++-- > tools/perf/util/pmu.h | 12 +- > tools/perf/util/probe-event.c | 9 +- > tools/perf/util/probe-event.h | 3 +- > tools/perf/util/probe-finder.c | 16 +- > tools/perf/util/sort.c | 37 +++- > tools/perf/util/symbol-elf.c | 15 +- > tools/perf/util/symbol.c | 9 +- > tools/perf/util/symbol.h | 1 + > tools/perf/util/util.h | 4 +- > 31 files changed, 487 insertions(+), 60 deletions(-) > create mode 100644 tools/perf/perf-with-kcore.sh Pulled into tip:perf/core, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2015-03-03 3:25 Arnaldo Carvalho de Melo 2015-03-03 6:20 ` Ingo Molnar 2015-03-10 10:03 ` Ingo Molnar 0 siblings, 2 replies; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-03-03 3:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra, Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner, Arnaldo Carvalho de Melo Hi Ingo, This one has the thread reference counting, that I tested using 'perf probe': perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid' perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid' perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid' perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top with that I checked and in the end the refcount reaches zero and thread__delete is called, as expected, using 'perf script', looking at the callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to work. David, Namhyung, please holler if you find something fishy with this thread refcnt stuff, as it is something that is related to previous/current work by you guys, Ah, I also merged perf/urgent so that it is buildable in more systems.o There is also the revert for that is_power_of_2 "simplification" in perf_mmap, that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry about that one, should have caught that :-\ Please consider pulling, - Arnaldo The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301: Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -0300) 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 ae536acfacb65a4a9858c32b12361e09f84f4157: perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu) - 'perf record' Documentation fixes (Namhyung Kim) - Report unsupported events properly in 'perf stat' (Suzuki K. Poulose) Infrastructure: - Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo) - Reference count struct thread (Arnaldo Carvalho de Melo) - No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo) - Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter) - Only include tsc file for x86 (David Ahern) - Compare JOBS to 0 after grep (David Ahern) - Improve feature detection messages (Ingo Molnar) - Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang) - Remove bias offset to find probe point by address (Masami Hiramatsu) - Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (1): perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test Arnaldo Carvalho de Melo (3): perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads perf tools: Reference count struct thread perf sched: No need to keep the session around David Ahern (2): perf tools: Only include tsc file for x86 perf tools: Compare JOBS to 0 after grep Ingo Molnar (7): perf tools: Add PERF-FEATURES to the .gitignore file perf tools: Remove annoying extra message from the features build perf tools: Improve Python feature detection messages perf tools: Improve libperl detection message perf tools: Improve libbfd detection message perf tools: Improve feature test debuggability perf tools: Improve 'libbabel' feature check failure message Kan Liang (1): Revert "perf: Remove the extra validity check on nr_pages" Masami Hiramatsu (2): perf probe: Warn if given uprobe event accesses memory on older kernel perf probe: Remove bias offset to find probe point by address Namhyung Kim (3): perf tools: Fix build error on ARCH=i386/x86_64/sparc64 perf record: Get rid of -l option from Documentation perf record: Document --group option Suzuki K. Poulose (1): perf stat: Report unsupported events properly kernel/events/core.c | 2 +- tools/perf/.gitignore | 1 + tools/perf/Documentation/perf-record.txt | 12 ++++-- tools/perf/Makefile | 2 +- tools/perf/builtin-sched.c | 26 +++++-------- tools/perf/builtin-stat.c | 5 ++- tools/perf/builtin-trace.c | 7 +++- tools/perf/config/Makefile | 17 ++++----- tools/perf/config/Makefile.arch | 27 +++---------- tools/perf/config/feature-checks/Makefile | 16 ++++---- .../test-pthread-attr-setaffinity-np.c | 4 +- tools/perf/config/utilities.mak | 3 +- tools/perf/ui/browsers/hists.c | 6 +-- tools/perf/util/Build | 2 +- tools/perf/util/build-id.c | 5 ++- tools/perf/util/event.c | 34 ++++++++++++----- tools/perf/util/hist.c | 2 + tools/perf/util/hist.h | 2 +- tools/perf/util/machine.c | 44 +++++++++++----------- tools/perf/util/machine.h | 1 - tools/perf/util/probe-event.c | 23 +++++++++++ tools/perf/util/probe-finder.c | 5 +-- tools/perf/util/session.c | 6 --- tools/perf/util/thread.c | 14 +++++++ tools/perf/util/thread.h | 13 +++++++ 25 files changed, 164 insertions(+), 115 deletions(-) ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2015-03-03 3:25 Arnaldo Carvalho de Melo @ 2015-03-03 6:20 ` Ingo Molnar 2015-03-10 10:03 ` Ingo Molnar 1 sibling, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2015-03-03 6:20 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra, Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > This one has the thread reference counting, that I tested using 'perf probe': > > perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid' > perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid' > perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid' > perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top > > with that I checked and in the end the refcount reaches zero and > thread__delete is called, as expected, using 'perf script', looking at the > callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to > work. > > David, Namhyung, please holler if you find something fishy with this > thread refcnt stuff, as it is something that is related to previous/current > work by you guys, > > Ah, I also merged perf/urgent so that it is buildable in more systems.o > > There is also the revert for that is_power_of_2 "simplification" in perf_mmap, > that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry > about that one, should have caught that :-\ > > Please consider pulling, > > - Arnaldo > The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301: > > Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -0300) > > 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 ae536acfacb65a4a9858c32b12361e09f84f4157: > > perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu) > > - 'perf record' Documentation fixes (Namhyung Kim) > > - Report unsupported events properly in 'perf stat' (Suzuki K. Poulose) > > Infrastructure: > > - Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo) > > - Reference count struct thread (Arnaldo Carvalho de Melo) > > - No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo) > > - Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter) > > - Only include tsc file for x86 (David Ahern) > > - Compare JOBS to 0 after grep (David Ahern) > > - Improve feature detection messages (Ingo Molnar) > > - Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang) > > - Remove bias offset to find probe point by address (Masami Hiramatsu) > > - Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (1): > perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test > > Arnaldo Carvalho de Melo (3): > perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads > perf tools: Reference count struct thread > perf sched: No need to keep the session around > > David Ahern (2): > perf tools: Only include tsc file for x86 > perf tools: Compare JOBS to 0 after grep > > Ingo Molnar (7): > perf tools: Add PERF-FEATURES to the .gitignore file > perf tools: Remove annoying extra message from the features build > perf tools: Improve Python feature detection messages > perf tools: Improve libperl detection message > perf tools: Improve libbfd detection message > perf tools: Improve feature test debuggability > perf tools: Improve 'libbabel' feature check failure message > > Kan Liang (1): > Revert "perf: Remove the extra validity check on nr_pages" > > Masami Hiramatsu (2): > perf probe: Warn if given uprobe event accesses memory on older kernel > perf probe: Remove bias offset to find probe point by address > > Namhyung Kim (3): > perf tools: Fix build error on ARCH=i386/x86_64/sparc64 > perf record: Get rid of -l option from Documentation > perf record: Document --group option > > Suzuki K. Poulose (1): > perf stat: Report unsupported events properly > > kernel/events/core.c | 2 +- > tools/perf/.gitignore | 1 + > tools/perf/Documentation/perf-record.txt | 12 ++++-- > tools/perf/Makefile | 2 +- > tools/perf/builtin-sched.c | 26 +++++-------- > tools/perf/builtin-stat.c | 5 ++- > tools/perf/builtin-trace.c | 7 +++- > tools/perf/config/Makefile | 17 ++++----- > tools/perf/config/Makefile.arch | 27 +++---------- > tools/perf/config/feature-checks/Makefile | 16 ++++---- > .../test-pthread-attr-setaffinity-np.c | 4 +- > tools/perf/config/utilities.mak | 3 +- > tools/perf/ui/browsers/hists.c | 6 +-- > tools/perf/util/Build | 2 +- > tools/perf/util/build-id.c | 5 ++- > tools/perf/util/event.c | 34 ++++++++++++----- > tools/perf/util/hist.c | 2 + > tools/perf/util/hist.h | 2 +- > tools/perf/util/machine.c | 44 +++++++++++----------- > tools/perf/util/machine.h | 1 - > tools/perf/util/probe-event.c | 23 +++++++++++ > tools/perf/util/probe-finder.c | 5 +-- > tools/perf/util/session.c | 6 --- > tools/perf/util/thread.c | 14 +++++++ > tools/perf/util/thread.h | 13 +++++++ > 25 files changed, 164 insertions(+), 115 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2015-03-03 3:25 Arnaldo Carvalho de Melo 2015-03-03 6:20 ` Ingo Molnar @ 2015-03-10 10:03 ` Ingo Molnar 2015-03-10 14:03 ` Arnaldo Carvalho de Melo 1 sibling, 1 reply; 39+ messages in thread From: Ingo Molnar @ 2015-03-10 10:03 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra, Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner, Arnaldo Carvalho de Melo So I got this error today: ┌─Warning:───────────────────────────┐ │The vmlinux file can't be used. │ │Kernel samples will not be resolved.│ │ │ │ │ │Press any key... │ └────────────────────────────────────┘ ... and sadly perf is being passive-aggressive again: being negative but refusing to say why! :-) Is there a way to figure out why it did not like the vmlinux? Thanks, Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2015-03-10 10:03 ` Ingo Molnar @ 2015-03-10 14:03 ` Arnaldo Carvalho de Melo 2015-03-10 14:37 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-03-10 14:03 UTC (permalink / raw) To: Ingo Molnar Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra, Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu: > So I got this error today: > > ┌─Warning:───────────────────────────┐ > │The vmlinux file can't be used. │ > │Kernel samples will not be resolved.│ > │ │ > │ │ > │Press any key... │ > └────────────────────────────────────┘ > > ... and sadly perf is being passive-aggressive again: being negative > but refusing to say why! :-) > Is there a way to figure out why it did not like the vmlinux? I'll check and improve the message. But you must've noticed that perf is going to a therapist, aka improving error messages... ;-) - Arnaldo ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2015-03-10 14:03 ` Arnaldo Carvalho de Melo @ 2015-03-10 14:37 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2015-03-10 14:37 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra, Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner * Arnaldo Carvalho de Melo <acme@redhat.com> wrote: > Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu: > > So I got this error today: > > > > ┌─Warning:───────────────────────────┐ > > │The vmlinux file can't be used. │ > > │Kernel samples will not be resolved.│ > > │ │ > > │ │ > > │Press any key... │ > > └────────────────────────────────────┘ > > > > ... and sadly perf is being passive-aggressive again: being negative > > but refusing to say why! :-) > > > Is there a way to figure out why it did not like the vmlinux? > > I'll check and improve the message. > > But you must've noticed that perf is going to a therapist, aka > improving error messages... ;-) Absolutely! ;-) Also, on the positive side, today I was able to build and run perf on ancient user-space: a Fedora Core 6 installation, with very few hacks (see the attached hacks). The HAVE_NEW_FLAX hack results in a non-working -e option. Thanks, Ingo Index: tip/tools/perf/util/parse-events.c =================================================================== --- tip.orig/tools/perf/util/parse-events.c +++ tip/tools/perf/util/parse-events.c @@ -968,6 +968,13 @@ perf_pmu__parse_check(const char *name) return r ? r->type : PMU_EVENT_SYMBOL_ERR; } +#ifndef HAVE_NEW_FLEX +static int parse_events_lex_init_extra(int start_token __maybe_unused, void **scanner __maybe_unused) +{ + return -1; +} +#endif + static int parse_events__scanner(const char *str, void *data, int start_token) { YY_BUFFER_STATE buffer; Index: tip/tools/perf/util/symbol-elf.c =================================================================== --- tip.orig/tools/perf/util/symbol-elf.c +++ tip/tools/perf/util/symbol-elf.c @@ -53,6 +53,13 @@ static int elf_getphdrnum(Elf *elf, size } #endif +#ifndef HAVE_ELF_GETPHDRNUM +static int elf_getphdrnum (Elf *__elf __maybe_unused, size_t *__dst __maybe_unused) +{ + return 1; +} +#endif + #ifndef NT_GNU_BUILD_ID #define NT_GNU_BUILD_ID 3 #endif ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2016-12-05 21:37 Arnaldo Carvalho de Melo 2016-12-06 8:17 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin, Alexei Starovoitov, Chris Riyder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, linuxppc-dev, Markus Trippelsdorf, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Foley, Peter Zijlstra, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, pi3orama, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4: Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08:03 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161205 for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9: perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Fixes: - Do not show a bogus target address in 'perf annotate' for targetless powerpc jump instructions such as 'bctr' (Ravi Bangoria) - tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa) - Fix building objtool with clang (Peter Foley) Infrastructure: - Support linking perf with clang and LLVM libraries, initially statically, but this limitation will be lifted and shared libraries, when available, will be preferred to the static build, that should, as with other features, be enabled explicitly (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Jiri Olsa (7): tools build: Make fixdep parsing wait for last target tools build: Make the .cmd file more readable tools build: Move tabs to spaces where suitable perf tools: Move install-gtk target into rules area perf tools: Move python/perf.so target into rules area perf tools: Cleanup build directory before each test perf tools: Add non config targets Peter Foley (1): tools build: Fix objtool build with clang Ravi Bangoria (1): perf annotate: Show raw form for jump instruction with indirect target Wang Nan (11): perf tools: Pass context to perf hook functions perf llvm: Extract helpers in llvm-utils.c tools build: Add feature detection for LLVM tools build: Add feature detection for clang perf build: Add clang and llvm compile and linking support perf clang: Add builtin clang support ant test case perf clang: Use real file system for #include perf clang: Allow passing CFLAGS to builtin clang perf clang: Update test case to use real BPF script perf clang: Support compile IR to BPF object and add testcase perf clang: Compile BPF script using builtin clang support tools/build/Build.include | 20 ++-- tools/build/Makefile.feature | 138 +++++++++++++------------- tools/build/feature/Makefile | 120 +++++++++++++---------- tools/build/feature/test-clang.cpp | 21 ++++ tools/build/feature/test-llvm.cpp | 8 ++ tools/build/fixdep.c | 5 +- tools/perf/Makefile.config | 62 +++++++++--- tools/perf/Makefile.perf | 56 +++++++---- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 9 ++ tools/perf/tests/clang.c | 46 +++++++++ tools/perf/tests/llvm.h | 7 ++ tools/perf/tests/make | 4 +- tools/perf/tests/perf-hooks.c | 14 ++- tools/perf/tests/tests.h | 3 + tools/perf/util/Build | 2 + tools/perf/util/annotate.c | 3 + tools/perf/util/bpf-loader.c | 19 +++- tools/perf/util/c++/Build | 2 + tools/perf/util/c++/clang-c.h | 43 ++++++++ tools/perf/util/c++/clang-test.cpp | 62 ++++++++++++ tools/perf/util/c++/clang.cpp | 195 +++++++++++++++++++++++++++++++++++++ tools/perf/util/c++/clang.h | 26 +++++ tools/perf/util/llvm-utils.c | 76 +++++++++++---- tools/perf/util/llvm-utils.h | 6 ++ tools/perf/util/perf-hooks.c | 10 +- tools/perf/util/perf-hooks.h | 6 +- tools/perf/util/util-cxx.h | 26 +++++ 28 files changed, 795 insertions(+), 195 deletions(-) create mode 100644 tools/build/feature/test-clang.cpp create mode 100644 tools/build/feature/test-llvm.cpp create mode 100644 tools/perf/tests/clang.c create mode 100644 tools/perf/util/c++/Build create mode 100644 tools/perf/util/c++/clang-c.h create mode 100644 tools/perf/util/c++/clang-test.cpp create mode 100644 tools/perf/util/c++/clang.cpp create mode 100644 tools/perf/util/c++/clang.h create mode 100644 tools/perf/util/util-cxx.h # uname -a Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: PERF_RECORD_* events & perf_sample fields : Ok 7: Parse perf pmu format : Ok 8: DSO data read : Ok 9: DSO data cache : Ok 10: DSO data reopen : Ok 11: Roundtrip evsel->name : Ok 12: Parse sched tracepoints fields : Ok 13: syscalls:sys_enter_openat event fields : Ok 14: Setup struct perf_event_attr : Ok 15: Match and link multiple hists : Ok 16: 'import perf' in python : Ok 17: Breakpoint overflow signal handler : Ok 18: Breakpoint overflow sampling : Ok 19: Number of exit events of a simple workload : Ok 20: Software clock events period values : Ok 21: Object code reading : Ok 22: Sample parsing : Ok 23: Use a dummy software event to keep tracking: Ok 24: Parse with no sample_id_all bit set : Ok 25: Filter hist entries : Ok 26: Lookup mmap thread : Ok 27: Share thread mg : Ok 28: Sort output of hist entries : Ok 29: Cumulate child hist entries : Ok 30: Track with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: kmod_path__parse : Ok 34: Thread map : Ok 35: LLVM search and compile : 35.1: Basic BPF llvm compile : Ok 35.2: kbuild searching : Ok 35.3: Compile source for BPF prologue generation: Ok 35.4: Compile source for BPF relocation : Ok 36: Session topology : Ok 37: BPF filter : 37.1: Basic BPF filtering : Ok 37.2: BPF prologue generation : Ok 37.3: BPF relocation checker : Ok 38: Synthesize thread map : Ok 39: Synthesize cpu map : Ok 40: Synthesize stat config : Ok 41: Synthesize stat : Ok 42: Synthesize stat round : Ok 43: Synthesize attr update : Ok 44: Event times : Ok 45: Read backward ring buffer : Ok 46: Print cpu map : Ok 47: Probe SDT events : Ok 48: is_printable_array : Ok 49: Print bitmap : Ok 50: perf hooks : Ok 51: builtin clang support : Skip (not compiled in) 52: x86 rdpmc : Ok 53: Convert perf time to TSC : Ok 54: DWARF unwind : Ok 55: x86 instruction decoder - new instructions : Ok 56: Intel cqm nmi context read : Skip # # time dm 1 alpine:3.4: Ok 2 android-ndk:r12b-arm: Ok 3 archlinux:latest: Ok 4 centos:5: Ok 5 centos:6: Ok 6 centos:7: Ok 7 debian:7: Ok 8 debian:8: Ok 9 debian:experimental: Ok 10 fedora:20: Ok 11 fedora:21: Ok 12 fedora:22: Ok 13 fedora:23: Ok 14 fedora:24: Ok 15 fedora:24-x-ARC-uClibc: Ok 16 fedora:25: Ok 17 fedora:rawhide: Ok 18 mageia:5: Ok 19 opensuse:13.2: Ok 20 opensuse:42.1: Ok 21 opensuse:tumbleweed: Ok 22 ubuntu:12.04.5: Ok 23 ubuntu:14.04.4-x-linaro-arm64: Ok 24 ubuntu:16.04: Ok 25 ubuntu:16.04-x-arm: Ok 26 ubuntu:16.04-x-arm64: Ok 27 ubuntu:16.04-x-powerpc: Ok 28 ubuntu:16.04-x-powerpc64: Ok 29 ubuntu:16.04-x-powerpc64el: Ok 30 ubuntu:16.04-x-s390: Ok 31 ubuntu:16.10: Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_backtrace_O: make NO_BACKTRACE=1 make_no_gtk2_O: make NO_GTK2=1 make_static_O: make LDFLAGS=-static make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_perf_o_O: make perf.o make_no_slang_O: make NO_SLANG=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libpython_O: make NO_LIBPYTHON=1 make_no_newt_O: make NO_NEWT=1 make_debug_O: make DEBUG=1 make_tags_O: make tags make_no_libbionic_O: make NO_LIBBIONIC=1 make_help_O: make help make_install_O: make install make_no_libunwind_O: make NO_LIBUNWIND=1 make_pure_O: make make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_doc_O: make doc make_no_libaudit_O: make NO_LIBAUDIT=1 make_clean_all_O: make clean all make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_util_map_o_O: make util/map.o make_install_bin_O: make install-bin make_no_demangle_O: make NO_DEMANGLE=1 make_no_libelf_O: make NO_LIBELF=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_with_clangllvm_O: make LIBCLANGLLVM=1 OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2016-12-05 21:37 Arnaldo Carvalho de Melo @ 2016-12-06 8:17 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2016-12-06 8:17 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov, Chris Riyder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, linuxppc-dev, Markus Trippelsdorf, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Foley, Peter Zijlstra, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, pi3orama, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4: > > Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08:03 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161205 > > for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9: > > perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > Fixes: > > - Do not show a bogus target address in 'perf annotate' for targetless powerpc > jump instructions such as 'bctr' (Ravi Bangoria) > > - tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa) > > - Fix building objtool with clang (Peter Foley) > > Infrastructure: > > - Support linking perf with clang and LLVM libraries, initially statically, but > this limitation will be lifted and shared libraries, when available, will > be preferred to the static build, that should, as with other features, be > enabled explicitly (Wang Nan) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Jiri Olsa (7): > tools build: Make fixdep parsing wait for last target > tools build: Make the .cmd file more readable > tools build: Move tabs to spaces where suitable > perf tools: Move install-gtk target into rules area > perf tools: Move python/perf.so target into rules area > perf tools: Cleanup build directory before each test > perf tools: Add non config targets > > Peter Foley (1): > tools build: Fix objtool build with clang > > Ravi Bangoria (1): > perf annotate: Show raw form for jump instruction with indirect target > > Wang Nan (11): > perf tools: Pass context to perf hook functions > perf llvm: Extract helpers in llvm-utils.c > tools build: Add feature detection for LLVM > tools build: Add feature detection for clang > perf build: Add clang and llvm compile and linking support > perf clang: Add builtin clang support ant test case > perf clang: Use real file system for #include > perf clang: Allow passing CFLAGS to builtin clang > perf clang: Update test case to use real BPF script > perf clang: Support compile IR to BPF object and add testcase > perf clang: Compile BPF script using builtin clang support > > tools/build/Build.include | 20 ++-- > tools/build/Makefile.feature | 138 +++++++++++++------------- > tools/build/feature/Makefile | 120 +++++++++++++---------- > tools/build/feature/test-clang.cpp | 21 ++++ > tools/build/feature/test-llvm.cpp | 8 ++ > tools/build/fixdep.c | 5 +- > tools/perf/Makefile.config | 62 +++++++++--- > tools/perf/Makefile.perf | 56 +++++++---- > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 9 ++ > tools/perf/tests/clang.c | 46 +++++++++ > tools/perf/tests/llvm.h | 7 ++ > tools/perf/tests/make | 4 +- > tools/perf/tests/perf-hooks.c | 14 ++- > tools/perf/tests/tests.h | 3 + > tools/perf/util/Build | 2 + > tools/perf/util/annotate.c | 3 + > tools/perf/util/bpf-loader.c | 19 +++- > tools/perf/util/c++/Build | 2 + > tools/perf/util/c++/clang-c.h | 43 ++++++++ > tools/perf/util/c++/clang-test.cpp | 62 ++++++++++++ > tools/perf/util/c++/clang.cpp | 195 +++++++++++++++++++++++++++++++++++++ > tools/perf/util/c++/clang.h | 26 +++++ > tools/perf/util/llvm-utils.c | 76 +++++++++++---- > tools/perf/util/llvm-utils.h | 6 ++ > tools/perf/util/perf-hooks.c | 10 +- > tools/perf/util/perf-hooks.h | 6 +- > tools/perf/util/util-cxx.h | 26 +++++ > 28 files changed, 795 insertions(+), 195 deletions(-) > create mode 100644 tools/build/feature/test-clang.cpp > create mode 100644 tools/build/feature/test-llvm.cpp > create mode 100644 tools/perf/tests/clang.c > create mode 100644 tools/perf/util/c++/Build > create mode 100644 tools/perf/util/c++/clang-c.h > create mode 100644 tools/perf/util/c++/clang-test.cpp > create mode 100644 tools/perf/util/c++/clang.cpp > create mode 100644 tools/perf/util/c++/clang.h > create mode 100644 tools/perf/util/util-cxx.h > > # uname -a > Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > # perf test > 1: vmlinux symtab matches kallsyms : Ok > 2: Detect openat syscall event : Ok > 3: Detect openat syscall event on all cpus : Ok > 4: Read samples using the mmap interface : Ok > 5: Parse event definition strings : Ok > 6: PERF_RECORD_* events & perf_sample fields : Ok > 7: Parse perf pmu format : Ok > 8: DSO data read : Ok > 9: DSO data cache : Ok > 10: DSO data reopen : Ok > 11: Roundtrip evsel->name : Ok > 12: Parse sched tracepoints fields : Ok > 13: syscalls:sys_enter_openat event fields : Ok > 14: Setup struct perf_event_attr : Ok > 15: Match and link multiple hists : Ok > 16: 'import perf' in python : Ok > 17: Breakpoint overflow signal handler : Ok > 18: Breakpoint overflow sampling : Ok > 19: Number of exit events of a simple workload : Ok > 20: Software clock events period values : Ok > 21: Object code reading : Ok > 22: Sample parsing : Ok > 23: Use a dummy software event to keep tracking: Ok > 24: Parse with no sample_id_all bit set : Ok > 25: Filter hist entries : Ok > 26: Lookup mmap thread : Ok > 27: Share thread mg : Ok > 28: Sort output of hist entries : Ok > 29: Cumulate child hist entries : Ok > 30: Track with sched_switch : Ok > 31: Filter fds with revents mask in a fdarray : Ok > 32: Add fd to a fdarray, making it autogrow : Ok > 33: kmod_path__parse : Ok > 34: Thread map : Ok > 35: LLVM search and compile : > 35.1: Basic BPF llvm compile : Ok > 35.2: kbuild searching : Ok > 35.3: Compile source for BPF prologue generation: Ok > 35.4: Compile source for BPF relocation : Ok > 36: Session topology : Ok > 37: BPF filter : > 37.1: Basic BPF filtering : Ok > 37.2: BPF prologue generation : Ok > 37.3: BPF relocation checker : Ok > 38: Synthesize thread map : Ok > 39: Synthesize cpu map : Ok > 40: Synthesize stat config : Ok > 41: Synthesize stat : Ok > 42: Synthesize stat round : Ok > 43: Synthesize attr update : Ok > 44: Event times : Ok > 45: Read backward ring buffer : Ok > 46: Print cpu map : Ok > 47: Probe SDT events : Ok > 48: is_printable_array : Ok > 49: Print bitmap : Ok > 50: perf hooks : Ok > 51: builtin clang support : Skip (not compiled in) > 52: x86 rdpmc : Ok > 53: Convert perf time to TSC : Ok > 54: DWARF unwind : Ok > 55: x86 instruction decoder - new instructions : Ok > 56: Intel cqm nmi context read : Skip > # > # time dm > 1 alpine:3.4: Ok > 2 android-ndk:r12b-arm: Ok > 3 archlinux:latest: Ok > 4 centos:5: Ok > 5 centos:6: Ok > 6 centos:7: Ok > 7 debian:7: Ok > 8 debian:8: Ok > 9 debian:experimental: Ok > 10 fedora:20: Ok > 11 fedora:21: Ok > 12 fedora:22: Ok > 13 fedora:23: Ok > 14 fedora:24: Ok > 15 fedora:24-x-ARC-uClibc: Ok > 16 fedora:25: Ok > 17 fedora:rawhide: Ok > 18 mageia:5: Ok > 19 opensuse:13.2: Ok > 20 opensuse:42.1: Ok > 21 opensuse:tumbleweed: Ok > 22 ubuntu:12.04.5: Ok > 23 ubuntu:14.04.4-x-linaro-arm64: Ok > 24 ubuntu:16.04: Ok > 25 ubuntu:16.04-x-arm: Ok > 26 ubuntu:16.04-x-arm64: Ok > 27 ubuntu:16.04-x-powerpc: Ok > 28 ubuntu:16.04-x-powerpc64: Ok > 29 ubuntu:16.04-x-powerpc64el: Ok > 30 ubuntu:16.04-x-s390: Ok > 31 ubuntu:16.10: Ok > # > $ make -C tools/perf build-test > make: Entering directory '/home/acme/git/linux/tools/perf' > - tarpkg: ./tests/perf-targz-src-pkg . > make_no_backtrace_O: make NO_BACKTRACE=1 > make_no_gtk2_O: make NO_GTK2=1 > make_static_O: make LDFLAGS=-static > make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 > make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 > make_perf_o_O: make perf.o > make_no_slang_O: make NO_SLANG=1 > make_install_prefix_O: make install prefix=/tmp/krava > make_no_libpython_O: make NO_LIBPYTHON=1 > make_no_newt_O: make NO_NEWT=1 > make_debug_O: make DEBUG=1 > make_tags_O: make tags > make_no_libbionic_O: make NO_LIBBIONIC=1 > make_help_O: make help > make_install_O: make install > make_no_libunwind_O: make NO_LIBUNWIND=1 > make_pure_O: make > make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 > make_no_libperl_O: make NO_LIBPERL=1 > make_no_libbpf_O: make NO_LIBBPF=1 > make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 > make_doc_O: make doc > make_no_libaudit_O: make NO_LIBAUDIT=1 > make_clean_all_O: make clean all > make_with_babeltrace_O: make LIBBABELTRACE=1 > make_no_libnuma_O: make NO_LIBNUMA=1 > make_util_map_o_O: make util/map.o > make_install_bin_O: make install-bin > make_no_demangle_O: make NO_DEMANGLE=1 > make_no_libelf_O: make NO_LIBELF=1 > make_no_auxtrace_O: make NO_AUXTRACE=1 > make_util_pmu_bison_o_O: make util/pmu-bison.o > make_install_prefix_slash_O: make install prefix=/tmp/krava/ > make_with_clangllvm_O: make LIBCLANGLLVM=1 > OK > make: Leaving directory '/home/acme/git/linux/tools/perf' > $ Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2017-03-24 14:57 Arnaldo Carvalho de Melo 2017-03-24 18:39 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Alexis Berlemont, Andi Kleen, David Ahern, Hanjun Guo, Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang, Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Taeung Song, Wang Nan, linux-perf-users, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad: Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170324 for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e: perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen) - Collapse identically named PMU events in 'perf stat', allow not merging it via --no-merge (Andi Kleen) Fixes: - Use more precise 'grep -v' to suppress unwanted 'objdump -dS' disassembly output to not ditch line:number lines needed by 'perf annotate --print-lines' logic (Taeung Song) Infrastructure: - SDT (Statically Defined Tracing)/uprobes_events arguments improvements (Alexis Berlemont, Ravi Bangoria) - Improvements for the handling of JSON described vendor events, including having an expression parser to calculate metrics from multiple vendor events (Andi Kleen) - Update Intel JSON vendor event files (Andi Kleen) - Restore error reporting in 'perf probe -d' when none of the events requested to be deleted exist. (Kefeng Wang) - Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts (Ravi Bangoria) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Alexis Berlemont (2): perf sdt: Add scanning of sdt probes arguments perf probe: Add sdt probes arguments into the uprobe cmd string Andi Kleen (13): perf stat: Factor out callback for collecting event values perf stat: Collapse identically named events perf stat: Handle partially bad results with merging perf tools: Factor out PMU matching in parser perf pmu: Expand PMU events by prefix match perf pmu: Special case uncore_ prefix perf tools: Add a simple expression parser for JSON perf vendor events intel: Update Intel uncore JSON event files perf pmu: Support MetricExpr header in JSON event list perf stat: Output JSON MetricExpr metric perf list: Support printing MetricExpr with --debug perf pmu: Add support for MetricName JSON attribute perf list: Move extra details printing to new option Arnaldo Carvalho de Melo (1): perf annotate: Add comment clarifying how the source code line is parsed Kefeng Wang (1): perf probe: Return errno when not hitting any event Ravi Bangoria (2): perf probe: Change MAX_CMDLEN perf sdt x86: Add renaming logic for rNN and other registers Taeung Song (1): perf annotate: More exactly grep -v of the objdump command tools/perf/Documentation/perf-list.txt | 4 + tools/perf/Documentation/perf-stat.txt | 3 + tools/perf/arch/x86/util/perf_regs.c | 103 +++++++++++ tools/perf/builtin-list.c | 14 +- tools/perf/builtin-probe.c | 6 +- tools/perf/builtin-stat.c | 146 ++++++++++++--- .../arch/x86/broadwellde/uncore-cache.json | 28 +-- .../arch/x86/broadwellde/uncore-memory.json | 26 ++- .../arch/x86/broadwellde/uncore-power.json | 26 ++- .../arch/x86/broadwellx/uncore-cache.json | 28 +-- .../arch/x86/broadwellx/uncore-interconnect.json | 6 +- .../arch/x86/broadwellx/uncore-memory.json | 21 ++- .../arch/x86/broadwellx/uncore-power.json | 26 ++- .../pmu-events/arch/x86/haswellx/uncore-cache.json | 28 +-- .../arch/x86/haswellx/uncore-interconnect.json | 6 +- .../arch/x86/haswellx/uncore-memory.json | 21 ++- .../pmu-events/arch/x86/haswellx/uncore-power.json | 26 ++- .../pmu-events/arch/x86/ivytown/uncore-cache.json | 22 +-- .../arch/x86/ivytown/uncore-interconnect.json | 12 +- .../pmu-events/arch/x86/ivytown/uncore-memory.json | 19 +- .../pmu-events/arch/x86/ivytown/uncore-power.json | 53 ++++-- .../pmu-events/arch/x86/jaketown/uncore-cache.json | 13 +- .../arch/x86/jaketown/uncore-interconnect.json | 12 +- .../arch/x86/jaketown/uncore-memory.json | 21 ++- .../pmu-events/arch/x86/jaketown/uncore-power.json | 53 ++++-- tools/perf/pmu-events/jevents.c | 26 ++- tools/perf/pmu-events/jevents.h | 3 +- tools/perf/pmu-events/pmu-events.h | 2 + tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/expr.c | 56 ++++++ tools/perf/tests/tests.h | 1 + tools/perf/util/Build | 6 + tools/perf/util/annotate.c | 8 +- tools/perf/util/evsel.c | 4 + tools/perf/util/evsel.h | 5 + tools/perf/util/expr.h | 25 +++ tools/perf/util/expr.y | 173 ++++++++++++++++++ tools/perf/util/parse-events.c | 78 +++++++- tools/perf/util/parse-events.h | 10 +- tools/perf/util/parse-events.y | 73 ++++---- tools/perf/util/perf_regs.c | 6 + tools/perf/util/perf_regs.h | 6 + tools/perf/util/pmu.c | 32 +++- tools/perf/util/pmu.h | 6 +- tools/perf/util/probe-event.c | 1 - tools/perf/util/probe-file.c | 173 +++++++++++++++++- tools/perf/util/stat-shadow.c | 197 +++++++++++++++++++++ tools/perf/util/stat.h | 2 + tools/perf/util/symbol-elf.c | 25 ++- tools/perf/util/symbol.h | 1 + 51 files changed, 1370 insertions(+), 277 deletions(-) create mode 100644 tools/perf/tests/expr.c create mode 100644 tools/perf/util/expr.h create mode 100644 tools/perf/util/expr.y Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:edge: Ok 4 android-ndk:r12b-arm: Ok 5 archlinux:latest: Ok 6 centos:5: Ok 7 centos:6: Ok 8 centos:7: Ok 9 debian:7: Ok 10 debian:8: Ok 11 debian:experimental: Ok 12 debian:experimental-x-arm64: Ok 13 debian:experimental-x-mips: Ok 14 debian:experimental-x-mips64: Ok 15 debian:experimental-x-mipsel: Ok 16 fedora:20: Ok 17 fedora:21: Ok 18 fedora:22: Ok 19 fedora:23: Ok 20 fedora:24: Ok 21 fedora:24-x-ARC-uClibc: Ok 22 fedora:25: Ok 23 fedora:rawhide: Ok 24 mageia:5: Ok 25 opensuse:13.2: Ok 26 opensuse:42.1: Ok 27 opensuse:tumbleweed: Ok 28 ubuntu:12.04.5: Ok 29 ubuntu:14.04.4: Ok 30 ubuntu:14.04.4-x-linaro-arm64: Ok 31 ubuntu:15.10: Ok 32 ubuntu:16.04: Ok 33 ubuntu:16.04-x-arm: Ok 34 ubuntu:16.04-x-arm64: Ok 35 ubuntu:16.04-x-powerpc: Ok 36 ubuntu:16.04-x-powerpc64: Ok 37 ubuntu:16.04-x-s390: Ok 38 ubuntu:16.10: Ok 39 ubuntu:17.04: Ok # # uname -a Linux felicio.ghostprotocols.net 4.11.0-rc3+ #1 SMP Thu Mar 23 14:32:00 BRT 2017 x86_64 x86_64 x86_64 GNU/Linux # Has peterz's fix for 'perf test tsc' # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: Simple expression parser : Ok 7: PERF_RECORD_* events & perf_sample fields : Ok 8: Parse perf pmu format : Ok 9: DSO data read : Ok 10: DSO data cache : Ok 11: DSO data reopen : Ok 12: Roundtrip evsel->name : Ok 13: Parse sched tracepoints fields : Ok 14: syscalls:sys_enter_openat event fields : Ok 15: Setup struct perf_event_attr : Ok 16: Match and link multiple hists : Ok 17: 'import perf' in python : Ok 18: Breakpoint overflow signal handler : Ok 19: Breakpoint overflow sampling : Ok 20: Number of exit events of a simple workload : Ok 21: Software clock events period values : Ok 22: Object code reading : Ok 23: Sample parsing : Ok 24: Use a dummy software event to keep tracking: Ok 25: Parse with no sample_id_all bit set : Ok 26: Filter hist entries : Ok 27: Lookup mmap thread : Ok 28: Share thread mg : Ok 29: Sort output of hist entries : Ok 30: Cumulate child hist entries : Ok 31: Track with sched_switch : Ok 32: Filter fds with revents mask in a fdarray : Ok 33: Add fd to a fdarray, making it autogrow : Ok 34: kmod_path__parse : Ok 35: Thread map : Ok 36: LLVM search and compile : 36.1: Basic BPF llvm compile : Ok 36.2: kbuild searching : Ok 36.3: Compile source for BPF prologue generation: Ok 36.4: Compile source for BPF relocation : Ok 37: Session topology : Ok 38: BPF filter : 38.1: Basic BPF filtering : Ok 38.2: BPF pinning : Ok 38.3: BPF prologue generation : Ok 38.4: BPF relocation checker : Ok 39: Synthesize thread map : Ok 40: Remove thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok 46: Event times : Ok 47: Read backward ring buffer : Ok 48: Print cpu map : Ok 49: Probe SDT events : Ok 50: is_printable_array : Ok 51: Print bitmap : Ok 52: perf hooks : Ok 53: builtin clang support : Skip (not compiled in) 54: unit_number__scnprintf : Ok 55: x86 rdpmc : Ok 56: Convert perf time to TSC : Ok 57: DWARF unwind : Ok 58: x86 instruction decoder - new instructions : Ok 59: Intel cqm nmi context read : Skip # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_install_O: make install make_install_bin_O: make install-bin make_with_clangllvm_O: make LIBCLANGLLVM=1 make_pure_O: make make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_newt_O: make NO_NEWT=1 make_debug_O: make DEBUG=1 make_doc_O: make doc make_no_slang_O: make NO_SLANG=1 make_static_O: make LDFLAGS=-static make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_no_libbpf_O: make NO_LIBBPF=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_perf_o_O: make perf.o make_no_libnuma_O: make NO_LIBNUMA=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_help_O: make help make_util_map_o_O: make util/map.o make_no_libperl_O: make NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_install_prefix_O: make install prefix=/tmp/krava make_clean_all_O: make clean all make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_tags_O: make tags make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2017-03-24 14:57 Arnaldo Carvalho de Melo @ 2017-03-24 18:39 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2017-03-24 18:39 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexis Berlemont, Andi Kleen, David Ahern, Hanjun Guo, Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang, Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Taeung Song, Wang Nan, linux-perf-users, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad: > > Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170324 > > for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e: > > perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen) > > - Collapse identically named PMU events in 'perf stat', allow > not merging it via --no-merge (Andi Kleen) > > Fixes: > > - Use more precise 'grep -v' to suppress unwanted 'objdump -dS' > disassembly output to not ditch line:number lines needed by > 'perf annotate --print-lines' logic (Taeung Song) > > Infrastructure: > > - SDT (Statically Defined Tracing)/uprobes_events arguments improvements > (Alexis Berlemont, Ravi Bangoria) > > - Improvements for the handling of JSON described vendor events, > including having an expression parser to calculate metrics > from multiple vendor events (Andi Kleen) > > - Update Intel JSON vendor event files (Andi Kleen) > > - Restore error reporting in 'perf probe -d' when none of the events > requested to be deleted exist. (Kefeng Wang) > > - Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts > (Ravi Bangoria) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Alexis Berlemont (2): > perf sdt: Add scanning of sdt probes arguments > perf probe: Add sdt probes arguments into the uprobe cmd string > > Andi Kleen (13): > perf stat: Factor out callback for collecting event values > perf stat: Collapse identically named events > perf stat: Handle partially bad results with merging > perf tools: Factor out PMU matching in parser > perf pmu: Expand PMU events by prefix match > perf pmu: Special case uncore_ prefix > perf tools: Add a simple expression parser for JSON > perf vendor events intel: Update Intel uncore JSON event files > perf pmu: Support MetricExpr header in JSON event list > perf stat: Output JSON MetricExpr metric > perf list: Support printing MetricExpr with --debug > perf pmu: Add support for MetricName JSON attribute > perf list: Move extra details printing to new option > > Arnaldo Carvalho de Melo (1): > perf annotate: Add comment clarifying how the source code line is parsed > > Kefeng Wang (1): > perf probe: Return errno when not hitting any event > > Ravi Bangoria (2): > perf probe: Change MAX_CMDLEN > perf sdt x86: Add renaming logic for rNN and other registers > > Taeung Song (1): > perf annotate: More exactly grep -v of the objdump command > > tools/perf/Documentation/perf-list.txt | 4 + > tools/perf/Documentation/perf-stat.txt | 3 + > tools/perf/arch/x86/util/perf_regs.c | 103 +++++++++++ > tools/perf/builtin-list.c | 14 +- > tools/perf/builtin-probe.c | 6 +- > tools/perf/builtin-stat.c | 146 ++++++++++++--- > .../arch/x86/broadwellde/uncore-cache.json | 28 +-- > .../arch/x86/broadwellde/uncore-memory.json | 26 ++- > .../arch/x86/broadwellde/uncore-power.json | 26 ++- > .../arch/x86/broadwellx/uncore-cache.json | 28 +-- > .../arch/x86/broadwellx/uncore-interconnect.json | 6 +- > .../arch/x86/broadwellx/uncore-memory.json | 21 ++- > .../arch/x86/broadwellx/uncore-power.json | 26 ++- > .../pmu-events/arch/x86/haswellx/uncore-cache.json | 28 +-- > .../arch/x86/haswellx/uncore-interconnect.json | 6 +- > .../arch/x86/haswellx/uncore-memory.json | 21 ++- > .../pmu-events/arch/x86/haswellx/uncore-power.json | 26 ++- > .../pmu-events/arch/x86/ivytown/uncore-cache.json | 22 +-- > .../arch/x86/ivytown/uncore-interconnect.json | 12 +- > .../pmu-events/arch/x86/ivytown/uncore-memory.json | 19 +- > .../pmu-events/arch/x86/ivytown/uncore-power.json | 53 ++++-- > .../pmu-events/arch/x86/jaketown/uncore-cache.json | 13 +- > .../arch/x86/jaketown/uncore-interconnect.json | 12 +- > .../arch/x86/jaketown/uncore-memory.json | 21 ++- > .../pmu-events/arch/x86/jaketown/uncore-power.json | 53 ++++-- > tools/perf/pmu-events/jevents.c | 26 ++- > tools/perf/pmu-events/jevents.h | 3 +- > tools/perf/pmu-events/pmu-events.h | 2 + > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/expr.c | 56 ++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/util/Build | 6 + > tools/perf/util/annotate.c | 8 +- > tools/perf/util/evsel.c | 4 + > tools/perf/util/evsel.h | 5 + > tools/perf/util/expr.h | 25 +++ > tools/perf/util/expr.y | 173 ++++++++++++++++++ > tools/perf/util/parse-events.c | 78 +++++++- > tools/perf/util/parse-events.h | 10 +- > tools/perf/util/parse-events.y | 73 ++++---- > tools/perf/util/perf_regs.c | 6 + > tools/perf/util/perf_regs.h | 6 + > tools/perf/util/pmu.c | 32 +++- > tools/perf/util/pmu.h | 6 +- > tools/perf/util/probe-event.c | 1 - > tools/perf/util/probe-file.c | 173 +++++++++++++++++- > tools/perf/util/stat-shadow.c | 197 +++++++++++++++++++++ > tools/perf/util/stat.h | 2 + > tools/perf/util/symbol-elf.c | 25 ++- > tools/perf/util/symbol.h | 1 + > 51 files changed, 1370 insertions(+), 277 deletions(-) > create mode 100644 tools/perf/tests/expr.c > create mode 100644 tools/perf/util/expr.h > create mode 100644 tools/perf/util/expr.y Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes @ 2017-03-28 1:38 Arnaldo Carvalho de Melo 2017-03-28 5:45 ` Ingo Molnar 0 siblings, 1 reply; 39+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-03-28 1:38 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, Ravi Bangoria, Sukadev Bhattiprolu, Taeung Song, Tommi Rantala, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92: Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170327 for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de: perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Handle inline functions in callchains (Jin Yao) - Enable sorting by srcline as key (Milian Wolff) Fixes: - Fix no_size logic in addr_filter__resolve_kernel_syms() in the auxtrace code (Adrian Hunter) - Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo) - Fix divide by zero when calculating percent for an event in a group in the annotate by source line code (Taeung Song) - build-id files now aren't anymore symlinks, their parent directories are, so readlink the later (Taeung Song) - Assorted fixes for null termination problems, mostly related to readlink, detected by valgrind (Tommi Rantala) Infrastructure: - Make vfs_getname probe point logic in 'perf trace' more robust wrt length of pathname (Arnaldo Carvalho de Melo) - Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo) - Show 'perf list sdt' option in man page (Ravi Bangoria) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (1): perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms() Arnaldo Carvalho de Melo (4): perf trace: Check for vfs_getname.pathname length perf trace: Fix up error path indentation perf trace: Fixup thread refcounting perf tools: Remove unused 'prefix' from builtin functions Jin Yao (5): perf report: Refactor common code in srcline.c perf report: Find the inline stack for a given address perf report: Introduce --inline option perf report: Show inline stack for stdio mode perf report: Show inline stack for browser mode Milian Wolff (1): perf report: Enable sorting by srcline as key Ravi Bangoria (1): perf list sdt: Show option in man page Taeung Song (2): perf annotate: Fix a bug following symbolic link of a build-id file perf annotate: Fix a bug of division by zero when calculating percent Tommi Rantala (6): perf buildid: Do not update SDT cache with null filename perf buildid: Do not assume that readlink() returns a null terminated string perf tests: Do not assume that readlink() returns a null terminated string perf utils: use sizeof(buf) - 1 in readlink() call perf utils: Null terminate buf in read_ftrace_printk() perf utils: Readlink /proc/self/exe to find the perf binary tools/perf/Documentation/perf-list.txt | 4 +- tools/perf/Documentation/perf-report.txt | 5 + tools/perf/bench/bench.h | 20 +-- tools/perf/bench/futex-hash.c | 3 +- tools/perf/bench/futex-lock-pi.c | 3 +- tools/perf/bench/futex-requeue.c | 3 +- tools/perf/bench/futex-wake-parallel.c | 3 +- tools/perf/bench/futex-wake.c | 3 +- tools/perf/bench/mem-functions.c | 4 +- tools/perf/bench/numa.c | 2 +- tools/perf/bench/sched-messaging.c | 3 +- tools/perf/bench/sched-pipe.c | 2 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-bench.c | 12 +- tools/perf/builtin-buildid-cache.c | 3 +- tools/perf/builtin-buildid-list.c | 3 +- tools/perf/builtin-c2c.c | 4 +- tools/perf/builtin-config.c | 2 +- tools/perf/builtin-data.c | 9 +- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-evlist.c | 2 +- tools/perf/builtin-ftrace.c | 2 +- tools/perf/builtin-help.c | 2 +- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kallsyms.c | 2 +- tools/perf/builtin-kmem.c | 4 +- tools/perf/builtin-kvm.c | 16 +- tools/perf/builtin-list.c | 2 +- tools/perf/builtin-lock.c | 6 +- tools/perf/builtin-mem.c | 6 +- tools/perf/builtin-probe.c | 6 +- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-report.c | 4 +- tools/perf/builtin-sched.c | 6 +- tools/perf/builtin-script.c | 4 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-timechart.c | 7 +- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 25 ++-- tools/perf/builtin-version.c | 3 +- tools/perf/builtin.h | 58 ++++---- tools/perf/perf.c | 11 +- tools/perf/tests/builtin-test.c | 2 +- tools/perf/tests/sdt.c | 2 +- tools/perf/ui/browsers/hists.c | 181 ++++++++++++++++++++++- tools/perf/ui/stdio/hist.c | 86 ++++++++++- tools/perf/util/annotate.c | 23 ++- tools/perf/util/auxtrace.c | 4 +- tools/perf/util/build-id.c | 8 +- tools/perf/util/callchain.c | 52 ++++++- tools/perf/util/callchain.h | 3 +- tools/perf/util/header.c | 8 +- tools/perf/util/hist.c | 5 + tools/perf/util/map.c | 3 +- tools/perf/util/sort.c | 16 +- tools/perf/util/sort.h | 1 + tools/perf/util/srcline.c | 246 +++++++++++++++++++++++++++---- tools/perf/util/symbol-elf.c | 5 + tools/perf/util/symbol-minimal.c | 7 + tools/perf/util/symbol.h | 5 +- tools/perf/util/trace-event-read.c | 4 +- tools/perf/util/util.h | 20 ++- 62 files changed, 739 insertions(+), 208 deletions(-) Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:edge: Ok 4 android-ndk:r12b-arm: Ok 5 archlinux:latest: Ok 6 centos:5: Ok 7 centos:6: Ok 8 centos:7: Ok 9 debian:7: Ok 10 debian:8: Ok 11 debian:9: Ok 12 debian:experimental: Ok 13 debian:experimental-x-arm64: Ok 14 debian:experimental-x-mips: Ok 15 debian:experimental-x-mips64: Ok 16 debian:experimental-x-mipsel: Ok 17 fedora:20: Ok 18 fedora:21: Ok 19 fedora:22: Ok 20 fedora:23: Ok 21 fedora:24: Ok 22 fedora:24-x-ARC-uClibc: Ok 23 fedora:25: Ok 24 fedora:rawhide: Ok 25 mageia:5: Ok 26 opensuse:13.2: Ok 27 opensuse:42.1: Ok 28 opensuse:tumbleweed: Ok 29 ubuntu:12.04.5: Ok 30 ubuntu:14.04.4: Ok 31 ubuntu:14.04.4-x-linaro-arm64: Ok 32 ubuntu:15.10: Ok 33 ubuntu:16.04: Ok 34 ubuntu:16.04-x-arm: Ok 35 ubuntu:16.04-x-arm64: Ok 36 ubuntu:16.04-x-powerpc: Ok 37 ubuntu:16.04-x-powerpc64: Ok 38 ubuntu:16.04-x-s390: Ok 39 ubuntu:16.10: Ok 40 ubuntu:17.04: Ok # # uname -a Linux jouet 4.11.0-rc2+ #5 SMP Mon Mar 20 18:12:29 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # This kernel lacks the fix by peterz for 'perf test tsc' # # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: Simple expression parser : Ok 7: PERF_RECORD_* events & perf_sample fields : Ok 8: Parse perf pmu format : Ok 9: DSO data read : Ok 10: DSO data cache : Ok 11: DSO data reopen : Ok 12: Roundtrip evsel->name : Ok 13: Parse sched tracepoints fields : Ok 14: syscalls:sys_enter_openat event fields : Ok 15: Setup struct perf_event_attr : Ok 16: Match and link multiple hists : Ok 17: 'import perf' in python : Ok 18: Breakpoint overflow signal handler : Ok 19: Breakpoint overflow sampling : Ok 20: Number of exit events of a simple workload : Ok 21: Software clock events period values : Ok 22: Object code reading : Ok 23: Sample parsing : Ok 24: Use a dummy software event to keep tracking: Ok 25: Parse with no sample_id_all bit set : Ok 26: Filter hist entries : Ok 27: Lookup mmap thread : Ok 28: Share thread mg : Ok 29: Sort output of hist entries : Ok 30: Cumulate child hist entries : Ok 31: Track with sched_switch : Ok 32: Filter fds with revents mask in a fdarray : Ok 33: Add fd to a fdarray, making it autogrow : Ok 34: kmod_path__parse : Ok 35: Thread map : Ok 36: LLVM search and compile : 36.1: Basic BPF llvm compile : Ok 36.2: kbuild searching : Ok 36.3: Compile source for BPF prologue generation: Ok 36.4: Compile source for BPF relocation : Ok 37: Session topology : Ok 38: BPF filter : 38.1: Basic BPF filtering : Ok 38.2: BPF pinning : Ok 38.3: BPF prologue generation : Ok 38.4: BPF relocation checker : Ok 39: Synthesize thread map : Ok 40: Remove thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok 46: Event times : Ok 47: Read backward ring buffer : Ok 48: Print cpu map : Ok 49: Probe SDT events : Ok 50: is_printable_array : Ok 51: Print bitmap : Ok 52: perf hooks : Ok 53: builtin clang support : Skip (not compiled in) 54: unit_number__scnprintf : Ok 55: x86 rdpmc : Ok 56: Convert perf time to TSC : FAILED! 57: DWARF unwind : Ok 58: x86 instruction decoder - new instructions : Ok 59: Intel cqm nmi context read : Skip # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_clean_all_O: make clean all make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_backtrace_O: make NO_BACKTRACE=1 make_install_O: make install make_no_libaudit_O: make NO_LIBAUDIT=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_tags_O: make tags make_no_slang_O: make NO_SLANG=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_pure_O: make make_install_prefix_O: make install prefix=/tmp/krava make_no_demangle_O: make NO_DEMANGLE=1 make_doc_O: make doc make_no_gtk2_O: make NO_GTK2=1 make_help_O: make help make_static_O: make LDFLAGS=-static make_no_libunwind_O: make NO_LIBUNWIND=1 make_util_map_o_O: make util/map.o make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libelf_O: make NO_LIBELF=1 make_debug_O: make DEBUG=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_perf_o_O: make perf.o make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_newt_O: make NO_NEWT=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_install_bin_O: make install-bin OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes 2017-03-28 1:38 Arnaldo Carvalho de Melo @ 2017-03-28 5:45 ` Ingo Molnar 0 siblings, 0 replies; 39+ messages in thread From: Ingo Molnar @ 2017-03-28 5:45 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, Ravi Bangoria, Sukadev Bhattiprolu, Taeung Song, Tommi Rantala, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92: > > Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170327 > > for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de: > > perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Handle inline functions in callchains (Jin Yao) > > - Enable sorting by srcline as key (Milian Wolff) > > Fixes: > > - Fix no_size logic in addr_filter__resolve_kernel_syms() in the > auxtrace code (Adrian Hunter) > > - Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo) > > - Fix divide by zero when calculating percent for an event in a group in > the annotate by source line code (Taeung Song) > > - build-id files now aren't anymore symlinks, their parent directories > are, so readlink the later (Taeung Song) > > - Assorted fixes for null termination problems, mostly related to > readlink, detected by valgrind (Tommi Rantala) > > Infrastructure: > > - Make vfs_getname probe point logic in 'perf trace' more robust > wrt length of pathname (Arnaldo Carvalho de Melo) > > - Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo) > > - Show 'perf list sdt' option in man page (Ravi Bangoria) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (1): > perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms() > > Arnaldo Carvalho de Melo (4): > perf trace: Check for vfs_getname.pathname length > perf trace: Fix up error path indentation > perf trace: Fixup thread refcounting > perf tools: Remove unused 'prefix' from builtin functions > > Jin Yao (5): > perf report: Refactor common code in srcline.c > perf report: Find the inline stack for a given address > perf report: Introduce --inline option > perf report: Show inline stack for stdio mode > perf report: Show inline stack for browser mode > > Milian Wolff (1): > perf report: Enable sorting by srcline as key > > Ravi Bangoria (1): > perf list sdt: Show option in man page > > Taeung Song (2): > perf annotate: Fix a bug following symbolic link of a build-id file > perf annotate: Fix a bug of division by zero when calculating percent > > Tommi Rantala (6): > perf buildid: Do not update SDT cache with null filename > perf buildid: Do not assume that readlink() returns a null terminated string > perf tests: Do not assume that readlink() returns a null terminated string > perf utils: use sizeof(buf) - 1 in readlink() call > perf utils: Null terminate buf in read_ftrace_printk() > perf utils: Readlink /proc/self/exe to find the perf binary > > tools/perf/Documentation/perf-list.txt | 4 +- > tools/perf/Documentation/perf-report.txt | 5 + > tools/perf/bench/bench.h | 20 +-- > tools/perf/bench/futex-hash.c | 3 +- > tools/perf/bench/futex-lock-pi.c | 3 +- > tools/perf/bench/futex-requeue.c | 3 +- > tools/perf/bench/futex-wake-parallel.c | 3 +- > tools/perf/bench/futex-wake.c | 3 +- > tools/perf/bench/mem-functions.c | 4 +- > tools/perf/bench/numa.c | 2 +- > tools/perf/bench/sched-messaging.c | 3 +- > tools/perf/bench/sched-pipe.c | 2 +- > tools/perf/builtin-annotate.c | 2 +- > tools/perf/builtin-bench.c | 12 +- > tools/perf/builtin-buildid-cache.c | 3 +- > tools/perf/builtin-buildid-list.c | 3 +- > tools/perf/builtin-c2c.c | 4 +- > tools/perf/builtin-config.c | 2 +- > tools/perf/builtin-data.c | 9 +- > tools/perf/builtin-diff.c | 2 +- > tools/perf/builtin-evlist.c | 2 +- > tools/perf/builtin-ftrace.c | 2 +- > tools/perf/builtin-help.c | 2 +- > tools/perf/builtin-inject.c | 2 +- > tools/perf/builtin-kallsyms.c | 2 +- > tools/perf/builtin-kmem.c | 4 +- > tools/perf/builtin-kvm.c | 16 +- > tools/perf/builtin-list.c | 2 +- > tools/perf/builtin-lock.c | 6 +- > tools/perf/builtin-mem.c | 6 +- > tools/perf/builtin-probe.c | 6 +- > tools/perf/builtin-record.c | 2 +- > tools/perf/builtin-report.c | 4 +- > tools/perf/builtin-sched.c | 6 +- > tools/perf/builtin-script.c | 4 +- > tools/perf/builtin-stat.c | 2 +- > tools/perf/builtin-timechart.c | 7 +- > tools/perf/builtin-top.c | 2 +- > tools/perf/builtin-trace.c | 25 ++-- > tools/perf/builtin-version.c | 3 +- > tools/perf/builtin.h | 58 ++++---- > tools/perf/perf.c | 11 +- > tools/perf/tests/builtin-test.c | 2 +- > tools/perf/tests/sdt.c | 2 +- > tools/perf/ui/browsers/hists.c | 181 ++++++++++++++++++++++- > tools/perf/ui/stdio/hist.c | 86 ++++++++++- > tools/perf/util/annotate.c | 23 ++- > tools/perf/util/auxtrace.c | 4 +- > tools/perf/util/build-id.c | 8 +- > tools/perf/util/callchain.c | 52 ++++++- > tools/perf/util/callchain.h | 3 +- > tools/perf/util/header.c | 8 +- > tools/perf/util/hist.c | 5 + > tools/perf/util/map.c | 3 +- > tools/perf/util/sort.c | 16 +- > tools/perf/util/sort.h | 1 + > tools/perf/util/srcline.c | 246 +++++++++++++++++++++++++++---- > tools/perf/util/symbol-elf.c | 5 + > tools/perf/util/symbol-minimal.c | 7 + > tools/perf/util/symbol.h | 5 +- > tools/perf/util/trace-event-read.c | 4 +- > tools/perf/util/util.h | 20 ++- > 62 files changed, 739 insertions(+), 208 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2017-03-28 5:46 UTC | newest] Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-07-05 15:44 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo 2012-07-05 15:44 ` [PATCH 01/20] tools lib traceevent: Let filtering numbers by string use function names Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 02/20] tools lib traceevent: Add support for "%.*s" in bprintk events Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 03/20] tools lib traceevent: Add support to show migrate disable counter Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 04/20] tools lib traceevent: Fix %pM print format arg handling Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 05/20] tools lib traceevent: Fix trace_printk for long integers Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 06/20] tools lib traceevent: Fix printk_cmp() Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 07/20] tools lib traceevent: Introduce extend_token() Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 08/20] tools lib traceevent: Handle strdup failure cases Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 09/20] tools lib traceevent: Handle realloc() failure path Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 10/20] tools lib traceevent: Pass string type argument to args Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 11/20] tools lib traceevent: Do not call add_event() again if allocation failed Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 12/20] tools lib traceevent: Fix some comments Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 13/20] tools lib traceevent: Check result of malloc() during reading token Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 14/20] tools lib traceevent: Check return value of arg_to_str() Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 15/20] tools lib traceevent: Add missing break in make_bprint_args Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 16/20] tools lib traceevent: Cleanup realloc use Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 17/20] perf test: Use ARRAY_SIZE in parse events tests Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 18/20] perf tools: Add empty rule for new line in event syntax parsing Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 19/20] perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens Arnaldo Carvalho de Melo 2012-07-05 15:45 ` [PATCH 20/20] perf tools: Split event symbols arrays to hw and sw parts Arnaldo Carvalho de Melo 2012-07-06 8:22 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar 2012-09-11 23:52 Arnaldo Carvalho de Melo 2012-09-13 15:15 ` Ingo Molnar 2013-12-13 15:11 Arnaldo Carvalho de Melo 2013-12-16 13:54 ` Ingo Molnar 2014-09-17 21:24 Arnaldo Carvalho de Melo 2014-09-19 5:15 ` Ingo Molnar 2015-03-03 3:25 Arnaldo Carvalho de Melo 2015-03-03 6:20 ` Ingo Molnar 2015-03-10 10:03 ` Ingo Molnar 2015-03-10 14:03 ` Arnaldo Carvalho de Melo 2015-03-10 14:37 ` Ingo Molnar 2016-12-05 21:37 Arnaldo Carvalho de Melo 2016-12-06 8:17 ` Ingo Molnar 2017-03-24 14:57 Arnaldo Carvalho de Melo 2017-03-24 18:39 ` Ingo Molnar 2017-03-28 1:38 Arnaldo Carvalho de Melo 2017-03-28 5:45 ` Ingo Molnar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).