* [GIT PULL 00/17] perf/core improvements and fixes @ 2012-09-05 23:08 Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 01/17] tools lib traceevent: Modify header to work in C++ programs Arnaldo Carvalho de Melo ` (16 more replies) 0 siblings, 17 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Ananth N. Mavinakayanahalli, David Ahern, Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Maciek Borzecki, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Robert Richter, Steven Rostedt, Suzuki K. Poulose, Arnaldo Carvalho de Melo The following changes since commit bab57e994d6311298b4e3915d2c75296cd81638c: Merge branch 'core' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/core (2012-09-05 08:29:56 +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 7a4ec938857cf534270b23545495300fbac7f5de: perf tools: Allow user to indicate path to objdump in command line (2012-09-05 19:41:55 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: 1) Rename libtraceevent 'private' struct member to 'priv' so that it works in C++, from Steven Rostedt 2) Remove lots of exit()/die() calls from tools so that the main perf exit routine can take place, from David Ahern 3) Fix x86 build on x86-64, from David Ahern. 4) Remove some headers that prevented perf from building on Android, from David Ahern 5) {int,str,rb}list fixes from Suzuki K Poulose 6) perf.data header fixes from Namhyung Kim 7) Replace needless mempcpy with memcpy, to allow build on Android, from Irina Tirdea 8) Allow user to indicate objdump path, needed in cross environments, from Maciek Borzecki Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- David Ahern (9): perf session: flush_sample_queue needs to handle errors from handlers perf tool: handle errors in synthesized event functions perf lock: Remove use of die and handle errors perf stat: Remove use of die/exit and handle errors perf help: Remove use of die and handle errors perf script: Remove use of die/exit perf record: Remove use of die/exit perf tools: Fix x86 builds with ARCH specified on the command line perf tools: remove unneeded include of network header files Irina Tirdea (1): perf tools: Replace mempcpy with memcpy Maciek Borzecki (1): perf tools: Allow user to indicate path to objdump in command line Namhyung Kim (3): perf header: Use evlist->nr_entries on write_event_desc() perf header: Set tracepoint event name only if not set perf header: Swap pmu mapping numbers if needed Steven Rostedt (1): tools lib traceevent: Modify header to work in C++ programs Suzuki K. Poulose (2): perf tools: Fix intlist node removal perf tools: Remove the node from rblist in strlist__remove tools/lib/traceevent/event-parse.h | 4 +- tools/perf/Documentation/perf-annotate.txt | 3 + tools/perf/Documentation/perf-report.txt | 3 + tools/perf/Makefile | 4 +- tools/perf/builtin-annotate.c | 2 + tools/perf/builtin-help.c | 48 ++++-- tools/perf/builtin-lock.c | 181 ++++++++++++++------ tools/perf/builtin-record.c | 158 +++++++++++------ tools/perf/builtin-report.c | 2 + tools/perf/builtin-script.c | 60 +++++-- tools/perf/builtin-stat.c | 7 +- tools/perf/util/annotate.c | 4 +- tools/perf/util/annotate.h | 1 + tools/perf/util/event.c | 35 +++- tools/perf/util/header.c | 13 +- tools/perf/util/intlist.c | 4 +- .../perf/util/scripting-engines/trace-event-perl.c | 8 +- tools/perf/util/session.c | 24 ++- tools/perf/util/strlist.c | 2 +- tools/perf/util/target.c | 4 +- tools/perf/util/util.h | 5 - 21 files changed, 389 insertions(+), 183 deletions(-) ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 01/17] tools lib traceevent: Modify header to work in C++ programs 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 02/17] perf session: flush_sample_queue needs to handle errors from handlers Arnaldo Carvalho de Melo ` (15 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Steven Rostedt, Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo From: Steven Rostedt <rostedt@goodmis.org> Replace keyword "private" to "priv" in event-parse.h to allow it to be used in C++ programs. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1345735321.5069.62.camel@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/traceevent/event-parse.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 527df03..863a0bb 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -49,7 +49,7 @@ struct pevent_record { int cpu; int ref_count; int locked; /* Do not free, even if ref_count is zero */ - void *private; + void *priv; #if DEBUG_RECORD struct pevent_record *prev; struct pevent_record *next; @@ -106,7 +106,7 @@ struct plugin_option { char *plugin_alias; char *description; char *value; - void *private; + void *priv; int set; }; -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 02/17] perf session: flush_sample_queue needs to handle errors from handlers 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 01/17] tools lib traceevent: Modify header to work in C++ programs Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 03/17] perf tool: handle errors in synthesized event functions Arnaldo Carvalho de Melo ` (14 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Allows errors to propogate through event processing code and back to commands. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-2-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/session.c | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index f7bb7ae..9453758 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -692,7 +692,7 @@ static int perf_session_deliver_event(struct perf_session *session, struct perf_tool *tool, u64 file_offset); -static void flush_sample_queue(struct perf_session *s, +static int flush_sample_queue(struct perf_session *s, struct perf_tool *tool) { struct ordered_samples *os = &s->ordered_samples; @@ -705,7 +705,7 @@ static void flush_sample_queue(struct perf_session *s, int ret; if (!tool->ordered_samples || !limit) - return; + return 0; list_for_each_entry_safe(iter, tmp, head, list) { if (iter->timestamp > limit) @@ -715,9 +715,12 @@ static void flush_sample_queue(struct perf_session *s, s->header.needs_swap); if (ret) pr_err("Can't parse sample, err = %d\n", ret); - else - perf_session_deliver_event(s, iter->event, &sample, tool, - iter->file_offset); + else { + ret = perf_session_deliver_event(s, iter->event, &sample, tool, + iter->file_offset); + if (ret) + return ret; + } os->last_flush = iter->timestamp; list_del(&iter->list); @@ -737,6 +740,8 @@ static void flush_sample_queue(struct perf_session *s, } os->nr_samples = 0; + + return 0; } /* @@ -782,10 +787,11 @@ static int process_finished_round(struct perf_tool *tool, union perf_event *event __used, struct perf_session *session) { - flush_sample_queue(session, tool); - session->ordered_samples.next_flush = session->ordered_samples.max_timestamp; + int ret = flush_sample_queue(session, tool); + if (!ret) + session->ordered_samples.next_flush = session->ordered_samples.max_timestamp; - return 0; + return ret; } /* The queue is ordered by time */ @@ -1443,7 +1449,7 @@ more: err = 0; /* do the final flush for ordered samples */ session->ordered_samples.next_flush = ULLONG_MAX; - flush_sample_queue(session, tool); + err = flush_sample_queue(session, tool); out_err: perf_session__warn_about_errors(session, tool); perf_session_free_sample_buffers(session); -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 03/17] perf tool: handle errors in synthesized event functions 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 01/17] tools lib traceevent: Modify header to work in C++ programs Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 02/17] perf session: flush_sample_queue needs to handle errors from handlers Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 04/17] perf lock: Remove use of die and handle errors Arnaldo Carvalho de Melo ` (13 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Handle error from process callback and propagate back to caller. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-3-git-send-email-dsahern@gmail.com Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/event.c | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 3a0f1a5..84ff6f1 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -120,7 +120,9 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool, if (!full) { event->comm.tid = pid; - process(tool, event, &synth_sample, machine); + if (process(tool, event, &synth_sample, machine) != 0) + return -1; + goto out; } @@ -151,7 +153,10 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool, event->comm.tid = pid; - process(tool, event, &synth_sample, machine); + if (process(tool, event, &synth_sample, machine) != 0) { + tgid = -1; + break; + } } closedir(tasks); @@ -167,6 +172,7 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, { char filename[PATH_MAX]; FILE *fp; + int rc = 0; snprintf(filename, sizeof(filename), "/proc/%d/maps", pid); @@ -231,18 +237,22 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, event->mmap.pid = tgid; event->mmap.tid = pid; - process(tool, event, &synth_sample, machine); + if (process(tool, event, &synth_sample, machine) != 0) { + rc = -1; + break; + } } } fclose(fp); - return 0; + return rc; } int perf_event__synthesize_modules(struct perf_tool *tool, perf_event__handler_t process, struct machine *machine) { + int rc = 0; struct rb_node *nd; struct map_groups *kmaps = &machine->kmaps; union perf_event *event = zalloc((sizeof(event->mmap) + @@ -284,11 +294,14 @@ int perf_event__synthesize_modules(struct perf_tool *tool, memcpy(event->mmap.filename, pos->dso->long_name, pos->dso->long_name_len + 1); - process(tool, event, &synth_sample, machine); + if (process(tool, event, &synth_sample, machine) != 0) { + rc = -1; + break; + } } free(event); - return 0; + return rc; } static int __event__synthesize_thread(union perf_event *comm_event, @@ -392,12 +405,16 @@ int perf_event__synthesize_threads(struct perf_tool *tool, if (*end) /* only interested in proper numerical dirents */ continue; - __event__synthesize_thread(comm_event, mmap_event, pid, 1, - process, tool, machine); + if (__event__synthesize_thread(comm_event, mmap_event, pid, 1, + process, tool, machine) != 0) { + err = -1; + goto out_closedir; + } } - closedir(proc); err = 0; +out_closedir: + closedir(proc); out_free_mmap: free(mmap_event); out_free_comm: -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 04/17] perf lock: Remove use of die and handle errors 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (2 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 03/17] perf tool: handle errors in synthesized event functions Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 05/17] perf stat: Remove use of die/exit " Arnaldo Carvalho de Melo ` (12 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Allows perf to clean up properly on exit. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-4-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-lock.c | 181 +++++++++++++++++++++++++++++++-------------- 1 files changed, 124 insertions(+), 57 deletions(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 585aae2..75153c8 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -161,8 +161,10 @@ static struct thread_stat *thread_stat_findnew_after_first(u32 tid) return st; st = zalloc(sizeof(struct thread_stat)); - if (!st) - die("memory allocation failed\n"); + if (!st) { + pr_err("memory allocation failed\n"); + return NULL; + } st->tid = tid; INIT_LIST_HEAD(&st->seq_list); @@ -181,8 +183,10 @@ static struct thread_stat *thread_stat_findnew_first(u32 tid) struct thread_stat *st; st = zalloc(sizeof(struct thread_stat)); - if (!st) - die("memory allocation failed\n"); + if (!st) { + pr_err("memory allocation failed\n"); + return NULL; + } st->tid = tid; INIT_LIST_HEAD(&st->seq_list); @@ -248,18 +252,20 @@ struct lock_key keys[] = { { NULL, NULL } }; -static void select_key(void) +static int select_key(void) { int i; for (i = 0; keys[i].name; i++) { if (!strcmp(keys[i].name, sort_key)) { compare = keys[i].key; - return; + return 0; } } - die("Unknown compare key:%s\n", sort_key); + pr_err("Unknown compare key: %s\n", sort_key); + + return -1; } static void insert_to_result(struct lock_stat *st, @@ -324,7 +330,8 @@ static struct lock_stat *lock_stat_findnew(void *addr, const char *name) return new; alloc_failed: - die("memory allocation failed\n"); + pr_err("memory allocation failed\n"); + return NULL; } static const char *input_name; @@ -356,16 +363,16 @@ struct trace_release_event { }; struct trace_lock_handler { - void (*acquire_event)(struct trace_acquire_event *, + int (*acquire_event)(struct trace_acquire_event *, const struct perf_sample *sample); - void (*acquired_event)(struct trace_acquired_event *, + int (*acquired_event)(struct trace_acquired_event *, const struct perf_sample *sample); - void (*contended_event)(struct trace_contended_event *, + int (*contended_event)(struct trace_contended_event *, const struct perf_sample *sample); - void (*release_event)(struct trace_release_event *, + int (*release_event)(struct trace_release_event *, const struct perf_sample *sample); }; @@ -379,8 +386,10 @@ static struct lock_seq_stat *get_seq(struct thread_stat *ts, void *addr) } seq = zalloc(sizeof(struct lock_seq_stat)); - if (!seq) - die("Not enough memory\n"); + if (!seq) { + pr_err("memory allocation failed\n"); + return NULL; + } seq->state = SEQ_STATE_UNINITIALIZED; seq->addr = addr; @@ -403,7 +412,7 @@ enum acquire_flags { READ_LOCK = 2, }; -static void +static int report_lock_acquire_event(struct trace_acquire_event *acquire_event, const struct perf_sample *sample) { @@ -412,11 +421,18 @@ report_lock_acquire_event(struct trace_acquire_event *acquire_event, struct lock_seq_stat *seq; ls = lock_stat_findnew(acquire_event->addr, acquire_event->name); + if (!ls) + return -1; if (ls->discard) - return; + return 0; ts = thread_stat_findnew(sample->tid); + if (!ts) + return -1; + seq = get_seq(ts, acquire_event->addr); + if (!seq) + return -1; switch (seq->state) { case SEQ_STATE_UNINITIALIZED: @@ -461,10 +477,10 @@ broken: ls->nr_acquire++; seq->prev_event_time = sample->time; end: - return; + return 0; } -static void +static int report_lock_acquired_event(struct trace_acquired_event *acquired_event, const struct perf_sample *sample) { @@ -475,16 +491,23 @@ report_lock_acquired_event(struct trace_acquired_event *acquired_event, u64 contended_term; ls = lock_stat_findnew(acquired_event->addr, acquired_event->name); + if (!ls) + return -1; if (ls->discard) - return; + return 0; ts = thread_stat_findnew(sample->tid); + if (!ts) + return -1; + seq = get_seq(ts, acquired_event->addr); + if (!seq) + return -1; switch (seq->state) { case SEQ_STATE_UNINITIALIZED: /* orphan event, do nothing */ - return; + return 0; case SEQ_STATE_ACQUIRING: break; case SEQ_STATE_CONTENDED: @@ -515,10 +538,10 @@ report_lock_acquired_event(struct trace_acquired_event *acquired_event, ls->nr_acquired++; seq->prev_event_time = timestamp; end: - return; + return 0; } -static void +static int report_lock_contended_event(struct trace_contended_event *contended_event, const struct perf_sample *sample) { @@ -527,16 +550,23 @@ report_lock_contended_event(struct trace_contended_event *contended_event, struct lock_seq_stat *seq; ls = lock_stat_findnew(contended_event->addr, contended_event->name); + if (!ls) + return -1; if (ls->discard) - return; + return 0; ts = thread_stat_findnew(sample->tid); + if (!ts) + return -1; + seq = get_seq(ts, contended_event->addr); + if (!seq) + return -1; switch (seq->state) { case SEQ_STATE_UNINITIALIZED: /* orphan event, do nothing */ - return; + return 0; case SEQ_STATE_ACQUIRING: break; case SEQ_STATE_RELEASED: @@ -559,10 +589,10 @@ report_lock_contended_event(struct trace_contended_event *contended_event, ls->nr_contended++; seq->prev_event_time = sample->time; end: - return; + return 0; } -static void +static int report_lock_release_event(struct trace_release_event *release_event, const struct perf_sample *sample) { @@ -571,11 +601,18 @@ report_lock_release_event(struct trace_release_event *release_event, struct lock_seq_stat *seq; ls = lock_stat_findnew(release_event->addr, release_event->name); + if (!ls) + return -1; if (ls->discard) - return; + return 0; ts = thread_stat_findnew(sample->tid); + if (!ts) + return -1; + seq = get_seq(ts, release_event->addr); + if (!seq) + return -1; switch (seq->state) { case SEQ_STATE_UNINITIALIZED: @@ -609,7 +646,7 @@ free_seq: list_del(&seq->list); free(seq); end: - return; + return 0; } /* lock oriented handlers */ @@ -623,13 +660,14 @@ static struct trace_lock_handler report_lock_ops = { static struct trace_lock_handler *trace_handler; -static void perf_evsel__process_lock_acquire(struct perf_evsel *evsel, +static int perf_evsel__process_lock_acquire(struct perf_evsel *evsel, struct perf_sample *sample) { struct trace_acquire_event acquire_event; struct event_format *event = evsel->tp_format; void *data = sample->raw_data; u64 tmp; /* this is required for casting... */ + int rc = 0; tmp = raw_field_value(event, "lockdep_addr", data); memcpy(&acquire_event.addr, &tmp, sizeof(void *)); @@ -637,70 +675,84 @@ static void perf_evsel__process_lock_acquire(struct perf_evsel *evsel, acquire_event.flag = (int)raw_field_value(event, "flag", data); if (trace_handler->acquire_event) - trace_handler->acquire_event(&acquire_event, sample); + rc = trace_handler->acquire_event(&acquire_event, sample); + + return rc; } -static void perf_evsel__process_lock_acquired(struct perf_evsel *evsel, +static int perf_evsel__process_lock_acquired(struct perf_evsel *evsel, struct perf_sample *sample) { struct trace_acquired_event acquired_event; struct event_format *event = evsel->tp_format; void *data = sample->raw_data; u64 tmp; /* this is required for casting... */ + int rc = 0; tmp = raw_field_value(event, "lockdep_addr", data); memcpy(&acquired_event.addr, &tmp, sizeof(void *)); acquired_event.name = (char *)raw_field_ptr(event, "name", data); - if (trace_handler->acquire_event) - trace_handler->acquired_event(&acquired_event, sample); + if (trace_handler->acquired_event) + rc = trace_handler->acquired_event(&acquired_event, sample); + + return rc; } -static void perf_evsel__process_lock_contended(struct perf_evsel *evsel, +static int perf_evsel__process_lock_contended(struct perf_evsel *evsel, struct perf_sample *sample) { struct trace_contended_event contended_event; struct event_format *event = evsel->tp_format; void *data = sample->raw_data; u64 tmp; /* this is required for casting... */ + int rc = 0; tmp = raw_field_value(event, "lockdep_addr", data); memcpy(&contended_event.addr, &tmp, sizeof(void *)); contended_event.name = (char *)raw_field_ptr(event, "name", data); - if (trace_handler->acquire_event) - trace_handler->contended_event(&contended_event, sample); + if (trace_handler->contended_event) + rc = trace_handler->contended_event(&contended_event, sample); + + return rc; } -static void perf_evsel__process_lock_release(struct perf_evsel *evsel, +static int perf_evsel__process_lock_release(struct perf_evsel *evsel, struct perf_sample *sample) { struct trace_release_event release_event; struct event_format *event = evsel->tp_format; void *data = sample->raw_data; u64 tmp; /* this is required for casting... */ + int rc = 0; tmp = raw_field_value(event, "lockdep_addr", data); memcpy(&release_event.addr, &tmp, sizeof(void *)); release_event.name = (char *)raw_field_ptr(event, "name", data); - if (trace_handler->acquire_event) - trace_handler->release_event(&release_event, sample); + if (trace_handler->release_event) + rc = trace_handler->release_event(&release_event, sample); + + return rc; } -static void perf_evsel__process_lock_event(struct perf_evsel *evsel, +static int perf_evsel__process_lock_event(struct perf_evsel *evsel, struct perf_sample *sample) { struct event_format *event = evsel->tp_format; + int rc = 0; if (!strcmp(event->name, "lock_acquire")) - perf_evsel__process_lock_acquire(evsel, sample); + rc = perf_evsel__process_lock_acquire(evsel, sample); if (!strcmp(event->name, "lock_acquired")) - perf_evsel__process_lock_acquired(evsel, sample); + rc = perf_evsel__process_lock_acquired(evsel, sample); if (!strcmp(event->name, "lock_contended")) - perf_evsel__process_lock_contended(evsel, sample); + rc = perf_evsel__process_lock_contended(evsel, sample); if (!strcmp(event->name, "lock_release")) - perf_evsel__process_lock_release(evsel, sample); + rc = perf_evsel__process_lock_release(evsel, sample); + + return rc; } static void print_bad_events(int bad, int total) @@ -802,14 +854,20 @@ static void dump_map(void) } } -static void dump_info(void) +static int dump_info(void) { + int rc = 0; + if (info_threads) dump_threads(); else if (info_map) dump_map(); - else - die("Unknown type of information\n"); + else { + rc = -1; + pr_err("Unknown type of information\n"); + } + + return rc; } static int process_sample_event(struct perf_tool *tool __used, @@ -826,8 +884,7 @@ static int process_sample_event(struct perf_tool *tool __used, return -1; } - perf_evsel__process_lock_event(evsel, sample); - return 0; + return perf_evsel__process_lock_event(evsel, sample); } static struct perf_tool eops = { @@ -839,8 +896,10 @@ static struct perf_tool eops = { static int read_events(void) { session = perf_session__new(input_name, O_RDONLY, 0, false, &eops); - if (!session) - die("Initializing perf session failed\n"); + if (!session) { + pr_err("Initializing perf session failed\n"); + return -1; + } return perf_session__process_events(session, &eops); } @@ -857,13 +916,18 @@ static void sort_result(void) } } -static void __cmd_report(void) +static int __cmd_report(void) { setup_pager(); - select_key(); - read_events(); + + if ((select_key() != 0) || + (read_events() != 0)) + return -1; + sort_result(); print_result(); + + return 0; } static const char * const report_usage[] = { @@ -959,6 +1023,7 @@ static int __cmd_record(int argc, const char **argv) int cmd_lock(int argc, const char **argv, const char *prefix __used) { unsigned int i; + int rc = 0; symbol__init(); for (i = 0; i < LOCKHASH_SIZE; i++) @@ -993,11 +1058,13 @@ int cmd_lock(int argc, const char **argv, const char *prefix __used) /* recycling report_lock_ops */ trace_handler = &report_lock_ops; setup_pager(); - read_events(); - dump_info(); + if (read_events() != 0) + rc = -1; + else + rc = dump_info(); } else { usage_with_options(lock_usage, lock_options); } - return 0; + return rc; } -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 05/17] perf stat: Remove use of die/exit and handle errors 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (3 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 04/17] perf lock: Remove use of die and handle errors Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 06/17] perf help: Remove use of die " Arnaldo Carvalho de Melo ` (11 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Allows perf to clean up properly on program termination. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-5-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d53d8ab..02f49eb 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -428,7 +428,7 @@ static int run_perf_stat(int argc __used, const char **argv) if (forks && (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0)) { perror("failed to create pipes"); - exit(1); + return -1; } if (forks) { @@ -510,7 +510,8 @@ static int run_perf_stat(int argc __used, const char **argv) } if (child_pid != -1) kill(child_pid, SIGTERM); - die("Not all events could be opened.\n"); + + pr_err("Not all events could be opened.\n"); return -1; } counter->supported = true; @@ -1189,7 +1190,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used) output = fopen(output_name, mode); if (!output) { perror("failed to create output file"); - exit(-1); + return -1; } clock_gettime(CLOCK_REALTIME, &tm); fprintf(output, "# started on %s\n", ctime(&tm.tv_sec)); -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 06/17] perf help: Remove use of die and handle errors 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (4 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 05/17] perf stat: Remove use of die/exit " Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 07/17] perf script: Remove use of die/exit Arnaldo Carvalho de Melo ` (10 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Allows perf to clean up properly on exit. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-6-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-help.c | 48 +++++++++++++++++++++++++++++++------------- 1 files changed, 34 insertions(+), 14 deletions(-) diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 6d5a8a7..f9daae5 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -24,13 +24,14 @@ static struct man_viewer_info_list { } *man_viewer_info_list; enum help_format { + HELP_FORMAT_NONE, HELP_FORMAT_MAN, HELP_FORMAT_INFO, HELP_FORMAT_WEB, }; static bool show_all = false; -static enum help_format help_format = HELP_FORMAT_MAN; +static enum help_format help_format = HELP_FORMAT_NONE; static struct option builtin_help_options[] = { OPT_BOOLEAN('a', "all", &show_all, "print all available commands"), OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN), @@ -54,7 +55,9 @@ static enum help_format parse_help_format(const char *format) return HELP_FORMAT_INFO; if (!strcmp(format, "web") || !strcmp(format, "html")) return HELP_FORMAT_WEB; - die("unrecognized help format '%s'", format); + + pr_err("unrecognized help format '%s'", format); + return HELP_FORMAT_NONE; } static const char *get_man_viewer_info(const char *name) @@ -259,6 +262,8 @@ static int perf_help_config(const char *var, const char *value, void *cb) if (!value) return config_error_nonbool(var); help_format = parse_help_format(value); + if (help_format == HELP_FORMAT_NONE) + return -1; return 0; } if (!strcmp(var, "man.viewer")) { @@ -352,7 +357,7 @@ static void exec_viewer(const char *name, const char *page) warning("'%s': unknown man viewer.", name); } -static void show_man_page(const char *perf_cmd) +static int show_man_page(const char *perf_cmd) { struct man_viewer_list *viewer; const char *page = cmd_to_page(perf_cmd); @@ -365,28 +370,35 @@ static void show_man_page(const char *perf_cmd) if (fallback) exec_viewer(fallback, page); exec_viewer("man", page); - die("no man viewer handled the request"); + + pr_err("no man viewer handled the request"); + return -1; } -static void show_info_page(const char *perf_cmd) +static int show_info_page(const char *perf_cmd) { const char *page = cmd_to_page(perf_cmd); setenv("INFOPATH", system_path(PERF_INFO_PATH), 1); execlp("info", "info", "perfman", page, NULL); + return -1; } -static void get_html_page_path(struct strbuf *page_path, const char *page) +static int get_html_page_path(struct strbuf *page_path, const char *page) { struct stat st; const char *html_path = system_path(PERF_HTML_PATH); /* Check that we have a perf documentation directory. */ if (stat(mkpath("%s/perf.html", html_path), &st) - || !S_ISREG(st.st_mode)) - die("'%s': not a documentation directory.", html_path); + || !S_ISREG(st.st_mode)) { + pr_err("'%s': not a documentation directory.", html_path); + return -1; + } strbuf_init(page_path, 0); strbuf_addf(page_path, "%s/%s.html", html_path, page); + + return 0; } /* @@ -401,19 +413,23 @@ static void open_html(const char *path) } #endif -static void show_html_page(const char *perf_cmd) +static int show_html_page(const char *perf_cmd) { const char *page = cmd_to_page(perf_cmd); struct strbuf page_path; /* it leaks but we exec bellow */ - get_html_page_path(&page_path, page); + if (get_html_page_path(&page_path, page) != 0) + return -1; open_html(page_path.buf); + + return 0; } int cmd_help(int argc, const char **argv, const char *prefix __used) { const char *alias; + int rc = 0; load_command_list("perf-", &main_cmds, &other_cmds); @@ -444,16 +460,20 @@ int cmd_help(int argc, const char **argv, const char *prefix __used) switch (help_format) { case HELP_FORMAT_MAN: - show_man_page(argv[0]); + rc = show_man_page(argv[0]); break; case HELP_FORMAT_INFO: - show_info_page(argv[0]); + rc = show_info_page(argv[0]); break; case HELP_FORMAT_WEB: - show_html_page(argv[0]); + rc = show_html_page(argv[0]); + break; + case HELP_FORMAT_NONE: + /* fall-through */ default: + rc = -1; break; } - return 0; + return rc; } -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 07/17] perf script: Remove use of die/exit 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (5 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 06/17] perf help: Remove use of die " Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 08/17] perf record: " Arnaldo Carvalho de Melo ` (9 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Allows perf to clean up properly on exit. Only exits left are exec failures which are appropriate and usage callbacks that list available options. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-7-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 60 +++++++++++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 19 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 2d6e3b2..c350cfe 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1153,18 +1153,23 @@ static const struct option options[] = { OPT_END() }; -static bool have_cmd(int argc, const char **argv) +static int have_cmd(int argc, const char **argv) { char **__argv = malloc(sizeof(const char *) * argc); - if (!__argv) - die("malloc"); + if (!__argv) { + pr_err("malloc failed\n"); + return -1; + } + memcpy(__argv, argv, sizeof(const char *) * argc); argc = parse_options(argc, (const char **)__argv, record_options, NULL, PARSE_OPT_STOP_AT_NON_OPTION); free(__argv); - return argc != 0; + system_wide = (argc == 0); + + return 0; } int cmd_script(int argc, const char **argv, const char *prefix __used) @@ -1231,13 +1236,13 @@ int cmd_script(int argc, const char **argv, const char *prefix __used) if (pipe(live_pipe) < 0) { perror("failed to create pipe"); - exit(-1); + return -1; } pid = fork(); if (pid < 0) { perror("failed to fork"); - exit(-1); + return -1; } if (!pid) { @@ -1249,13 +1254,18 @@ int cmd_script(int argc, const char **argv, const char *prefix __used) if (is_top_script(argv[0])) { system_wide = true; } else if (!system_wide) { - system_wide = !have_cmd(argc - rep_args, - &argv[rep_args]); + if (have_cmd(argc - rep_args, &argv[rep_args]) != 0) { + err = -1; + goto out; + } } __argv = malloc((argc + 6) * sizeof(const char *)); - if (!__argv) - die("malloc"); + if (!__argv) { + pr_err("malloc failed\n"); + err = -ENOMEM; + goto out; + } __argv[j++] = "/bin/sh"; __argv[j++] = rec_script_path; @@ -1277,8 +1287,12 @@ int cmd_script(int argc, const char **argv, const char *prefix __used) close(live_pipe[1]); __argv = malloc((argc + 4) * sizeof(const char *)); - if (!__argv) - die("malloc"); + if (!__argv) { + pr_err("malloc failed\n"); + err = -ENOMEM; + goto out; + } + j = 0; __argv[j++] = "/bin/sh"; __argv[j++] = rep_script_path; @@ -1303,12 +1317,20 @@ int cmd_script(int argc, const char **argv, const char *prefix __used) if (!rec_script_path) system_wide = false; - else if (!system_wide) - system_wide = !have_cmd(argc - 1, &argv[1]); + else if (!system_wide) { + if (have_cmd(argc - 1, &argv[1]) != 0) { + err = -1; + goto out; + } + } __argv = malloc((argc + 2) * sizeof(const char *)); - if (!__argv) - die("malloc"); + if (!__argv) { + pr_err("malloc failed\n"); + err = -ENOMEM; + goto out; + } + __argv[j++] = "/bin/sh"; __argv[j++] = script_path; if (system_wide) @@ -1357,18 +1379,18 @@ int cmd_script(int argc, const char **argv, const char *prefix __used) input = open(session->filename, O_RDONLY); /* input_name */ if (input < 0) { perror("failed to open file"); - exit(-1); + return -1; } err = fstat(input, &perf_stat); if (err < 0) { perror("failed to stat file"); - exit(-1); + return -1; } if (!perf_stat.st_size) { fprintf(stderr, "zero-sized file, nothing to do!\n"); - exit(0); + return 0; } scripting_ops = script_spec__lookup(generate_script_lang); -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 08/17] perf record: Remove use of die/exit 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (6 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 07/17] perf script: Remove use of die/exit Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 09/17] perf tools: Fix x86 builds with ARCH specified on the command line Arnaldo Carvalho de Melo ` (8 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> Allows perf to clean up properly on exit. If perf-record is exiting due to failure, the on_exit should not run as the session has been deleted. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346005487-62961-8-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 158 +++++++++++++++++++++++++++++------------- 1 files changed, 109 insertions(+), 49 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 479ff2a..7b8b891 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -71,19 +71,23 @@ static void advance_output(struct perf_record *rec, size_t size) rec->bytes_written += size; } -static void write_output(struct perf_record *rec, void *buf, size_t size) +static int write_output(struct perf_record *rec, void *buf, size_t size) { while (size) { int ret = write(rec->output, buf, size); - if (ret < 0) - die("failed to write"); + if (ret < 0) { + pr_err("failed to write\n"); + return -1; + } size -= ret; buf += ret; rec->bytes_written += ret; } + + return 0; } static int process_synthesized_event(struct perf_tool *tool, @@ -92,11 +96,13 @@ static int process_synthesized_event(struct perf_tool *tool, struct machine *machine __used) { struct perf_record *rec = container_of(tool, struct perf_record, tool); - write_output(rec, event, event->header.size); + if (write_output(rec, event, event->header.size) < 0) + return -1; + return 0; } -static void perf_record__mmap_read(struct perf_record *rec, +static int perf_record__mmap_read(struct perf_record *rec, struct perf_mmap *md) { unsigned int head = perf_mmap__read_head(md); @@ -104,9 +110,10 @@ static void perf_record__mmap_read(struct perf_record *rec, unsigned char *data = md->base + rec->page_size; unsigned long size; void *buf; + int rc = 0; if (old == head) - return; + return 0; rec->samples++; @@ -117,17 +124,26 @@ static void perf_record__mmap_read(struct perf_record *rec, size = md->mask + 1 - (old & md->mask); old += size; - write_output(rec, buf, size); + if (write_output(rec, buf, size) < 0) { + rc = -1; + goto out; + } } buf = &data[old & md->mask]; size = head - old; old += size; - write_output(rec, buf, size); + if (write_output(rec, buf, size) < 0) { + rc = -1; + goto out; + } md->prev = old; perf_mmap__write_tail(md, old); + +out: + return rc; } static volatile int done = 0; @@ -183,12 +199,13 @@ static bool perf_evlist__equal(struct perf_evlist *evlist, return true; } -static void perf_record__open(struct perf_record *rec) +static int perf_record__open(struct perf_record *rec) { struct perf_evsel *pos; struct perf_evlist *evlist = rec->evlist; struct perf_session *session = rec->session; struct perf_record_opts *opts = &rec->opts; + int rc = 0; perf_evlist__config_attrs(evlist, opts); @@ -222,10 +239,13 @@ try_again: if (err == EPERM || err == EACCES) { ui__error_paranoid(); - exit(EXIT_FAILURE); + rc = -err; + goto out; } else if (err == ENODEV && opts->target.cpu_list) { - die("No such device - did you specify" - " an out-of-range profile CPU?\n"); + pr_err("No such device - did you specify" + " an out-of-range profile CPU?\n"); + rc = -err; + goto out; } else if (err == EINVAL) { if (!opts->exclude_guest_missing && (attr->exclude_guest || attr->exclude_host)) { @@ -272,7 +292,8 @@ try_again: if (err == ENOENT) { ui__error("The %s event is not supported.\n", perf_evsel__name(pos)); - exit(EXIT_FAILURE); + rc = -err; + goto out; } printf("\n"); @@ -280,34 +301,46 @@ try_again: err, strerror(err)); #if defined(__i386__) || defined(__x86_64__) - if (attr->type == PERF_TYPE_HARDWARE && err == EOPNOTSUPP) - die("No hardware sampling interrupt available." - " No APIC? If so then you can boot the kernel" - " with the \"lapic\" boot parameter to" - " force-enable it.\n"); + if (attr->type == PERF_TYPE_HARDWARE && + err == EOPNOTSUPP) { + pr_err("No hardware sampling interrupt available." + " No APIC? If so then you can boot the kernel" + " with the \"lapic\" boot parameter to" + " force-enable it.\n"); + rc = -err; + goto out; + } #endif - die("No CONFIG_PERF_EVENTS=y kernel support configured?\n"); + pr_err("No CONFIG_PERF_EVENTS=y kernel support configured?\n"); + rc = -err; + goto out; } } if (perf_evlist__set_filters(evlist)) { error("failed to set filter with %d (%s)\n", errno, strerror(errno)); - exit(-1); + rc = -1; + goto out; } if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) { - if (errno == EPERM) - die("Permission error mapping pages.\n" - "Consider increasing " - "/proc/sys/kernel/perf_event_mlock_kb,\n" - "or try again with a smaller value of -m/--mmap_pages.\n" - "(current value: %d)\n", opts->mmap_pages); - else if (!is_power_of_2(opts->mmap_pages)) - die("--mmap_pages/-m value must be a power of two."); - - die("failed to mmap with %d (%s)\n", errno, strerror(errno)); + if (errno == EPERM) { + pr_err("Permission error mapping pages.\n" + "Consider increasing " + "/proc/sys/kernel/perf_event_mlock_kb,\n" + "or try again with a smaller value of -m/--mmap_pages.\n" + "(current value: %d)\n", opts->mmap_pages); + rc = -errno; + } else if (!is_power_of_2(opts->mmap_pages)) { + pr_err("--mmap_pages/-m value must be a power of two."); + rc = -EINVAL; + } else { + pr_err("failed to mmap with %d (%s)\n", errno, strerror(errno)); + rc = -errno; + } + goto out; } if (rec->file_new) @@ -315,11 +348,14 @@ try_again: else { if (!perf_evlist__equal(session->evlist, evlist)) { fprintf(stderr, "incompatible append\n"); - exit(-1); + rc = -1; + goto out; } } perf_session__set_id_hdr_size(session); +out: + return rc; } static int process_buildids(struct perf_record *rec) @@ -335,10 +371,13 @@ static int process_buildids(struct perf_record *rec) size, &build_id__mark_dso_hit_ops); } -static void perf_record__exit(int status __used, void *arg) +static void perf_record__exit(int status, void *arg) { struct perf_record *rec = arg; + if (status != 0) + return; + if (!rec->opts.pipe_output) { rec->session->header.data_size += rec->bytes_written; @@ -393,17 +432,26 @@ static struct perf_event_header finished_round_event = { .type = PERF_RECORD_FINISHED_ROUND, }; -static void perf_record__mmap_read_all(struct perf_record *rec) +static int perf_record__mmap_read_all(struct perf_record *rec) { int i; + int rc = 0; for (i = 0; i < rec->evlist->nr_mmaps; i++) { - if (rec->evlist->mmap[i].base) - perf_record__mmap_read(rec, &rec->evlist->mmap[i]); + if (rec->evlist->mmap[i].base) { + if (perf_record__mmap_read(rec, &rec->evlist->mmap[i]) != 0) { + rc = -1; + goto out; + } + } } if (perf_header__has_feat(&rec->session->header, HEADER_TRACING_DATA)) - write_output(rec, &finished_round_event, sizeof(finished_round_event)); + rc = write_output(rec, &finished_round_event, + sizeof(finished_round_event)); + +out: + return rc; } static int __cmd_record(struct perf_record *rec, int argc, const char **argv) @@ -463,7 +511,7 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) output = open(output_name, flags, S_IRUSR | S_IWUSR); if (output < 0) { perror("failed to create output file"); - exit(-1); + return -1; } rec->output = output; @@ -503,7 +551,10 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) } } - perf_record__open(rec); + if (perf_record__open(rec) != 0) { + err = -1; + goto out_delete_session; + } /* * perf_session__delete(session) will be called at perf_record__exit() @@ -513,19 +564,20 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) if (opts->pipe_output) { err = perf_header__write_pipe(output); if (err < 0) - return err; + goto out_delete_session; } else if (rec->file_new) { err = perf_session__write_header(session, evsel_list, output, false); if (err < 0) - return err; + goto out_delete_session; } if (!rec->no_buildid && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) { pr_err("Couldn't generate buildids. " "Use --no-buildid to profile anyway.\n"); - return -1; + err = -1; + goto out_delete_session; } rec->post_processing_offset = lseek(output, 0, SEEK_CUR); @@ -533,7 +585,8 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) machine = perf_session__find_host_machine(session); if (!machine) { pr_err("Couldn't find native kernel information.\n"); - return -1; + err = -1; + goto out_delete_session; } if (opts->pipe_output) { @@ -541,14 +594,14 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) process_synthesized_event); if (err < 0) { pr_err("Couldn't synthesize attrs.\n"); - return err; + goto out_delete_session; } err = perf_event__synthesize_event_types(tool, process_synthesized_event, machine); if (err < 0) { pr_err("Couldn't synthesize event_types.\n"); - return err; + goto out_delete_session; } if (have_tracepoints(&evsel_list->entries)) { @@ -564,7 +617,7 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) process_synthesized_event); if (err <= 0) { pr_err("Couldn't record tracing data.\n"); - return err; + goto out_delete_session; } advance_output(rec, err); } @@ -592,20 +645,24 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) perf_event__synthesize_guest_os); if (!opts->target.system_wide) - perf_event__synthesize_thread_map(tool, evsel_list->threads, + err = perf_event__synthesize_thread_map(tool, evsel_list->threads, process_synthesized_event, machine); else - perf_event__synthesize_threads(tool, process_synthesized_event, + err = perf_event__synthesize_threads(tool, process_synthesized_event, machine); + if (err != 0) + goto out_delete_session; + if (rec->realtime_prio) { struct sched_param param; param.sched_priority = rec->realtime_prio; if (sched_setscheduler(0, SCHED_FIFO, ¶m)) { pr_err("Could not set realtime priority.\n"); - exit(-1); + err = -1; + goto out_delete_session; } } @@ -620,7 +677,10 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) for (;;) { int hits = rec->samples; - perf_record__mmap_read_all(rec); + if (perf_record__mmap_read_all(rec) < 0) { + err = -1; + goto out_delete_session; + } if (hits == rec->samples) { if (done) -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 09/17] perf tools: Fix x86 builds with ARCH specified on the command line 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (7 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 08/17] perf record: " Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 10/17] perf tools: Fix intlist node removal Arnaldo Carvalho de Melo ` (7 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> e.g., compiling i386 on x86_64 using: $ make -C tools/perf ARCH=i386 fails with: CC /tmp/pbuild/util/evsel.o In file included from util/evsel.c:21:0: util/perf_regs.h:5:23: fatal error: perf_regs.h: No such file or directory compilation terminated. Adding V=1 you see that the include argument for the arch is '-Iarch/i386/include' is wrong. It is supposed to be -Iarch/x86/include per the redefinition of ARCH in the Makefile. According to the make manual, http://www.gnu.org/software/make/manual/make.html#Override-Directive: "If a variable has been set with a command argument (see Overriding Variables), then ordinary assignments in the makefile are ignored. If you want to set the variable in the makefile even though it was set with a command argument, you can use an override directive ..." Make it so. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346094354-74356-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 722ddee..939cf6d 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -64,12 +64,12 @@ AR = $(CROSS_COMPILE)ar # Additional ARCH settings for x86 ifeq ($(ARCH),i386) - ARCH := x86 + override ARCH := x86 NO_PERF_REGS := 0 LIBUNWIND_LIBS = -lunwind -lunwind-x86 endif ifeq ($(ARCH),x86_64) - ARCH := x86 + override ARCH := x86 IS_X86_64 := 0 ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 10/17] perf tools: Fix intlist node removal 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (8 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 09/17] perf tools: Fix x86 builds with ARCH specified on the command line Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove Arnaldo Carvalho de Melo ` (6 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Suzuki K. Poulose, David Ahern, Arnaldo Carvalho de Melo From: Suzuki K. Poulose <suzuki@in.ibm.com> Similar to the one in : https://lkml.org/lkml/2012/8/29/27 Make sure we remove the node from the rblist before we delete the node. The rblist__remove_node() will invoke rblist->node_delete, which will take care of deleting the node with the suitable function provided by the user. Signed-off-by: Suzuki K Poulose <suzuki@in.ibm.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Suzuki K Poulose <suzuki@in.ibm.com> Link: http://lkml.kernel.org/r/20120831065840.5167.90318.stgit@suzukikp.in.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/intlist.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/intlist.c b/tools/perf/util/intlist.c index fd530dc..77c504f 100644 --- a/tools/perf/util/intlist.c +++ b/tools/perf/util/intlist.c @@ -52,9 +52,9 @@ int intlist__add(struct intlist *ilist, int i) return rblist__add_node(&ilist->rblist, (void *)((long)i)); } -void intlist__remove(struct intlist *ilist __used, struct int_node *node) +void intlist__remove(struct intlist *ilist, struct int_node *node) { - int_node__delete(node); + rblist__remove_node(&ilist->rblist, &node->rb_node); } struct int_node *intlist__find(struct intlist *ilist, int i) -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (9 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 10/17] perf tools: Fix intlist node removal Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:32 ` David Ahern 2012-09-05 23:08 ` [PATCH 12/17] perf tools: remove unneeded include of network header files Arnaldo Carvalho de Melo ` (5 subsequent siblings) 16 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Suzuki K. Poulose, Ananth N Mavinakayanahalli, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo From: Suzuki K. Poulose <suzuki@in.ibm.com> The following commit: author David Ahern <dsahern@gmail.com> Tue, 31 Jul 2012 04:31:33 +0000 (22:31 -0600) committer Arnaldo Carvalho de Melo <acme@redhat.com> Fri, 3 Aug 2012 13:39:51 +0000 (10:39 -0300) commit ee8dd3ca43f151d9fbe1edeef68fb8a77eb9f047 causes a double free during a probe deletion as the node is never removed from the list via strlist__remove(), even though it gets 'deleted' (read free()'d). This causes a double free when we do strlist__delete() as the node is already deleted but present in the rblist. [suzukikp@suzukikp perf]$ sudo ./perf probe -a do_fork Added new event: probe:do_fork (on do_fork) You can now use it in all perf tools, such as: perf record -e probe:do_fork -aR sleep 1 [suzukikp@suzukikp perf]$ sudo ./perf probe -d do_fork Removed event: probe:do_fork *** glibc detected *** ./perf: double free or corruption (fasttop): 0x000000000133d600 *** ======= Backtrace: ========= /lib64/libc.so.6[0x38eec7dda6] ./perf(rblist__delete+0x5c)[0x47d3dc] ./perf(del_perf_probe_events+0xb6)[0x47b826] ./perf(cmd_probe+0x471)[0x42c8d1] ./perf[0x4150b3] ./perf(main+0x501)[0x4148e1] /lib64/libc.so.6(__libc_start_main+0xed)[0x38eec2169d] ./perf[0x414a61] Make sure we remove the node from the rblist before we delete the node. The rblist__remove_node() will invoke rblist->node_delete, which will take care of deleting the node with the suitable function provided by the user. Reported-by: Ananth N. Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120829055840.7802.1459.stgit@suzukikp.in.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/strlist.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c index 95856ff..155d8b7 100644 --- a/tools/perf/util/strlist.c +++ b/tools/perf/util/strlist.c @@ -93,7 +93,7 @@ out: void strlist__remove(struct strlist *slist, struct str_node *snode) { - str_node__delete(snode, slist->dupstr); + rblist__remove_node(&slist->rblist, &snode->rb_node); } struct str_node *strlist__find(struct strlist *slist, const char *entry) -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove 2012-09-05 23:08 ` [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove Arnaldo Carvalho de Melo @ 2012-09-05 23:32 ` David Ahern 0 siblings, 0 replies; 35+ messages in thread From: David Ahern @ 2012-09-05 23:32 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Ingo Molnar, linux-kernel, Suzuki K. Poulose, Ananth N Mavinakayanahalli, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo This one needs to go through urgent. On 9/5/12 5:08 PM, Arnaldo Carvalho de Melo wrote: > From: Suzuki K. Poulose <suzuki@in.ibm.com> > > The following commit: > > author David Ahern <dsahern@gmail.com> > Tue, 31 Jul 2012 04:31:33 +0000 (22:31 -0600) > committer Arnaldo Carvalho de Melo <acme@redhat.com> > Fri, 3 Aug 2012 13:39:51 +0000 (10:39 -0300) > commit ee8dd3ca43f151d9fbe1edeef68fb8a77eb9f047 > > causes a double free during a probe deletion as the node is never > removed from the list via strlist__remove(), even though it gets > 'deleted' (read free()'d). This causes a double free when we do > strlist__delete() as the node is already deleted but present in the > rblist. > > [suzukikp@suzukikp perf]$ sudo ./perf probe -a do_fork > Added new event: > probe:do_fork (on do_fork) > > You can now use it in all perf tools, such as: > > perf record -e probe:do_fork -aR sleep 1 > > [suzukikp@suzukikp perf]$ sudo ./perf probe -d do_fork > Removed event: probe:do_fork > *** glibc detected *** ./perf: double free or corruption (fasttop): 0x000000000133d600 *** > ======= Backtrace: ========= > /lib64/libc.so.6[0x38eec7dda6] > ./perf(rblist__delete+0x5c)[0x47d3dc] > ./perf(del_perf_probe_events+0xb6)[0x47b826] > ./perf(cmd_probe+0x471)[0x42c8d1] > ./perf[0x4150b3] > ./perf(main+0x501)[0x4148e1] > /lib64/libc.so.6(__libc_start_main+0xed)[0x38eec2169d] > ./perf[0x414a61] > > Make sure we remove the node from the rblist before we delete the node. > The rblist__remove_node() will invoke rblist->node_delete, which will > take care of deleting the node with the suitable function provided by > the user. > > Reported-by: Ananth N. Mavinakayanahalli <ananth@in.ibm.com> > Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com> > Acked-by: David Ahern <dsahern@gmail.com> > Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> > Cc: David Ahern <dsahern@gmail.com> > Cc: Frederic Weisbecker <fweisbec@gmail.com> > Cc: Ingo Molnar <mingo@kernel.org> > Cc: Jiri Olsa <jolsa@redhat.com> > Cc: Namhyung Kim <namhyung@kernel.org> > Cc: Peter Zijlstra <peterz@infradead.org> > Link: http://lkml.kernel.org/r/20120829055840.7802.1459.stgit@suzukikp.in.ibm.com > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > --- > tools/perf/util/strlist.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c > index 95856ff..155d8b7 100644 > --- a/tools/perf/util/strlist.c > +++ b/tools/perf/util/strlist.c > @@ -93,7 +93,7 @@ out: > > void strlist__remove(struct strlist *slist, struct str_node *snode) > { > - str_node__delete(snode, slist->dupstr); > + rblist__remove_node(&slist->rblist, &snode->rb_node); > } > > struct str_node *strlist__find(struct strlist *slist, const char *entry) > ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 12/17] perf tools: remove unneeded include of network header files 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (10 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 13/17] perf header: Use evlist->nr_entries on write_event_desc() Arnaldo Carvalho de Melo ` (4 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo From: David Ahern <dsahern@gmail.com> perf does not have networking related functionality, and the inclusion of these headers is one of the causes of compile failures for Android: https://lkml.org/lkml/2012/8/23/316 https://lkml.org/lkml/2012/8/28/293 So, remove them. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346255732-93246-1-git-send-email-dsahern@gmail.com [ committer note: fix trace-event-perl.c compile failure by reordering includes ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../perf/util/scripting-engines/trace-event-perl.c | 8 ++++---- tools/perf/util/util.h | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index d280010..94e6736 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -25,16 +25,16 @@ #include <ctype.h> #include <errno.h> -#include "../../perf.h" #include "../util.h" +#include <EXTERN.h> +#include <perl.h> + +#include "../../perf.h" #include "../thread.h" #include "../event.h" #include "../trace-event.h" #include "../evsel.h" -#include <EXTERN.h> -#include <perl.h> - void boot_Perf__Trace__Context(pTHX_ CV *cv); void boot_DynaLoader(pTHX_ CV *cv); typedef PerlInterpreter * INTERP; diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 00a93a9..67a3713 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -69,11 +69,6 @@ #include <sys/poll.h> #include <sys/socket.h> #include <sys/ioctl.h> -#include <sys/select.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <arpa/inet.h> -#include <netdb.h> #include <inttypes.h> #include "../../../include/linux/magic.h" #include "types.h" -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 13/17] perf header: Use evlist->nr_entries on write_event_desc() 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (11 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 12/17] perf tools: remove unneeded include of network header files Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 14/17] perf header: Set tracepoint event name only if not set Arnaldo Carvalho de Melo ` (3 subsequent siblings) 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung.kim@lge.com> Number of events (evsels) in a evlist is kept on nr_entries field so that we don't need to recalculate it. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1346821373-31621-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/header.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 9696e64..a124b93 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -610,11 +610,10 @@ static int write_event_desc(int fd, struct perf_header *h __used, struct perf_evlist *evlist) { struct perf_evsel *evsel; - u32 nre = 0, nri, sz; + u32 nre, nri, sz; int ret; - list_for_each_entry(evsel, &evlist->entries, node) - nre++; + nre = evlist->nr_entries; /* * write number of events -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 14/17] perf header: Set tracepoint event name only if not set 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (12 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 13/17] perf header: Use evlist->nr_entries on write_event_desc() Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-06 0:01 ` David Ahern 2012-09-05 23:08 ` [PATCH 15/17] perf header: Swap pmu mapping numbers if needed Arnaldo Carvalho de Melo ` (2 subsequent siblings) 16 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung.kim@lge.com> The event name can be set already by processing a event_desc data. So check it before setting to prevent possible leak. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1346821373-31621-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/header.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index a124b93..05c9310 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2314,7 +2314,7 @@ static int perf_evlist__set_tracepoint_names(struct perf_evlist *evlist, struct perf_evsel *pos; list_for_each_entry(pos, &evlist->entries, node) { - if (pos->attr.type == PERF_TYPE_TRACEPOINT && + if (pos->attr.type == PERF_TYPE_TRACEPOINT && !pos->name && perf_evsel__set_tracepoint_name(pos, pevent)) return -1; } -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 14/17] perf header: Set tracepoint event name only if not set 2012-09-05 23:08 ` [PATCH 14/17] perf header: Set tracepoint event name only if not set Arnaldo Carvalho de Melo @ 2012-09-06 0:01 ` David Ahern 2012-09-06 1:30 ` Namhyung Kim 0 siblings, 1 reply; 35+ messages in thread From: David Ahern @ 2012-09-06 0:01 UTC (permalink / raw) To: Arnaldo Carvalho de Melo, Namhyung Kim Cc: Ingo Molnar, linux-kernel, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo On 9/5/12 5:08 PM, Arnaldo Carvalho de Melo wrote: > From: Namhyung Kim <namhyung.kim@lge.com> > > The event name can be set already by processing a event_desc data. > > So check it before setting to prevent possible leak. > > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > Cc: Ingo Molnar <mingo@kernel.org> > Cc: Paul Mackerras <paulus@samba.org> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> > Link: http://lkml.kernel.org/r/1346821373-31621-3-git-send-email-namhyung@kernel.org > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > --- > tools/perf/util/header.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c > index a124b93..05c9310 100644 > --- a/tools/perf/util/header.c > +++ b/tools/perf/util/header.c > @@ -2314,7 +2314,7 @@ static int perf_evlist__set_tracepoint_names(struct perf_evlist *evlist, > struct perf_evsel *pos; > > list_for_each_entry(pos, &evlist->entries, node) { > - if (pos->attr.type == PERF_TYPE_TRACEPOINT && > + if (pos->attr.type == PERF_TYPE_TRACEPOINT && !pos->name && > perf_evsel__set_tracepoint_name(pos, pevent)) > return -1; > } > I'm getting a segfault running perf-script due to this patch. Most likely this is exposing another problem. Back trace is: #0 0x000000000049f4f2 in pevent_event_info (s=0x7fffffffdab0, event=0x0, record=0x7fffffffda70) at tools/lib/traceevent/event-parse.c:4183 #1 0x000000000046cd52 in event_format__print (event=0x0, cpu=<optimized out>, data=<optimized out>, size=<optimized out>) at util/trace-event-parse.c:182 #2 0x000000000042d41b in process_event (event=0x7fffef9d1e60, sample=0x7fffffffdc90, evsel=0x90d870, machine=0x906f80, al=<optimized out>) at builtin-script.c:415 #3 0x000000000042c4e1 in process_sample_event (tool=<optimized out>, event=0x7fffef9d1e60, sample=0x7fffffffdc90, evsel= 0x90d870, machine=0x906f80) at builtin-script.c:515 #4 0x000000000046864d in perf_session_deliver_event (session=<optimized out>, event=0x7fffef9d1e60, sample=0x7fffffffdc90, tool=0x79d020, file_offset=<optimized out>) at util/session.c:1065 #5 0x0000000000468c5a in flush_sample_queue (s=0x906f20, tool=0x79d020) at util/session.c:719 #6 0x0000000000468d46 in process_finished_round (tool=<optimized out>, event=<optimized out>, session=0x906f20) at util/session.c:790 #7 0x0000000000469055 in perf_session__process_user_event (file_offset=541768, tool=0x79d020, event=0x7fffefa2b448, session=0x906f20) at util/session.c:1129 #8 perf_session__process_event (session=0x906f20, event=0x7fffefa2b448, tool=0x79d020, file_offset=541768) at util/session.c:1161 #9 0x000000000046a851 in __perf_session__process_events (session=0x906f20, data_offset=<optimized out>, data_size=<optimized out>, file_size=2564784, tool=0x79d020) at util/session.c:1429 #10 0x000000000042ebdc in __cmd_script (session=0x906f20) at builtin-script.c:548 ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 14/17] perf header: Set tracepoint event name only if not set 2012-09-06 0:01 ` David Ahern @ 2012-09-06 1:30 ` Namhyung Kim 0 siblings, 0 replies; 35+ messages in thread From: Namhyung Kim @ 2012-09-06 1:30 UTC (permalink / raw) To: David Ahern Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Ingo Molnar, linux-kernel, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo On Wed, 05 Sep 2012 18:01:16 -0600, David Ahern wrote: > On 9/5/12 5:08 PM, Arnaldo Carvalho de Melo wrote: >> From: Namhyung Kim <namhyung.kim@lge.com> >> >> The event name can be set already by processing a event_desc data. >> >> So check it before setting to prevent possible leak. >> >> Signed-off-by: Namhyung Kim <namhyung@kernel.org> >> Cc: Ingo Molnar <mingo@kernel.org> >> Cc: Paul Mackerras <paulus@samba.org> >> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> >> Link: http://lkml.kernel.org/r/1346821373-31621-3-git-send-email-namhyung@kernel.org >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> >> --- >> tools/perf/util/header.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c >> index a124b93..05c9310 100644 >> --- a/tools/perf/util/header.c >> +++ b/tools/perf/util/header.c >> @@ -2314,7 +2314,7 @@ static int perf_evlist__set_tracepoint_names(struct perf_evlist *evlist, >> struct perf_evsel *pos; >> >> list_for_each_entry(pos, &evlist->entries, node) { >> - if (pos->attr.type == PERF_TYPE_TRACEPOINT && >> + if (pos->attr.type == PERF_TYPE_TRACEPOINT && !pos->name && >> perf_evsel__set_tracepoint_name(pos, pevent)) >> return -1; >> } >> > > I'm getting a segfault running perf-script due to this patch. Most > likely this is exposing another problem. Back trace is: Hmm. It's because evsel->tp_format being not set, not sure why I didn't detect this during tests. Will find out a solution. Thanks, Namhyung > > #0 0x000000000049f4f2 in pevent_event_info (s=0x7fffffffdab0, > event=0x0, record=0x7fffffffda70) > at tools/lib/traceevent/event-parse.c:4183 > #1 0x000000000046cd52 in event_format__print (event=0x0, > cpu=<optimized out>, data=<optimized out>, size=<optimized out>) > at util/trace-event-parse.c:182 > #2 0x000000000042d41b in process_event (event=0x7fffef9d1e60, > sample=0x7fffffffdc90, evsel=0x90d870, machine=0x906f80, > al=<optimized out>) at builtin-script.c:415 > #3 0x000000000042c4e1 in process_sample_event (tool=<optimized out>, > event=0x7fffef9d1e60, sample=0x7fffffffdc90, evsel= > 0x90d870, machine=0x906f80) at builtin-script.c:515 > #4 0x000000000046864d in perf_session_deliver_event > (session=<optimized out>, event=0x7fffef9d1e60, sample=0x7fffffffdc90, > tool=0x79d020, file_offset=<optimized out>) at util/session.c:1065 > #5 0x0000000000468c5a in flush_sample_queue (s=0x906f20, > tool=0x79d020) at util/session.c:719 > #6 0x0000000000468d46 in process_finished_round (tool=<optimized > out>, event=<optimized out>, session=0x906f20) > at util/session.c:790 > #7 0x0000000000469055 in perf_session__process_user_event > (file_offset=541768, tool=0x79d020, event=0x7fffefa2b448, > session=0x906f20) at util/session.c:1129 > #8 perf_session__process_event (session=0x906f20, > event=0x7fffefa2b448, tool=0x79d020, file_offset=541768) > at util/session.c:1161 > #9 0x000000000046a851 in __perf_session__process_events > (session=0x906f20, data_offset=<optimized out>, > data_size=<optimized out>, file_size=2564784, tool=0x79d020) at > util/session.c:1429 > #10 0x000000000042ebdc in __cmd_script (session=0x906f20) at > builtin-script.c:548 ^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 15/17] perf header: Swap pmu mapping numbers if needed 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (13 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 14/17] perf header: Set tracepoint event name only if not set Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 16/17] perf tools: Replace mempcpy with memcpy Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 17/17] perf tools: Allow user to indicate path to objdump in command line Arnaldo Carvalho de Melo 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Robert Richter, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung.kim@lge.com> Like others, the numbers can be saved in a different endian format than a host machine. Swap them if needed. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Robert Richter <robert.richter@amd.com> Link: http://lkml.kernel.org/r/1346821373-31621-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/header.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 05c9310..43425b7 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1440,6 +1440,9 @@ static void print_pmu_mappings(struct perf_header *ph, int fd, FILE *fp) if (ret != sizeof(pmu_num)) goto error; + if (ph->needs_swap) + pmu_num = bswap_32(pmu_num); + if (!pmu_num) { fprintf(fp, "# pmu mappings: not available\n"); return; @@ -1448,6 +1451,9 @@ static void print_pmu_mappings(struct perf_header *ph, int fd, FILE *fp) while (pmu_num) { if (read(fd, &type, sizeof(type)) != sizeof(type)) break; + if (ph->needs_swap) + type = bswap_32(type); + name = do_read_string(fd, ph); if (!name) break; -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 16/17] perf tools: Replace mempcpy with memcpy 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (14 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 15/17] perf header: Swap pmu mapping numbers if needed Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 17/17] perf tools: Allow user to indicate path to objdump in command line Arnaldo Carvalho de Melo 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Irina Tirdea, Irina Tirdea, Frederic Weisbecker, Namhyung Kim, Peter Zijlstra, Steven Rostedt, Arnaldo Carvalho de Melo From: Irina Tirdea <irina.tirdea@gmail.com> mempcpy is not supported by bionic in Android and will lead to compilation errors. Replacing mempcpy with memcpy so it will work in Android. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/CANg8OW+Y3ZMG-GdhYu2_yKOYH_XEMgw73PdCX_23UTnfYhmttA@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/target.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c index 051eaa6..065528b 100644 --- a/tools/perf/util/target.c +++ b/tools/perf/util/target.c @@ -117,8 +117,8 @@ int perf_target__strerror(struct perf_target *target, int errnum, if (err != buf) { size_t len = strlen(err); - char *c = mempcpy(buf, err, min(buflen - 1, len)); - *c = '\0'; + memcpy(buf, err, min(buflen - 1, len)); + *(buf + min(buflen - 1, len)) = '\0'; } return 0; -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 17/17] perf tools: Allow user to indicate path to objdump in command line 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (15 preceding siblings ...) 2012-09-05 23:08 ` [PATCH 16/17] perf tools: Replace mempcpy with memcpy Arnaldo Carvalho de Melo @ 2012-09-05 23:08 ` Arnaldo Carvalho de Melo 16 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 23:08 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Maciek Borzecki, Arnaldo Carvalho de Melo From: Maciek Borzecki <maciek.borzecki@gmail.com> When analyzing perf data from hosts of other architecture than one of the local host it's useful to call objdump that is part of a toolchain for that architecture. Instead of calling regular objdump, call one that user specified in command line. Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1346754750.16299.3.camel@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-annotate.txt | 3 +++ tools/perf/Documentation/perf-report.txt | 3 +++ tools/perf/builtin-annotate.c | 2 ++ tools/perf/builtin-report.c | 2 ++ tools/perf/util/annotate.c | 4 +++- tools/perf/util/annotate.h | 1 + 6 files changed, 14 insertions(+), 1 deletions(-) diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt index c89f9e1..c8ffd9f 100644 --- a/tools/perf/Documentation/perf-annotate.txt +++ b/tools/perf/Documentation/perf-annotate.txt @@ -85,6 +85,9 @@ OPTIONS -M:: --disassembler-style=:: Set disassembler style for objdump. +--objdump=<path>:: + Path to objdump binary. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1] diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index 495210a..f4d91be 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt @@ -168,6 +168,9 @@ OPTIONS branch stacks and it will automatically switch to the branch view mode, unless --no-branch-stack is used. +--objdump=<path>:: + Path to objdump binary. + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-annotate[1] diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 67522cf..2f3f002 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -282,6 +282,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used) "Display raw encoding of assembly instructions (default)"), OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", "Specify disassembler style (e.g. -M intel for intel syntax)"), + OPT_STRING(0, "objdump", &objdump_path, "path", + "objdump binary to use for disassembly and annotations"), OPT_END() }; diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index d618253..1f8d11b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -638,6 +638,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) "Show a column with the sum of periods"), OPT_CALLBACK_NOOPT('b', "branch-stack", &sort__branch_mode, "", "use branch records for histogram filling", parse_branch_mode), + OPT_STRING(0, "objdump", &objdump_path, "path", + "objdump binary to use for disassembly and annotations"), OPT_END() }; diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 3a282c0..51ef69c 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -17,6 +17,7 @@ #include <pthread.h> const char *disassembler_style; +const char *objdump_path; static struct ins *ins__find(const char *name); static int disasm_line__parse(char *line, char **namep, char **rawp); @@ -820,9 +821,10 @@ fallback: dso, dso->long_name, sym, sym->name); snprintf(command, sizeof(command), - "objdump %s%s --start-address=0x%016" PRIx64 + "%s %s%s --start-address=0x%016" PRIx64 " --stop-address=0x%016" PRIx64 " -d %s %s -C %s|grep -v %s|expand", + objdump_path ? objdump_path : "objdump", disassembler_style ? "-M " : "", disassembler_style ? disassembler_style : "", map__rip_2objdump(map, sym->start), diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 78a5692..a6d6bc5 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -152,5 +152,6 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, #endif extern const char *disassembler_style; +extern const char *objdump_path; #endif /* __PERF_ANNOTATE_H */ -- 1.7.1 ^ permalink raw reply related [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2013-02-06 21:44 Arnaldo Carvalho de Melo 2013-02-06 21:51 ` Ingo Molnar 0 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2013-02-06 21:44 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen, Andrew Jones, Borislav Petkov, Corey Ashford, David Ahern, Feng Tang, Frederic Weisbecker, Jiri Olsa, Joe Perches, Mike Galbraith, Namhyung Kim, Paul Gortmaker, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 0fbdad078a70ed72248c3d30fe32e45e83be00d1: perf/x86: Allow for architecture specific RDPMC indexes (2013-02-06 19:45:24 +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 88fd2b6a76264e9e14463f532caae09d82a53207: perf python: Link with sysfs.o (2013-02-06 18:09:28 -0300) ---------------------------------------------------------------- perf/core improvements and fixes . Check for flex and bison before continuing building, from Borislav Petkov. . Make event_copy local to mmaps, fixing buffer wrap around problems, from David Ahern. . Add option for runtime switching perf data file in perf report, just press 's' and a menu with the valid files found in the current directory will be presented, from Feng Tang. . Add support to display whole group data for raw columns, from Jiri Olsa. . Fix SIGALRM and pipe read race for the rwtop perl script. from Jiri Olsa. . Fix perf_evsel::exclude_GH handling and add a test to catch regressions, from Jiri Olsa. . Error checking fixes, from Namhyung Kim. . Fix calloc argument ordering, from Paul Gortmaker. . Fix set event list leader, from Stephane Eranian. . Add per processor socket count aggregation in perf stat, from Stephane Eranian. . Fix perf python binding breakage. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf evlist: Pass the event_group info via perf_attr_details perf python: Link with sysfs.o Borislav Petkov (1): perf tools: Check for flex and bison before continuing building David Ahern (1): perf evlist: Make event_copy local to mmaps Feng Tang (2): perf hists browser: Add option for runtime switching perf data file perf report: Enable the runtime switching of perf data file Jiri Olsa (4): perf hists browser: Add support to display whole group data for raw columns perf perl scripts: Fix SIGALRM and pipe read race for rwtop perf tools: Fix perf_evsel::exclude_GH handling perf tests: Adding automated parsing tests for group :GH modifiers Namhyung Kim (3): perf sort: Drop ip_[lr] arguments from _sort__sym_cmp() perf sort: Make setup_sorting returns an error code perf sort: Check return value of strdup() Paul Gortmaker (1): perf tools: Fix calloc argument ordering Stephane Eranian (3): perf evlist: Fix set event list leader perf tools: Add cpu_map processor socket level functions perf stat: Add per processor socket count aggregation tools/perf/Documentation/perf-stat.txt | 9 +- tools/perf/Makefile | 13 ++- tools/perf/builtin-annotate.c | 3 +- tools/perf/builtin-diff.c | 4 +- tools/perf/builtin-evlist.c | 4 +- tools/perf/builtin-report.c | 41 +++++--- tools/perf/builtin-stat.c | 126 +++++++++++++++++++++-- tools/perf/builtin-top.c | 3 +- tools/perf/perf.h | 26 ----- tools/perf/scripts/perl/rwtop.pl | 6 +- tools/perf/tests/hists_link.c | 3 +- tools/perf/tests/parse-events.c | 178 ++++++++++++++++++++++++++++++++- tools/perf/ui/browsers/hists.c | 112 ++++++++++++++++++++- tools/perf/ui/hist.c | 53 +++++----- tools/perf/ui/keysyms.h | 1 + tools/perf/util/callchain.c | 2 +- tools/perf/util/cpumap.c | 54 ++++++++++ tools/perf/util/cpumap.h | 9 ++ tools/perf/util/evlist.c | 7 +- tools/perf/util/evlist.h | 29 +++++- tools/perf/util/evsel.c | 2 +- tools/perf/util/evsel.h | 1 + tools/perf/util/header.c | 4 +- tools/perf/util/parse-events.c | 8 -- tools/perf/util/python-ext-sources | 1 + tools/perf/util/sort.c | 38 ++++--- tools/perf/util/sort.h | 2 +- 27 files changed, 611 insertions(+), 128 deletions(-) ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes 2013-02-06 21:44 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2013-02-06 21:51 ` Ingo Molnar 0 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2013-02-06 21:51 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen, Andrew Jones, Borislav Petkov, Corey Ashford, David Ahern, Feng Tang, Frederic Weisbecker, Jiri Olsa, Joe Perches, Mike Galbraith, Namhyung Kim, Paul Gortmaker, Paul Mackerras, Peter Zijlstra, Stephane Eranian, 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, > > - Arnaldo > > The following changes since commit 0fbdad078a70ed72248c3d30fe32e45e83be00d1: > > perf/x86: Allow for architecture specific RDPMC indexes (2013-02-06 19:45:24 +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 88fd2b6a76264e9e14463f532caae09d82a53207: > > perf python: Link with sysfs.o (2013-02-06 18:09:28 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes > > . Check for flex and bison before continuing building, from Borislav Petkov. > > . Make event_copy local to mmaps, fixing buffer wrap around problems, from > David Ahern. > > . Add option for runtime switching perf data file in perf report, just press > 's' and a menu with the valid files found in the current directory will be > presented, from Feng Tang. > > . Add support to display whole group data for raw columns, from Jiri Olsa. > > . Fix SIGALRM and pipe read race for the rwtop perl script. from Jiri Olsa. > > . Fix perf_evsel::exclude_GH handling and add a test to catch regressions, from > Jiri Olsa. > > . Error checking fixes, from Namhyung Kim. > > . Fix calloc argument ordering, from Paul Gortmaker. > > . Fix set event list leader, from Stephane Eranian. > > . Add per processor socket count aggregation in perf stat, from Stephane Eranian. > > . Fix perf python binding breakage. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > perf evlist: Pass the event_group info via perf_attr_details > perf python: Link with sysfs.o > > Borislav Petkov (1): > perf tools: Check for flex and bison before continuing building > > David Ahern (1): > perf evlist: Make event_copy local to mmaps > > Feng Tang (2): > perf hists browser: Add option for runtime switching perf data file > perf report: Enable the runtime switching of perf data file > > Jiri Olsa (4): > perf hists browser: Add support to display whole group data for raw columns > perf perl scripts: Fix SIGALRM and pipe read race for rwtop > perf tools: Fix perf_evsel::exclude_GH handling > perf tests: Adding automated parsing tests for group :GH modifiers > > Namhyung Kim (3): > perf sort: Drop ip_[lr] arguments from _sort__sym_cmp() > perf sort: Make setup_sorting returns an error code > perf sort: Check return value of strdup() > > Paul Gortmaker (1): > perf tools: Fix calloc argument ordering > > Stephane Eranian (3): > perf evlist: Fix set event list leader > perf tools: Add cpu_map processor socket level functions > perf stat: Add per processor socket count aggregation > > tools/perf/Documentation/perf-stat.txt | 9 +- > tools/perf/Makefile | 13 ++- > tools/perf/builtin-annotate.c | 3 +- > tools/perf/builtin-diff.c | 4 +- > tools/perf/builtin-evlist.c | 4 +- > tools/perf/builtin-report.c | 41 +++++--- > tools/perf/builtin-stat.c | 126 +++++++++++++++++++++-- > tools/perf/builtin-top.c | 3 +- > tools/perf/perf.h | 26 ----- > tools/perf/scripts/perl/rwtop.pl | 6 +- > tools/perf/tests/hists_link.c | 3 +- > tools/perf/tests/parse-events.c | 178 ++++++++++++++++++++++++++++++++- > tools/perf/ui/browsers/hists.c | 112 ++++++++++++++++++++- > tools/perf/ui/hist.c | 53 +++++----- > tools/perf/ui/keysyms.h | 1 + > tools/perf/util/callchain.c | 2 +- > tools/perf/util/cpumap.c | 54 ++++++++++ > tools/perf/util/cpumap.h | 9 ++ > tools/perf/util/evlist.c | 7 +- > tools/perf/util/evlist.h | 29 +++++- > tools/perf/util/evsel.c | 2 +- > tools/perf/util/evsel.h | 1 + > tools/perf/util/header.c | 4 +- > tools/perf/util/parse-events.c | 8 -- > tools/perf/util/python-ext-sources | 1 + > tools/perf/util/sort.c | 38 ++++--- > tools/perf/util/sort.h | 2 +- > 27 files changed, 611 insertions(+), 128 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2015-05-14 22:37 Arnaldo Carvalho de Melo 2015-05-15 6:39 ` Ingo Molnar 0 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-05-14 22:37 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit a41f3c8cd4e28dcbebd8ec27a9602c86cfa5f009: perf/x86/intel/uncore: Add Broadwell-U uncore IMC PMU support (2015-05-11 11:57:47 +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 70923bd26c732ac2d9e248d80214df6dfd75f78c: perf tools: Make flex/bison calls honour V=1 (2015-05-14 19:27:47 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Add --range option to show a variable's location range in 'perf probe', helping in collecting variables in probes when there is a mismatch between assembly and source code (He Kuang) - Show better error message when failed to find variable in 'perf probe' (He Kuang) - Fix 'perf report --thread' handling and document it better (Namhyung Kim) Infrastructure: - Fix to get negative exit codes in 'perf test' test routines (He Kuang) - Make flex/bison calls honour V=1 (Jiri Olsa) - Ignore tail calls to probed functions in 'perf probe' (Naveen N. Rao) - Fix refcount expectations in map_group share 'perf test' (Arnaldo Carvalho de Melo) Build Fixes: - Fix 'perf kmem' build due to compiler thinking uninitialized var is being accessed (Arnaldo Carvalho de Melo) - Provide le16toh if not defined, to fix the libtraceevent build on older distros (Arnaldo Carvalho de Melo) - Fix 'perf trace' build on older distros by providing some CLOEXEC, NONBLOCK defines (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (6): perf kmem: Fix compiler warning about may be accessing uninitialized variable perf tests: Show refcounting broken expectations in thread-mg-share test perf machine: No need to keep a refcnt for last_match perf tests: Fix map_groups refcount test tools lib traceevent: Provide le16toh define for older systems perf trace: Fix the build on older distros He Kuang (5): perf trace: Removed duplicated NULL test perf probe: Remove length limitation for showing available variables perf probe: Add --range option to show a variable's location range perf probe: Show better error message when failed to find variable perf tests: Fix to get negative exit codes Jiri Olsa (1): perf tools: Make flex/bison calls honour V=1 Namhyung Kim (4): perf tools: Document relation of per-thread event count feature perf report: Force tty output if -T/--thread option is given perf report: Do not restrict -T option by other options perf report: Fix some option handling on --stdio Naveen N. Rao (1): perf probe: Ignore tail calls to probed functions tools/lib/traceevent/plugin_cfg80211.c | 13 ++ tools/perf/Documentation/perf-record.txt | 3 +- tools/perf/Documentation/perf-report.txt | 3 +- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-probe.c | 2 + tools/perf/builtin-report.c | 17 ++- tools/perf/builtin-trace.c | 32 ++++- tools/perf/tests/builtin-test.c | 2 +- tools/perf/tests/tests.h | 9 ++ tools/perf/tests/thread-mg-share.c | 29 +++-- tools/perf/util/Build | 8 +- tools/perf/util/cache.h | 1 - tools/perf/util/dwarf-aux.c | 204 +++++++++++++++++++++++++++---- tools/perf/util/dwarf-aux.h | 10 +- tools/perf/util/environment.c | 1 - tools/perf/util/machine.c | 8 +- tools/perf/util/pager.c | 5 - tools/perf/util/probe-event.h | 1 + tools/perf/util/probe-finder.c | 90 ++++++++++---- 19 files changed, 346 insertions(+), 94 deletions(-) ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes 2015-05-14 22:37 Arnaldo Carvalho de Melo @ 2015-05-15 6:39 ` Ingo Molnar 0 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2015-05-15 6:39 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit a41f3c8cd4e28dcbebd8ec27a9602c86cfa5f009: > > perf/x86/intel/uncore: Add Broadwell-U uncore IMC PMU support (2015-05-11 11:57:47 +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 70923bd26c732ac2d9e248d80214df6dfd75f78c: > > perf tools: Make flex/bison calls honour V=1 (2015-05-14 19:27:47 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Add --range option to show a variable's location range in 'perf probe', > helping in collecting variables in probes when there is a mismatch > between assembly and source code (He Kuang) > > - Show better error message when failed to find variable in 'perf probe' (He Kuang) > > - Fix 'perf report --thread' handling and document it better (Namhyung Kim) > > Infrastructure: > > - Fix to get negative exit codes in 'perf test' test routines (He Kuang) > > - Make flex/bison calls honour V=1 (Jiri Olsa) > > - Ignore tail calls to probed functions in 'perf probe' (Naveen N. Rao) > > - Fix refcount expectations in map_group share 'perf test' (Arnaldo Carvalho de Melo) > > Build Fixes: > > - Fix 'perf kmem' build due to compiler thinking uninitialized var is > being accessed (Arnaldo Carvalho de Melo) > > - Provide le16toh if not defined, to fix the libtraceevent build on > older distros (Arnaldo Carvalho de Melo) > > - Fix 'perf trace' build on older distros by providing some CLOEXEC, NONBLOCK > defines (Arnaldo Carvalho de Melo) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (6): > perf kmem: Fix compiler warning about may be accessing uninitialized variable > perf tests: Show refcounting broken expectations in thread-mg-share test > perf machine: No need to keep a refcnt for last_match > perf tests: Fix map_groups refcount test > tools lib traceevent: Provide le16toh define for older systems > perf trace: Fix the build on older distros > > He Kuang (5): > perf trace: Removed duplicated NULL test > perf probe: Remove length limitation for showing available variables > perf probe: Add --range option to show a variable's location range > perf probe: Show better error message when failed to find variable > perf tests: Fix to get negative exit codes > > Jiri Olsa (1): > perf tools: Make flex/bison calls honour V=1 > > Namhyung Kim (4): > perf tools: Document relation of per-thread event count feature > perf report: Force tty output if -T/--thread option is given > perf report: Do not restrict -T option by other options > perf report: Fix some option handling on --stdio > > Naveen N. Rao (1): > perf probe: Ignore tail calls to probed functions > > tools/lib/traceevent/plugin_cfg80211.c | 13 ++ > tools/perf/Documentation/perf-record.txt | 3 +- > tools/perf/Documentation/perf-report.txt | 3 +- > tools/perf/builtin-kmem.c | 2 +- > tools/perf/builtin-probe.c | 2 + > tools/perf/builtin-report.c | 17 ++- > tools/perf/builtin-trace.c | 32 ++++- > tools/perf/tests/builtin-test.c | 2 +- > tools/perf/tests/tests.h | 9 ++ > tools/perf/tests/thread-mg-share.c | 29 +++-- > tools/perf/util/Build | 8 +- > tools/perf/util/cache.h | 1 - > tools/perf/util/dwarf-aux.c | 204 +++++++++++++++++++++++++++---- > tools/perf/util/dwarf-aux.h | 10 +- > tools/perf/util/environment.c | 1 - > tools/perf/util/machine.c | 8 +- > tools/perf/util/pager.c | 5 - > tools/perf/util/probe-event.h | 1 + > tools/perf/util/probe-finder.c | 90 ++++++++++---- > 19 files changed, 346 insertions(+), 94 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2016-05-06 0:29 Arnaldo Carvalho de Melo 2016-05-06 6:36 ` Ingo Molnar 0 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-05-06 0:29 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Ananth N Mavinakayanahalli, Balbir Singh, David Ahern, Ian Munsie, Jiri Olsa, linuxppc-dev, Mark Wielaard, Masami Hiramatsu, Michael Ellerman, Milian Wolff, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, pi3orama, Thiago Jung Bauermann, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 1b6de5917172967acd8db4d222df4225d23a8a60: perf/x86/intel/pt: Convert ACCESS_ONCE()s (2016-05-05 10:16:29 +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-20160505 for you to fetch changes up to b6b85dad30ad7e7394990e2317a780577974a4e6: perf evlist: Rename variable in perf_mmap__read() (2016-05-05 21:04:04 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Order output of 'perf trace --summary' better, now the threads will appear ascending order of number of events, and then, for each, in descending order of syscalls by the time spent in the syscalls, so that the last page produced can be the one about the most interesting thread straced, suggested by Milian Wolff (Arnaldo Carvalho de Melo) - Do not show the runtime_ms for a thread when not collecting it, that is done so far only with 'perf trace --sched' (Arnaldo Carvalho de Melo) - Fix kallsyms perf test on ppc64le (Naveen N. Rao) Infrastructure: - Move global variables related to presence of some keys in the sort order to a per hist struct, to allow code like the hists browser to work with multiple hists with different lists of columns (Jiri Olsa) - Add support for generating bpf prologue in powerpc (Naveen N. Rao) - Fix kprobe and kretprobe handling with kallsyms on ppc64le (Naveen N. Rao) - evlist mmap changes, prep work for supporting reading backwards (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (5): perf machine: Introduce number of threads member perf tools: Add template for generating rbtree resort class perf trace: Sort summary output by number of events perf trace: Sort syscalls stats by msecs in --summary perf trace: Do not show the runtime_ms for a thread when not collecting it Jiri Olsa (7): perf hists: Move sort__need_collapse into struct perf_hpp_list perf hists: Move sort__has_parent into struct perf_hpp_list perf hists: Move sort__has_sym into struct perf_hpp_list perf hists: Move sort__has_dso into struct perf_hpp_list perf hists: Move sort__has_socket into struct perf_hpp_list perf hists: Move sort__has_thread into struct perf_hpp_list perf hists: Move sort__has_comm into struct perf_hpp_list Naveen N. Rao (3): perf tools powerpc: Add support for generating bpf prologue perf powerpc: Fix kprobe and kretprobe handling with kallsyms on ppc64le perf symbols: Fix kallsyms perf test on ppc64le Wang Nan (2): perf evlist: Extract perf_mmap__read() perf evlist: Rename variable in perf_mmap__read() tools/perf/arch/powerpc/Makefile | 1 + tools/perf/arch/powerpc/util/dwarf-regs.c | 40 +++++--- tools/perf/arch/powerpc/util/sym-handling.c | 43 ++++++-- tools/perf/builtin-diff.c | 4 +- tools/perf/builtin-report.c | 4 +- tools/perf/builtin-top.c | 8 +- tools/perf/builtin-trace.c | 87 ++++++++++------ tools/perf/tests/hists_common.c | 2 +- tools/perf/tests/hists_cumulate.c | 2 +- tools/perf/tests/hists_link.c | 4 +- tools/perf/tests/hists_output.c | 2 +- tools/perf/ui/browsers/hists.c | 32 +++--- tools/perf/ui/gtk/hists.c | 2 +- tools/perf/ui/hist.c | 2 +- tools/perf/util/annotate.c | 2 +- tools/perf/util/callchain.c | 2 +- tools/perf/util/evlist.c | 56 ++++++----- tools/perf/util/hist.c | 14 +-- tools/perf/util/hist.h | 10 ++ tools/perf/util/machine.c | 9 +- tools/perf/util/machine.h | 1 + tools/perf/util/probe-event.c | 5 +- tools/perf/util/probe-event.h | 3 +- tools/perf/util/rb_resort.h | 149 ++++++++++++++++++++++++++++ tools/perf/util/sort.c | 35 +++---- tools/perf/util/sort.h | 7 -- tools/perf/util/symbol-elf.c | 7 +- tools/perf/util/symbol.h | 3 +- 28 files changed, 382 insertions(+), 154 deletions(-) create mode 100644 tools/perf/util/rb_resort.h ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes 2016-05-06 0:29 Arnaldo Carvalho de Melo @ 2016-05-06 6:36 ` Ingo Molnar 0 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2016-05-06 6:36 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Ananth N Mavinakayanahalli, Balbir Singh, David Ahern, Ian Munsie, Jiri Olsa, linuxppc-dev, Mark Wielaard, Masami Hiramatsu, Michael Ellerman, Milian Wolff, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, pi3orama, Thiago Jung Bauermann, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > > The following changes since commit 1b6de5917172967acd8db4d222df4225d23a8a60: > > perf/x86/intel/pt: Convert ACCESS_ONCE()s (2016-05-05 10:16:29 +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-20160505 > > for you to fetch changes up to b6b85dad30ad7e7394990e2317a780577974a4e6: > > perf evlist: Rename variable in perf_mmap__read() (2016-05-05 21:04:04 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Order output of 'perf trace --summary' better, now the threads will > appear ascending order of number of events, and then, for each, in > descending order of syscalls by the time spent in the syscalls, so > that the last page produced can be the one about the most interesting > thread straced, suggested by Milian Wolff (Arnaldo Carvalho de Melo) > > - Do not show the runtime_ms for a thread when not collecting it, that > is done so far only with 'perf trace --sched' (Arnaldo Carvalho de Melo) > > - Fix kallsyms perf test on ppc64le (Naveen N. Rao) > > Infrastructure: > > - Move global variables related to presence of some keys in the sort order to a > per hist struct, to allow code like the hists browser to work with multiple > hists with different lists of columns (Jiri Olsa) > > - Add support for generating bpf prologue in powerpc (Naveen N. Rao) > > - Fix kprobe and kretprobe handling with kallsyms on ppc64le (Naveen N. Rao) > > - evlist mmap changes, prep work for supporting reading backwards (Wang Nan) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (5): > perf machine: Introduce number of threads member > perf tools: Add template for generating rbtree resort class > perf trace: Sort summary output by number of events > perf trace: Sort syscalls stats by msecs in --summary > perf trace: Do not show the runtime_ms for a thread when not collecting it > > Jiri Olsa (7): > perf hists: Move sort__need_collapse into struct perf_hpp_list > perf hists: Move sort__has_parent into struct perf_hpp_list > perf hists: Move sort__has_sym into struct perf_hpp_list > perf hists: Move sort__has_dso into struct perf_hpp_list > perf hists: Move sort__has_socket into struct perf_hpp_list > perf hists: Move sort__has_thread into struct perf_hpp_list > perf hists: Move sort__has_comm into struct perf_hpp_list > > Naveen N. Rao (3): > perf tools powerpc: Add support for generating bpf prologue > perf powerpc: Fix kprobe and kretprobe handling with kallsyms on ppc64le > perf symbols: Fix kallsyms perf test on ppc64le > > Wang Nan (2): > perf evlist: Extract perf_mmap__read() > perf evlist: Rename variable in perf_mmap__read() > > tools/perf/arch/powerpc/Makefile | 1 + > tools/perf/arch/powerpc/util/dwarf-regs.c | 40 +++++--- > tools/perf/arch/powerpc/util/sym-handling.c | 43 ++++++-- > tools/perf/builtin-diff.c | 4 +- > tools/perf/builtin-report.c | 4 +- > tools/perf/builtin-top.c | 8 +- > tools/perf/builtin-trace.c | 87 ++++++++++------ > tools/perf/tests/hists_common.c | 2 +- > tools/perf/tests/hists_cumulate.c | 2 +- > tools/perf/tests/hists_link.c | 4 +- > tools/perf/tests/hists_output.c | 2 +- > tools/perf/ui/browsers/hists.c | 32 +++--- > tools/perf/ui/gtk/hists.c | 2 +- > tools/perf/ui/hist.c | 2 +- > tools/perf/util/annotate.c | 2 +- > tools/perf/util/callchain.c | 2 +- > tools/perf/util/evlist.c | 56 ++++++----- > tools/perf/util/hist.c | 14 +-- > tools/perf/util/hist.h | 10 ++ > tools/perf/util/machine.c | 9 +- > tools/perf/util/machine.h | 1 + > tools/perf/util/probe-event.c | 5 +- > tools/perf/util/probe-event.h | 3 +- > tools/perf/util/rb_resort.h | 149 ++++++++++++++++++++++++++++ > tools/perf/util/sort.c | 35 +++---- > tools/perf/util/sort.h | 7 -- > tools/perf/util/symbol-elf.c | 7 +- > tools/perf/util/symbol.h | 3 +- > 28 files changed, 382 insertions(+), 154 deletions(-) > create mode 100644 tools/perf/util/rb_resort.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2016-08-04 0:49 Arnaldo Carvalho de Melo 2016-08-04 9:04 ` Ingo Molnar 0 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-08-04 0:49 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Corey Ashford, David Ahern, Frederic Weisbecker, Jan Stancek, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Steven Rostedt, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 674d2d69b14f677a771ceec4b48bfade94a0c5f1: Merge tag 'perf-core-for-mingo-20160725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-07-25 19:48:41 +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-20160803 for you to fetch changes up to c369e0a1a8fa6ca80e6c37c8735d9427b623ae62: perf tests bpf: Use SyS_epoll_wait alias (2016-08-03 19:40:48 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Add --sample-cpu to 'perf record', to explicitely ask for sampling the CPU (Jiri Olsa) Fixes: - Fix processing of multi byte chunks in objdump output, fixing disassemble processing for annotation on at least ARM64 (Jan Stancek) - Use SyS_epoll_wait in a BPF 'perf test' entry instead of sys_epoll_wait, that is not present in the DWARF info in vmlinux files (Arnaldo Carvalho de Melo) - Add -wno-shadow when processing files using perl headers, fixing the build on Fedora Rawhide and Arch Linux (Namhyung Kim) Infrastructure: - Annotate prep work to better catch and report errors related to using objdump to disassemble DSOs (Arnaldo Carvalho de Melo) - Add 'alloc', 'scnprintf' and 'and' methods for bitmap processing (Jiri Olsa) - Add nested output resorting callback in hists processing (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (7): perf evsel: Introduce constructor for cycles event perf annotate: Use pipe + fork instead of popen perf target: str_error_r() always returns the buffer it receives perf annotate: Rename symbol__annotate() to symbol__disassemble() perf annotate: Introduce strerror for handling symbol__disassemble() errors perf annotate: Plug filename string leak perf tests bpf: Use SyS_epoll_wait alias Jan Stancek (1): perf tests: objdump output can contain multi byte chunks Jiri Olsa (7): tools lib: Add bitmap_alloc function tools lib: Add bitmap_scnprintf function tools lib: Add bitmap_and function perf tests: Add test for bitmap_scnprintf function perf tools: Move config/Makefile into Makefile.config perf hists: Introduce output_resort_cb method perf record: Add --sample-cpu option Namhyung Kim (2): perf tools: Fix build failure on perl script context tools lib traceevent: Ignore generated library files tools/include/linux/bitmap.h | 37 ++++++++ tools/lib/bitmap.c | 44 +++++++++ tools/lib/traceevent/.gitignore | 1 + tools/perf/Documentation/perf-record.txt | 3 + tools/perf/{config/Makefile => Makefile.config} | 0 tools/perf/Makefile.perf | 6 +- tools/perf/builtin-record.c | 1 + tools/perf/builtin-top.c | 6 +- tools/perf/perf.h | 1 + tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +- tools/perf/tests/Build | 1 + tools/perf/tests/bitmap.c | 53 +++++++++++ tools/perf/tests/bpf-script-example.c | 4 +- tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/code-reading.c | 100 ++++++++++++++------ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/annotate.c | 9 +- tools/perf/ui/gtk/annotate.c | 8 +- tools/perf/util/annotate.c | 116 +++++++++++++++++------- tools/perf/util/annotate.h | 22 ++++- tools/perf/util/evlist.c | 22 +---- tools/perf/util/evsel.c | 30 +++++- tools/perf/util/evsel.h | 2 + tools/perf/util/hist.c | 15 ++- tools/perf/util/hist.h | 4 + tools/perf/util/target.c | 6 +- 26 files changed, 394 insertions(+), 106 deletions(-) rename tools/perf/{config/Makefile => Makefile.config} (100%) create mode 100644 tools/perf/tests/bitmap.c ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes 2016-08-04 0:49 Arnaldo Carvalho de Melo @ 2016-08-04 9:04 ` Ingo Molnar 0 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2016-08-04 9:04 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Corey Ashford, David Ahern, Frederic Weisbecker, Jan Stancek, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Steven Rostedt, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 674d2d69b14f677a771ceec4b48bfade94a0c5f1: > > Merge tag 'perf-core-for-mingo-20160725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-07-25 19:48:41 +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-20160803 > > for you to fetch changes up to c369e0a1a8fa6ca80e6c37c8735d9427b623ae62: > > perf tests bpf: Use SyS_epoll_wait alias (2016-08-03 19:40:48 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Add --sample-cpu to 'perf record', to explicitely ask for sampling > the CPU (Jiri Olsa) > > Fixes: > > - Fix processing of multi byte chunks in objdump output, fixing > disassemble processing for annotation on at least ARM64 (Jan Stancek) > > - Use SyS_epoll_wait in a BPF 'perf test' entry instead of sys_epoll_wait, that > is not present in the DWARF info in vmlinux files (Arnaldo Carvalho de Melo) > > - Add -wno-shadow when processing files using perl headers, fixing > the build on Fedora Rawhide and Arch Linux (Namhyung Kim) > > Infrastructure: > > - Annotate prep work to better catch and report errors related to > using objdump to disassemble DSOs (Arnaldo Carvalho de Melo) > > - Add 'alloc', 'scnprintf' and 'and' methods for bitmap processing (Jiri Olsa) > > - Add nested output resorting callback in hists processing (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (7): > perf evsel: Introduce constructor for cycles event > perf annotate: Use pipe + fork instead of popen > perf target: str_error_r() always returns the buffer it receives > perf annotate: Rename symbol__annotate() to symbol__disassemble() > perf annotate: Introduce strerror for handling symbol__disassemble() errors > perf annotate: Plug filename string leak > perf tests bpf: Use SyS_epoll_wait alias > > Jan Stancek (1): > perf tests: objdump output can contain multi byte chunks > > Jiri Olsa (7): > tools lib: Add bitmap_alloc function > tools lib: Add bitmap_scnprintf function > tools lib: Add bitmap_and function > perf tests: Add test for bitmap_scnprintf function > perf tools: Move config/Makefile into Makefile.config > perf hists: Introduce output_resort_cb method > perf record: Add --sample-cpu option > > Namhyung Kim (2): > perf tools: Fix build failure on perl script context > tools lib traceevent: Ignore generated library files > > tools/include/linux/bitmap.h | 37 ++++++++ > tools/lib/bitmap.c | 44 +++++++++ > tools/lib/traceevent/.gitignore | 1 + > tools/perf/Documentation/perf-record.txt | 3 + > tools/perf/{config/Makefile => Makefile.config} | 0 > tools/perf/Makefile.perf | 6 +- > tools/perf/builtin-record.c | 1 + > tools/perf/builtin-top.c | 6 +- > tools/perf/perf.h | 1 + > tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +- > tools/perf/tests/Build | 1 + > tools/perf/tests/bitmap.c | 53 +++++++++++ > tools/perf/tests/bpf-script-example.c | 4 +- > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/code-reading.c | 100 ++++++++++++++------ > tools/perf/tests/tests.h | 1 + > tools/perf/ui/browsers/annotate.c | 9 +- > tools/perf/ui/gtk/annotate.c | 8 +- > tools/perf/util/annotate.c | 116 +++++++++++++++++------- > tools/perf/util/annotate.h | 22 ++++- > tools/perf/util/evlist.c | 22 +---- > tools/perf/util/evsel.c | 30 +++++- > tools/perf/util/evsel.h | 2 + > tools/perf/util/hist.c | 15 ++- > tools/perf/util/hist.h | 4 + > tools/perf/util/target.c | 6 +- > 26 files changed, 394 insertions(+), 106 deletions(-) > rename tools/perf/{config/Makefile => Makefile.config} (100%) > create mode 100644 tools/perf/tests/bitmap.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2018-04-04 2:21 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2018-04-04 2:21 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Jiri Olsa, Kan Liang, Kim Phillips, Kirill A . Shutemov, Linus Torvalds, Martin Liška, Maxim Kuvyrkov, Milian Wolff, Namhyung Kim, Peter Zijlstra, Wang Nan, 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 1159e09476536250c2a0173d4298d15114df7a89: perf/x86/intel: Enable C-state residency events for Cannon Lake (2018-03-31 11:28: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-4.17-20180403 for you to fetch changes up to 51125a29a395048fdb3429b8c4ca0ada57097744: perf trace: Remove redundant ')' (2018-04-03 16:16:41 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Show only failing syscalls with 'perf trace --failure' (Arnaldo Carvalho de Melo) e.g: See what 'openat' syscalls are failing: # perf trace --failure -e openat 762.323 ( 0.007 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video2) = -1 ENOENT No such file or directory <SNIP N /dev/videoN open attempts... sigh, where is that improvised camera lid?!? 8-) > 790.228 ( 0.008 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video63) = -1 ENOENT No such file or directory ^C# - Show information about the event (freq, nr_samples, total period/nr_events) in the annotate --tui and --stdio2 'perf annotate' output, similar to the first line in the 'perf report --tui', but just for the samples for the annotated symbol (Arnaldo Carvalho de Melo) - Introduce 'perf version --build-options' to show what features were linked, aliased as well as a shorter 'perf -vv' (Jin Yao) - Add a "dso_size" sort order (Kim Phillips) - Remove redundant ')' in the tracepoint output in 'perf trace' (Changbin Du) - Synchronize x86's cpufeatures.h, no effect on tools (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (9): tools headers: Synchronize x86's cpufeatures.h perf trace: Show only failing syscalls perf hists browser: Rename perf_evsel_browser_title to a more descriptive name perf hists: Introduce hists__scnprint_title() perf hists: Move hists__scnprintf_title() away from the TUI code perf ui browser: Move the extra title lines from the hists browser perf annotate: Introduce annotation__scnprintf_samples_period() method perf annotate browser: Show extra title line with event information perf annotate stdio2: Print more descriptive event information header Changbin Du (1): perf trace: Remove redundant ')' Jin Yao (5): perf config: Add some new -DHAVE_XXX to CFLAGS perf config: Rename to HAVE_DWARF_GETLOCATIONS_SUPPORT perf version: Print the compiled-in status of libraries perf tools: Add 'perf -vv' as an alias to 'perf version --build-options' perf version: Add man page Jiri Olsa (1): tools include: Add config.h header file Kim Phillips (1): perf tools: Add a "dso_size" sort order tools/arch/x86/include/asm/cpufeatures.h | 2 + tools/include/tools/config.h | 34 ++++++++ tools/perf/Documentation/perf-report.txt | 1 + tools/perf/Documentation/perf-trace.txt | 3 + tools/perf/Documentation/perf-version.txt | 24 ++++++ tools/perf/Makefile.config | 8 +- tools/perf/builtin-trace.c | 11 ++- tools/perf/builtin-version.c | 82 +++++++++++++++++++- tools/perf/perf.c | 6 ++ tools/perf/perf.h | 1 + tools/perf/ui/browser.c | 8 +- tools/perf/ui/browser.h | 2 + tools/perf/ui/browsers/annotate.c | 31 +++++++- tools/perf/ui/browsers/hists.c | 125 +++++++----------------------- tools/perf/util/annotate.c | 48 ++++++++++-- tools/perf/util/annotate.h | 12 +++ tools/perf/util/dwarf-aux.c | 2 +- tools/perf/util/hist.c | 81 +++++++++++++++++++ tools/perf/util/hist.h | 7 ++ tools/perf/util/map.h | 4 + tools/perf/util/sort.c | 41 ++++++++++ tools/perf/util/sort.h | 1 + 22 files changed, 418 insertions(+), 116 deletions(-) create mode 100644 tools/include/tools/config.h create mode 100644 tools/perf/Documentation/perf-version.txt Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. 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 gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:edge : Ok gcc (Alpine 6.4.0) 6.4.0 6 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11) 7 amazonlinux:2 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2) 8 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 9 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 10 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 11 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 12 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) 13 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2 14 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u1) 4.9.2 15 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 16 debian:experimental : Ok gcc (Debian 7.3.0-14) 7.3.0 17 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 7.3.0-12) 7.3.0 18 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 7.3.0-12) 7.3.0 19 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 7.3.0-12) 7.3.0 20 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 7.3.0-12) 7.3.0 21 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 22 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) 23 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 24 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 25 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 26 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 27 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 28 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2) 29 fedora:27 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) 30 fedora:28 : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20) 31 fedora:rawhide : Ok gcc (GCC) 8.0.1 20180222 (Red Hat 8.0.1-0.16) 32 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0 33 mageia:5 : Ok gcc (GCC) 4.9.2 34 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0 35 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5 36 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5 37 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5 38 opensuse:tumbleweed : Ok gcc (SUSE Linux) 7.3.0 39 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 40 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16.0.3) 41 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 42 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 43 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404 44 ubuntu:15.04 : Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2 45 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 46 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 47 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 48 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 49 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 52 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 53 ubuntu:17.04 : Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406 53 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0 54 ubuntu:18.04 : Ok gcc (Ubuntu 7.2.0-16ubuntu1) 7.2.0 # uname -a Linux jouet 4.16.0-rc7 #3 SMP Mon Mar 26 14:35:30 -03 2018 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: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Breakpoint accounting : Skip 22: Number of exit events of a simple workload : Ok 23: Software clock events period values : Ok 24: Object code reading : Ok 25: Sample parsing : Ok 26: Use a dummy software event to keep tracking : Ok 27: Parse with no sample_id_all bit set : Ok 28: Filter hist entries : Ok 29: Lookup mmap thread : Ok 30: Share thread mg : Ok 31: Sort output of hist entries : Ok 32: Cumulate child hist entries : Ok 33: Track with sched_switch : Ok 34: Filter fds with revents mask in a fdarray : Ok 35: Add fd to a fdarray, making it autogrow : Ok 36: kmod_path__parse : Ok 37: Thread map : Ok 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Ok 38.2: kbuild searching : Ok 38.3: Compile source for BPF prologue generation : Ok 38.4: Compile source for BPF relocation : Ok 39: Session topology : Ok 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : Ok 41: Synthesize thread map : Ok 42: Remove thread map : Ok 43: Synthesize cpu map : Ok 44: Synthesize stat config : Ok 45: Synthesize stat : Ok 46: Synthesize stat round : Ok 47: Synthesize attr update : Ok 48: Event times : Ok 49: Read backward ring buffer : Ok 50: Print cpu map : Ok 51: Probe SDT events : Ok 52: is_printable_array : Ok 53: Print bitmap : Ok 54: perf hooks : Ok 55: builtin clang support : Skip (not compiled in) 56: unit_number__scnprintf : Ok 57: mem2node : Ok 58: x86 rdpmc : Ok 59: Convert perf time to TSC : Ok 60: DWARF unwind : Ok 61: x86 instruction decoder - new instructions : Ok 62: Use vfs_getname probe to get syscall args filenames : Ok 63: probe libc's inet_pton & backtrace it with ping : Ok 64: Check open filename arg using perf trace + vfs_getname: Ok 65: probe libc's inet_pton & backtrace it with ping : Ok 66: Add vfs_getname probe to get syscall args filenames : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_install_O: make install make_install_bin_O: make install-bin make_pure_O: make make_clean_all_O: make clean all make_help_O: make help make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_slang_O: make NO_SLANG=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_backtrace_O: make NO_BACKTRACE=1 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_libnuma_O: make NO_LIBNUMA=1 make_no_libperl_O: make NO_LIBPERL=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_static_O: make LDFLAGS=-static make_doc_O: make doc make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libelf_O: make NO_LIBELF=1 make_tags_O: make tags make_no_demangle_O: make NO_DEMANGLE=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_newt_O: make NO_NEWT=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_util_map_o_O: make util/map.o make_debug_O: make DEBUG=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_perf_o_O: make perf.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_install_prefix_O: make install prefix=/tmp/krava OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2018-04-04 2:21 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2018-04-04 2:21 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Jiri Olsa, Kan Liang, Kim Phillips, Kirill A . Shutemov, Linus Torvalds, Martin Liška, Maxim Kuvyrkov, Milian Wolff, Namhyung Kim, Peter Zijlstra Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 1159e09476536250c2a0173d4298d15114df7a89: perf/x86/intel: Enable C-state residency events for Cannon Lake (2018-03-31 11:28: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-4.17-20180403 for you to fetch changes up to 51125a29a395048fdb3429b8c4ca0ada57097744: perf trace: Remove redundant ')' (2018-04-03 16:16:41 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Show only failing syscalls with 'perf trace --failure' (Arnaldo Carvalho de Melo) e.g: See what 'openat' syscalls are failing: # perf trace --failure -e openat 762.323 ( 0.007 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video2) = -1 ENOENT No such file or directory <SNIP N /dev/videoN open attempts... sigh, where is that improvised camera lid?!? 8-) > 790.228 ( 0.008 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video63) = -1 ENOENT No such file or directory ^C# - Show information about the event (freq, nr_samples, total period/nr_events) in the annotate --tui and --stdio2 'perf annotate' output, similar to the first line in the 'perf report --tui', but just for the samples for the annotated symbol (Arnaldo Carvalho de Melo) - Introduce 'perf version --build-options' to show what features were linked, aliased as well as a shorter 'perf -vv' (Jin Yao) - Add a "dso_size" sort order (Kim Phillips) - Remove redundant ')' in the tracepoint output in 'perf trace' (Changbin Du) - Synchronize x86's cpufeatures.h, no effect on tools (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (9): tools headers: Synchronize x86's cpufeatures.h perf trace: Show only failing syscalls perf hists browser: Rename perf_evsel_browser_title to a more descriptive name perf hists: Introduce hists__scnprint_title() perf hists: Move hists__scnprintf_title() away from the TUI code perf ui browser: Move the extra title lines from the hists browser perf annotate: Introduce annotation__scnprintf_samples_period() method perf annotate browser: Show extra title line with event information perf annotate stdio2: Print more descriptive event information header Changbin Du (1): perf trace: Remove redundant ')' Jin Yao (5): perf config: Add some new -DHAVE_XXX to CFLAGS perf config: Rename to HAVE_DWARF_GETLOCATIONS_SUPPORT perf version: Print the compiled-in status of libraries perf tools: Add 'perf -vv' as an alias to 'perf version --build-options' perf version: Add man page Jiri Olsa (1): tools include: Add config.h header file Kim Phillips (1): perf tools: Add a "dso_size" sort order tools/arch/x86/include/asm/cpufeatures.h | 2 + tools/include/tools/config.h | 34 ++++++++ tools/perf/Documentation/perf-report.txt | 1 + tools/perf/Documentation/perf-trace.txt | 3 + tools/perf/Documentation/perf-version.txt | 24 ++++++ tools/perf/Makefile.config | 8 +- tools/perf/builtin-trace.c | 11 ++- tools/perf/builtin-version.c | 82 +++++++++++++++++++- tools/perf/perf.c | 6 ++ tools/perf/perf.h | 1 + tools/perf/ui/browser.c | 8 +- tools/perf/ui/browser.h | 2 + tools/perf/ui/browsers/annotate.c | 31 +++++++- tools/perf/ui/browsers/hists.c | 125 +++++++----------------------- tools/perf/util/annotate.c | 48 ++++++++++-- tools/perf/util/annotate.h | 12 +++ tools/perf/util/dwarf-aux.c | 2 +- tools/perf/util/hist.c | 81 +++++++++++++++++++ tools/perf/util/hist.h | 7 ++ tools/perf/util/map.h | 4 + tools/perf/util/sort.c | 41 ++++++++++ tools/perf/util/sort.h | 1 + 22 files changed, 418 insertions(+), 116 deletions(-) create mode 100644 tools/include/tools/config.h create mode 100644 tools/perf/Documentation/perf-version.txt Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. 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 gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:edge : Ok gcc (Alpine 6.4.0) 6.4.0 6 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11) 7 amazonlinux:2 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2) 8 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 9 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 10 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 11 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 12 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) 13 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2 14 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u1) 4.9.2 15 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 16 debian:experimental : Ok gcc (Debian 7.3.0-14) 7.3.0 17 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 7.3.0-12) 7.3.0 18 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 7.3.0-12) 7.3.0 19 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 7.3.0-12) 7.3.0 20 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 7.3.0-12) 7.3.0 21 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 22 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) 23 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 24 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 25 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 26 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 27 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 28 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2) 29 fedora:27 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) 30 fedora:28 : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20) 31 fedora:rawhide : Ok gcc (GCC) 8.0.1 20180222 (Red Hat 8.0.1-0.16) 32 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0 33 mageia:5 : Ok gcc (GCC) 4.9.2 34 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0 35 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5 36 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5 37 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5 38 opensuse:tumbleweed : Ok gcc (SUSE Linux) 7.3.0 39 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 40 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16.0.3) 41 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 42 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 43 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404 44 ubuntu:15.04 : Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2 45 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 46 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 47 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 48 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 49 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 52 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 53 ubuntu:17.04 : Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406 53 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0 54 ubuntu:18.04 : Ok gcc (Ubuntu 7.2.0-16ubuntu1) 7.2.0 # uname -a Linux jouet 4.16.0-rc7 #3 SMP Mon Mar 26 14:35:30 -03 2018 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: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Breakpoint accounting : Skip 22: Number of exit events of a simple workload : Ok 23: Software clock events period values : Ok 24: Object code reading : Ok 25: Sample parsing : Ok 26: Use a dummy software event to keep tracking : Ok 27: Parse with no sample_id_all bit set : Ok 28: Filter hist entries : Ok 29: Lookup mmap thread : Ok 30: Share thread mg : Ok 31: Sort output of hist entries : Ok 32: Cumulate child hist entries : Ok 33: Track with sched_switch : Ok 34: Filter fds with revents mask in a fdarray : Ok 35: Add fd to a fdarray, making it autogrow : Ok 36: kmod_path__parse : Ok 37: Thread map : Ok 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Ok 38.2: kbuild searching : Ok 38.3: Compile source for BPF prologue generation : Ok 38.4: Compile source for BPF relocation : Ok 39: Session topology : Ok 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : Ok 41: Synthesize thread map : Ok 42: Remove thread map : Ok 43: Synthesize cpu map : Ok 44: Synthesize stat config : Ok 45: Synthesize stat : Ok 46: Synthesize stat round : Ok 47: Synthesize attr update : Ok 48: Event times : Ok 49: Read backward ring buffer : Ok 50: Print cpu map : Ok 51: Probe SDT events : Ok 52: is_printable_array : Ok 53: Print bitmap : Ok 54: perf hooks : Ok 55: builtin clang support : Skip (not compiled in) 56: unit_number__scnprintf : Ok 57: mem2node : Ok 58: x86 rdpmc : Ok 59: Convert perf time to TSC : Ok 60: DWARF unwind : Ok 61: x86 instruction decoder - new instructions : Ok 62: Use vfs_getname probe to get syscall args filenames : Ok 63: probe libc's inet_pton & backtrace it with ping : Ok 64: Check open filename arg using perf trace + vfs_getname: Ok 65: probe libc's inet_pton & backtrace it with ping : Ok 66: Add vfs_getname probe to get syscall args filenames : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_install_O: make install make_install_bin_O: make install-bin make_pure_O: make make_clean_all_O: make clean all make_help_O: make help make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_slang_O: make NO_SLANG=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_backtrace_O: make NO_BACKTRACE=1 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_libnuma_O: make NO_LIBNUMA=1 make_no_libperl_O: make NO_LIBPERL=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_static_O: make LDFLAGS=-static make_doc_O: make doc make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libelf_O: make NO_LIBELF=1 make_tags_O: make tags make_no_demangle_O: make NO_DEMANGLE=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_newt_O: make NO_NEWT=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_util_map_o_O: make util/map.o make_debug_O: make DEBUG=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_perf_o_O: make perf.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_install_prefix_O: make install prefix=/tmp/krava OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes 2018-04-04 2:21 ` Arnaldo Carvalho de Melo @ 2018-04-04 5:25 ` Ingo Molnar -1 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2018-04-04 5:25 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, linux-perf-users, Adrian Hunter, Alexander Shishkin, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Jiri Olsa, Kan Liang, Kim Phillips, Kirill A . Shutemov, Linus Torvalds, Martin Liška, Maxim Kuvyrkov, Milian Wolff, Namhyung Kim, Peter Zijlstra, Wang Nan, 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 1159e09476536250c2a0173d4298d15114df7a89: > > perf/x86/intel: Enable C-state residency events for Cannon Lake (2018-03-31 11:28: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-4.17-20180403 > > for you to fetch changes up to 51125a29a395048fdb3429b8c4ca0ada57097744: > > perf trace: Remove redundant ')' (2018-04-03 16:16:41 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Show only failing syscalls with 'perf trace --failure' (Arnaldo Carvalho de Melo) > > e.g: See what 'openat' syscalls are failing: > > # perf trace --failure -e openat > 762.323 ( 0.007 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video2) = -1 ENOENT No such file or directory > <SNIP N /dev/videoN open attempts... sigh, where is that improvised camera lid?!? 8-) > > 790.228 ( 0.008 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video63) = -1 ENOENT No such file or directory > ^C# > > - Show information about the event (freq, nr_samples, total period/nr_events) in > the annotate --tui and --stdio2 'perf annotate' output, similar to the > first line in the 'perf report --tui', but just for the samples for > the annotated symbol (Arnaldo Carvalho de Melo) > > - Introduce 'perf version --build-options' to show what features were > linked, aliased as well as a shorter 'perf -vv' (Jin Yao) > > - Add a "dso_size" sort order (Kim Phillips) > > - Remove redundant ')' in the tracepoint output in 'perf trace' (Changbin Du) > > - Synchronize x86's cpufeatures.h, no effect on tools (Arnaldo Carvalho de Melo) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (9): > tools headers: Synchronize x86's cpufeatures.h > perf trace: Show only failing syscalls > perf hists browser: Rename perf_evsel_browser_title to a more descriptive name > perf hists: Introduce hists__scnprint_title() > perf hists: Move hists__scnprintf_title() away from the TUI code > perf ui browser: Move the extra title lines from the hists browser > perf annotate: Introduce annotation__scnprintf_samples_period() method > perf annotate browser: Show extra title line with event information > perf annotate stdio2: Print more descriptive event information header > > Changbin Du (1): > perf trace: Remove redundant ')' > > Jin Yao (5): > perf config: Add some new -DHAVE_XXX to CFLAGS > perf config: Rename to HAVE_DWARF_GETLOCATIONS_SUPPORT > perf version: Print the compiled-in status of libraries > perf tools: Add 'perf -vv' as an alias to 'perf version --build-options' > perf version: Add man page > > Jiri Olsa (1): > tools include: Add config.h header file > > Kim Phillips (1): > perf tools: Add a "dso_size" sort order > > tools/arch/x86/include/asm/cpufeatures.h | 2 + > tools/include/tools/config.h | 34 ++++++++ > tools/perf/Documentation/perf-report.txt | 1 + > tools/perf/Documentation/perf-trace.txt | 3 + > tools/perf/Documentation/perf-version.txt | 24 ++++++ > tools/perf/Makefile.config | 8 +- > tools/perf/builtin-trace.c | 11 ++- > tools/perf/builtin-version.c | 82 +++++++++++++++++++- > tools/perf/perf.c | 6 ++ > tools/perf/perf.h | 1 + > tools/perf/ui/browser.c | 8 +- > tools/perf/ui/browser.h | 2 + > tools/perf/ui/browsers/annotate.c | 31 +++++++- > tools/perf/ui/browsers/hists.c | 125 +++++++----------------------- > tools/perf/util/annotate.c | 48 ++++++++++-- > tools/perf/util/annotate.h | 12 +++ > tools/perf/util/dwarf-aux.c | 2 +- > tools/perf/util/hist.c | 81 +++++++++++++++++++ > tools/perf/util/hist.h | 7 ++ > tools/perf/util/map.h | 4 + > tools/perf/util/sort.c | 41 ++++++++++ > tools/perf/util/sort.h | 1 + > 22 files changed, 418 insertions(+), 116 deletions(-) > create mode 100644 tools/include/tools/config.h > create mode 100644 tools/perf/Documentation/perf-version.txt Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes @ 2018-04-04 5:25 ` Ingo Molnar 0 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2018-04-04 5:25 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, linux-perf-users, Adrian Hunter, Alexander Shishkin, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Jiri Olsa, Kan Liang, Kim Phillips, Kirill A . Shutemov, Linus Torvalds, Martin Liška, Maxim Kuvyrkov, Milian Wolff, Namhyung Kim, Peter Zijlstra, Wang Nan, 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 1159e09476536250c2a0173d4298d15114df7a89: > > perf/x86/intel: Enable C-state residency events for Cannon Lake (2018-03-31 11:28: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-4.17-20180403 > > for you to fetch changes up to 51125a29a395048fdb3429b8c4ca0ada57097744: > > perf trace: Remove redundant ')' (2018-04-03 16:16:41 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Show only failing syscalls with 'perf trace --failure' (Arnaldo Carvalho de Melo) > > e.g: See what 'openat' syscalls are failing: > > # perf trace --failure -e openat > 762.323 ( 0.007 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video2) = -1 ENOENT No such file or directory > <SNIP N /dev/videoN open attempts... sigh, where is that improvised camera lid?!? 8-) > > 790.228 ( 0.008 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video63) = -1 ENOENT No such file or directory > ^C# > > - Show information about the event (freq, nr_samples, total period/nr_events) in > the annotate --tui and --stdio2 'perf annotate' output, similar to the > first line in the 'perf report --tui', but just for the samples for > the annotated symbol (Arnaldo Carvalho de Melo) > > - Introduce 'perf version --build-options' to show what features were > linked, aliased as well as a shorter 'perf -vv' (Jin Yao) > > - Add a "dso_size" sort order (Kim Phillips) > > - Remove redundant ')' in the tracepoint output in 'perf trace' (Changbin Du) > > - Synchronize x86's cpufeatures.h, no effect on tools (Arnaldo Carvalho de Melo) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (9): > tools headers: Synchronize x86's cpufeatures.h > perf trace: Show only failing syscalls > perf hists browser: Rename perf_evsel_browser_title to a more descriptive name > perf hists: Introduce hists__scnprint_title() > perf hists: Move hists__scnprintf_title() away from the TUI code > perf ui browser: Move the extra title lines from the hists browser > perf annotate: Introduce annotation__scnprintf_samples_period() method > perf annotate browser: Show extra title line with event information > perf annotate stdio2: Print more descriptive event information header > > Changbin Du (1): > perf trace: Remove redundant ')' > > Jin Yao (5): > perf config: Add some new -DHAVE_XXX to CFLAGS > perf config: Rename to HAVE_DWARF_GETLOCATIONS_SUPPORT > perf version: Print the compiled-in status of libraries > perf tools: Add 'perf -vv' as an alias to 'perf version --build-options' > perf version: Add man page > > Jiri Olsa (1): > tools include: Add config.h header file > > Kim Phillips (1): > perf tools: Add a "dso_size" sort order > > tools/arch/x86/include/asm/cpufeatures.h | 2 + > tools/include/tools/config.h | 34 ++++++++ > tools/perf/Documentation/perf-report.txt | 1 + > tools/perf/Documentation/perf-trace.txt | 3 + > tools/perf/Documentation/perf-version.txt | 24 ++++++ > tools/perf/Makefile.config | 8 +- > tools/perf/builtin-trace.c | 11 ++- > tools/perf/builtin-version.c | 82 +++++++++++++++++++- > tools/perf/perf.c | 6 ++ > tools/perf/perf.h | 1 + > tools/perf/ui/browser.c | 8 +- > tools/perf/ui/browser.h | 2 + > tools/perf/ui/browsers/annotate.c | 31 +++++++- > tools/perf/ui/browsers/hists.c | 125 +++++++----------------------- > tools/perf/util/annotate.c | 48 ++++++++++-- > tools/perf/util/annotate.h | 12 +++ > tools/perf/util/dwarf-aux.c | 2 +- > tools/perf/util/hist.c | 81 +++++++++++++++++++ > tools/perf/util/hist.h | 7 ++ > tools/perf/util/map.h | 4 + > tools/perf/util/sort.c | 41 ++++++++++ > tools/perf/util/sort.h | 1 + > 22 files changed, 418 insertions(+), 116 deletions(-) > create mode 100644 tools/include/tools/config.h > create mode 100644 tools/perf/Documentation/perf-version.txt Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
* [GIT PULL 00/17] perf/core improvements and fixes @ 2019-02-21 1:25 Arnaldo Carvalho de Melo 2019-02-28 7:28 ` Ingo Molnar 0 siblings, 1 reply; 35+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-02-21 1:25 UTC (permalink / raw) To: Ingo Molnar Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, He Kuang, Jonas Rabenstein, Thomas Richter, Tommi Rantala, 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 43f4e6279f05eefac058a3524e184cecae463bfe: Merge tag 'perf-core-for-mingo-5.1-20190214' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-02-15 10:19:11 +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-5.1-20190220 for you to fetch changes up to b4409ae112caa6315f6ee678e953b9fc93e6919c: perf tools: Make rm_rf() remove single file (2019-02-20 17:09:28 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report: He Kuang: - Don't shadow inlined symbol with different addr range. perf script: Jiri Olsa: - Allow +- operator to ask for -F to add/remove fields to the default set, for instance to ask for the removal of the 'cpu' field in tracepoint events, adding 'period' to that kind of events, etc. perf test: Thomas Richter: - Fix scheduler tracepoint signedness of COMM fields failure of 'evsel-tp-sched' test on s390 and other arches. Tommi Rantala: - Skip trace+probe_vfs_getname.sh when 'perf trace' is not built. perf trace: Arnaldo Carvalho de Melo: - Add initial BPF map dumper, initially just for the current, minimal needs of the augmented_raw_syscalls BPF example used to collect pointer args payloads that uses BPF maps for pid and syscall filtering, but will in time have features similar to 'perf stat' --interval-print, --interval-clear, ways to signal from a BPF event that a specific map (or range of that map) should be printed, optionally as a histogram, etc. General: Jiri Olsa: - Add cpu and numa topologies classes for further reuse, fixing some issues in the process. - Fixup some warnings and debug levels. - Make rm_rf() remove single file, not just directories. Documentation: Jonas Rabenstein: - Fix HEADER_CMDLINE description in perf.data documentation. - Fix documentation of the Flags section in perf.data. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf bpf: Add bpf_map dumper perf trace: Allow dumping a BPF map after setting up BPF events He Kuang (1): perf report: Don't shadow inlined symbol with different addr range Jiri Olsa (10): perf header: Fix wrong node write in NUMA_TOPOLOGY feature perf tools: Add cpu_topology object perf tools: Add numa_topology object perf tools: Use sysfs__mountpoint() when reading cpu topology perf session: Don't report zero period samples for slave events perf evsel: Force sample_type for slave events perf script: Allow +- operator for type specific fields option perf bpf-event: Add missing new line into pr_debug call perf cpumap: Increase debug level for cpu_map__snprint verbose output perf tools: Make rm_rf() remove single file Jonas Rabenstein (2): perf doc: Fix HEADER_CMDLINE description in perf.data documentation perf doc: Fix documentation of the Flags section in perf.data Thomas Richter (1): perf test: Fix failure of 'evsel-tp-sched' test on s390 Tommi Rantala (1): perf tests shell: Skip trace+probe_vfs_getname.sh if built without trace support tools/perf/Documentation/perf-script.txt | 6 + tools/perf/Documentation/perf-trace.txt | 8 + tools/perf/Documentation/perf.data-file-format.txt | 11 +- tools/perf/builtin-script.c | 8 + tools/perf/builtin-trace.c | 19 ++ tools/perf/tests/evsel-tp-sched.c | 6 +- tools/perf/tests/shell/lib/probe.sh | 5 + tools/perf/tests/shell/trace+probe_vfs_getname.sh | 1 + tools/perf/util/Build | 2 + tools/perf/util/bpf-event.c | 2 +- tools/perf/util/bpf_map.c | 72 ++++++ tools/perf/util/bpf_map.h | 22 ++ tools/perf/util/cpumap.c | 2 +- tools/perf/util/cputopo.c | 277 +++++++++++++++++++++ tools/perf/util/cputopo.h | 33 +++ tools/perf/util/evsel.c | 8 + tools/perf/util/header.c | 269 +++----------------- tools/perf/util/session.c | 7 + tools/perf/util/sort.c | 10 +- tools/perf/util/srcline.c | 2 +- tools/perf/util/util.c | 16 +- 21 files changed, 530 insertions(+), 256 deletions(-) create mode 100644 tools/perf/util/bpf_map.c create mode 100644 tools/perf/util/bpf_map.h create mode 100644 tools/perf/util/cputopo.c create mode 100644 tools/perf/util/cputopo.h Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. 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. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.0.0-rc5.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0 6 alpine:3.9 : Ok gcc (Alpine 8.2.0) 8.2.0 7 alpine:edge : Ok gcc (Alpine 8.2.0) 8.2.0 8 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28) 9 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) 10 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 11 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 13 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 14 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) 15 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502 16 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 19 debian:experimental : Ok gcc (Debian 8.2.0-17) 8.2.1 20190204 20 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0 21 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0 22 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.2.0-16) 8.2.0 23 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 24 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) 25 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 26 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 27 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 29 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 30 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2) 31 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6) 32 fedora:28 : Ok gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6) 33 fedora:29 : Ok gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6) 34 fedora:30 : Ok gcc (GCC) 9.0.1 20190203 (Red Hat 9.0.1-0.3) 35 fedora:rawhide : Ok gcc (GCC) 9.0.0 20190119 (Red Hat 9.0.0-0.3) 36 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0 37 mageia:5 : Ok gcc (GCC) 4.9.2 38 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0 39 opensuse:13.2 : Ok gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] 40 opensuse:15.0 : Ok gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812] 41 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0 42 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5 43 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5 44 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5 45 opensuse:tumbleweed : Ok gcc (SUSE Linux) 8.2.1 20190103 [gcc-8-branch revision 267549] 46 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 47 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) 48 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 49 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 50 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0 51 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 52 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 53 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 54 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0 59 ubuntu:18.04 : Ok gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 60 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0 61 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0 62 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 63 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 64 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 65 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 66 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 67 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 68 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 69 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 70 ubuntu:18.10 : Ok gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0 71 ubuntu:19.04 : Ok gcc (Ubuntu 8.2.0-20ubuntu1) 8.2.0 72 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.2.0-20ubuntu1) 8.2.0 73 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.2.0-20ubuntu1) 8.2.0 74 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.2.0-20ubuntu1) 8.2.0 # # uname -a Linux quaco 4.20.6-200.fc29.x86_64 #1 SMP Thu Jan 31 15:50:43 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 b4409ae112ca perf tools: Make rm_rf() remove single file # perf version --build-options perf version 5.0.rc5.gb4409a dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT # 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: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Breakpoint accounting : Ok 22: Watchpoint : 22.1: Read Only Watchpoint : Skip 22.2: Write Only Watchpoint : Ok 22.3: Read / Write Watchpoint : Ok 22.4: Modify Watchpoint : Ok 23: Number of exit events of a simple workload : Ok 24: Software clock events period values : Ok 25: Object code reading : Ok 26: Sample parsing : Ok 27: Use a dummy software event to keep tracking : Ok 28: Parse with no sample_id_all bit set : Ok 29: Filter hist entries : Ok 30: Lookup mmap thread : Ok 31: Share thread mg : Ok 32: Sort output of hist entries : Ok 33: Cumulate child hist entries : Ok 34: Track with sched_switch : Ok 35: Filter fds with revents mask in a fdarray : Ok 36: Add fd to a fdarray, making it autogrow : Ok 37: kmod_path__parse : Ok 38: Thread map : Ok 39: LLVM search and compile : 39.1: Basic BPF llvm compile : Ok 39.2: kbuild searching : Ok 39.3: Compile source for BPF prologue generation : Ok 39.4: Compile source for BPF relocation : Ok 40: Session topology : Ok 41: BPF filter : 41.1: Basic BPF filtering : Ok 41.2: BPF pinning : Ok 41.3: BPF prologue generation : Ok 41.4: BPF relocation checker : Ok 42: Synthesize thread map : Ok 43: Remove thread map : Ok 44: Synthesize cpu map : Ok 45: Synthesize stat config : Ok 46: Synthesize stat : Ok 47: Synthesize stat round : Ok 48: Synthesize attr update : Ok 49: Event times : Ok 50: Read backward ring buffer : Ok 51: Print cpu map : Ok 52: Probe SDT events : Ok 53: is_printable_array : Ok 54: Print bitmap : Ok 55: perf hooks : Ok 56: builtin clang support : Skip (not compiled in) 57: unit_number__scnprintf : Ok 58: mem2node : Ok 59: x86 rdpmc : Ok 60: Convert perf time to TSC : Ok 61: DWARF unwind : Ok 62: x86 instruction decoder - new instructions : Ok 63: x86 bp modify : Ok 64: probe libc's inet_pton & backtrace it with ping : Ok 65: Use vfs_getname probe to get syscall args filenames : Ok 66: Add vfs_getname probe to get syscall args filenames : Ok 67: Check open filename arg using perf trace + vfs_getname: Ok $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_libelf_O: make NO_LIBELF=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_perf_o_O: make perf.o make_install_bin_O: make install-bin make_no_libbionic_O: make NO_LIBBIONIC=1 make_help_O: make help make_no_demangle_O: make NO_DEMANGLE=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_install_O: make install make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_libaudit_O: make NO_LIBAUDIT=1 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_slang_O: make NO_SLANG=1 make_no_libbpf_O: make NO_LIBBPF=1 make_cscope_O: make cscope make_no_newt_O: make NO_NEWT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_debug_O: make DEBUG=1 make_util_map_o_O: make util/map.o make_tags_O: make tags make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_clean_all_O: make clean all make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_static_O: make LDFLAGS=-static make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_gtk2_O: make NO_GTK2=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_auxtrace_O: make NO_AUXTRACE=1 make_doc_O: make doc make_pure_O: make OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [GIT PULL 00/17] perf/core improvements and fixes 2019-02-21 1:25 Arnaldo Carvalho de Melo @ 2019-02-28 7:28 ` Ingo Molnar 0 siblings, 0 replies; 35+ messages in thread From: Ingo Molnar @ 2019-02-28 7:28 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, He Kuang, Jonas Rabenstein, Thomas Richter, Tommi Rantala, 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 43f4e6279f05eefac058a3524e184cecae463bfe: > > Merge tag 'perf-core-for-mingo-5.1-20190214' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-02-15 10:19:11 +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-5.1-20190220 > > for you to fetch changes up to b4409ae112caa6315f6ee678e953b9fc93e6919c: > > perf tools: Make rm_rf() remove single file (2019-02-20 17:09:28 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf report: > > He Kuang: > > - Don't shadow inlined symbol with different addr range. > > perf script: > > Jiri Olsa: > > - Allow +- operator to ask for -F to add/remove fields to > the default set, for instance to ask for the removal of the > 'cpu' field in tracepoint events, adding 'period' to that > kind of events, etc. > > perf test: > > Thomas Richter: > > - Fix scheduler tracepoint signedness of COMM fields failure of > 'evsel-tp-sched' test on s390 and other arches. > > Tommi Rantala: > > - Skip trace+probe_vfs_getname.sh when 'perf trace' is not built. > > perf trace: > > Arnaldo Carvalho de Melo: > > - Add initial BPF map dumper, initially just for the current, minimal > needs of the augmented_raw_syscalls BPF example used to collect > pointer args payloads that uses BPF maps for pid and syscall filtering, > but will in time have features similar to 'perf stat' --interval-print, > --interval-clear, ways to signal from a BPF event that a specific > map (or range of that map) should be printed, optionally as a > histogram, etc. > > General: > > Jiri Olsa: > > - Add cpu and numa topologies classes for further reuse, fixing some > issues in the process. > > - Fixup some warnings and debug levels. > > - Make rm_rf() remove single file, not just directories. > > Documentation: > > Jonas Rabenstein: > > - Fix HEADER_CMDLINE description in perf.data documentation. > > - Fix documentation of the Flags section in perf.data. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > perf bpf: Add bpf_map dumper > perf trace: Allow dumping a BPF map after setting up BPF events > > He Kuang (1): > perf report: Don't shadow inlined symbol with different addr range > > Jiri Olsa (10): > perf header: Fix wrong node write in NUMA_TOPOLOGY feature > perf tools: Add cpu_topology object > perf tools: Add numa_topology object > perf tools: Use sysfs__mountpoint() when reading cpu topology > perf session: Don't report zero period samples for slave events > perf evsel: Force sample_type for slave events > perf script: Allow +- operator for type specific fields option > perf bpf-event: Add missing new line into pr_debug call > perf cpumap: Increase debug level for cpu_map__snprint verbose output > perf tools: Make rm_rf() remove single file > > Jonas Rabenstein (2): > perf doc: Fix HEADER_CMDLINE description in perf.data documentation > perf doc: Fix documentation of the Flags section in perf.data > > Thomas Richter (1): > perf test: Fix failure of 'evsel-tp-sched' test on s390 > > Tommi Rantala (1): > perf tests shell: Skip trace+probe_vfs_getname.sh if built without trace support > > tools/perf/Documentation/perf-script.txt | 6 + > tools/perf/Documentation/perf-trace.txt | 8 + > tools/perf/Documentation/perf.data-file-format.txt | 11 +- > tools/perf/builtin-script.c | 8 + > tools/perf/builtin-trace.c | 19 ++ > tools/perf/tests/evsel-tp-sched.c | 6 +- > tools/perf/tests/shell/lib/probe.sh | 5 + > tools/perf/tests/shell/trace+probe_vfs_getname.sh | 1 + > tools/perf/util/Build | 2 + > tools/perf/util/bpf-event.c | 2 +- > tools/perf/util/bpf_map.c | 72 ++++++ > tools/perf/util/bpf_map.h | 22 ++ > tools/perf/util/cpumap.c | 2 +- > tools/perf/util/cputopo.c | 277 +++++++++++++++++++++ > tools/perf/util/cputopo.h | 33 +++ > tools/perf/util/evsel.c | 8 + > tools/perf/util/header.c | 269 +++----------------- > tools/perf/util/session.c | 7 + > tools/perf/util/sort.c | 10 +- > tools/perf/util/srcline.c | 2 +- > tools/perf/util/util.c | 16 +- > 21 files changed, 530 insertions(+), 256 deletions(-) > create mode 100644 tools/perf/util/bpf_map.c > create mode 100644 tools/perf/util/bpf_map.h > create mode 100644 tools/perf/util/cputopo.c > create mode 100644 tools/perf/util/cputopo.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2019-02-28 7:28 UTC | newest] Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 01/17] tools lib traceevent: Modify header to work in C++ programs Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 02/17] perf session: flush_sample_queue needs to handle errors from handlers Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 03/17] perf tool: handle errors in synthesized event functions Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 04/17] perf lock: Remove use of die and handle errors Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 05/17] perf stat: Remove use of die/exit " Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 06/17] perf help: Remove use of die " Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 07/17] perf script: Remove use of die/exit Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 08/17] perf record: " Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 09/17] perf tools: Fix x86 builds with ARCH specified on the command line Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 10/17] perf tools: Fix intlist node removal Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove Arnaldo Carvalho de Melo 2012-09-05 23:32 ` David Ahern 2012-09-05 23:08 ` [PATCH 12/17] perf tools: remove unneeded include of network header files Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 13/17] perf header: Use evlist->nr_entries on write_event_desc() Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 14/17] perf header: Set tracepoint event name only if not set Arnaldo Carvalho de Melo 2012-09-06 0:01 ` David Ahern 2012-09-06 1:30 ` Namhyung Kim 2012-09-05 23:08 ` [PATCH 15/17] perf header: Swap pmu mapping numbers if needed Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 16/17] perf tools: Replace mempcpy with memcpy Arnaldo Carvalho de Melo 2012-09-05 23:08 ` [PATCH 17/17] perf tools: Allow user to indicate path to objdump in command line Arnaldo Carvalho de Melo 2013-02-06 21:44 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo 2013-02-06 21:51 ` Ingo Molnar 2015-05-14 22:37 Arnaldo Carvalho de Melo 2015-05-15 6:39 ` Ingo Molnar 2016-05-06 0:29 Arnaldo Carvalho de Melo 2016-05-06 6:36 ` Ingo Molnar 2016-08-04 0:49 Arnaldo Carvalho de Melo 2016-08-04 9:04 ` Ingo Molnar 2018-04-04 2:21 Arnaldo Carvalho de Melo 2018-04-04 2:21 ` Arnaldo Carvalho de Melo 2018-04-04 5:25 ` Ingo Molnar 2018-04-04 5:25 ` Ingo Molnar 2019-02-21 1:25 Arnaldo Carvalho de Melo 2019-02-28 7:28 ` Ingo Molnar
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.