* [GIT PULL 00/18] perf/core improvements and fixes @ 2014-11-06 21:04 Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 01/18] perf tools: Add a thread stack for synthesizing call chains Arnaldo Carvalho de Melo ` (18 more replies) 0 siblings, 19 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit daa01794a4a36a1da1b09a529adec0c8c0b94ab2: perf evsel: Do not call pevent_free_format when deleting tracepoint (2014-11-06 17:47:14 -0300) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo for you to fetch changes up to daa01794a4a36a1da1b09a529adec0c8c0b94ab2: perf evsel: Do not call pevent_free_format when deleting tracepoint (2014-11-06 17:47:14 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Infrastructure: o Add gzip decompression support for kernel modules (Namhyung Kim) o More prep patches for Intel PT, including a a thread stack and more stuff made available via the database export mechanism (Adrian Hunter) o Optimize checking that tracepoint events are defined in perf script perl/python (Jiri Olsa) o Do not free pevent when deleting tracepoint evsel (Jiri Olsa) o Fix build-id matching for vmlinux (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- ^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH 01/18] perf tools: Add a thread stack for synthesizing call chains 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 02/18] perf tools: Enhance the thread stack to output call/return data Arnaldo Carvalho de Melo ` (17 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Add a thread stack for synthesizing call chains from call and return events. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile.perf | 2 + tools/perf/util/event.h | 26 +++++++ tools/perf/util/thread-stack.c | 172 +++++++++++++++++++++++++++++++++++++++++ tools/perf/util/thread-stack.h | 32 ++++++++ tools/perf/util/thread.c | 3 + tools/perf/util/thread.h | 3 + 6 files changed, 238 insertions(+) create mode 100644 tools/perf/util/thread-stack.c create mode 100644 tools/perf/util/thread-stack.h diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 3caf7dab50e8..0ebcc4ad0244 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -317,6 +317,7 @@ LIB_H += ui/util.h LIB_H += ui/ui.h LIB_H += util/data.h LIB_H += util/kvm-stat.h +LIB_H += util/thread-stack.h LIB_OBJS += $(OUTPUT)util/abspath.o LIB_OBJS += $(OUTPUT)util/alias.o @@ -394,6 +395,7 @@ LIB_OBJS += $(OUTPUT)util/srcline.o LIB_OBJS += $(OUTPUT)util/data.o LIB_OBJS += $(OUTPUT)util/tsc.o LIB_OBJS += $(OUTPUT)util/cloexec.o +LIB_OBJS += $(OUTPUT)util/thread-stack.o LIB_OBJS += $(OUTPUT)ui/setup.o LIB_OBJS += $(OUTPUT)ui/helpline.o diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 8c7fe9d64e79..7be389735402 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -143,6 +143,32 @@ struct branch_stack { struct branch_entry entries[0]; }; +enum { + PERF_IP_FLAG_BRANCH = 1ULL << 0, + PERF_IP_FLAG_CALL = 1ULL << 1, + PERF_IP_FLAG_RETURN = 1ULL << 2, + PERF_IP_FLAG_CONDITIONAL = 1ULL << 3, + PERF_IP_FLAG_SYSCALLRET = 1ULL << 4, + PERF_IP_FLAG_ASYNC = 1ULL << 5, + PERF_IP_FLAG_INTERRUPT = 1ULL << 6, + PERF_IP_FLAG_TX_ABORT = 1ULL << 7, + PERF_IP_FLAG_TRACE_BEGIN = 1ULL << 8, + PERF_IP_FLAG_TRACE_END = 1ULL << 9, + PERF_IP_FLAG_IN_TX = 1ULL << 10, +}; + +#define PERF_BRANCH_MASK (\ + PERF_IP_FLAG_BRANCH |\ + PERF_IP_FLAG_CALL |\ + PERF_IP_FLAG_RETURN |\ + PERF_IP_FLAG_CONDITIONAL |\ + PERF_IP_FLAG_SYSCALLRET |\ + PERF_IP_FLAG_ASYNC |\ + PERF_IP_FLAG_INTERRUPT |\ + PERF_IP_FLAG_TX_ABORT |\ + PERF_IP_FLAG_TRACE_BEGIN |\ + PERF_IP_FLAG_TRACE_END) + struct perf_sample { u64 ip; u32 pid, tid; diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c new file mode 100644 index 000000000000..85b60d2e738f --- /dev/null +++ b/tools/perf/util/thread-stack.c @@ -0,0 +1,172 @@ +/* + * thread-stack.c: Synthesize a thread's stack using call / return events + * Copyright (c) 2014, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + */ + +#include "thread.h" +#include "event.h" +#include "util.h" +#include "debug.h" +#include "thread-stack.h" + +#define STACK_GROWTH 4096 + +struct thread_stack_entry { + u64 ret_addr; +}; + +struct thread_stack { + struct thread_stack_entry *stack; + size_t cnt; + size_t sz; + u64 trace_nr; +}; + +static int thread_stack__grow(struct thread_stack *ts) +{ + struct thread_stack_entry *new_stack; + size_t sz, new_sz; + + new_sz = ts->sz + STACK_GROWTH; + sz = new_sz * sizeof(struct thread_stack_entry); + + new_stack = realloc(ts->stack, sz); + if (!new_stack) + return -ENOMEM; + + ts->stack = new_stack; + ts->sz = new_sz; + + return 0; +} + +static struct thread_stack *thread_stack__new(void) +{ + struct thread_stack *ts; + + ts = zalloc(sizeof(struct thread_stack)); + if (!ts) + return NULL; + + if (thread_stack__grow(ts)) { + free(ts); + return NULL; + } + + return ts; +} + +static int thread_stack__push(struct thread_stack *ts, u64 ret_addr) +{ + int err = 0; + + if (ts->cnt == ts->sz) { + err = thread_stack__grow(ts); + if (err) { + pr_warning("Out of memory: discarding thread stack\n"); + ts->cnt = 0; + } + } + + ts->stack[ts->cnt++].ret_addr = ret_addr; + + return err; +} + +static void thread_stack__pop(struct thread_stack *ts, u64 ret_addr) +{ + size_t i; + + /* + * In some cases there may be functions which are not seen to return. + * For example when setjmp / longjmp has been used. Or the perf context + * switch in the kernel which doesn't stop and start tracing in exactly + * the same code path. When that happens the return address will be + * further down the stack. If the return address is not found at all, + * we assume the opposite (i.e. this is a return for a call that wasn't + * seen for some reason) and leave the stack alone. + */ + for (i = ts->cnt; i; ) { + if (ts->stack[--i].ret_addr == ret_addr) { + ts->cnt = i; + return; + } + } +} + +int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, + u64 to_ip, u16 insn_len, u64 trace_nr) +{ + if (!thread) + return -EINVAL; + + if (!thread->ts) { + thread->ts = thread_stack__new(); + if (!thread->ts) { + pr_warning("Out of memory: no thread stack\n"); + return -ENOMEM; + } + thread->ts->trace_nr = trace_nr; + } + + /* + * When the trace is discontinuous, the trace_nr changes. In that case + * the stack might be completely invalid. Better to report nothing than + * to report something misleading, so reset the stack count to zero. + */ + if (trace_nr != thread->ts->trace_nr) { + thread->ts->trace_nr = trace_nr; + thread->ts->cnt = 0; + } + + if (flags & PERF_IP_FLAG_CALL) { + u64 ret_addr; + + if (!to_ip) + return 0; + ret_addr = from_ip + insn_len; + if (ret_addr == to_ip) + return 0; /* Zero-length calls are excluded */ + return thread_stack__push(thread->ts, ret_addr); + } else if (flags & PERF_IP_FLAG_RETURN) { + if (!from_ip) + return 0; + thread_stack__pop(thread->ts, to_ip); + } + + return 0; +} + +void thread_stack__free(struct thread *thread) +{ + if (thread->ts) { + zfree(&thread->ts->stack); + zfree(&thread->ts); + } +} + +void thread_stack__sample(struct thread *thread, struct ip_callchain *chain, + size_t sz, u64 ip) +{ + size_t i; + + if (!thread || !thread->ts) + chain->nr = 1; + else + chain->nr = min(sz, thread->ts->cnt + 1); + + chain->ips[0] = ip; + + for (i = 1; i < chain->nr; i++) + chain->ips[i] = thread->ts->stack[thread->ts->cnt - i].ret_addr; +} diff --git a/tools/perf/util/thread-stack.h b/tools/perf/util/thread-stack.h new file mode 100644 index 000000000000..7c41579aec74 --- /dev/null +++ b/tools/perf/util/thread-stack.h @@ -0,0 +1,32 @@ +/* + * thread-stack.h: Synthesize a thread's stack using call / return events + * Copyright (c) 2014, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + */ + +#ifndef __PERF_THREAD_STACK_H +#define __PERF_THREAD_STACK_H + +#include <sys/types.h> + +#include <linux/types.h> + +struct thread; +struct ip_callchain; + +int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, + u64 to_ip, u16 insn_len, u64 trace_nr); +void thread_stack__sample(struct thread *thread, struct ip_callchain *chain, + size_t sz, u64 ip); +void thread_stack__free(struct thread *thread); + +#endif diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index bf5bf858b7f6..a2157f0ef1df 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -4,6 +4,7 @@ #include <string.h> #include "session.h" #include "thread.h" +#include "thread-stack.h" #include "util.h" #include "debug.h" #include "comm.h" @@ -66,6 +67,8 @@ void thread__delete(struct thread *thread) { struct comm *comm, *tmp; + thread_stack__free(thread); + if (thread->mg) { map_groups__put(thread->mg); thread->mg = NULL; diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index d34cf5c0d0d9..160fd066a7d1 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h @@ -8,6 +8,8 @@ #include "symbol.h" #include <strlist.h> +struct thread_stack; + struct thread { union { struct rb_node rb_node; @@ -26,6 +28,7 @@ struct thread { u64 db_id; void *priv; + struct thread_stack *ts; }; struct machine; -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 02/18] perf tools: Enhance the thread stack to output call/return data 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 01/18] perf tools: Add a thread stack for synthesizing call chains Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 03/18] perf tools: Add branch type to db export Arnaldo Carvalho de Melo ` (16 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Enhance the thread stack to output detailed information about paired calls and returns. The enhanced processing consumes sample information via thread_stack__process() and outputs information about paired calls / returns via a call-back. While the call-back makes it possible for the facility to be used by arbitrary tools, a subsequent patch will provide the information to Python scripting via the db-export interface. An important part of the call/return information is the call path which provides a structure that defines a context sensitive call graph. Note that there are now two ways to use the thread stack. For simply providing a call stack (like you would get from the perf record -g option) the interface consists of thread_stack__event() and thread_stack__sample(). Whereas the enhanced interface consists of call_return_processor__new() and thread_stack__process(). Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-5-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/thread-stack.c | 585 ++++++++++++++++++++++++++++++++++++++++- tools/perf/util/thread-stack.h | 79 ++++++ 2 files changed, 659 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c index 85b60d2e738f..9ed59a452d1f 100644 --- a/tools/perf/util/thread-stack.c +++ b/tools/perf/util/thread-stack.c @@ -13,23 +13,96 @@ * */ +#include <linux/rbtree.h> +#include <linux/list.h> #include "thread.h" #include "event.h" +#include "machine.h" #include "util.h" #include "debug.h" +#include "symbol.h" +#include "comm.h" #include "thread-stack.h" -#define STACK_GROWTH 4096 +#define CALL_PATH_BLOCK_SHIFT 8 +#define CALL_PATH_BLOCK_SIZE (1 << CALL_PATH_BLOCK_SHIFT) +#define CALL_PATH_BLOCK_MASK (CALL_PATH_BLOCK_SIZE - 1) +struct call_path_block { + struct call_path cp[CALL_PATH_BLOCK_SIZE]; + struct list_head node; +}; + +/** + * struct call_path_root - root of all call paths. + * @call_path: root call path + * @blocks: list of blocks to store call paths + * @next: next free space + * @sz: number of spaces + */ +struct call_path_root { + struct call_path call_path; + struct list_head blocks; + size_t next; + size_t sz; +}; + +/** + * struct call_return_processor - provides a call-back to consume call-return + * information. + * @cpr: call path root + * @process: call-back that accepts call/return information + * @data: anonymous data for call-back + */ +struct call_return_processor { + struct call_path_root *cpr; + int (*process)(struct call_return *cr, void *data); + void *data; +}; + +#define STACK_GROWTH 2048 + +/** + * struct thread_stack_entry - thread stack entry. + * @ret_addr: return address + * @timestamp: timestamp (if known) + * @ref: external reference (e.g. db_id of sample) + * @branch_count: the branch count when the entry was created + * @cp: call path + * @no_call: a 'call' was not seen + */ struct thread_stack_entry { u64 ret_addr; + u64 timestamp; + u64 ref; + u64 branch_count; + struct call_path *cp; + bool no_call; }; +/** + * struct thread_stack - thread stack constructed from 'call' and 'return' + * branch samples. + * @stack: array that holds the stack + * @cnt: number of entries in the stack + * @sz: current maximum stack size + * @trace_nr: current trace number + * @branch_count: running branch count + * @kernel_start: kernel start address + * @last_time: last timestamp + * @crp: call/return processor + * @comm: current comm + */ struct thread_stack { struct thread_stack_entry *stack; size_t cnt; size_t sz; u64 trace_nr; + u64 branch_count; + u64 kernel_start; + u64 last_time; + struct call_return_processor *crp; + struct comm *comm; }; static int thread_stack__grow(struct thread_stack *ts) @@ -50,7 +123,8 @@ static int thread_stack__grow(struct thread_stack *ts) return 0; } -static struct thread_stack *thread_stack__new(void) +static struct thread_stack *thread_stack__new(struct thread *thread, + struct call_return_processor *crp) { struct thread_stack *ts; @@ -63,6 +137,12 @@ static struct thread_stack *thread_stack__new(void) return NULL; } + if (thread->mg && thread->mg->machine) + ts->kernel_start = machine__kernel_start(thread->mg->machine); + else + ts->kernel_start = 1ULL << 63; + ts->crp = crp; + return ts; } @@ -104,6 +184,64 @@ static void thread_stack__pop(struct thread_stack *ts, u64 ret_addr) } } +static bool thread_stack__in_kernel(struct thread_stack *ts) +{ + if (!ts->cnt) + return false; + + return ts->stack[ts->cnt - 1].cp->in_kernel; +} + +static int thread_stack__call_return(struct thread *thread, + struct thread_stack *ts, size_t idx, + u64 timestamp, u64 ref, bool no_return) +{ + struct call_return_processor *crp = ts->crp; + struct thread_stack_entry *tse; + struct call_return cr = { + .thread = thread, + .comm = ts->comm, + .db_id = 0, + }; + + tse = &ts->stack[idx]; + cr.cp = tse->cp; + cr.call_time = tse->timestamp; + cr.return_time = timestamp; + cr.branch_count = ts->branch_count - tse->branch_count; + cr.call_ref = tse->ref; + cr.return_ref = ref; + if (tse->no_call) + cr.flags |= CALL_RETURN_NO_CALL; + if (no_return) + cr.flags |= CALL_RETURN_NO_RETURN; + + return crp->process(&cr, crp->data); +} + +static int thread_stack__flush(struct thread *thread, struct thread_stack *ts) +{ + struct call_return_processor *crp = ts->crp; + int err; + + if (!crp) { + ts->cnt = 0; + return 0; + } + + while (ts->cnt) { + err = thread_stack__call_return(thread, ts, --ts->cnt, + ts->last_time, 0, true); + if (err) { + pr_err("Error flushing thread stack!\n"); + ts->cnt = 0; + return err; + } + } + + return 0; +} + int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, u64 to_ip, u16 insn_len, u64 trace_nr) { @@ -111,7 +249,7 @@ int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, return -EINVAL; if (!thread->ts) { - thread->ts = thread_stack__new(); + thread->ts = thread_stack__new(thread, NULL); if (!thread->ts) { pr_warning("Out of memory: no thread stack\n"); return -ENOMEM; @@ -122,13 +260,18 @@ int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, /* * When the trace is discontinuous, the trace_nr changes. In that case * the stack might be completely invalid. Better to report nothing than - * to report something misleading, so reset the stack count to zero. + * to report something misleading, so flush the stack. */ if (trace_nr != thread->ts->trace_nr) { + if (thread->ts->trace_nr) + thread_stack__flush(thread, thread->ts); thread->ts->trace_nr = trace_nr; - thread->ts->cnt = 0; } + /* Stop here if thread_stack__process() is in use */ + if (thread->ts->crp) + return 0; + if (flags & PERF_IP_FLAG_CALL) { u64 ret_addr; @@ -147,9 +290,22 @@ int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, return 0; } +void thread_stack__set_trace_nr(struct thread *thread, u64 trace_nr) +{ + if (!thread || !thread->ts) + return; + + if (trace_nr != thread->ts->trace_nr) { + if (thread->ts->trace_nr) + thread_stack__flush(thread, thread->ts); + thread->ts->trace_nr = trace_nr; + } +} + void thread_stack__free(struct thread *thread) { if (thread->ts) { + thread_stack__flush(thread, thread->ts); zfree(&thread->ts->stack); zfree(&thread->ts); } @@ -170,3 +326,422 @@ void thread_stack__sample(struct thread *thread, struct ip_callchain *chain, for (i = 1; i < chain->nr; i++) chain->ips[i] = thread->ts->stack[thread->ts->cnt - i].ret_addr; } + +static void call_path__init(struct call_path *cp, struct call_path *parent, + struct symbol *sym, u64 ip, bool in_kernel) +{ + cp->parent = parent; + cp->sym = sym; + cp->ip = sym ? 0 : ip; + cp->db_id = 0; + cp->in_kernel = in_kernel; + RB_CLEAR_NODE(&cp->rb_node); + cp->children = RB_ROOT; +} + +static struct call_path_root *call_path_root__new(void) +{ + struct call_path_root *cpr; + + cpr = zalloc(sizeof(struct call_path_root)); + if (!cpr) + return NULL; + call_path__init(&cpr->call_path, NULL, NULL, 0, false); + INIT_LIST_HEAD(&cpr->blocks); + return cpr; +} + +static void call_path_root__free(struct call_path_root *cpr) +{ + struct call_path_block *pos, *n; + + list_for_each_entry_safe(pos, n, &cpr->blocks, node) { + list_del(&pos->node); + free(pos); + } + free(cpr); +} + +static struct call_path *call_path__new(struct call_path_root *cpr, + struct call_path *parent, + struct symbol *sym, u64 ip, + bool in_kernel) +{ + struct call_path_block *cpb; + struct call_path *cp; + size_t n; + + if (cpr->next < cpr->sz) { + cpb = list_last_entry(&cpr->blocks, struct call_path_block, + node); + } else { + cpb = zalloc(sizeof(struct call_path_block)); + if (!cpb) + return NULL; + list_add_tail(&cpb->node, &cpr->blocks); + cpr->sz += CALL_PATH_BLOCK_SIZE; + } + + n = cpr->next++ & CALL_PATH_BLOCK_MASK; + cp = &cpb->cp[n]; + + call_path__init(cp, parent, sym, ip, in_kernel); + + return cp; +} + +static struct call_path *call_path__findnew(struct call_path_root *cpr, + struct call_path *parent, + struct symbol *sym, u64 ip, u64 ks) +{ + struct rb_node **p; + struct rb_node *node_parent = NULL; + struct call_path *cp; + bool in_kernel = ip >= ks; + + if (sym) + ip = 0; + + if (!parent) + return call_path__new(cpr, parent, sym, ip, in_kernel); + + p = &parent->children.rb_node; + while (*p != NULL) { + node_parent = *p; + cp = rb_entry(node_parent, struct call_path, rb_node); + + if (cp->sym == sym && cp->ip == ip) + return cp; + + if (sym < cp->sym || (sym == cp->sym && ip < cp->ip)) + p = &(*p)->rb_left; + else + p = &(*p)->rb_right; + } + + cp = call_path__new(cpr, parent, sym, ip, in_kernel); + if (!cp) + return NULL; + + rb_link_node(&cp->rb_node, node_parent, p); + rb_insert_color(&cp->rb_node, &parent->children); + + return cp; +} + +struct call_return_processor * +call_return_processor__new(int (*process)(struct call_return *cr, void *data), + void *data) +{ + struct call_return_processor *crp; + + crp = zalloc(sizeof(struct call_return_processor)); + if (!crp) + return NULL; + crp->cpr = call_path_root__new(); + if (!crp->cpr) + goto out_free; + crp->process = process; + crp->data = data; + return crp; + +out_free: + free(crp); + return NULL; +} + +void call_return_processor__free(struct call_return_processor *crp) +{ + if (crp) { + call_path_root__free(crp->cpr); + free(crp); + } +} + +static int thread_stack__push_cp(struct thread_stack *ts, u64 ret_addr, + u64 timestamp, u64 ref, struct call_path *cp, + bool no_call) +{ + struct thread_stack_entry *tse; + int err; + + if (ts->cnt == ts->sz) { + err = thread_stack__grow(ts); + if (err) + return err; + } + + tse = &ts->stack[ts->cnt++]; + tse->ret_addr = ret_addr; + tse->timestamp = timestamp; + tse->ref = ref; + tse->branch_count = ts->branch_count; + tse->cp = cp; + tse->no_call = no_call; + + return 0; +} + +static int thread_stack__pop_cp(struct thread *thread, struct thread_stack *ts, + u64 ret_addr, u64 timestamp, u64 ref, + struct symbol *sym) +{ + int err; + + if (!ts->cnt) + return 1; + + if (ts->cnt == 1) { + struct thread_stack_entry *tse = &ts->stack[0]; + + if (tse->cp->sym == sym) + return thread_stack__call_return(thread, ts, --ts->cnt, + timestamp, ref, false); + } + + if (ts->stack[ts->cnt - 1].ret_addr == ret_addr) { + return thread_stack__call_return(thread, ts, --ts->cnt, + timestamp, ref, false); + } else { + size_t i = ts->cnt - 1; + + while (i--) { + if (ts->stack[i].ret_addr != ret_addr) + continue; + i += 1; + while (ts->cnt > i) { + err = thread_stack__call_return(thread, ts, + --ts->cnt, + timestamp, ref, + true); + if (err) + return err; + } + return thread_stack__call_return(thread, ts, --ts->cnt, + timestamp, ref, false); + } + } + + return 1; +} + +static int thread_stack__bottom(struct thread *thread, struct thread_stack *ts, + struct perf_sample *sample, + struct addr_location *from_al, + struct addr_location *to_al, u64 ref) +{ + struct call_path_root *cpr = ts->crp->cpr; + struct call_path *cp; + struct symbol *sym; + u64 ip; + + if (sample->ip) { + ip = sample->ip; + sym = from_al->sym; + } else if (sample->addr) { + ip = sample->addr; + sym = to_al->sym; + } else { + return 0; + } + + cp = call_path__findnew(cpr, &cpr->call_path, sym, ip, + ts->kernel_start); + if (!cp) + return -ENOMEM; + + return thread_stack__push_cp(thread->ts, ip, sample->time, ref, cp, + true); +} + +static int thread_stack__no_call_return(struct thread *thread, + struct thread_stack *ts, + struct perf_sample *sample, + struct addr_location *from_al, + struct addr_location *to_al, u64 ref) +{ + struct call_path_root *cpr = ts->crp->cpr; + struct call_path *cp, *parent; + u64 ks = ts->kernel_start; + int err; + + if (sample->ip >= ks && sample->addr < ks) { + /* Return to userspace, so pop all kernel addresses */ + while (thread_stack__in_kernel(ts)) { + err = thread_stack__call_return(thread, ts, --ts->cnt, + sample->time, ref, + true); + if (err) + return err; + } + + /* If the stack is empty, push the userspace address */ + if (!ts->cnt) { + cp = call_path__findnew(cpr, &cpr->call_path, + to_al->sym, sample->addr, + ts->kernel_start); + if (!cp) + return -ENOMEM; + return thread_stack__push_cp(ts, 0, sample->time, ref, + cp, true); + } + } else if (thread_stack__in_kernel(ts) && sample->ip < ks) { + /* Return to userspace, so pop all kernel addresses */ + while (thread_stack__in_kernel(ts)) { + err = thread_stack__call_return(thread, ts, --ts->cnt, + sample->time, ref, + true); + if (err) + return err; + } + } + + if (ts->cnt) + parent = ts->stack[ts->cnt - 1].cp; + else + parent = &cpr->call_path; + + /* This 'return' had no 'call', so push and pop top of stack */ + cp = call_path__findnew(cpr, parent, from_al->sym, sample->ip, + ts->kernel_start); + if (!cp) + return -ENOMEM; + + err = thread_stack__push_cp(ts, sample->addr, sample->time, ref, cp, + true); + if (err) + return err; + + return thread_stack__pop_cp(thread, ts, sample->addr, sample->time, ref, + to_al->sym); +} + +static int thread_stack__trace_begin(struct thread *thread, + struct thread_stack *ts, u64 timestamp, + u64 ref) +{ + struct thread_stack_entry *tse; + int err; + + if (!ts->cnt) + return 0; + + /* Pop trace end */ + tse = &ts->stack[ts->cnt - 1]; + if (tse->cp->sym == NULL && tse->cp->ip == 0) { + err = thread_stack__call_return(thread, ts, --ts->cnt, + timestamp, ref, false); + if (err) + return err; + } + + return 0; +} + +static int thread_stack__trace_end(struct thread_stack *ts, + struct perf_sample *sample, u64 ref) +{ + struct call_path_root *cpr = ts->crp->cpr; + struct call_path *cp; + u64 ret_addr; + + /* No point having 'trace end' on the bottom of the stack */ + if (!ts->cnt || (ts->cnt == 1 && ts->stack[0].ref == ref)) + return 0; + + cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, NULL, 0, + ts->kernel_start); + if (!cp) + return -ENOMEM; + + ret_addr = sample->ip + sample->insn_len; + + return thread_stack__push_cp(ts, ret_addr, sample->time, ref, cp, + false); +} + +int thread_stack__process(struct thread *thread, struct comm *comm, + struct perf_sample *sample, + struct addr_location *from_al, + struct addr_location *to_al, u64 ref, + struct call_return_processor *crp) +{ + struct thread_stack *ts = thread->ts; + int err = 0; + + if (ts) { + if (!ts->crp) { + /* Supersede thread_stack__event() */ + thread_stack__free(thread); + thread->ts = thread_stack__new(thread, crp); + if (!thread->ts) + return -ENOMEM; + ts = thread->ts; + ts->comm = comm; + } + } else { + thread->ts = thread_stack__new(thread, crp); + if (!thread->ts) + return -ENOMEM; + ts = thread->ts; + ts->comm = comm; + } + + /* Flush stack on exec */ + if (ts->comm != comm && thread->pid_ == thread->tid) { + err = thread_stack__flush(thread, ts); + if (err) + return err; + ts->comm = comm; + } + + /* If the stack is empty, put the current symbol on the stack */ + if (!ts->cnt) { + err = thread_stack__bottom(thread, ts, sample, from_al, to_al, + ref); + if (err) + return err; + } + + ts->branch_count += 1; + ts->last_time = sample->time; + + if (sample->flags & PERF_IP_FLAG_CALL) { + struct call_path_root *cpr = ts->crp->cpr; + struct call_path *cp; + u64 ret_addr; + + if (!sample->ip || !sample->addr) + return 0; + + ret_addr = sample->ip + sample->insn_len; + if (ret_addr == sample->addr) + return 0; /* Zero-length calls are excluded */ + + cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, + to_al->sym, sample->addr, + ts->kernel_start); + if (!cp) + return -ENOMEM; + err = thread_stack__push_cp(ts, ret_addr, sample->time, ref, + cp, false); + } else if (sample->flags & PERF_IP_FLAG_RETURN) { + if (!sample->ip || !sample->addr) + return 0; + + err = thread_stack__pop_cp(thread, ts, sample->addr, + sample->time, ref, from_al->sym); + if (err) { + if (err < 0) + return err; + err = thread_stack__no_call_return(thread, ts, sample, + from_al, to_al, ref); + } + } else if (sample->flags & PERF_IP_FLAG_TRACE_BEGIN) { + err = thread_stack__trace_begin(thread, ts, sample->time, ref); + } else if (sample->flags & PERF_IP_FLAG_TRACE_END) { + err = thread_stack__trace_end(ts, sample, ref); + } + + return err; +} diff --git a/tools/perf/util/thread-stack.h b/tools/perf/util/thread-stack.h index 7c41579aec74..b843bbef8ba2 100644 --- a/tools/perf/util/thread-stack.h +++ b/tools/perf/util/thread-stack.h @@ -19,14 +19,93 @@ #include <sys/types.h> #include <linux/types.h> +#include <linux/rbtree.h> struct thread; +struct comm; struct ip_callchain; +struct symbol; +struct dso; +struct call_return_processor; +struct comm; +struct perf_sample; +struct addr_location; + +/* + * Call/Return flags. + * + * CALL_RETURN_NO_CALL: 'return' but no matching 'call' + * CALL_RETURN_NO_RETURN: 'call' but no matching 'return' + */ +enum { + CALL_RETURN_NO_CALL = 1 << 0, + CALL_RETURN_NO_RETURN = 1 << 1, +}; + +/** + * struct call_return - paired call/return information. + * @thread: thread in which call/return occurred + * @comm: comm in which call/return occurred + * @cp: call path + * @call_time: timestamp of call (if known) + * @return_time: timestamp of return (if known) + * @branch_count: number of branches seen between call and return + * @call_ref: external reference to 'call' sample (e.g. db_id) + * @return_ref: external reference to 'return' sample (e.g. db_id) + * @db_id: id used for db-export + * @flags: Call/Return flags + */ +struct call_return { + struct thread *thread; + struct comm *comm; + struct call_path *cp; + u64 call_time; + u64 return_time; + u64 branch_count; + u64 call_ref; + u64 return_ref; + u64 db_id; + u32 flags; +}; + +/** + * struct call_path - node in list of calls leading to a function call. + * @parent: call path to the parent function call + * @sym: symbol of function called + * @ip: only if sym is null, the ip of the function + * @db_id: id used for db-export + * @in_kernel: whether function is a in the kernel + * @rb_node: node in parent's tree of called functions + * @children: tree of call paths of functions called + * + * In combination with the call_return structure, the call_path structure + * defines a context-sensitve call-graph. + */ +struct call_path { + struct call_path *parent; + struct symbol *sym; + u64 ip; + u64 db_id; + bool in_kernel; + struct rb_node rb_node; + struct rb_root children; +}; int thread_stack__event(struct thread *thread, u32 flags, u64 from_ip, u64 to_ip, u16 insn_len, u64 trace_nr); +void thread_stack__set_trace_nr(struct thread *thread, u64 trace_nr); void thread_stack__sample(struct thread *thread, struct ip_callchain *chain, size_t sz, u64 ip); void thread_stack__free(struct thread *thread); +struct call_return_processor * +call_return_processor__new(int (*process)(struct call_return *cr, void *data), + void *data); +void call_return_processor__free(struct call_return_processor *crp); +int thread_stack__process(struct thread *thread, struct comm *comm, + struct perf_sample *sample, + struct addr_location *from_al, + struct addr_location *to_al, u64 ref, + struct call_return_processor *crp); + #endif -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 03/18] perf tools: Add branch type to db export 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 01/18] perf tools: Add a thread stack for synthesizing call chains Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 02/18] perf tools: Enhance the thread stack to output call/return data Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 04/18] perf tools: Add branch_type and in_tx to Python export Arnaldo Carvalho de Melo ` (15 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Add the ability to export branch types through the database export facility. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/db-export.c | 48 +++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/db-export.h | 6 ++++++ 2 files changed, 54 insertions(+) diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index be128b075a32..bccb83120971 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c @@ -208,6 +208,15 @@ static int db_ids_from_al(struct db_export *dbe, struct addr_location *al, return 0; } +int db_export__branch_type(struct db_export *dbe, u32 branch_type, + const char *name) +{ + if (dbe->export_branch_type) + return dbe->export_branch_type(dbe, branch_type, name); + + return 0; +} + int db_export__sample(struct db_export *dbe, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct thread *thread, struct addr_location *al) @@ -268,3 +277,42 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, return 0; } + +static struct { + u32 branch_type; + const char *name; +} branch_types[] = { + {0, "no branch"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL, "call"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_RETURN, "return"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CONDITIONAL, "conditional jump"}, + {PERF_IP_FLAG_BRANCH, "unconditional jump"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_INTERRUPT, + "software interrupt"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_RETURN | PERF_IP_FLAG_INTERRUPT, + "return from interrupt"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_SYSCALLRET, + "system call"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_RETURN | PERF_IP_FLAG_SYSCALLRET, + "return from system call"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_ASYNC, "asynchronous branch"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_ASYNC | + PERF_IP_FLAG_INTERRUPT, "hardware interrupt"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TX_ABORT, "transaction abort"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TRACE_BEGIN, "trace begin"}, + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TRACE_END, "trace end"}, + {0, NULL} +}; + +int db_export__branch_types(struct db_export *dbe) +{ + int i, err = 0; + + for (i = 0; branch_types[i].name ; i++) { + err = db_export__branch_type(dbe, branch_types[i].branch_type, + branch_types[i].name); + if (err) + break; + } + return err; +} diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h index b3643e8e5750..e4baa45ead70 100644 --- a/tools/perf/util/db-export.h +++ b/tools/perf/util/db-export.h @@ -54,6 +54,8 @@ struct db_export { struct machine *machine); int (*export_symbol)(struct db_export *dbe, struct symbol *sym, struct dso *dso); + int (*export_branch_type)(struct db_export *dbe, u32 branch_type, + const char *name); int (*export_sample)(struct db_export *dbe, struct export_sample *es); u64 evsel_last_db_id; u64 machine_last_db_id; @@ -79,8 +81,12 @@ int db_export__dso(struct db_export *dbe, struct dso *dso, struct machine *machine); int db_export__symbol(struct db_export *dbe, struct symbol *sym, struct dso *dso); +int db_export__branch_type(struct db_export *dbe, u32 branch_type, + const char *name); int db_export__sample(struct db_export *dbe, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct thread *thread, struct addr_location *al); +int db_export__branch_types(struct db_export *dbe); + #endif -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 04/18] perf tools: Add branch_type and in_tx to Python export 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (2 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 03/18] perf tools: Add branch type to db export Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 05/18] perf tools: Add call information to the database export API Arnaldo Carvalho de Melo ` (14 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Add branch_type and in_tx to Python db export and the export-to-postgresql.py script. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-4-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/scripts/python/export-to-postgresql.py | 32 ++++++++++++++++++---- .../util/scripting-engines/trace-event-python.c | 30 +++++++++++++++++++- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py index d8f6df0093d6..bb79aecccf58 100644 --- a/tools/perf/scripts/python/export-to-postgresql.py +++ b/tools/perf/scripts/python/export-to-postgresql.py @@ -123,6 +123,10 @@ do_query(query, 'CREATE TABLE symbols (' 'sym_end bigint,' 'binding integer,' 'name varchar(2048))') +do_query(query, 'CREATE TABLE branch_types (' + 'id integer NOT NULL,' + 'name varchar(80))') + if branches: do_query(query, 'CREATE TABLE samples (' 'id bigint NOT NULL,' @@ -139,7 +143,9 @@ if branches: 'to_dso_id bigint,' 'to_symbol_id bigint,' 'to_sym_offset bigint,' - 'to_ip bigint)') + 'to_ip bigint,' + 'branch_type integer,' + 'in_tx boolean)') else: do_query(query, 'CREATE TABLE samples (' 'id bigint NOT NULL,' @@ -160,7 +166,9 @@ else: 'period bigint,' 'weight bigint,' 'transaction bigint,' - 'data_src bigint)') + 'data_src bigint,' + 'branch_type integer,' + 'in_tx boolean)') do_query(query, 'CREATE VIEW samples_view AS ' 'SELECT ' @@ -178,7 +186,9 @@ do_query(query, 'CREATE VIEW samples_view AS ' 'to_hex(to_ip) AS to_ip_hex,' '(SELECT name FROM symbols WHERE id = to_symbol_id) AS to_symbol,' 'to_sym_offset,' - '(SELECT short_name FROM dsos WHERE id = to_dso_id) AS to_dso_short_name' + '(SELECT short_name FROM dsos WHERE id = to_dso_id) AS to_dso_short_name,' + '(SELECT name FROM branch_types WHERE id = branch_type) AS branch_type_name,' + 'in_tx' ' FROM samples') @@ -234,6 +244,7 @@ comm_file = open_output_file("comm_table.bin") comm_thread_file = open_output_file("comm_thread_table.bin") dso_file = open_output_file("dso_table.bin") symbol_file = open_output_file("symbol_table.bin") +branch_type_file = open_output_file("branch_type_table.bin") sample_file = open_output_file("sample_table.bin") def trace_begin(): @@ -257,6 +268,7 @@ def trace_end(): copy_output_file(comm_thread_file, "comm_threads") copy_output_file(dso_file, "dsos") copy_output_file(symbol_file, "symbols") + copy_output_file(branch_type_file, "branch_types") copy_output_file(sample_file, "samples") print datetime.datetime.today(), "Removing intermediate files..." @@ -267,6 +279,7 @@ def trace_end(): remove_output_file(comm_thread_file) remove_output_file(dso_file) remove_output_file(symbol_file) + remove_output_file(branch_type_file) remove_output_file(sample_file) os.rmdir(output_dir_name) print datetime.datetime.today(), "Adding primary keys" @@ -277,6 +290,7 @@ def trace_end(): do_query(query, 'ALTER TABLE comm_threads ADD PRIMARY KEY (id)') do_query(query, 'ALTER TABLE dsos ADD PRIMARY KEY (id)') do_query(query, 'ALTER TABLE symbols ADD PRIMARY KEY (id)') + do_query(query, 'ALTER TABLE branch_types ADD PRIMARY KEY (id)') do_query(query, 'ALTER TABLE samples ADD PRIMARY KEY (id)') print datetime.datetime.today(), "Adding foreign keys" @@ -352,9 +366,15 @@ def symbol_table(symbol_id, dso_id, sym_start, sym_end, binding, symbol_name, *x value = struct.pack(fmt, 6, 8, symbol_id, 8, dso_id, 8, sym_start, 8, sym_end, 4, binding, n, symbol_name) symbol_file.write(value) -def sample_table(sample_id, evsel_id, machine_id, thread_id, comm_id, dso_id, symbol_id, sym_offset, ip, time, cpu, to_dso_id, to_symbol_id, to_sym_offset, to_ip, period, weight, transaction, data_src, *x): +def branch_type_table(branch_type, name, *x): + n = len(name) + fmt = "!hiii" + str(n) + "s" + value = struct.pack(fmt, 2, 4, branch_type, n, name) + branch_type_file.write(value) + +def sample_table(sample_id, evsel_id, machine_id, thread_id, comm_id, dso_id, symbol_id, sym_offset, ip, time, cpu, to_dso_id, to_symbol_id, to_sym_offset, to_ip, period, weight, transaction, data_src, branch_type, in_tx, *x): if branches: - value = struct.pack("!hiqiqiqiqiqiqiqiqiqiqiiiqiqiqiq", 15, 8, sample_id, 8, evsel_id, 8, machine_id, 8, thread_id, 8, comm_id, 8, dso_id, 8, symbol_id, 8, sym_offset, 8, ip, 8, time, 4, cpu, 8, to_dso_id, 8, to_symbol_id, 8, to_sym_offset, 8, to_ip) + value = struct.pack("!hiqiqiqiqiqiqiqiqiqiqiiiqiqiqiqiiiB", 17, 8, sample_id, 8, evsel_id, 8, machine_id, 8, thread_id, 8, comm_id, 8, dso_id, 8, symbol_id, 8, sym_offset, 8, ip, 8, time, 4, cpu, 8, to_dso_id, 8, to_symbol_id, 8, to_sym_offset, 8, to_ip, 4, branch_type, 1, in_tx) else: - value = struct.pack("!hiqiqiqiqiqiqiqiqiqiqiiiqiqiqiqiqiqiqiq", 19, 8, sample_id, 8, evsel_id, 8, machine_id, 8, thread_id, 8, comm_id, 8, dso_id, 8, symbol_id, 8, sym_offset, 8, ip, 8, time, 4, cpu, 8, to_dso_id, 8, to_symbol_id, 8, to_sym_offset, 8, to_ip, 8, period, 8, weight, 8, transaction, 8, data_src) + value = struct.pack("!hiqiqiqiqiqiqiqiqiqiqiiiqiqiqiqiqiqiqiqiiiB", 21, 8, sample_id, 8, evsel_id, 8, machine_id, 8, thread_id, 8, comm_id, 8, dso_id, 8, symbol_id, 8, sym_offset, 8, ip, 8, time, 4, cpu, 8, to_dso_id, 8, to_symbol_id, 8, to_sym_offset, 8, to_ip, 8, period, 8, weight, 8, transaction, 8, data_src, 4, branch_type, 1, in_tx) sample_file.write(value) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 2fd7ee8f18c7..f3ca7798b3d0 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -66,6 +66,7 @@ struct tables { PyObject *comm_thread_handler; PyObject *dso_handler; PyObject *symbol_handler; + PyObject *branch_type_handler; PyObject *sample_handler; bool db_export_mode; }; @@ -664,13 +665,31 @@ static int python_export_symbol(struct db_export *dbe, struct symbol *sym, return 0; } +static int python_export_branch_type(struct db_export *dbe, u32 branch_type, + const char *name) +{ + struct tables *tables = container_of(dbe, struct tables, dbe); + PyObject *t; + + t = tuple_new(2); + + tuple_set_s32(t, 0, branch_type); + tuple_set_string(t, 1, name); + + call_object(tables->branch_type_handler, t, "branch_type_table"); + + Py_DECREF(t); + + return 0; +} + static int python_export_sample(struct db_export *dbe, struct export_sample *es) { struct tables *tables = container_of(dbe, struct tables, dbe); PyObject *t; - t = tuple_new(19); + t = tuple_new(21); tuple_set_u64(t, 0, es->db_id); tuple_set_u64(t, 1, es->evsel->db_id); @@ -691,6 +710,8 @@ static int python_export_sample(struct db_export *dbe, tuple_set_u64(t, 16, es->sample->weight); tuple_set_u64(t, 17, es->sample->transaction); tuple_set_u64(t, 18, es->sample->data_src); + tuple_set_s32(t, 19, es->sample->flags & PERF_BRANCH_MASK); + tuple_set_s32(t, 20, !!(es->sample->flags & PERF_IP_FLAG_IN_TX)); call_object(tables->sample_handler, t, "sample_table"); @@ -861,6 +882,7 @@ static void set_table_handlers(struct tables *tables) SET_TABLE_HANDLER(comm_thread); SET_TABLE_HANDLER(dso); SET_TABLE_HANDLER(symbol); + SET_TABLE_HANDLER(branch_type); SET_TABLE_HANDLER(sample); } @@ -910,6 +932,12 @@ static int python_start_script(const char *script, int argc, const char **argv) set_table_handlers(tables); + if (tables->db_export_mode) { + err = db_export__branch_types(&tables->dbe); + if (err) + goto error; + } + return err; error: Py_Finalize(); -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 05/18] perf tools: Add call information to the database export API 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (3 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 04/18] perf tools: Add branch_type and in_tx to Python export Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 06/18] perf tools: Add call information to Python export Arnaldo Carvalho de Melo ` (13 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Make it possible for the database export API to use the enhanced thread stack and export detailed information about paired calls and returns. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-6-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/db-export.c | 52 ++++++++++++++++++++++++++++++++++++++++++++- tools/perf/util/db-export.h | 12 +++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index bccb83120971..017ecbb0ec05 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c @@ -21,6 +21,7 @@ #include "comm.h" #include "symbol.h" #include "event.h" +#include "thread-stack.h" #include "db-export.h" int db_export__init(struct db_export *dbe) @@ -29,8 +30,10 @@ int db_export__init(struct db_export *dbe) return 0; } -void db_export__exit(struct db_export *dbe __maybe_unused) +void db_export__exit(struct db_export *dbe) { + call_return_processor__free(dbe->crp); + dbe->crp = NULL; } int db_export__evsel(struct db_export *dbe, struct perf_evsel *evsel) @@ -270,6 +273,13 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, &es.addr_sym_db_id, &es.addr_offset); if (err) return err; + if (dbe->crp) { + err = thread_stack__process(thread, comm, sample, al, + &addr_al, es.db_id, + dbe->crp); + if (err) + return err; + } } if (dbe->export_sample) @@ -316,3 +326,43 @@ int db_export__branch_types(struct db_export *dbe) } return err; } + +int db_export__call_path(struct db_export *dbe, struct call_path *cp) +{ + int err; + + if (cp->db_id) + return 0; + + if (cp->parent) { + err = db_export__call_path(dbe, cp->parent); + if (err) + return err; + } + + cp->db_id = ++dbe->call_path_last_db_id; + + if (dbe->export_call_path) + return dbe->export_call_path(dbe, cp); + + return 0; +} + +int db_export__call_return(struct db_export *dbe, struct call_return *cr) +{ + int err; + + if (cr->db_id) + return 0; + + err = db_export__call_path(dbe, cr->cp); + if (err) + return err; + + cr->db_id = ++dbe->call_return_last_db_id; + + if (dbe->export_call_return) + return dbe->export_call_return(dbe, cr); + + return 0; +} diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h index e4baa45ead70..dd5ac2ae97d4 100644 --- a/tools/perf/util/db-export.h +++ b/tools/perf/util/db-export.h @@ -25,6 +25,9 @@ struct comm; struct dso; struct perf_sample; struct addr_location; +struct call_return_processor; +struct call_path; +struct call_return; struct export_sample { union perf_event *event; @@ -57,6 +60,10 @@ struct db_export { int (*export_branch_type)(struct db_export *dbe, u32 branch_type, const char *name); int (*export_sample)(struct db_export *dbe, struct export_sample *es); + int (*export_call_path)(struct db_export *dbe, struct call_path *cp); + int (*export_call_return)(struct db_export *dbe, + struct call_return *cr); + struct call_return_processor *crp; u64 evsel_last_db_id; u64 machine_last_db_id; u64 thread_last_db_id; @@ -65,6 +72,8 @@ struct db_export { u64 dso_last_db_id; u64 symbol_last_db_id; u64 sample_last_db_id; + u64 call_path_last_db_id; + u64 call_return_last_db_id; }; int db_export__init(struct db_export *dbe); @@ -89,4 +98,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, int db_export__branch_types(struct db_export *dbe); +int db_export__call_path(struct db_export *dbe, struct call_path *cp); +int db_export__call_return(struct db_export *dbe, struct call_return *cr); + #endif -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 06/18] perf tools: Add call information to Python export 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (4 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 05/18] perf tools: Add call information to the database export API Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 07/18] perf tools: Defer export of comms that were not 'set' Arnaldo Carvalho de Melo ` (12 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Add the ability to export detailed information about paired calls and returns to Python db export and the export-to-postgresql.py script. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-7-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../scripts/python/bin/export-to-postgresql-report | 15 ++-- tools/perf/scripts/python/export-to-postgresql.py | 66 ++++++++++++++++- .../util/scripting-engines/trace-event-python.c | 84 +++++++++++++++++++++- 3 files changed, 158 insertions(+), 7 deletions(-) diff --git a/tools/perf/scripts/python/bin/export-to-postgresql-report b/tools/perf/scripts/python/bin/export-to-postgresql-report index a8fdd15f85bf..cd335b6e2a01 100644 --- a/tools/perf/scripts/python/bin/export-to-postgresql-report +++ b/tools/perf/scripts/python/bin/export-to-postgresql-report @@ -1,6 +1,6 @@ #!/bin/bash # description: export perf data to a postgresql database -# args: [database name] [columns] +# args: [database name] [columns] [calls] n_args=0 for i in "$@" do @@ -9,11 +9,16 @@ do fi n_args=$(( $n_args + 1 )) done -if [ "$n_args" -gt 2 ] ; then - echo "usage: export-to-postgresql-report [database name] [columns]" +if [ "$n_args" -gt 3 ] ; then + echo "usage: export-to-postgresql-report [database name] [columns] [calls]" exit fi -if [ "$n_args" -gt 1 ] ; then +if [ "$n_args" -gt 2 ] ; then + dbname=$1 + columns=$2 + calls=$3 + shift 3 +elif [ "$n_args" -gt 1 ] ; then dbname=$1 columns=$2 shift 2 @@ -21,4 +26,4 @@ elif [ "$n_args" -gt 0 ] ; then dbname=$1 shift fi -perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/export-to-postgresql.py $dbname $columns +perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/export-to-postgresql.py $dbname $columns $calls diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py index bb79aecccf58..4cdafd880074 100644 --- a/tools/perf/scripts/python/export-to-postgresql.py +++ b/tools/perf/scripts/python/export-to-postgresql.py @@ -40,10 +40,12 @@ sys.path.append(os.environ['PERF_EXEC_PATH'] + \ #from Core import * perf_db_export_mode = True +perf_db_export_calls = False def usage(): - print >> sys.stderr, "Usage is: export-to-postgresql.py <database name> [<columns>]" + print >> sys.stderr, "Usage is: export-to-postgresql.py <database name> [<columns>] [<calls>]" print >> sys.stderr, "where: columns 'all' or 'branches'" + print >> sys.stderr, " calls 'calls' => create calls table" raise Exception("Too few arguments") if (len(sys.argv) < 2): @@ -61,6 +63,12 @@ if columns not in ("all", "branches"): branches = (columns == "branches") +if (len(sys.argv) >= 4): + if (sys.argv[3] == "calls"): + perf_db_export_calls = True + else: + usage() + output_dir_name = os.getcwd() + "/" + dbname + "-perf-data" os.mkdir(output_dir_name) @@ -170,6 +178,25 @@ else: 'branch_type integer,' 'in_tx boolean)') +if perf_db_export_calls: + do_query(query, 'CREATE TABLE call_paths (' + 'id bigint NOT NULL,' + 'parent_id bigint,' + 'symbol_id bigint,' + 'ip bigint)') + do_query(query, 'CREATE TABLE calls (' + 'id bigint NOT NULL,' + 'thread_id bigint,' + 'comm_id bigint,' + 'call_path_id bigint,' + 'call_time bigint,' + 'return_time bigint,' + 'branch_count bigint,' + 'call_id bigint,' + 'return_id bigint,' + 'parent_call_path_id bigint,' + 'flags integer)') + do_query(query, 'CREATE VIEW samples_view AS ' 'SELECT ' 'id,' @@ -246,6 +273,9 @@ dso_file = open_output_file("dso_table.bin") symbol_file = open_output_file("symbol_table.bin") branch_type_file = open_output_file("branch_type_table.bin") sample_file = open_output_file("sample_table.bin") +if perf_db_export_calls: + call_path_file = open_output_file("call_path_table.bin") + call_file = open_output_file("call_table.bin") def trace_begin(): print datetime.datetime.today(), "Writing to intermediate files..." @@ -256,6 +286,9 @@ def trace_begin(): comm_table(0, "unknown") dso_table(0, 0, "unknown", "unknown", "") symbol_table(0, 0, 0, 0, 0, "unknown") + sample_table(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + if perf_db_export_calls: + call_path_table(0, 0, 0, 0) unhandled_count = 0 @@ -270,6 +303,9 @@ def trace_end(): copy_output_file(symbol_file, "symbols") copy_output_file(branch_type_file, "branch_types") copy_output_file(sample_file, "samples") + if perf_db_export_calls: + copy_output_file(call_path_file, "call_paths") + copy_output_file(call_file, "calls") print datetime.datetime.today(), "Removing intermediate files..." remove_output_file(evsel_file) @@ -281,6 +317,9 @@ def trace_end(): remove_output_file(symbol_file) remove_output_file(branch_type_file) remove_output_file(sample_file) + if perf_db_export_calls: + remove_output_file(call_path_file) + remove_output_file(call_file) os.rmdir(output_dir_name) print datetime.datetime.today(), "Adding primary keys" do_query(query, 'ALTER TABLE selected_events ADD PRIMARY KEY (id)') @@ -292,6 +331,9 @@ def trace_end(): do_query(query, 'ALTER TABLE symbols ADD PRIMARY KEY (id)') do_query(query, 'ALTER TABLE branch_types ADD PRIMARY KEY (id)') do_query(query, 'ALTER TABLE samples ADD PRIMARY KEY (id)') + if perf_db_export_calls: + do_query(query, 'ALTER TABLE call_paths ADD PRIMARY KEY (id)') + do_query(query, 'ALTER TABLE calls ADD PRIMARY KEY (id)') print datetime.datetime.today(), "Adding foreign keys" do_query(query, 'ALTER TABLE threads ' @@ -313,6 +355,18 @@ def trace_end(): 'ADD CONSTRAINT symbolfk FOREIGN KEY (symbol_id) REFERENCES symbols (id),' 'ADD CONSTRAINT todsofk FOREIGN KEY (to_dso_id) REFERENCES dsos (id),' 'ADD CONSTRAINT tosymbolfk FOREIGN KEY (to_symbol_id) REFERENCES symbols (id)') + if perf_db_export_calls: + do_query(query, 'ALTER TABLE call_paths ' + 'ADD CONSTRAINT parentfk FOREIGN KEY (parent_id) REFERENCES call_paths (id),' + 'ADD CONSTRAINT symbolfk FOREIGN KEY (symbol_id) REFERENCES symbols (id)') + do_query(query, 'ALTER TABLE calls ' + 'ADD CONSTRAINT threadfk FOREIGN KEY (thread_id) REFERENCES threads (id),' + 'ADD CONSTRAINT commfk FOREIGN KEY (comm_id) REFERENCES comms (id),' + 'ADD CONSTRAINT call_pathfk FOREIGN KEY (call_path_id) REFERENCES call_paths (id),' + 'ADD CONSTRAINT callfk FOREIGN KEY (call_id) REFERENCES samples (id),' + 'ADD CONSTRAINT returnfk FOREIGN KEY (return_id) REFERENCES samples (id),' + 'ADD CONSTRAINT parent_call_pathfk FOREIGN KEY (parent_call_path_id) REFERENCES call_paths (id)') + do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)') if (unhandled_count): print datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events" @@ -378,3 +432,13 @@ def sample_table(sample_id, evsel_id, machine_id, thread_id, comm_id, dso_id, sy else: value = struct.pack("!hiqiqiqiqiqiqiqiqiqiqiiiqiqiqiqiqiqiqiqiiiB", 21, 8, sample_id, 8, evsel_id, 8, machine_id, 8, thread_id, 8, comm_id, 8, dso_id, 8, symbol_id, 8, sym_offset, 8, ip, 8, time, 4, cpu, 8, to_dso_id, 8, to_symbol_id, 8, to_sym_offset, 8, to_ip, 8, period, 8, weight, 8, transaction, 8, data_src, 4, branch_type, 1, in_tx) sample_file.write(value) + +def call_path_table(cp_id, parent_id, symbol_id, ip, *x): + fmt = "!hiqiqiqiq" + value = struct.pack(fmt, 4, 8, cp_id, 8, parent_id, 8, symbol_id, 8, ip) + call_path_file.write(value) + +def call_return_table(cr_id, thread_id, comm_id, call_path_id, call_time, return_time, branch_count, call_id, return_id, parent_call_path_id, flags, *x): + fmt = "!hiqiqiqiqiqiqiqiqiqiqii" + value = struct.pack(fmt, 11, 8, cr_id, 8, thread_id, 8, comm_id, 8, call_path_id, 8, call_time, 8, return_time, 8, branch_count, 8, call_id, 8, return_id, 8, parent_call_path_id, 4, flags) + call_file.write(value) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index f3ca7798b3d0..cb1d9602f418 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -37,6 +37,7 @@ #include "../comm.h" #include "../machine.h" #include "../db-export.h" +#include "../thread-stack.h" #include "../trace-event.h" #include "../machine.h" @@ -68,6 +69,8 @@ struct tables { PyObject *symbol_handler; PyObject *branch_type_handler; PyObject *sample_handler; + PyObject *call_path_handler; + PyObject *call_return_handler; bool db_export_mode; }; @@ -720,6 +723,64 @@ static int python_export_sample(struct db_export *dbe, return 0; } +static int python_export_call_path(struct db_export *dbe, struct call_path *cp) +{ + struct tables *tables = container_of(dbe, struct tables, dbe); + PyObject *t; + u64 parent_db_id, sym_db_id; + + parent_db_id = cp->parent ? cp->parent->db_id : 0; + sym_db_id = cp->sym ? *(u64 *)symbol__priv(cp->sym) : 0; + + t = tuple_new(4); + + tuple_set_u64(t, 0, cp->db_id); + tuple_set_u64(t, 1, parent_db_id); + tuple_set_u64(t, 2, sym_db_id); + tuple_set_u64(t, 3, cp->ip); + + call_object(tables->call_path_handler, t, "call_path_table"); + + Py_DECREF(t); + + return 0; +} + +static int python_export_call_return(struct db_export *dbe, + struct call_return *cr) +{ + struct tables *tables = container_of(dbe, struct tables, dbe); + u64 comm_db_id = cr->comm ? cr->comm->db_id : 0; + PyObject *t; + + t = tuple_new(11); + + tuple_set_u64(t, 0, cr->db_id); + tuple_set_u64(t, 1, cr->thread->db_id); + tuple_set_u64(t, 2, comm_db_id); + tuple_set_u64(t, 3, cr->cp->db_id); + tuple_set_u64(t, 4, cr->call_time); + tuple_set_u64(t, 5, cr->return_time); + tuple_set_u64(t, 6, cr->branch_count); + tuple_set_u64(t, 7, cr->call_ref); + tuple_set_u64(t, 8, cr->return_ref); + tuple_set_u64(t, 9, cr->cp->parent->db_id); + tuple_set_s32(t, 10, cr->flags); + + call_object(tables->call_return_handler, t, "call_return_table"); + + Py_DECREF(t); + + return 0; +} + +static int python_process_call_return(struct call_return *cr, void *data) +{ + struct db_export *dbe = data; + + return db_export__call_return(dbe, cr); +} + static void python_process_general_event(struct perf_sample *sample, struct perf_evsel *evsel, struct thread *thread, @@ -852,7 +913,9 @@ error: static void set_table_handlers(struct tables *tables) { const char *perf_db_export_mode = "perf_db_export_mode"; - PyObject *db_export_mode; + const char *perf_db_export_calls = "perf_db_export_calls"; + PyObject *db_export_mode, *db_export_calls; + bool export_calls = false; int ret; memset(tables, 0, sizeof(struct tables)); @@ -869,6 +932,23 @@ static void set_table_handlers(struct tables *tables) if (!ret) return; + tables->dbe.crp = NULL; + db_export_calls = PyDict_GetItemString(main_dict, perf_db_export_calls); + if (db_export_calls) { + ret = PyObject_IsTrue(db_export_calls); + if (ret == -1) + handler_call_die(perf_db_export_calls); + export_calls = !!ret; + } + + if (export_calls) { + tables->dbe.crp = + call_return_processor__new(python_process_call_return, + &tables->dbe); + if (!tables->dbe.crp) + Py_FatalError("failed to create calls processor"); + } + tables->db_export_mode = true; /* * Reserve per symbol space for symbol->db_id via symbol__priv() @@ -884,6 +964,8 @@ static void set_table_handlers(struct tables *tables) SET_TABLE_HANDLER(symbol); SET_TABLE_HANDLER(branch_type); SET_TABLE_HANDLER(sample); + SET_TABLE_HANDLER(call_path); + SET_TABLE_HANDLER(call_return); } /* -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 07/18] perf tools: Defer export of comms that were not 'set' 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (5 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 06/18] perf tools: Add call information to Python export Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 08/18] perf symbols: Preparation for compressed kernel module support Arnaldo Carvalho de Melo ` (11 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Tracing for a workload begins before the comm event is seen, which results in the initial comm having a string of the form ":<pid>" (e.g. ":12345"). In order to export the correct string, defer the export until the new script 'flush' callback. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1414678188-14946-8-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/db-export.c | 62 +++++++++++++++++++++- tools/perf/util/db-export.h | 3 ++ .../util/scripting-engines/trace-event-python.c | 4 +- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index 017ecbb0ec05..c81dae399763 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c @@ -21,17 +21,74 @@ #include "comm.h" #include "symbol.h" #include "event.h" +#include "util.h" #include "thread-stack.h" #include "db-export.h" +struct deferred_export { + struct list_head node; + struct comm *comm; +}; + +static int db_export__deferred(struct db_export *dbe) +{ + struct deferred_export *de; + int err; + + while (!list_empty(&dbe->deferred)) { + de = list_entry(dbe->deferred.next, struct deferred_export, + node); + err = dbe->export_comm(dbe, de->comm); + list_del(&de->node); + free(de); + if (err) + return err; + } + + return 0; +} + +static void db_export__free_deferred(struct db_export *dbe) +{ + struct deferred_export *de; + + while (!list_empty(&dbe->deferred)) { + de = list_entry(dbe->deferred.next, struct deferred_export, + node); + list_del(&de->node); + free(de); + } +} + +static int db_export__defer_comm(struct db_export *dbe, struct comm *comm) +{ + struct deferred_export *de; + + de = zalloc(sizeof(struct deferred_export)); + if (!de) + return -ENOMEM; + + de->comm = comm; + list_add_tail(&de->node, &dbe->deferred); + + return 0; +} + int db_export__init(struct db_export *dbe) { memset(dbe, 0, sizeof(struct db_export)); + INIT_LIST_HEAD(&dbe->deferred); return 0; } +int db_export__flush(struct db_export *dbe) +{ + return db_export__deferred(dbe); +} + void db_export__exit(struct db_export *dbe) { + db_export__free_deferred(dbe); call_return_processor__free(dbe->crp); dbe->crp = NULL; } @@ -115,7 +172,10 @@ int db_export__comm(struct db_export *dbe, struct comm *comm, comm->db_id = ++dbe->comm_last_db_id; if (dbe->export_comm) { - err = dbe->export_comm(dbe, comm); + if (main_thread->comm_set) + err = dbe->export_comm(dbe, comm); + else + err = db_export__defer_comm(dbe, comm); if (err) return err; } diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h index dd5ac2ae97d4..adbd22d66798 100644 --- a/tools/perf/util/db-export.h +++ b/tools/perf/util/db-export.h @@ -17,6 +17,7 @@ #define __PERF_DB_EXPORT_H #include <linux/types.h> +#include <linux/list.h> struct perf_evsel; struct machine; @@ -74,9 +75,11 @@ struct db_export { u64 sample_last_db_id; u64 call_path_last_db_id; u64 call_return_last_db_id; + struct list_head deferred; }; int db_export__init(struct db_export *dbe); +int db_export__flush(struct db_export *dbe); void db_export__exit(struct db_export *dbe); int db_export__evsel(struct db_export *dbe, struct perf_evsel *evsel); int db_export__machine(struct db_export *dbe, struct machine *machine); diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index cb1d9602f418..118bc62850a8 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -1030,7 +1030,9 @@ error: static int python_flush_script(void) { - return 0; + struct tables *tables = &tables_global; + + return db_export__flush(&tables->dbe); } /* -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 08/18] perf symbols: Preparation for compressed kernel module support 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (6 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 07/18] perf tools: Defer export of comms that were not 'set' Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 09/18] perf tools: Add gzip decompression support for kernel module Arnaldo Carvalho de Melo ` (10 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> This patch adds basic support to handle compressed kernel module as some distro (such as Archlinux) carries on it now. The actual work using compression library will be added later. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1415063674-17206-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/dso.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/dso.h | 7 +++++ tools/perf/util/machine.c | 19 ++++++++++- tools/perf/util/symbol-elf.c | 35 ++++++++++++++++++++- tools/perf/util/symbol.c | 8 ++++- 5 files changed, 141 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 0247acfdfaca..36a607cf8f50 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -21,8 +21,10 @@ char dso__symtab_origin(const struct dso *dso) [DSO_BINARY_TYPE__BUILDID_DEBUGINFO] = 'b', [DSO_BINARY_TYPE__SYSTEM_PATH_DSO] = 'd', [DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE] = 'K', + [DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP] = 'm', [DSO_BINARY_TYPE__GUEST_KALLSYMS] = 'g', [DSO_BINARY_TYPE__GUEST_KMODULE] = 'G', + [DSO_BINARY_TYPE__GUEST_KMODULE_COMP] = 'M', [DSO_BINARY_TYPE__GUEST_VMLINUX] = 'V', }; @@ -112,11 +114,13 @@ int dso__read_binary_type_filename(const struct dso *dso, break; case DSO_BINARY_TYPE__GUEST_KMODULE: + case DSO_BINARY_TYPE__GUEST_KMODULE_COMP: path__join3(filename, size, symbol_conf.symfs, root_dir, dso->long_name); break; case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE: + case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP: __symbol__join_symfs(filename, size, dso->long_name); break; @@ -137,6 +141,77 @@ int dso__read_binary_type_filename(const struct dso *dso, return ret; } +static int decompress_dummy(const char *input __maybe_unused, + int output __maybe_unused) +{ + return -1; +} + +static const struct { + const char *fmt; + int (*decompress)(const char *input, int output); +} compressions[] = { + { "gz", decompress_dummy }, + { NULL, }, +}; + +bool is_supported_compression(const char *ext) +{ + unsigned i; + + for (i = 0; compressions[i].fmt; i++) { + if (!strcmp(ext, compressions[i].fmt)) + return true; + } + return false; +} + +bool is_kmodule_extension(const char *ext) +{ + if (strncmp(ext, "ko", 2)) + return false; + + if (ext[2] == '\0' || (ext[2] == '.' && is_supported_compression(ext+3))) + return true; + + return false; +} + +bool is_kernel_module(const char *pathname, bool *compressed) +{ + const char *ext = strrchr(pathname, '.'); + + if (ext == NULL) + return false; + + if (is_supported_compression(ext + 1)) { + if (compressed) + *compressed = true; + ext -= 3; + } else if (compressed) + *compressed = false; + + return is_kmodule_extension(ext + 1); +} + +bool decompress_to_file(const char *ext, const char *filename, int output_fd) +{ + unsigned i; + + for (i = 0; compressions[i].fmt; i++) { + if (!strcmp(ext, compressions[i].fmt)) + return !compressions[i].decompress(filename, + output_fd); + } + return false; +} + +bool dso__needs_decompress(struct dso *dso) +{ + return dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP || + dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE_COMP; +} + /* * Global list of open DSOs and the counter. */ diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index a316e4af321f..3782c82c6e44 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -22,7 +22,9 @@ enum dso_binary_type { DSO_BINARY_TYPE__BUILDID_DEBUGINFO, DSO_BINARY_TYPE__SYSTEM_PATH_DSO, DSO_BINARY_TYPE__GUEST_KMODULE, + DSO_BINARY_TYPE__GUEST_KMODULE_COMP, DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE, + DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP, DSO_BINARY_TYPE__KCORE, DSO_BINARY_TYPE__GUEST_KCORE, DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO, @@ -185,6 +187,11 @@ int dso__kernel_module_get_build_id(struct dso *dso, const char *root_dir); char dso__symtab_origin(const struct dso *dso); int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type type, char *root_dir, char *filename, size_t size); +bool is_supported_compression(const char *ext); +bool is_kmodule_extension(const char *ext); +bool is_kernel_module(const char *pathname, bool *compressed); +bool decompress_to_file(const char *ext, const char *filename, int output_fd); +bool dso__needs_decompress(struct dso *dso); /* * The dso__data_* external interface provides following functions: diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 51a630301afa..946c7d62cb6e 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -464,6 +464,7 @@ struct map *machine__new_module(struct machine *machine, u64 start, { struct map *map; struct dso *dso = __dsos__findnew(&machine->kernel_dsos, filename); + bool compressed; if (dso == NULL) return NULL; @@ -476,6 +477,11 @@ struct map *machine__new_module(struct machine *machine, u64 start, dso->symtab_type = DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE; else dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE; + + /* _KMODULE_COMP should be next to _KMODULE */ + if (is_kernel_module(filename, &compressed) && compressed) + dso->symtab_type++; + map_groups__insert(&machine->kmaps, map); return map; } @@ -861,8 +867,14 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, struct map *map; char *long_name; - if (dot == NULL || strcmp(dot, ".ko")) + if (dot == NULL) continue; + + /* On some system, modules are compressed like .ko.gz */ + if (is_supported_compression(dot + 1) && + is_kmodule_extension(dot - 2)) + dot -= 3; + snprintf(dso_name, sizeof(dso_name), "[%.*s]", (int)(dot - dent->d_name), dent->d_name); @@ -1044,6 +1056,11 @@ static int machine__process_kernel_mmap_event(struct machine *machine, dot = strrchr(name, '.'); if (dot == NULL) goto out_problem; + /* On some system, modules are compressed like .ko.gz */ + if (is_supported_compression(dot + 1)) + dot -= 3; + if (!is_kmodule_extension(dot + 1)) + goto out_problem; snprintf(short_module_name, sizeof(short_module_name), "[%.*s]", (int)(dot - name), name); strxfrchar(short_module_name, '-', '_'); diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 1e23a5bfb044..efc7eb6b8f0f 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -546,6 +546,35 @@ static int dso__swap_init(struct dso *dso, unsigned char eidata) return 0; } +static int decompress_kmodule(struct dso *dso, const char *name, + enum dso_binary_type type) +{ + int fd; + const char *ext = strrchr(name, '.'); + char tmpbuf[] = "/tmp/perf-kmod-XXXXXX"; + + if ((type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP && + type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP) || + type != dso->symtab_type) + return -1; + + if (!ext || !is_supported_compression(ext + 1)) + return -1; + + fd = mkstemp(tmpbuf); + if (fd < 0) + return -1; + + if (!decompress_to_file(ext + 1, name, fd)) { + close(fd); + fd = -1; + } + + unlink(tmpbuf); + + return fd; +} + bool symsrc__possibly_runtime(struct symsrc *ss) { return ss->dynsym || ss->opdsec; @@ -571,7 +600,11 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, Elf *elf; int fd; - fd = open(name, O_RDONLY); + if (dso__needs_decompress(dso)) + fd = decompress_kmodule(dso, name, type); + else + fd = open(name, O_RDONLY); + if (fd < 0) return -1; diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 078331140d8c..c69915c9d5bc 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -51,7 +51,9 @@ static enum dso_binary_type binary_type_symtab[] = { DSO_BINARY_TYPE__BUILDID_DEBUGINFO, DSO_BINARY_TYPE__SYSTEM_PATH_DSO, DSO_BINARY_TYPE__GUEST_KMODULE, + DSO_BINARY_TYPE__GUEST_KMODULE_COMP, DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE, + DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP, DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO, DSO_BINARY_TYPE__NOT_FOUND, }; @@ -1300,7 +1302,9 @@ static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod, return dso->kernel == DSO_TYPE_GUEST_KERNEL; case DSO_BINARY_TYPE__GUEST_KMODULE: + case DSO_BINARY_TYPE__GUEST_KMODULE_COMP: case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE: + case DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP: /* * kernel modules know their symtab type - it's set when * creating a module dso in machine__new_module(). @@ -1368,7 +1372,9 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) return -1; kmod = dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE || - dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE; + dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP || + dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE || + dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE_COMP; /* * Iterate over candidate debug images. -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 09/18] perf tools: Add gzip decompression support for kernel module 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (7 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 08/18] perf symbols: Preparation for compressed kernel module support Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 10/18] perf build-id: Rename dsos__write_buildid_table() Arnaldo Carvalho de Melo ` (9 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Jiri Olsa, Peter Zijlstra, Paul Mackerras, Namhyung Kim, Adrian Hunter, David Ahern, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> Now my Archlinux box shows module symbols correctly. Before: $ perf report --stdio Failed to open /tmp/perf-3477.map, continuing without symbols no symbols found in /usr/bin/date, maybe install a debug package? No kallsyms or vmlinux with build-id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 was found [drm] with build id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 not found, continuing without symbols No kallsyms or vmlinux with build-id edd931629094b660ca9dec09a1b635c8d87aa2ee was found [jbd2] with build id edd931629094b660ca9dec09a1b635c8d87aa2ee not found, continuing without symbols No kallsyms or vmlinux with build-id a7b1eada671c34933e5610bb920b2ca4945a82c3 was found [ext4] with build id a7b1eada671c34933e5610bb920b2ca4945a82c3 not found, continuing without symbols No kallsyms or vmlinux with build-id d69511fa3e5840e770336ef45b06c83fef8d74e3 was found [scsi_mod] with build id d69511fa3e5840e770336ef45b06c83fef8d74e3 not found, continuing without symbols No kallsyms or vmlinux with build-id af0430af13461af058770ee9b87afc07922c2e77 was found [libata] with build id af0430af13461af058770ee9b87afc07922c2e77 not found, continuing without symbols No kallsyms or vmlinux with build-id aaeedff8160ce631a5f0333591c6ff291201d29f was found [libahci] with build id aaeedff8160ce631a5f0333591c6ff291201d29f not found, continuing without symbols No kallsyms or vmlinux with build-id c57907712becaf662dc4981824bb372c0441d605 was found [mac80211] with build id c57907712becaf662dc4981824bb372c0441d605 not found, continuing without symbols No kallsyms or vmlinux with build-id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f was found [iwldvm] with build id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f not found, continuing without symbols No kallsyms or vmlinux with build-id 2d86086bf136bf374a2f029cf85a48194f9b950b was found [cfg80211] with build id 2d86086bf136bf374a2f029cf85a48194f9b950b not found, continuing without symbols No kallsyms or vmlinux with build-id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 was found [iwlwifi] with build id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 not found, continuing without symbols ... # # Overhead Command Shared Object Symbol # ........ ............... ....................... ........................................................ # 0.03% swapper [ext4] [k] 0x000000000000fe2e 0.03% swapper [kernel.kallsyms] [k] account_entity_enqueue 0.03% swapper [ext4] [k] 0x000000000000fc2b 0.03% irq/50-iwlwifi [iwlwifi] [k] 0x000000000000200b 0.03% swapper [kernel.kallsyms] [k] ktime_add_safe 0.03% swapper [kernel.kallsyms] [k] elv_completed_request 0.03% swapper [libata] [k] 0x0000000000003997 0.03% swapper [libahci] [k] 0x0000000000001f25 0.03% swapper [kernel.kallsyms] [k] rb_next 0.03% swapper [kernel.kallsyms] [k] blk_finish_request 0.03% swapper [ext4] [k] 0x0000000000010248 0.00% perf [kernel.kallsyms] [k] native_write_msr_safe After: $ perf report --stdio Failed to open /tmp/perf-3477.map, continuing without symbols no symbols found in /usr/bin/tr, maybe install a debug package? ... # # Overhead Command Shared Object Symbol # ........ ............... ........................... ...................................................... # 0.04% kworker/u16:3 [ext4] [k] ext4_read_block_bitmap 0.03% kworker/u16:0 [mac80211] [k] ieee80211_sta_reset_beacon_monitor 0.02% irq/50-iwlwifi [mac80211] [k] ieee80211_get_bssid 0.02% firefox [e1000e] [k] __ew32_prepare 0.02% swapper [libahci] [k] ahci_handle_port_interrupt 0.02% emacs libglib-2.0.so.0.4000.0 [.] g_mutex_unlock 0.02% swapper [e1000e] [k] e1000_clean_tx_irq 0.02% dwm [kernel.kallsyms] [k] __schedule 0.02% gnome-terminal- [vdso] [.] __vdso_clock_gettime 0.02% swapper [e1000e] [k] e1000_alloc_rx_buffers 0.02% irq/50-iwlwifi [mac80211] [k] ieee80211_rx 0.01% firefox [vdso] [.] __vdso_gettimeofday 0.01% irq/50-iwlwifi [iwlwifi] [k] iwl_pcie_rxq_restock.part.13 Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/87h9yexshi.fsf@sejong.aot.lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile.perf | 7 +++ tools/perf/config/Makefile | 15 +++++- tools/perf/config/feature-checks/Makefile | 8 ++- tools/perf/config/feature-checks/test-all.c | 5 ++ tools/perf/config/feature-checks/test-zlib.c | 9 ++++ tools/perf/util/dso.c | 12 ++--- tools/perf/util/util.h | 5 ++ tools/perf/util/zlib.c | 78 ++++++++++++++++++++++++++++ 8 files changed, 127 insertions(+), 12 deletions(-) create mode 100644 tools/perf/config/feature-checks/test-zlib.c create mode 100644 tools/perf/util/zlib.c diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 0ebcc4ad0244..aecf61dcd754 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -66,6 +66,9 @@ include config/utilities.mak # # Define NO_PERF_READ_VDSOX32 if you do not want to build perf-read-vdsox32 # for reading the x32 mode 32-bit compatibility VDSO in 64-bit mode +# +# Define NO_ZLIB if you do not want to support compressed kernel modules + ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(shell pwd))) @@ -584,6 +587,10 @@ ifndef NO_LIBNUMA BUILTIN_OBJS += $(OUTPUT)bench/numa.o endif +ifndef NO_ZLIB + LIB_OBJS += $(OUTPUT)util/zlib.o +endif + ifdef ASCIIDOC8 export ASCIIDOC8 endif diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 71264e41fa85..79f906c7124e 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -200,7 +200,8 @@ CORE_FEATURE_TESTS = \ libunwind \ stackprotector-all \ timerfd \ - libdw-dwarf-unwind + libdw-dwarf-unwind \ + zlib LIB_FEATURE_TESTS = \ dwarf \ @@ -214,7 +215,8 @@ LIB_FEATURE_TESTS = \ libpython \ libslang \ libunwind \ - libdw-dwarf-unwind + libdw-dwarf-unwind \ + zlib VF_FEATURE_TESTS = \ backtrace \ @@ -604,6 +606,15 @@ ifneq ($(filter -lbfd,$(EXTLIBS)),) CFLAGS += -DHAVE_LIBBFD_SUPPORT endif +ifndef NO_ZLIB + ifeq ($(feature-zlib), 1) + CFLAGS += -DHAVE_ZLIB_SUPPORT + EXTLIBS += -lz + else + NO_ZLIB := 1 + endif +endif + ifndef NO_BACKTRACE ifeq ($(feature-backtrace), 1) CFLAGS += -DHAVE_BACKTRACE_SUPPORT diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index 7c68ec74a808..53f19b5dbc37 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile @@ -29,7 +29,8 @@ FILES= \ test-timerfd.bin \ test-libdw-dwarf-unwind.bin \ test-compile-32.bin \ - test-compile-x32.bin + test-compile-x32.bin \ + test-zlib.bin CC := $(CROSS_COMPILE)gcc -MD PKG_CONFIG := $(CROSS_COMPILE)pkg-config @@ -41,7 +42,7 @@ BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS) ############################### test-all.bin: - $(BUILD) -Werror -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl + $(BUILD) -Werror -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz test-hello.bin: $(BUILD) @@ -139,6 +140,9 @@ test-compile-32.bin: test-compile-x32.bin: $(CC) -mx32 -o $(OUTPUT)$@ test-compile.c +test-zlib.bin: + $(BUILD) -lz + -include *.d ############################### diff --git a/tools/perf/config/feature-checks/test-all.c b/tools/perf/config/feature-checks/test-all.c index a7d022e161c0..652e0098eba6 100644 --- a/tools/perf/config/feature-checks/test-all.c +++ b/tools/perf/config/feature-checks/test-all.c @@ -93,6 +93,10 @@ # include "test-sync-compare-and-swap.c" #undef main +#define main main_test_zlib +# include "test-zlib.c" +#undef main + int main(int argc, char *argv[]) { main_test_libpython(); @@ -116,6 +120,7 @@ int main(int argc, char *argv[]) main_test_stackprotector_all(); main_test_libdw_dwarf_unwind(); main_test_sync_compare_and_swap(argc, argv); + main_test_zlib(); return 0; } diff --git a/tools/perf/config/feature-checks/test-zlib.c b/tools/perf/config/feature-checks/test-zlib.c new file mode 100644 index 000000000000..e111fff6240e --- /dev/null +++ b/tools/perf/config/feature-checks/test-zlib.c @@ -0,0 +1,9 @@ +#include <zlib.h> + +int main(void) +{ + z_stream zs; + + inflateInit(&zs); + return 0; +} diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 36a607cf8f50..45be944d450a 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -141,18 +141,14 @@ int dso__read_binary_type_filename(const struct dso *dso, return ret; } -static int decompress_dummy(const char *input __maybe_unused, - int output __maybe_unused) -{ - return -1; -} - static const struct { const char *fmt; int (*decompress)(const char *input, int output); } compressions[] = { - { "gz", decompress_dummy }, - { NULL, }, +#ifdef HAVE_ZLIB_SUPPORT + { "gz", gzip_decompress_to_file }, +#endif + { NULL, NULL }, }; bool is_supported_compression(const char *ext) diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 80bfdaa0e2a4..7dc44cfe25b3 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -351,4 +351,9 @@ void mem_bswap_32(void *src, int byte_size); const char *get_filename_for_perf_kvm(void); bool find_process(const char *name); + +#ifdef HAVE_ZLIB_SUPPORT +int gzip_decompress_to_file(const char *input, int output_fd); +#endif + #endif /* GIT_COMPAT_UTIL_H */ diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c new file mode 100644 index 000000000000..495a449fc25c --- /dev/null +++ b/tools/perf/util/zlib.c @@ -0,0 +1,78 @@ +#include <stdio.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/mman.h> +#include <zlib.h> + +#include "util/util.h" +#include "util/debug.h" + + +#define CHUNK_SIZE 16384 + +int gzip_decompress_to_file(const char *input, int output_fd) +{ + int ret = Z_STREAM_ERROR; + int input_fd; + void *ptr; + int len; + struct stat stbuf; + unsigned char buf[CHUNK_SIZE]; + z_stream zs = { + .zalloc = Z_NULL, + .zfree = Z_NULL, + .opaque = Z_NULL, + .avail_in = 0, + .next_in = Z_NULL, + }; + + input_fd = open(input, O_RDONLY); + if (input_fd < 0) + return -1; + + if (fstat(input_fd, &stbuf) < 0) + goto out_close; + + ptr = mmap(NULL, stbuf.st_size, PROT_READ, MAP_PRIVATE, input_fd, 0); + if (ptr == MAP_FAILED) + goto out_close; + + if (inflateInit2(&zs, 16 + MAX_WBITS) != Z_OK) + goto out_unmap; + + zs.next_in = ptr; + zs.avail_in = stbuf.st_size; + + do { + zs.next_out = buf; + zs.avail_out = CHUNK_SIZE; + + ret = inflate(&zs, Z_NO_FLUSH); + switch (ret) { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; + /* fall through */ + case Z_DATA_ERROR: + case Z_MEM_ERROR: + goto out; + default: + break; + } + + len = CHUNK_SIZE - zs.avail_out; + if (writen(output_fd, buf, len) != len) { + ret = Z_DATA_ERROR; + goto out; + } + + } while (ret != Z_STREAM_END); + +out: + inflateEnd(&zs); +out_unmap: + munmap(ptr, stbuf.st_size); +out_close: + close(input_fd); + + return ret == Z_STREAM_END ? 0 : -1; +} -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 10/18] perf build-id: Rename dsos__write_buildid_table() 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (8 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 09/18] perf tools: Add gzip decompression support for kernel module Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 11/18] perf build-id: Move build-id related functions to util/build-id.c Arnaldo Carvalho de Melo ` (8 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> The dsos__write_buildid_table() is not use struct dso and it mostly uses perf_session struct. So rename it to perf_session__write_buildid_ table() so that it corresponds to other related functions such as perf_session__read_build_ids() and perf_session__cache_build_ids(). Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1415063674-17206-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/header.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 0ecf4a304cbc..be8d02eb97e9 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -297,10 +297,8 @@ static int machine__write_buildid_table(struct machine *machine, int fd) return err; } -static int dsos__write_buildid_table(struct perf_header *header, int fd) +static int perf_session__write_buildid_table(struct perf_session *session, int fd) { - struct perf_session *session = container_of(header, - struct perf_session, header); struct rb_node *nd; int err = machine__write_buildid_table(&session->machines.host, fd); @@ -523,7 +521,7 @@ static int write_build_id(int fd, struct perf_header *h, if (!perf_session__read_build_ids(session, true)) return -1; - err = dsos__write_buildid_table(h, fd); + err = perf_session__write_buildid_table(session, fd); if (err < 0) { pr_debug("failed to write buildid table\n"); return err; -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 11/18] perf build-id: Move build-id related functions to util/build-id.c 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (9 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 10/18] perf build-id: Rename dsos__write_buildid_table() Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 12/18] perf record: Do not save pathname in ./debug/.build-id directory for vmlinux Arnaldo Carvalho de Melo ` (7 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> It'd be better managing those functions in a separate place as util/header.c file is already big. It now exports following 3 functions to others: bool perf_session__read_build_ids(struct perf_session *session, bool with_hits); int perf_session__write_buildid_table(struct perf_session *session, int fd); int perf_session__cache_build_ids(struct perf_session *session); Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: http://lkml.kernel.org/r/545733E7.6010105@intel.com Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1415063674-17206-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/build-id.c | 334 ++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/build-id.h | 11 ++ tools/perf/util/header.c | 337 +-------------------------------------------- tools/perf/util/header.h | 8 +- 4 files changed, 349 insertions(+), 341 deletions(-) diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 2e7c68e39330..dd2a3e52ada1 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -15,6 +15,8 @@ #include "debug.h" #include "session.h" #include "tool.h" +#include "header.h" +#include "vdso.h" int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, union perf_event *event, @@ -105,3 +107,335 @@ char *dso__build_id_filename(const struct dso *dso, char *bf, size_t size) build_id_hex, build_id_hex + 2); return bf; } + +#define dsos__for_each_with_build_id(pos, head) \ + list_for_each_entry(pos, head, node) \ + if (!pos->has_build_id) \ + continue; \ + else + +static int write_buildid(const char *name, size_t name_len, u8 *build_id, + pid_t pid, u16 misc, int fd) +{ + int err; + struct build_id_event b; + size_t len; + + len = name_len + 1; + len = PERF_ALIGN(len, NAME_ALIGN); + + memset(&b, 0, sizeof(b)); + memcpy(&b.build_id, build_id, BUILD_ID_SIZE); + b.pid = pid; + b.header.misc = misc; + b.header.size = sizeof(b) + len; + + err = writen(fd, &b, sizeof(b)); + if (err < 0) + return err; + + return write_padded(fd, name, name_len + 1, len); +} + +static int __dsos__write_buildid_table(struct list_head *head, + struct machine *machine, + pid_t pid, u16 misc, int fd) +{ + char nm[PATH_MAX]; + struct dso *pos; + + dsos__for_each_with_build_id(pos, head) { + int err; + const char *name; + size_t name_len; + + if (!pos->hit) + continue; + + if (dso__is_vdso(pos)) { + name = pos->short_name; + name_len = pos->short_name_len + 1; + } else if (dso__is_kcore(pos)) { + machine__mmap_name(machine, nm, sizeof(nm)); + name = nm; + name_len = strlen(nm) + 1; + } else { + name = pos->long_name; + name_len = pos->long_name_len + 1; + } + + err = write_buildid(name, name_len, pos->build_id, + pid, misc, fd); + if (err) + return err; + } + + return 0; +} + +static int machine__write_buildid_table(struct machine *machine, int fd) +{ + int err; + u16 kmisc = PERF_RECORD_MISC_KERNEL, + umisc = PERF_RECORD_MISC_USER; + + if (!machine__is_host(machine)) { + kmisc = PERF_RECORD_MISC_GUEST_KERNEL; + umisc = PERF_RECORD_MISC_GUEST_USER; + } + + err = __dsos__write_buildid_table(&machine->kernel_dsos.head, machine, + machine->pid, kmisc, fd); + if (err == 0) + err = __dsos__write_buildid_table(&machine->user_dsos.head, + machine, machine->pid, umisc, + fd); + return err; +} + +int perf_session__write_buildid_table(struct perf_session *session, int fd) +{ + struct rb_node *nd; + int err = machine__write_buildid_table(&session->machines.host, fd); + + if (err) + return err; + + for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { + struct machine *pos = rb_entry(nd, struct machine, rb_node); + err = machine__write_buildid_table(pos, fd); + if (err) + break; + } + return err; +} + +static int __dsos__hit_all(struct list_head *head) +{ + struct dso *pos; + + list_for_each_entry(pos, head, node) + pos->hit = true; + + return 0; +} + +static int machine__hit_all_dsos(struct machine *machine) +{ + int err; + + err = __dsos__hit_all(&machine->kernel_dsos.head); + if (err) + return err; + + return __dsos__hit_all(&machine->user_dsos.head); +} + +int dsos__hit_all(struct perf_session *session) +{ + struct rb_node *nd; + int err; + + err = machine__hit_all_dsos(&session->machines.host); + if (err) + return err; + + for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { + struct machine *pos = rb_entry(nd, struct machine, rb_node); + + err = machine__hit_all_dsos(pos); + if (err) + return err; + } + + return 0; +} + +int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, + const char *name, bool is_kallsyms, bool is_vdso) +{ + const size_t size = PATH_MAX; + char *realname, *filename = zalloc(size), + *linkname = zalloc(size), *targetname; + int len, err = -1; + bool slash = is_kallsyms || is_vdso; + + if (is_kallsyms) { + if (symbol_conf.kptr_restrict) { + pr_debug("Not caching a kptr_restrict'ed /proc/kallsyms\n"); + err = 0; + goto out_free; + } + realname = (char *) name; + } else + realname = realpath(name, NULL); + + if (realname == NULL || filename == NULL || linkname == NULL) + goto out_free; + + len = scnprintf(filename, size, "%s%s%s", + debugdir, slash ? "/" : "", + is_vdso ? DSO__NAME_VDSO : realname); + if (mkdir_p(filename, 0755)) + goto out_free; + + snprintf(filename + len, size - len, "/%s", sbuild_id); + + if (access(filename, F_OK)) { + if (is_kallsyms) { + if (copyfile("/proc/kallsyms", filename)) + goto out_free; + } else if (link(realname, filename) && copyfile(name, filename)) + goto out_free; + } + + len = scnprintf(linkname, size, "%s/.build-id/%.2s", + debugdir, sbuild_id); + + if (access(linkname, X_OK) && mkdir_p(linkname, 0755)) + goto out_free; + + snprintf(linkname + len, size - len, "/%s", sbuild_id + 2); + targetname = filename + strlen(debugdir) - 5; + memcpy(targetname, "../..", 5); + + if (symlink(targetname, linkname) == 0) + err = 0; +out_free: + if (!is_kallsyms) + free(realname); + free(filename); + free(linkname); + return err; +} + +static int build_id_cache__add_b(const u8 *build_id, size_t build_id_size, + const char *name, const char *debugdir, + bool is_kallsyms, bool is_vdso) +{ + char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + + build_id__sprintf(build_id, build_id_size, sbuild_id); + + return build_id_cache__add_s(sbuild_id, debugdir, name, + is_kallsyms, is_vdso); +} + +int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir) +{ + const size_t size = PATH_MAX; + char *filename = zalloc(size), + *linkname = zalloc(size); + int err = -1; + + if (filename == NULL || linkname == NULL) + goto out_free; + + snprintf(linkname, size, "%s/.build-id/%.2s/%s", + debugdir, sbuild_id, sbuild_id + 2); + + if (access(linkname, F_OK)) + goto out_free; + + if (readlink(linkname, filename, size - 1) < 0) + goto out_free; + + if (unlink(linkname)) + goto out_free; + + /* + * Since the link is relative, we must make it absolute: + */ + snprintf(linkname, size, "%s/.build-id/%.2s/%s", + debugdir, sbuild_id, filename); + + if (unlink(linkname)) + goto out_free; + + err = 0; +out_free: + free(filename); + free(linkname); + return err; +} + +static int dso__cache_build_id(struct dso *dso, struct machine *machine, + const char *debugdir) +{ + bool is_kallsyms = dso->kernel && dso->long_name[0] != '/'; + bool is_vdso = dso__is_vdso(dso); + const char *name = dso->long_name; + char nm[PATH_MAX]; + + if (dso__is_kcore(dso)) { + is_kallsyms = true; + machine__mmap_name(machine, nm, sizeof(nm)); + name = nm; + } + return build_id_cache__add_b(dso->build_id, sizeof(dso->build_id), name, + debugdir, is_kallsyms, is_vdso); +} + +static int __dsos__cache_build_ids(struct list_head *head, + struct machine *machine, const char *debugdir) +{ + struct dso *pos; + int err = 0; + + dsos__for_each_with_build_id(pos, head) + if (dso__cache_build_id(pos, machine, debugdir)) + err = -1; + + return err; +} + +static int machine__cache_build_ids(struct machine *machine, const char *debugdir) +{ + int ret = __dsos__cache_build_ids(&machine->kernel_dsos.head, machine, + debugdir); + ret |= __dsos__cache_build_ids(&machine->user_dsos.head, machine, + debugdir); + return ret; +} + +int perf_session__cache_build_ids(struct perf_session *session) +{ + struct rb_node *nd; + int ret; + char debugdir[PATH_MAX]; + + snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir); + + if (mkdir(debugdir, 0755) != 0 && errno != EEXIST) + return -1; + + ret = machine__cache_build_ids(&session->machines.host, debugdir); + + for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { + struct machine *pos = rb_entry(nd, struct machine, rb_node); + ret |= machine__cache_build_ids(pos, debugdir); + } + return ret ? -1 : 0; +} + +static bool machine__read_build_ids(struct machine *machine, bool with_hits) +{ + bool ret; + + ret = __dsos__read_build_ids(&machine->kernel_dsos.head, with_hits); + ret |= __dsos__read_build_ids(&machine->user_dsos.head, with_hits); + return ret; +} + +bool perf_session__read_build_ids(struct perf_session *session, bool with_hits) +{ + struct rb_node *nd; + bool ret = machine__read_build_ids(&session->machines.host, with_hits); + + for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { + struct machine *pos = rb_entry(nd, struct machine, rb_node); + ret |= machine__read_build_ids(pos, with_hits); + } + + return ret; +} diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index ae392561470b..666a3bd4f64e 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h @@ -15,4 +15,15 @@ char *dso__build_id_filename(const struct dso *dso, char *bf, size_t size); int build_id__mark_dso_hit(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine); + +int dsos__hit_all(struct perf_session *session); + +bool perf_session__read_build_ids(struct perf_session *session, bool with_hits); +int perf_session__write_buildid_table(struct perf_session *session, int fd); +int perf_session__cache_build_ids(struct perf_session *session); + +int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, + const char *name, bool is_kallsyms, bool is_vdso); +int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir); + #endif diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index be8d02eb97e9..3e2c156d9c64 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -79,10 +79,7 @@ static int do_write(int fd, const void *buf, size_t size) return 0; } -#define NAME_ALIGN 64 - -static int write_padded(int fd, const void *bf, size_t count, - size_t count_aligned) +int write_padded(int fd, const void *bf, size_t count, size_t count_aligned) { static const char zero_buf[NAME_ALIGN]; int err = do_write(fd, bf, count); @@ -171,338 +168,6 @@ perf_header__set_cmdline(int argc, const char **argv) return 0; } -#define dsos__for_each_with_build_id(pos, head) \ - list_for_each_entry(pos, head, node) \ - if (!pos->has_build_id) \ - continue; \ - else - -static int write_buildid(const char *name, size_t name_len, u8 *build_id, - pid_t pid, u16 misc, int fd) -{ - int err; - struct build_id_event b; - size_t len; - - len = name_len + 1; - len = PERF_ALIGN(len, NAME_ALIGN); - - memset(&b, 0, sizeof(b)); - memcpy(&b.build_id, build_id, BUILD_ID_SIZE); - b.pid = pid; - b.header.misc = misc; - b.header.size = sizeof(b) + len; - - err = do_write(fd, &b, sizeof(b)); - if (err < 0) - return err; - - return write_padded(fd, name, name_len + 1, len); -} - -static int __dsos__hit_all(struct list_head *head) -{ - struct dso *pos; - - list_for_each_entry(pos, head, node) - pos->hit = true; - - return 0; -} - -static int machine__hit_all_dsos(struct machine *machine) -{ - int err; - - err = __dsos__hit_all(&machine->kernel_dsos.head); - if (err) - return err; - - return __dsos__hit_all(&machine->user_dsos.head); -} - -int dsos__hit_all(struct perf_session *session) -{ - struct rb_node *nd; - int err; - - err = machine__hit_all_dsos(&session->machines.host); - if (err) - return err; - - for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { - struct machine *pos = rb_entry(nd, struct machine, rb_node); - - err = machine__hit_all_dsos(pos); - if (err) - return err; - } - - return 0; -} - -static int __dsos__write_buildid_table(struct list_head *head, - struct machine *machine, - pid_t pid, u16 misc, int fd) -{ - char nm[PATH_MAX]; - struct dso *pos; - - dsos__for_each_with_build_id(pos, head) { - int err; - const char *name; - size_t name_len; - - if (!pos->hit) - continue; - - if (dso__is_vdso(pos)) { - name = pos->short_name; - name_len = pos->short_name_len + 1; - } else if (dso__is_kcore(pos)) { - machine__mmap_name(machine, nm, sizeof(nm)); - name = nm; - name_len = strlen(nm) + 1; - } else { - name = pos->long_name; - name_len = pos->long_name_len + 1; - } - - err = write_buildid(name, name_len, pos->build_id, - pid, misc, fd); - if (err) - return err; - } - - return 0; -} - -static int machine__write_buildid_table(struct machine *machine, int fd) -{ - int err; - u16 kmisc = PERF_RECORD_MISC_KERNEL, - umisc = PERF_RECORD_MISC_USER; - - if (!machine__is_host(machine)) { - kmisc = PERF_RECORD_MISC_GUEST_KERNEL; - umisc = PERF_RECORD_MISC_GUEST_USER; - } - - err = __dsos__write_buildid_table(&machine->kernel_dsos.head, machine, - machine->pid, kmisc, fd); - if (err == 0) - err = __dsos__write_buildid_table(&machine->user_dsos.head, - machine, machine->pid, umisc, - fd); - return err; -} - -static int perf_session__write_buildid_table(struct perf_session *session, int fd) -{ - struct rb_node *nd; - int err = machine__write_buildid_table(&session->machines.host, fd); - - if (err) - return err; - - for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { - struct machine *pos = rb_entry(nd, struct machine, rb_node); - err = machine__write_buildid_table(pos, fd); - if (err) - break; - } - return err; -} - -int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, - const char *name, bool is_kallsyms, bool is_vdso) -{ - const size_t size = PATH_MAX; - char *realname, *filename = zalloc(size), - *linkname = zalloc(size), *targetname; - int len, err = -1; - bool slash = is_kallsyms || is_vdso; - - if (is_kallsyms) { - if (symbol_conf.kptr_restrict) { - pr_debug("Not caching a kptr_restrict'ed /proc/kallsyms\n"); - err = 0; - goto out_free; - } - realname = (char *) name; - } else - realname = realpath(name, NULL); - - if (realname == NULL || filename == NULL || linkname == NULL) - goto out_free; - - len = scnprintf(filename, size, "%s%s%s", - debugdir, slash ? "/" : "", - is_vdso ? DSO__NAME_VDSO : realname); - if (mkdir_p(filename, 0755)) - goto out_free; - - snprintf(filename + len, size - len, "/%s", sbuild_id); - - if (access(filename, F_OK)) { - if (is_kallsyms) { - if (copyfile("/proc/kallsyms", filename)) - goto out_free; - } else if (link(realname, filename) && copyfile(name, filename)) - goto out_free; - } - - len = scnprintf(linkname, size, "%s/.build-id/%.2s", - debugdir, sbuild_id); - - if (access(linkname, X_OK) && mkdir_p(linkname, 0755)) - goto out_free; - - snprintf(linkname + len, size - len, "/%s", sbuild_id + 2); - targetname = filename + strlen(debugdir) - 5; - memcpy(targetname, "../..", 5); - - if (symlink(targetname, linkname) == 0) - err = 0; -out_free: - if (!is_kallsyms) - free(realname); - free(filename); - free(linkname); - return err; -} - -static int build_id_cache__add_b(const u8 *build_id, size_t build_id_size, - const char *name, const char *debugdir, - bool is_kallsyms, bool is_vdso) -{ - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; - - build_id__sprintf(build_id, build_id_size, sbuild_id); - - return build_id_cache__add_s(sbuild_id, debugdir, name, - is_kallsyms, is_vdso); -} - -int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir) -{ - const size_t size = PATH_MAX; - char *filename = zalloc(size), - *linkname = zalloc(size); - int err = -1; - - if (filename == NULL || linkname == NULL) - goto out_free; - - snprintf(linkname, size, "%s/.build-id/%.2s/%s", - debugdir, sbuild_id, sbuild_id + 2); - - if (access(linkname, F_OK)) - goto out_free; - - if (readlink(linkname, filename, size - 1) < 0) - goto out_free; - - if (unlink(linkname)) - goto out_free; - - /* - * Since the link is relative, we must make it absolute: - */ - snprintf(linkname, size, "%s/.build-id/%.2s/%s", - debugdir, sbuild_id, filename); - - if (unlink(linkname)) - goto out_free; - - err = 0; -out_free: - free(filename); - free(linkname); - return err; -} - -static int dso__cache_build_id(struct dso *dso, struct machine *machine, - const char *debugdir) -{ - bool is_kallsyms = dso->kernel && dso->long_name[0] != '/'; - bool is_vdso = dso__is_vdso(dso); - const char *name = dso->long_name; - char nm[PATH_MAX]; - - if (dso__is_kcore(dso)) { - is_kallsyms = true; - machine__mmap_name(machine, nm, sizeof(nm)); - name = nm; - } - return build_id_cache__add_b(dso->build_id, sizeof(dso->build_id), name, - debugdir, is_kallsyms, is_vdso); -} - -static int __dsos__cache_build_ids(struct list_head *head, - struct machine *machine, const char *debugdir) -{ - struct dso *pos; - int err = 0; - - dsos__for_each_with_build_id(pos, head) - if (dso__cache_build_id(pos, machine, debugdir)) - err = -1; - - return err; -} - -static int machine__cache_build_ids(struct machine *machine, const char *debugdir) -{ - int ret = __dsos__cache_build_ids(&machine->kernel_dsos.head, machine, - debugdir); - ret |= __dsos__cache_build_ids(&machine->user_dsos.head, machine, - debugdir); - return ret; -} - -static int perf_session__cache_build_ids(struct perf_session *session) -{ - struct rb_node *nd; - int ret; - char debugdir[PATH_MAX]; - - snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir); - - if (mkdir(debugdir, 0755) != 0 && errno != EEXIST) - return -1; - - ret = machine__cache_build_ids(&session->machines.host, debugdir); - - for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { - struct machine *pos = rb_entry(nd, struct machine, rb_node); - ret |= machine__cache_build_ids(pos, debugdir); - } - return ret ? -1 : 0; -} - -static bool machine__read_build_ids(struct machine *machine, bool with_hits) -{ - bool ret; - - ret = __dsos__read_build_ids(&machine->kernel_dsos.head, with_hits); - ret |= __dsos__read_build_ids(&machine->user_dsos.head, with_hits); - return ret; -} - -static bool perf_session__read_build_ids(struct perf_session *session, bool with_hits) -{ - struct rb_node *nd; - bool ret = machine__read_build_ids(&session->machines.host, with_hits); - - for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) { - struct machine *pos = rb_entry(nd, struct machine, rb_node); - ret |= machine__read_build_ids(pos, with_hits); - } - - return ret; -} - static int write_tracing_data(int fd, struct perf_header *h __maybe_unused, struct perf_evlist *evlist) { diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index 8f5cbaea64a5..3bb90ac172a1 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -122,10 +122,6 @@ int perf_header__process_sections(struct perf_header *header, int fd, int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full); -int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, - const char *name, bool is_kallsyms, bool is_vdso); -int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir); - int perf_event__synthesize_attr(struct perf_tool *tool, struct perf_event_attr *attr, u32 ids, u64 *id, perf_event__handler_t process); @@ -151,7 +147,9 @@ int perf_event__process_build_id(struct perf_tool *tool, struct perf_session *session); bool is_perf_magic(u64 magic); -int dsos__hit_all(struct perf_session *session); +#define NAME_ALIGN 64 + +int write_padded(int fd, const void *bf, size_t count, size_t count_aligned); /* * arch specific callback -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 12/18] perf record: Do not save pathname in ./debug/.build-id directory for vmlinux 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (10 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 11/18] perf build-id: Move build-id related functions to util/build-id.c Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 13/18] perf tools: Fix build-id matching on vmlinux Arnaldo Carvalho de Melo ` (6 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> When perf record finishes a session, it pre-processes samples in order to write build-id info from DSOs that had samples. During this process it'll call map__load() for the kernel map, and it ends up calling dso__load_vmlinux_path() which replaces dso->long_name. But this function checks kernel's build-id before searching vmlinux path so it'll end up with a cryptic name, the pathname for the entry in the ~/.debug cache, which can be confusing to users. This patch adds a flag to skip the build-id check during record, so that it'll have the original vmlinux path for the kernel dso->long_name, not the entry in the ~/.debug cache. Before: # perf record -va sleep 3 mmap size 528384B [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.196 MB perf.data (~8545 samples) ] Looking at the vmlinux_path (7 entries long) Using /home/namhyung/.debug/.build-id/f0/6e17aa50adf4d00b88925e03775de107611551 for symbols After: # perf record -va sleep 3 mmap size 528384B [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.193 MB perf.data (~8432 samples) ] Looking at the vmlinux_path (7 entries long) Using /lib/modules/3.16.4-1-ARCH/build/vmlinux for symbols Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1415063674-17206-7-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 11 +++++++++++ tools/perf/util/symbol.c | 11 ++++++----- tools/perf/util/symbol.h | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 5091a27e6d28..582c4da155ea 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -200,6 +200,17 @@ static int process_buildids(struct record *rec) if (size == 0) return 0; + /* + * During this process, it'll load kernel map and replace the + * dso->long_name to a real pathname it found. In this case + * we prefer the vmlinux path like + * /lib/modules/3.16.4/build/vmlinux + * + * rather than build-id path (in debug directory). + * $HOME/.debug/.build-id/f0/6e17aa50adf4d00b88925e03775de107611551 + */ + symbol_conf.ignore_vmlinux_buildid = true; + return __perf_session__process_events(session, start, size - start, size, &build_id__mark_dso_hit_ops); diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index c69915c9d5bc..c24c5b83156c 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1511,12 +1511,10 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map, symbol_filter_t filter) { int i, err = 0; - char *filename; + char *filename = NULL; - pr_debug("Looking at the vmlinux_path (%d entries long)\n", - vmlinux_path__nr_entries + 1); - - filename = dso__build_id_filename(dso, NULL, 0); + if (!symbol_conf.ignore_vmlinux_buildid) + filename = dso__build_id_filename(dso, NULL, 0); if (filename != NULL) { err = dso__load_vmlinux(dso, map, filename, true, filter); if (err > 0) @@ -1524,6 +1522,9 @@ int dso__load_vmlinux_path(struct dso *dso, struct map *map, free(filename); } + pr_debug("Looking at the vmlinux_path (%d entries long)\n", + vmlinux_path__nr_entries + 1); + for (i = 0; i < vmlinux_path__nr_entries; ++i) { err = dso__load_vmlinux(dso, map, vmlinux_path[i], false, filter); if (err > 0) diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index eb2c19bf8d90..ded3ca7266de 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -105,6 +105,7 @@ struct symbol_conf { unsigned short nr_events; bool try_vmlinux_path, ignore_vmlinux, + ignore_vmlinux_buildid, show_kernel_path, use_modules, sort_by_name, -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 13/18] perf tools: Fix build-id matching on vmlinux 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (11 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 12/18] perf record: Do not save pathname in ./debug/.build-id directory for vmlinux Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name Arnaldo Carvalho de Melo ` (5 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> There's a problem on finding correct kernel symbols when perf report runs on a different kernel. Although a part of the problem was solved by the prior commit 0a7e6d1b6844 ("perf tools: Check recorded kernel version when finding vmlinux"), there's a remaining problem still. When perf records samples, it synthesizes the kernel map using machine__mmap_name() and ref_reloc_sym like "[kernel.kallsyms]_text". You can easily see it using 'perf report -D' command. After finishing record, it goes through the recorded events to find maps/dsos actually used. And then record build-id info of them. During this process, it needs to load symbols in a dso and it'd call dso__load_vmlinux_path() since the default value of the symbol_conf. try_vmlinux_path is true. However it changes dso->long_name to a real path of the vmlinux file (e.g. /lib/modules/3.16.4/build/vmlinux) if one is running on a custom kernel. It resulted in that perf report reads the build-id of the vmlinux, but cannot use it since it only knows about the [kernel.kallsyms] map. It then falls back to possible vmlinux paths by using the recorded kernel version (in case of a recent version) or a running kernel silently. Even with the recent tools, this still has a possibility of breaking the result. As the build directory is a symbolic link, if one built a new kernel in the same directory with different source/config, the old link to vmlinux will point the new file. So it's absolutely needed to use build-id when finding a kernel image. In this patch, it's now changed to try to search a kernel dso in the existing dso list which was constructed during build-id table parsing so it'll always have a build-id. If not found, search "[kernel.kallsyms]". Before: $ perf report # Children Self Command Shared Object Symbol # ........ ........ ....... ................. ............................... # 72.15% 0.00% swapper [kernel.kallsyms] [k] set_curr_task_rt 72.15% 0.00% swapper [kernel.kallsyms] [k] native_calibrate_tsc 72.15% 0.00% swapper [kernel.kallsyms] [k] tsc_refine_calibration_work 71.87% 71.87% swapper [kernel.kallsyms] [k] module_finalize ... After (for the same perf.data): 72.15% 0.00% swapper vmlinux [k] cpu_startup_entry 72.15% 0.00% swapper vmlinux [k] arch_cpu_idle 72.15% 0.00% swapper vmlinux [k] default_idle 71.87% 71.87% swapper vmlinux [k] native_safe_halt ... Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/20140924073356.GB1962@gmail.com Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1415063674-17206-8-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/header.c | 2 +- tools/perf/util/machine.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 3e2c156d9c64..76442caca37e 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1269,7 +1269,7 @@ static int __event_process_build_id(struct build_id_event *bev, dso__set_build_id(dso, &bev->build_id); - if (filename[0] == '[') + if (!is_kernel_module(filename, NULL)) dso->kernel = dso_type; build_id__sprintf(dso->build_id, sizeof(dso->build_id), diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 946c7d62cb6e..53f90e9c65fe 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1085,8 +1085,20 @@ static int machine__process_kernel_mmap_event(struct machine *machine, * Should be there already, from the build-id table in * the header. */ - struct dso *kernel = __dsos__findnew(&machine->kernel_dsos, - kmmap_prefix); + struct dso *kernel = NULL; + struct dso *dso; + + list_for_each_entry(dso, &machine->kernel_dsos.head, node) { + if (is_kernel_module(dso->long_name, NULL)) + continue; + + kernel = dso; + break; + } + + if (kernel == NULL) + kernel = __dsos__findnew(&machine->kernel_dsos, + kmmap_prefix); if (kernel == NULL) goto out_problem; -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (12 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 13/18] perf tools: Fix build-id matching on vmlinux Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-09 7:51 ` Jiri Olsa 2014-11-06 21:04 ` [PATCH 15/18] perf tools: Add test_and_set_bit function Arnaldo Carvalho de Melo ` (4 subsequent siblings) 18 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> The previous patch changed kernel dso name from '[kernel.kallsyms]' to vmlinux. However it might add confusion to old users accustomed to the old name. So change the short name to '[kernel.vmlinux]' to reduce such confusion. Before: # Overhead Command Shared Object Symbol # ........ .............. ....................... ............................... # 9.83% swapper vmlinux [k] intel_idle 4.10% awk libc-2.20.so [.] __strcmp_sse2 1.86% sed libc-2.20.so [.] __strcmp_sse2 1.78% netctl-auto libc-2.20.so [.] __strcmp_sse2 1.23% netctl-auto libc-2.20.so [.] __mbrtowc 1.21% firefox libxul.so [.] 0x00000000024b62bd 1.20% swapper vmlinux [k] cpuidle_enter_state 1.03% sleep vmlinux [k] copy_user_generic_unrolled After: # Overhead Command Shared Object Symbol # ........ .............. ....................... ............................... # 9.83% swapper [kernel.vmlinux] [k] intel_idle 4.10% awk libc-2.20.so [.] __strcmp_sse2 1.86% sed libc-2.20.so [.] __strcmp_sse2 1.78% netctl-auto libc-2.20.so [.] __strcmp_sse2 1.23% netctl-auto libc-2.20.so [.] __mbrtowc 1.21% firefox libxul.so [.] 0x00000000024b62bd 1.20% swapper [kernel.vmlinux] [k] cpuidle_enter_state 1.03% sleep [kernel.vmlinux] [k] copy_user_generic_unrolled Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1415063674-17206-9-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/machine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 53f90e9c65fe..52e94902afb1 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1106,6 +1106,9 @@ static int machine__process_kernel_mmap_event(struct machine *machine, if (__machine__create_kernel_maps(machine, kernel) < 0) goto out_problem; + if (strstr(dso->long_name, "vmlinux")) + dso__set_short_name(dso, "[kernel.vmlinux]", false); + machine__set_kernel_mmap_len(machine, event); /* -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* Re: [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name 2014-11-06 21:04 ` [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name Arnaldo Carvalho de Melo @ 2014-11-09 7:51 ` Jiri Olsa 2014-11-10 6:13 ` Namhyung Kim 0 siblings, 1 reply; 53+ messages in thread From: Jiri Olsa @ 2014-11-09 7:51 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Ingo Molnar, linux-kernel, Namhyung Kim, Adrian Hunter, David Ahern, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo On Thu, Nov 06, 2014 at 06:04:35PM -0300, Arnaldo Carvalho de Melo wrote: > From: Namhyung Kim <namhyung@kernel.org> > > The previous patch changed kernel dso name from '[kernel.kallsyms]' to > vmlinux. However it might add confusion to old users accustomed to the > old name. So change the short name to '[kernel.vmlinux]' to reduce such > confusion. > SNIP > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > --- > tools/perf/util/machine.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > index 53f90e9c65fe..52e94902afb1 100644 > --- a/tools/perf/util/machine.c > +++ b/tools/perf/util/machine.c > @@ -1106,6 +1106,9 @@ static int machine__process_kernel_mmap_event(struct machine *machine, > if (__machine__create_kernel_maps(machine, kernel) < 0) > goto out_problem; > > + if (strstr(dso->long_name, "vmlinux")) > + dso__set_short_name(dso, "[kernel.vmlinux]", false); > + heya, I've got attached segfault in perf script because of this, if I revert it's ok.. jirka [jolsa@krava perf]$ ./perf record -e instructions -c 100000000 yes > /dev/null ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.013 MB perf.data (~576 samples) ] [jolsa@krava perf]$ gdb ./perf GNU gdb (GDB) Fedora 7.7.1-21.fc20 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./perf...done. (gdb) r script Starting program: /home/jolsa/kernel.org/linux-perf/tools/perf/perf script warning: section not found in /usr/lib/debug/lib/modules/3.16.6-203.fc20.x86_64/vdso/vdso64.so.debug [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Detaching after fork from child process 6849. Program received signal SIGSEGV, Segmentation fault. __strstr_sse42 (s1=0x0, s2=0x5db702 "vmlinux") at ../sysdeps/x86_64/multiarch/strstr.c:175 175 if (__builtin_expect (p1[0] == '\0', 0)) Missing separate debuginfos, use: debuginfo-install audit-libs-2.4-2.fc20.x86_64 elfutils-libelf-0.160-1.fc20.x86_64 elfutils-libs-0.160-1.fc20.x86_64 libunwind-1.1-3.fc20.x86_64 nss-softokn-freebl-3.17.2-1.fc20.x86_64 numactl-libs-2.0.9-2.fc20.x86_64 perl-libs-5.18.4-290.fc20.x86_64 python-libs-2.7.5-14.fc20.x86_64 slang-2.2.4-11.fc20.x86_64 xz-libs-5.1.2-12alpha.fc20.x86_64 zlib-1.2.8-3.fc20.x86_64 (gdb) bt #0 __strstr_sse42 (s1=0x0, s2=0x5db702 "vmlinux") at ../sysdeps/x86_64/multiarch/strstr.c:175 #1 0x00000000004a881d in machine__process_kernel_mmap_event (machine=0x8d3e80, event=0x7ffff7ff50d8) at util/machine.c:1109 #2 0x00000000004a8b4f in machine__process_mmap_event (machine=0x8d3e80, event=0x7ffff7ff50d8, sample=0x7fffffffd280) at util/machine.c:1203 #3 0x0000000000470e7e in perf_event__process_mmap (tool=0x7fffffffd650, event=0x7ffff7ff50d8, sample=0x7fffffffd280, machine=0x8d3e80) at util/event.c:666 #4 0x00000000004af2fa in perf_session__deliver_event (session=0x8d3dc0, event=0x7ffff7ff50d8, sample=0x7fffffffd280, tool=0x7fffffffd650, file_offset=216) at util/session.c:845 #5 0x00000000004afa96 in perf_session__process_event (session=0x8d3dc0, event=0x7ffff7ff50d8, tool=0x7fffffffd650, file_offset=216) at util/session.c:1020 #6 0x00000000004b0451 in __perf_session__process_events (session=0x8d3dc0, data_offset=216, data_size=16240, file_size=16456, tool=0x7fffffffd650) at util/session.c:1292 #7 0x00000000004b061e in perf_session__process_events (session=0x8d3dc0, tool=0x7fffffffd650) at util/session.c:1337 #8 0x00000000004453d4 in __cmd_script (script=0x7fffffffd650) at builtin-script.c:803 #9 0x0000000000448858 in cmd_script (argc=0, argv=0x7fffffffe2e0, prefix=0x0) at builtin-script.c:1835 #10 0x000000000041c88c in run_builtin (p=0x856f70 <commands+336>, argc=1, argv=0x7fffffffe2e0) at perf.c:331 #11 0x000000000041caeb in handle_internal_command (argc=1, argv=0x7fffffffe2e0) at perf.c:390 #12 0x000000000041cc37 in run_argv (argcp=0x7fffffffe13c, argv=0x7fffffffe130) at perf.c:434 #13 0x000000000041cf8e in main (argc=1, argv=0x7fffffffe2e0) at perf.c:549 (gdb) q A debugging session is active. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name 2014-11-09 7:51 ` Jiri Olsa @ 2014-11-10 6:13 ` Namhyung Kim 2014-11-10 15:29 ` Jiri Olsa 0 siblings, 1 reply; 53+ messages in thread From: Namhyung Kim @ 2014-11-10 6:13 UTC (permalink / raw) To: Jiri Olsa Cc: Arnaldo Carvalho de Melo, Ingo Molnar, linux-kernel, Adrian Hunter, David Ahern, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo Hi Jiri, On Sun, 9 Nov 2014 08:51:26 +0100, Jiri Olsa wrote: > On Thu, Nov 06, 2014 at 06:04:35PM -0300, Arnaldo Carvalho de Melo wrote: >> From: Namhyung Kim <namhyung@kernel.org> >> >> The previous patch changed kernel dso name from '[kernel.kallsyms]' to >> vmlinux. However it might add confusion to old users accustomed to the >> old name. So change the short name to '[kernel.vmlinux]' to reduce such >> confusion. >> > > SNIP > >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> >> --- >> tools/perf/util/machine.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c >> index 53f90e9c65fe..52e94902afb1 100644 >> --- a/tools/perf/util/machine.c >> +++ b/tools/perf/util/machine.c >> @@ -1106,6 +1106,9 @@ static int machine__process_kernel_mmap_event(struct machine *machine, >> if (__machine__create_kernel_maps(machine, kernel) < 0) >> goto out_problem; >> >> + if (strstr(dso->long_name, "vmlinux")) >> + dso__set_short_name(dso, "[kernel.vmlinux]", false); >> + > > heya, > I've got attached segfault in perf script because of this, > if I revert it's ok.. Oops, sorry. It seems somehow to fail to find a matching kernel dso from the build-id table.. anyway we need to access 'kernel' instead of 'dso' since it might be invalid at this time. Could you please check below patch? >From e28ec815465721b81669c47eb00d8307f4b424cd Mon Sep 17 00:00:00 2001 From: Namhyung Kim <namhyung@kernel.org> Date: Mon, 10 Nov 2014 15:05:26 +0900 Subject: [PATCH] perf tools: Fix segfault due to invalid kernel dso access When processing kernel mmap event, it should access the 'kernel' variable as sometimes it cannot find a matching dso from build-id table so 'dso' might be invalid. Reported-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/perf/util/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 52e94902afb1..85033d80fd6a 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1106,8 +1106,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine, if (__machine__create_kernel_maps(machine, kernel) < 0) goto out_problem; - if (strstr(dso->long_name, "vmlinux")) - dso__set_short_name(dso, "[kernel.vmlinux]", false); + if (strstr(kernel->long_name, "vmlinux")) + dso__set_short_name(kernel, "[kernel.vmlinux]", false); machine__set_kernel_mmap_len(machine, event); -- 2.1.2 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* Re: [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name 2014-11-10 6:13 ` Namhyung Kim @ 2014-11-10 15:29 ` Jiri Olsa 0 siblings, 0 replies; 53+ messages in thread From: Jiri Olsa @ 2014-11-10 15:29 UTC (permalink / raw) To: Namhyung Kim Cc: Arnaldo Carvalho de Melo, Ingo Molnar, linux-kernel, Adrian Hunter, David Ahern, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo On Mon, Nov 10, 2014 at 03:13:46PM +0900, Namhyung Kim wrote: SNIP > >> + dso__set_short_name(dso, "[kernel.vmlinux]", false); > >> + > > > > heya, > > I've got attached segfault in perf script because of this, > > if I revert it's ok.. > > Oops, sorry. It seems somehow to fail to find a matching kernel dso > from the build-id table.. anyway we need to access 'kernel' instead of > 'dso' since it might be invalid at this time. > > Could you please check below patch? > > > From e28ec815465721b81669c47eb00d8307f4b424cd Mon Sep 17 00:00:00 2001 > From: Namhyung Kim <namhyung@kernel.org> > Date: Mon, 10 Nov 2014 15:05:26 +0900 > Subject: [PATCH] perf tools: Fix segfault due to invalid kernel dso access > > When processing kernel mmap event, it should access the 'kernel' > variable as sometimes it cannot find a matching dso from build-id > table so 'dso' might be invalid. > > Reported-by: Jiri Olsa <jolsa@redhat.com> > Signed-off-by: Namhyung Kim <namhyung@kernel.org> yep, works nicely now Tested-by: Jiri Olsa <jolsa@redhat.com> thanks, jirka ^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH 15/18] perf tools: Add test_and_set_bit function 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (13 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 16/18] perf script perl: Removing event cache as it's no longer needed Arnaldo Carvalho de Melo ` (3 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Adrian Hunter, David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> Set a bit and return its old value. Stolen from kernel sources, will be used in next patches. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1414363445-22370-1-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/include/linux/bitmap.h | 17 +++++++++++++++++ tools/perf/util/include/linux/bitops.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h index 01ffd12dc791..40bd21488032 100644 --- a/tools/perf/util/include/linux/bitmap.h +++ b/tools/perf/util/include/linux/bitmap.h @@ -46,4 +46,21 @@ static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, __bitmap_or(dst, src1, src2, nbits); } +/** + * test_and_set_bit - Set a bit and return its old value + * @nr: Bit to set + * @addr: Address to count from + */ +static inline int test_and_set_bit(int nr, unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old; + + old = *p; + *p = old | mask; + + return (old & mask) != 0; +} + #endif /* _PERF_BITOPS_H */ diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h index dadfa7e54287..c3294163de17 100644 --- a/tools/perf/util/include/linux/bitops.h +++ b/tools/perf/util/include/linux/bitops.h @@ -15,6 +15,8 @@ #define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) +#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define for_each_set_bit(bit, addr, size) \ for ((bit) = find_first_bit((addr), (size)); \ -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 16/18] perf script perl: Removing event cache as it's no longer needed 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (14 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 15/18] perf tools: Add test_and_set_bit function Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 17/18] perf script python: " Arnaldo Carvalho de Melo ` (2 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Adrian Hunter, David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> We don't need to maintain cache of 'struct event_format' objects. Currently the 'struct perf_evsel' holds this reference already. Adding events_defined bitmap to keep track of defined events, which is much cheaper than array of pointers. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1414363445-22370-2-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../perf/util/scripting-engines/trace-event-perl.c | 29 +++++----------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index 0a01bac4ce02..22ebc46226e7 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -24,6 +24,7 @@ #include <string.h> #include <ctype.h> #include <errno.h> +#include <linux/bitmap.h> #include "../util.h" #include <EXTERN.h> @@ -57,7 +58,7 @@ INTERP my_perl; #define FTRACE_MAX_EVENT \ ((1 << (sizeof(unsigned short) * 8)) - 1) -struct event_format *events[FTRACE_MAX_EVENT]; +static DECLARE_BITMAP(events_defined, FTRACE_MAX_EVENT); extern struct scripting_context *scripting_context; @@ -238,35 +239,15 @@ static void define_event_symbols(struct event_format *event, define_event_symbols(event, ev_name, args->next); } -static inline struct event_format *find_cache_event(struct perf_evsel *evsel) -{ - static char ev_name[256]; - struct event_format *event; - int type = evsel->attr.config; - - if (events[type]) - return events[type]; - - events[type] = event = evsel->tp_format; - if (!event) - return NULL; - - sprintf(ev_name, "%s::%s", event->system, event->name); - - define_event_symbols(event, ev_name, event->print_fmt.args); - - return event; -} - static void perl_process_tracepoint(struct perf_sample *sample, struct perf_evsel *evsel, struct thread *thread) { + struct event_format *event = evsel->tp_format; struct format_field *field; static char handler[256]; unsigned long long val; unsigned long s, ns; - struct event_format *event; int pid; int cpu = sample->cpu; void *data = sample->raw_data; @@ -278,7 +259,6 @@ static void perl_process_tracepoint(struct perf_sample *sample, if (evsel->attr.type != PERF_TYPE_TRACEPOINT) return; - event = find_cache_event(evsel); if (!event) die("ug! no event found for type %" PRIu64, (u64)evsel->attr.config); @@ -286,6 +266,9 @@ static void perl_process_tracepoint(struct perf_sample *sample, sprintf(handler, "%s::%s", event->system, event->name); + if (!test_and_set_bit(event->id, events_defined)) + define_event_symbols(event, handler, event->print_fmt.args); + s = nsecs / NSECS_PER_SEC; ns = nsecs - s * NSECS_PER_SEC; -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 17/18] perf script python: Removing event cache as it's no longer needed 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (15 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 16/18] perf script perl: Removing event cache as it's no longer needed Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 18/18] perf evsel: Do not call pevent_free_format when deleting tracepoint Arnaldo Carvalho de Melo 2014-11-07 5:24 ` [GIT PULL 00/18] perf/core improvements and fixes Ingo Molnar 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Adrian Hunter, David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> We don't need to maintain cache of 'struct event_format' objects. Currently the 'struct perf_evsel' holds this reference already. Adding events_defined bitmap to keep track of defined events, which is much cheaper than array of pointers. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1414363445-22370-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../util/scripting-engines/trace-event-python.c | 34 ++++------------------ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 118bc62850a8..d808a328f4dc 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -26,6 +26,7 @@ #include <string.h> #include <stdbool.h> #include <errno.h> +#include <linux/bitmap.h> #include "../../perf.h" #include "../debug.h" @@ -46,7 +47,7 @@ PyMODINIT_FUNC initperf_trace_context(void); #define FTRACE_MAX_EVENT \ ((1 << (sizeof(unsigned short) * 8)) - 1) -struct event_format *events[FTRACE_MAX_EVENT]; +static DECLARE_BITMAP(events_defined, FTRACE_MAX_EVENT); #define MAX_FIELDS 64 #define N_COMMON_FIELDS 7 @@ -255,31 +256,6 @@ static void define_event_symbols(struct event_format *event, define_event_symbols(event, ev_name, args->next); } -static inline struct event_format *find_cache_event(struct perf_evsel *evsel) -{ - static char ev_name[256]; - struct event_format *event; - int type = evsel->attr.config; - - /* - * XXX: Do we really need to cache this since now we have evsel->tp_format - * cached already? Need to re-read this "cache" routine that as well calls - * define_event_symbols() :-\ - */ - if (events[type]) - return events[type]; - - events[type] = event = evsel->tp_format; - if (!event) - return NULL; - - sprintf(ev_name, "%s__%s", event->system, event->name); - - define_event_symbols(event, ev_name, event->print_fmt.args); - - return event; -} - static PyObject *get_field_numeric_entry(struct event_format *event, struct format_field *field, void *data) { @@ -403,12 +379,12 @@ static void python_process_tracepoint(struct perf_sample *sample, struct thread *thread, struct addr_location *al) { + struct event_format *event = evsel->tp_format; PyObject *handler, *context, *t, *obj, *callchain; PyObject *dict = NULL; static char handler_name[256]; struct format_field *field; unsigned long s, ns; - struct event_format *event; unsigned n = 0; int pid; int cpu = sample->cpu; @@ -420,7 +396,6 @@ static void python_process_tracepoint(struct perf_sample *sample, if (!t) Py_FatalError("couldn't create Python tuple"); - event = find_cache_event(evsel); if (!event) die("ug! no event found for type %d", (int)evsel->attr.config); @@ -428,6 +403,9 @@ static void python_process_tracepoint(struct perf_sample *sample, sprintf(handler_name, "%s__%s", event->system, event->name); + if (!test_and_set_bit(event->id, events_defined)) + define_event_symbols(event, handler_name, event->print_fmt.args); + handler = get_handler(handler_name); if (!handler) { dict = PyDict_New(); -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 18/18] perf evsel: Do not call pevent_free_format when deleting tracepoint 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (16 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 17/18] perf script python: " Arnaldo Carvalho de Melo @ 2014-11-06 21:04 ` Arnaldo Carvalho de Melo 2014-11-07 5:24 ` [GIT PULL 00/18] perf/core improvements and fixes Ingo Molnar 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-11-06 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Corey Ashford, David Ahern, Frederic Weisbecker, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Steven Rostedt, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> The libtraceevent library's main handle 'struct pevent' holds pointers of every event that was added to it via functions: pevent_parse_format pevent_parse_event We can't release struct event_format (call pevent_free_format) separately, because that breaks that pointers array mentioned above and another add_event call could end up with segfault. All added events are released within the handle cleanup in pevent_free. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1415098538-1512-1-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evsel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 2f9e68025ede..12b4396c7175 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -853,8 +853,6 @@ void perf_evsel__exit(struct perf_evsel *evsel) perf_evsel__free_id(evsel); close_cgroup(evsel->cgrp); zfree(&evsel->group_name); - if (evsel->tp_format) - pevent_free_format(evsel->tp_format); zfree(&evsel->name); perf_evsel__object.fini(evsel); } -- 1.9.3 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (17 preceding siblings ...) 2014-11-06 21:04 ` [PATCH 18/18] perf evsel: Do not call pevent_free_format when deleting tracepoint Arnaldo Carvalho de Melo @ 2014-11-07 5:24 ` Ingo Molnar 18 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2014-11-07 5:24 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit daa01794a4a36a1da1b09a529adec0c8c0b94ab2: > > perf evsel: Do not call pevent_free_format when deleting tracepoint (2014-11-06 17:47:14 -0300) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo > > for you to fetch changes up to daa01794a4a36a1da1b09a529adec0c8c0b94ab2: > > perf evsel: Do not call pevent_free_format when deleting tracepoint (2014-11-06 17:47:14 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > Infrastructure: > > o Add gzip decompression support for kernel modules (Namhyung Kim) > > o More prep patches for Intel PT, including a a thread stack and > more stuff made available via the database export mechanism (Adrian Hunter) > > o Optimize checking that tracepoint events are defined in perf script perl/python (Jiri Olsa) > > o Do not free pevent when deleting tracepoint evsel (Jiri Olsa) > > o Fix build-id matching for vmlinux (Namhyung Kim) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2018-05-19 10:54 Arnaldo Carvalho de Melo 2018-05-19 11:33 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2018-05-19 10:54 UTC (permalink / raw) To: Ingo Molnar Cc: Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andy Lutomirski, Dave Hansen, David Ahern, H . Peter Anvin, Jin Yao, Jiri Olsa, Joerg Roedel, Kan Liang, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Sandipan Das, Taeung Song, Thomas Gleixner, Wang Nan, x86, 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 5aafae8d097e2161ee5c6a12ad532100f8885d2b: Merge tag 'perf-core-for-mingo-4.18-20180516' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2018-05-16 17:56:43 +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.18-20180519 for you to fetch changes up to 19422a9f2a3be7f3a046285ffae4cbb571aa853a: perf tools: Fix kernel_start for PTI on x86 (2018-05-19 06:42:51 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Record min/max LBR cycles (>= skylake) and add 'perf annotate' TUI hotkey to show it (c) (Jin Yao) - Fix machine->kernel_start for PTI on x86 (Adrian Hunter) - Make machine->env->arch always available, e.g. in 'perf top', not just when reading that info from perf.data files (Adrian Hunter) - Reduce the number of files read at 'perf' start, leaving information such as cacheline size, tracefs mount point determination, max_stack, etc, to be lazily read as tools needs then (Arnaldo Carvalho de Melo) - Fixup BPF include and examples install messages (Arnaldo Carvalho de Melo) - Fixup callchain addresses and symbol offsets in 'perf script', to help correlating with objdump output (Sandipan Das) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (2): perf machine: Add machine__is() to identify machine arch perf tools: Fix kernel_start for PTI on x86 Arnaldo Carvalho de Melo (12): perf config: Call perf_config__init() lazily tools lib api: The tracing_mnt variable doesn't need to be global tools lib api: Unexport 'tracing_path' variable tools lib api fs tracing_path: Introduce get/put_events_file() helpers perf tools: Reuse the path to the tracepoint /events/ directory perf parse-events: Use get/put_events_file() tools lib api fs tracing_path: Introduce opendir() method tools lib api fs tracing_path: Make tracing_events_path private tools include compiler-gcc: Add __pure attribute helper perf tools: Read the cache line size lazily perf tools: No need to unconditionally read the max_stack sysctls perf bpf: Fixup include and examples install messages Jin Yao (2): perf annotate: Record the min/max cycles perf annotate: Create hotkey 'c' to show min/max cycles Sandipan Das (2): perf script: Show virtual addresses instead of offsets perf script: Show symbol offsets by default tools/include/linux/compiler-gcc.h | 3 + tools/lib/api/fs/tracing_path.c | 40 +++++++++--- tools/lib/api/fs/tracing_path.h | 9 ++- tools/perf/Makefile.perf | 2 + tools/perf/builtin-script.c | 26 ++++---- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 2 +- tools/perf/perf.c | 24 +------ tools/perf/tests/parse-events.c | 9 +-- .../tests/shell/record+probe_libc_inet_pton.sh | 12 ++-- tools/perf/ui/browsers/annotate.c | 8 +++ tools/perf/util/annotate.c | 51 ++++++++++++--- tools/perf/util/annotate.h | 11 +++- tools/perf/util/config.c | 16 ++--- tools/perf/util/config.h | 1 - tools/perf/util/env.c | 18 ++++++ tools/perf/util/env.h | 2 + tools/perf/util/evsel.c | 2 +- tools/perf/util/machine.c | 18 +++++- tools/perf/util/machine.h | 2 + tools/perf/util/parse-events.c | 73 +++++++++++++--------- tools/perf/util/probe-file.c | 3 +- tools/perf/util/sort.c | 4 +- tools/perf/util/sort.h | 4 +- tools/perf/util/trace-event-info.c | 11 ++-- tools/perf/util/trace-event.c | 8 ++- tools/perf/util/util.c | 34 +++++++++- tools/perf/util/util.h | 4 +- 28 files changed, 279 insertions(+), 120 deletions(-) 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, 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. # 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-28) 7 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) 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-19) 7.3.0 17 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 7.3.0-19) 7.3.0 18 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 7.3.0-19) 7.3.0 19 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 7.3.0-18) 7.3.0 20 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 7.3.0-19) 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.1.1 20180502 (Red Hat 8.1.1-1) 31 fedora:rawhide : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20) 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.1 20180323 [gcc-7-branch revision 258812] 39 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18.0.7) 40 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28.0.1) 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.5-2017.10) 5.5.0 44 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 45 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 46 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 47 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 48 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 49 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 52 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.2) 7.2.0 54 ubuntu:18.04 : Ok gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 # # uname -a Linux seventh 4.17.0-rc5-00069-g3acf4e395260 #2 SMP Fri May 18 12:13:59 -03 2018 x86_64 x86_64 x86_64 GNU/Linux # perf --version perf version 4.17.rc5.g19422a9 # 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: 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: Check open filename arg using perf trace + vfs_getname: Ok 64: probe libc's inet_pton & backtrace it with ping : Ok 65: 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_debug_O: make DEBUG=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_static_O: make LDFLAGS=-static make_no_libperl_O: make NO_LIBPERL=1 make_util_map_o_O: make util/map.o make_no_libelf_O: make NO_LIBELF=1 make_no_slang_O: make NO_SLANG=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_help_O: make help make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_newt_O: make NO_NEWT=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_perf_o_O: make perf.o make_install_O: make install make_util_pmu_bison_o_O: make util/pmu-bison.o make_tags_O: make tags make_install_prefix_O: make install prefix=/tmp/krava 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_clean_all_O: make clean all make_no_gtk2_O: make NO_GTK2=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libbpf_O: make NO_LIBBPF=1 make_install_bin_O: make install-bin make_doc_O: make doc make_pure_O: make OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2018-05-19 10:54 Arnaldo Carvalho de Melo @ 2018-05-19 11:33 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2018-05-19 11:33 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andy Lutomirski, Dave Hansen, David Ahern, H . Peter Anvin, Jin Yao, Jiri Olsa, Joerg Roedel, Kan Liang, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Sandipan Das, Taeung Song, Thomas Gleixner, Wang Nan, x86, 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 5aafae8d097e2161ee5c6a12ad532100f8885d2b: > > Merge tag 'perf-core-for-mingo-4.18-20180516' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2018-05-16 17:56:43 +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.18-20180519 > > for you to fetch changes up to 19422a9f2a3be7f3a046285ffae4cbb571aa853a: > > perf tools: Fix kernel_start for PTI on x86 (2018-05-19 06:42:51 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Record min/max LBR cycles (>= skylake) and add 'perf annotate' TUI > hotkey to show it (c) (Jin Yao) > > - Fix machine->kernel_start for PTI on x86 (Adrian Hunter) > > - Make machine->env->arch always available, e.g. in 'perf top', not > just when reading that info from perf.data files (Adrian Hunter) > > - Reduce the number of files read at 'perf' start, leaving information such as > cacheline size, tracefs mount point determination, max_stack, etc, to be > lazily read as tools needs then (Arnaldo Carvalho de Melo) > > - Fixup BPF include and examples install messages (Arnaldo Carvalho de Melo) > > - Fixup callchain addresses and symbol offsets in 'perf script', to help > correlating with objdump output (Sandipan Das) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (2): > perf machine: Add machine__is() to identify machine arch > perf tools: Fix kernel_start for PTI on x86 > > Arnaldo Carvalho de Melo (12): > perf config: Call perf_config__init() lazily > tools lib api: The tracing_mnt variable doesn't need to be global > tools lib api: Unexport 'tracing_path' variable > tools lib api fs tracing_path: Introduce get/put_events_file() helpers > perf tools: Reuse the path to the tracepoint /events/ directory > perf parse-events: Use get/put_events_file() > tools lib api fs tracing_path: Introduce opendir() method > tools lib api fs tracing_path: Make tracing_events_path private > tools include compiler-gcc: Add __pure attribute helper > perf tools: Read the cache line size lazily > perf tools: No need to unconditionally read the max_stack sysctls > perf bpf: Fixup include and examples install messages > > Jin Yao (2): > perf annotate: Record the min/max cycles > perf annotate: Create hotkey 'c' to show min/max cycles > > Sandipan Das (2): > perf script: Show virtual addresses instead of offsets > perf script: Show symbol offsets by default > > tools/include/linux/compiler-gcc.h | 3 + > tools/lib/api/fs/tracing_path.c | 40 +++++++++--- > tools/lib/api/fs/tracing_path.h | 9 ++- > tools/perf/Makefile.perf | 2 + > tools/perf/builtin-script.c | 26 ++++---- > tools/perf/builtin-top.c | 2 +- > tools/perf/builtin-trace.c | 2 +- > tools/perf/perf.c | 24 +------ > tools/perf/tests/parse-events.c | 9 +-- > .../tests/shell/record+probe_libc_inet_pton.sh | 12 ++-- > tools/perf/ui/browsers/annotate.c | 8 +++ > tools/perf/util/annotate.c | 51 ++++++++++++--- > tools/perf/util/annotate.h | 11 +++- > tools/perf/util/config.c | 16 ++--- > tools/perf/util/config.h | 1 - > tools/perf/util/env.c | 18 ++++++ > tools/perf/util/env.h | 2 + > tools/perf/util/evsel.c | 2 +- > tools/perf/util/machine.c | 18 +++++- > tools/perf/util/machine.h | 2 + > tools/perf/util/parse-events.c | 73 +++++++++++++--------- > tools/perf/util/probe-file.c | 3 +- > tools/perf/util/sort.c | 4 +- > tools/perf/util/sort.h | 4 +- > tools/perf/util/trace-event-info.c | 11 ++-- > tools/perf/util/trace-event.c | 8 ++- > tools/perf/util/util.c | 34 +++++++++- > tools/perf/util/util.h | 4 +- > 28 files changed, 279 insertions(+), 120 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2017-08-29 19:42 Arnaldo Carvalho de Melo 2017-08-29 21:15 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-08-29 19:42 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Alexis Berlemont, Andi Kleen, Andy Lutomirski, Arnd Bergmann, Borislav Petkov, Dave Hansen, David Ahern, David Carrillo-Cisneros, David Tolnay, Hanjun Guo, Hemant Kumar, Jack Henschel, Janakarajan Natarajan, Jiri Olsa, Joe Mario, Li Bin, Mark Rutland, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Paul Turner, Peter Zijlstra, Stephane Eranian, Wang Nan, zhangmengting, 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 b00233b5306512a09e339d69ef5e390a77f2d302: perf/x86: Export some PMU attributes in caps/ directory (2017-08-25 11:04:20 +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.14-20170829 for you to fetch changes up to b2f7605076d6cdd68162c42c34caadafbbe4c69f: perf symbols: Fix plt entry calculation for ARM and AARCH64 (2017-08-29 11:41:27 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Fix remote HITM detection for Skylake in 'perf c2c' (Jiri Olsa) - Fixes for the handling of PERF_RECORD_READ records (Jiri Olsa) - Fix kprobes blackist symbol lookup in 'perf probe' (Li Bin) - The PLT header and entry sizes are not the same in !x86, fix it for ARM and AARCH64 (Li Bin) - Beautify pkey_{alloc,free,mprotect} arguments in 'perf trace' (Arnaldo Carvalho de Melo) - Fix CC, AR, LD external definition, allow flex and bison to be externally defined and other related Makefile fixes (David Carrillo-Cisneros) - Sync cpu features kernel ABI headers with tooling headers (Arnaldo Carvalho de Melo) - Fix path to PMU formats in 'perf stat' documentation (Jack Henschel) - Fix static build with newer toolchains (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): tools headers: Sync cpu features kernel ABI headers with tooling headers perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments David Carrillo-Cisneros (5): tools build tests: Don't hardcode gcc name perf tools: Allow external definition of flex and bison binary names tools lib: Allow external definition of CC, AR and LD perf tools: Robustify detection of clang binary perf tools: Pass full path of FEATURES_DUMP Jack Henschel (1): perf stat: Fix path to PMU formats in documentation Jiri Olsa (8): perf tools: Fix static build with newer toolchains perf c2c: Fix remote HITM detection for Skylake perf record: Set read_format for inherit_stat perf report: Add dump_read function perf values: Fix thread index bug perf values: Fix allocation check perf values: Zero value buffers perf report: Group stat values on global event id Li Bin (2): perf probe: Fix kprobe blacklist checking condition perf symbols: Fix plt entry calculation for ARM and AARCH64 tools/arch/x86/include/asm/cpufeatures.h | 5 +-- tools/arch/x86/include/asm/disabled-features.h | 4 +- tools/build/tests/ex/Makefile | 2 +- tools/lib/api/Makefile | 8 ++-- tools/lib/subcmd/Makefile | 2 +- tools/perf/Documentation/perf-stat.txt | 4 +- tools/perf/Makefile.config | 4 +- tools/perf/Makefile.perf | 26 ++++++++--- tools/perf/builtin-report.c | 6 +-- tools/perf/builtin-trace.c | 8 ++++ tools/perf/trace/beauty/Build | 1 + tools/perf/trace/beauty/beauty.h | 3 ++ tools/perf/trace/beauty/pkey_alloc.c | 50 ++++++++++++++++++++++ .../perf/trace/beauty/pkey_alloc_access_rights.sh | 10 +++++ tools/perf/util/evsel.c | 7 ++- tools/perf/util/intel-pt-decoder/Build | 2 +- tools/perf/util/mem-events.c | 11 ++++- tools/perf/util/probe-event.c | 2 +- tools/perf/util/session.c | 25 +++++++++++ tools/perf/util/symbol-elf.c | 27 +++++++++--- tools/perf/util/values.c | 17 +++++--- tools/scripts/Makefile.include | 4 +- 22 files changed, 185 insertions(+), 43 deletions(-) create mode 100644 tools/perf/trace/beauty/pkey_alloc.c create mode 100755 tools/perf/trace/beauty/pkey_alloc_access_rights.sh Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. The 'perf test' also runs shell scripts exercising the tools, checking if they affect the system in certain ways, like setting up kprobes and uprobes, request callchains for well known programs and check that they are the expected ones, see if 'perf trace' beautifies system call arguments correctly, etc. Additionally, a new set of tests, script based, runs the tools in a live system, setting probes in place that then gets used by 'perf trace', with its output compared against expected results. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:3.6: Ok 4 alpine:edge: Ok 5 android-ndk:r12b-arm: Ok 6 archlinux:latest: Ok 7 centos:5: Ok 8 centos:6: Ok 9 centos:7: Ok 10 debian:7: Ok 11 debian:8: Ok 12 debian:9: Ok 13 debian:experimental: Ok 14 debian:experimental-x-arm64: Ok 15 debian:experimental-x-mips: Ok 16 debian:experimental-x-mips64: Ok 17 debian:experimental-x-mipsel: Ok 18 fedora:20: Ok 19 fedora:21: Ok 20 fedora:22: Ok 21 fedora:23: Ok 22 fedora:24: Ok 23 fedora:24-x-ARC-uClibc: Ok 24 fedora:25: Ok 25 fedora:26: Ok 26 fedora:rawhide: Ok 27 mageia:5: Ok 28 opensuse:13.2: Ok 29 opensuse:42.1: Ok 30 opensuse:42.2: Ok 31 opensuse:42.3: Ok 32 opensuse:tumbleweed: Ok 33 oraclelinux:6: Ok 34 oraclelinux:7: Ok 35 ubuntu:12.04.5: Ok 36 ubuntu:14.04.4: Ok 37 ubuntu:14.04.4-x-linaro-arm64: Ok 38 ubuntu:15.10: Ok 39 ubuntu:16.04: Ok 40 ubuntu:16.04-x-arm: Ok 41 ubuntu:16.04-x-arm64: Ok 42 ubuntu:16.04-x-powerpc: Ok 43 ubuntu:16.04-x-powerpc64: Ok 44 ubuntu:16.04-x-powerpc64el: Ok 45 ubuntu:16.04-x-s390: Ok 46 ubuntu:16.10: Ok 47 ubuntu:17.04: Ok 48 ubuntu:17.10: Ok # # uname -a Linux jouet 4.13.0-rc4+ #2 SMP Fri Aug 11 12:39:09 -03 2017 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: Number of exit events of a simple workload : Ok 22: Software clock events period values : Ok 23: Object code reading : Ok 24: Sample parsing : Ok 25: Use a dummy software event to keep tracking : Ok 26: Parse with no sample_id_all bit set : Ok 27: Filter hist entries : Ok 28: Lookup mmap thread : Ok 29: Share thread mg : Ok 30: Sort output of hist entries : Ok 31: Cumulate child hist entries : Ok 32: Track with sched_switch : Ok 33: Filter fds with revents mask in a fdarray : Ok 34: Add fd to a fdarray, making it autogrow : Ok 35: kmod_path__parse : Ok 36: Thread map : Ok 37: LLVM search and compile : 37.1: Basic BPF llvm compile : Ok 37.2: kbuild searching : Ok 37.3: Compile source for BPF prologue generation : Ok 37.4: Compile source for BPF relocation : Ok 38: Session topology : Ok 39: BPF filter : 39.1: Basic BPF filtering : Ok 39.2: BPF pinning : Ok 39.3: BPF prologue generation : Ok 39.4: BPF relocation checker : Ok 40: Synthesize thread map : Ok 41: Remove thread map : Ok 42: Synthesize cpu map : Ok 43: Synthesize stat config : Ok 44: Synthesize stat : Ok 45: Synthesize stat round : Ok 46: Synthesize attr update : Ok 47: Event times : Ok 48: Read backward ring buffer : Ok 49: Print cpu map : Ok 50: Probe SDT events : Ok 51: is_printable_array : Ok 52: Print bitmap : Ok 53: perf hooks : Ok 54: builtin clang support : Skip (not compiled in) 55: unit_number__scnprintf : Ok 56: x86 rdpmc : Ok 57: Convert perf time to TSC : Ok 58: DWARF unwind : Ok 59: x86 instruction decoder - new instructions : Ok 60: Intel cqm nmi context read : Skip 61: Use vfs_getname probe to get syscall args filenames : Ok 62: probe libc's inet_pton & backtrace it with ping : Ok 63: Check open filename arg using perf trace + vfs_getname: Ok 64: Add vfs_getname probe to get syscall args filenames : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_backtrace_O: make NO_BACKTRACE=1 make_debug_O: make DEBUG=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_demangle_O: make NO_DEMANGLE=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_tags_O: make tags make_install_prefix_O: make install prefix=/tmp/krava make_no_gtk2_O: make NO_GTK2=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_static_O: make LDFLAGS=-static make_util_map_o_O: make util/map.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_no_libelf_O: make NO_LIBELF=1 make_pure_O: make make_no_libperl_O: make NO_LIBPERL=1 make_perf_o_O: make perf.o make_with_clangllvm_O: make LIBCLANGLLVM=1 make_install_bin_O: make install-bin make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=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_newt_O: make NO_NEWT=1 make_doc_O: make doc make_no_libbpf_O: make NO_LIBBPF=1 make_clean_all_O: make clean all make_help_O: make help make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_slang_O: make NO_SLANG=1 OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2017-08-29 19:42 Arnaldo Carvalho de Melo @ 2017-08-29 21:15 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2017-08-29 21:15 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, linux-perf-users, Adrian Hunter, Alexander Shishkin, Alexis Berlemont, Andi Kleen, Andy Lutomirski, Arnd Bergmann, Borislav Petkov, Dave Hansen, David Ahern, David Carrillo-Cisneros, David Tolnay, Hanjun Guo, Hemant Kumar, Jack Henschel, Janakarajan Natarajan, Jiri Olsa, Joe Mario, Li Bin, Mark Rutland, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Paul Turner, Peter Zijlstra, Stephane Eranian, Wang Nan, zhangmengting, 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 b00233b5306512a09e339d69ef5e390a77f2d302: > > perf/x86: Export some PMU attributes in caps/ directory (2017-08-25 11:04:20 +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.14-20170829 > > for you to fetch changes up to b2f7605076d6cdd68162c42c34caadafbbe4c69f: > > perf symbols: Fix plt entry calculation for ARM and AARCH64 (2017-08-29 11:41:27 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Fix remote HITM detection for Skylake in 'perf c2c' (Jiri Olsa) > > - Fixes for the handling of PERF_RECORD_READ records (Jiri Olsa) > > - Fix kprobes blackist symbol lookup in 'perf probe' (Li Bin) > > - The PLT header and entry sizes are not the same in !x86, fix it for ARM and > AARCH64 (Li Bin) > > - Beautify pkey_{alloc,free,mprotect} arguments in 'perf trace' (Arnaldo Carvalho de Melo) > > - Fix CC, AR, LD external definition, allow flex and bison to be > externally defined and other related Makefile fixes (David Carrillo-Cisneros) > > - Sync cpu features kernel ABI headers with tooling headers (Arnaldo Carvalho de Melo) > > - Fix path to PMU formats in 'perf stat' documentation (Jack Henschel) > > - Fix static build with newer toolchains (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > tools headers: Sync cpu features kernel ABI headers with tooling headers > perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments > > David Carrillo-Cisneros (5): > tools build tests: Don't hardcode gcc name > perf tools: Allow external definition of flex and bison binary names > tools lib: Allow external definition of CC, AR and LD > perf tools: Robustify detection of clang binary > perf tools: Pass full path of FEATURES_DUMP > > Jack Henschel (1): > perf stat: Fix path to PMU formats in documentation > > Jiri Olsa (8): > perf tools: Fix static build with newer toolchains > perf c2c: Fix remote HITM detection for Skylake > perf record: Set read_format for inherit_stat > perf report: Add dump_read function > perf values: Fix thread index bug > perf values: Fix allocation check > perf values: Zero value buffers > perf report: Group stat values on global event id > > Li Bin (2): > perf probe: Fix kprobe blacklist checking condition > perf symbols: Fix plt entry calculation for ARM and AARCH64 > > tools/arch/x86/include/asm/cpufeatures.h | 5 +-- > tools/arch/x86/include/asm/disabled-features.h | 4 +- > tools/build/tests/ex/Makefile | 2 +- > tools/lib/api/Makefile | 8 ++-- > tools/lib/subcmd/Makefile | 2 +- > tools/perf/Documentation/perf-stat.txt | 4 +- > tools/perf/Makefile.config | 4 +- > tools/perf/Makefile.perf | 26 ++++++++--- > tools/perf/builtin-report.c | 6 +-- > tools/perf/builtin-trace.c | 8 ++++ > tools/perf/trace/beauty/Build | 1 + > tools/perf/trace/beauty/beauty.h | 3 ++ > tools/perf/trace/beauty/pkey_alloc.c | 50 ++++++++++++++++++++++ > .../perf/trace/beauty/pkey_alloc_access_rights.sh | 10 +++++ > tools/perf/util/evsel.c | 7 ++- > tools/perf/util/intel-pt-decoder/Build | 2 +- > tools/perf/util/mem-events.c | 11 ++++- > tools/perf/util/probe-event.c | 2 +- > tools/perf/util/session.c | 25 +++++++++++ > tools/perf/util/symbol-elf.c | 27 +++++++++--- > tools/perf/util/values.c | 17 +++++--- > tools/scripts/Makefile.include | 4 +- > 22 files changed, 185 insertions(+), 43 deletions(-) > create mode 100644 tools/perf/trace/beauty/pkey_alloc.c > create mode 100755 tools/perf/trace/beauty/pkey_alloc_access_rights.sh Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2017-04-12 0:51 Arnaldo Carvalho de Melo 2017-04-12 5:30 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-04-12 0:51 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin, Andi Kleen, Andreas Krebbel, Andrew Vagin, Christian Borntraeger, David Ahern, David Carrillo-Cisneros, Don Zickus, He Kuang, Hendrik Brueckner, Jiri Olsa, Kan Liang, Martin Schwidefsky, Masami Hiramatsu, Namhyung Kim, Paul Turner, Peter Zijlstra, Simon Que, stable, #, v4.10+, Stephane Eranian, Taeung Song, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 9df9078ef2086652647248ee6e82ca8f661cb3f5: perf/amd/uncore: Fix pr_fmt() prefix (2017-04-11 08:44:59 +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.12-20170411 for you to fetch changes up to 986a5bc028a84d487c354a529730b48682d1fb41: perf annotate: Use stripped line instead of raw disassemble line (2017-04-11 16:22:23 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Support s390 jump instructions in perf annotate (Christian Borntraeger) - When failing to setup multiple events (e.g. '-e irq_vectors:*'), state which one caused the failure (Yao Jin) - Various fixes for pipe mode, where the output of 'perf record' is written to stdout instead of to a perf.data file, fixing workloads such as: (David Carrillo-Cisneros) $ perf record -o - noploop | perf inject -b > perf.data $ perf record -o - noploop | perf annotate Infrastructure: - Simplify ltrim() implementation (Arnaldo Carvalho de Melo) - Use ltrim() and rtrim() in places where ad-hoc equivalents were being used (Taeung Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): perf callchains: Switch from strtok() to strtok_r() when parsing options perf script: Use strtok_r() when parsing output field list perf string: Simplify ltrim() implementation Christian Borntraeger (2): perf annotate s390: Fix perf annotate error -95 (4.10 regression) perf annotate s390: Implement jump types for perf annotate David Carrillo-Cisneros (6): perf inject: Don't proceed if perf_session__process_event() fails perf inject: Copy events when reordering events in pipe mode perf tools: Describe pipe mode in perf.data-file-fomat.txt perf annotate: Process attr and build_id records perf session: Don't rely on evlist in pipe mode perf tools: Do not print missing features in pipe-mode Jin Yao (1): perf evsel: Return exact sub event which failed with EPERM for wildcards Taeung Song (6): perf stat: Refactor the code to strip csv output with ltrim() perf ui browser: Refactor the code to parse color configs with ltrim() perf pmu: Refactor wordwrap() with ltrim() perf tools: Refactor the code to strip command name with {l,r}trim() perf annotate: Refactor the code to parse disassemble lines with {l,r}trim() perf annotate: Use stripped line instead of raw disassemble line tools/perf/Documentation/perf.data-file-format.txt | 19 +++++++- tools/perf/arch/s390/annotate/instructions.c | 30 ++++++++++++ tools/perf/builtin-annotate.c | 2 + tools/perf/builtin-inject.c | 2 + tools/perf/builtin-script.c | 4 +- tools/perf/builtin-stat.c | 10 +--- tools/perf/ui/browser.c | 2 +- tools/perf/util/annotate.c | 54 +++++++--------------- tools/perf/util/callchain.c | 4 +- tools/perf/util/event.c | 11 +---- tools/perf/util/evsel.c | 8 +++- tools/perf/util/header.c | 3 ++ tools/perf/util/ordered-events.c | 3 +- tools/perf/util/pmu.c | 3 +- tools/perf/util/session.c | 17 +++++-- tools/perf/util/string.c | 6 +-- 16 files changed, 105 insertions(+), 73 deletions(-) create mode 100644 tools/perf/arch/s390/annotate/instructions.c Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. For this specific pull request the samples/bpf/ was disabled, as 'make headers_install' is failing with the following error, in this case in fedora:rawhide: INSTALL usr/include/uapi/ (0 file) /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop. make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2 make[1]: Leaving directory '/tmp/build/linux' make: *** [Makefile:152: sub-make] Error 2 make: Leaving directory '/git/linux' I'll investigate later, perf and objtool builds just fine, with clang and gcc. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:edge: Ok 4 android-ndk:r12b-arm: Ok 5 archlinux:latest: Ok 6 centos:5: Ok 7 centos:6: Ok 8 centos:7: Ok 9 debian:7: Ok 10 debian:8: Ok 11 debian:9: Ok 12 debian:experimental: Ok 13 debian:experimental-x-arm64: Ok 14 debian:experimental-x-mips: Ok 15 debian:experimental-x-mips64: Ok 16 debian:experimental-x-mipsel: Ok 17 fedora:20: Ok 18 fedora:21: Ok 19 fedora:22: Ok 20 fedora:23: Ok 21 fedora:24: Ok 22 fedora:24-x-ARC-uClibc: Ok 23 fedora:25: Ok 24 fedora:rawhide: Ok 25 mageia:5: Ok 26 opensuse:13.2: Ok 27 opensuse:42.1: Ok 28 opensuse:tumbleweed: Ok 29 ubuntu:12.04.5: Ok 30 ubuntu:14.04.4: Ok 31 ubuntu:14.04.4-x-linaro-arm64: Ok 32 ubuntu:15.10: Ok 33 ubuntu:16.04: Ok 34 ubuntu:16.04-x-arm: Ok 35 ubuntu:16.04-x-arm64: Ok 36 ubuntu:16.04-x-powerpc: Ok 37 ubuntu:16.04-x-powerpc64: Ok 38 ubuntu:16.04-x-s390: Ok 39 ubuntu:16.10: Ok 40 ubuntu:17.04: Ok # # uname -a Linux jouet 4.11.0-rc6+ #7 SMP Tue Apr 11 11:53:14 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: Simple expression parser : Ok 7: PERF_RECORD_* events & perf_sample fields : Ok 8: Parse perf pmu format : Ok 9: DSO data read : Ok 10: DSO data cache : Ok 11: DSO data reopen : Ok 12: Roundtrip evsel->name : Ok 13: Parse sched tracepoints fields : Ok 14: syscalls:sys_enter_openat event fields : Ok 15: Setup struct perf_event_attr : Ok 16: Match and link multiple hists : Ok 17: 'import perf' in python : Ok 18: Breakpoint overflow signal handler : Ok 19: Breakpoint overflow sampling : Ok 20: Number of exit events of a simple workload : Ok 21: Software clock events period values : Ok 22: Object code reading : Ok 23: Sample parsing : Ok 24: Use a dummy software event to keep tracking: Ok 25: Parse with no sample_id_all bit set : Ok 26: Filter hist entries : Ok 27: Lookup mmap thread : Ok 28: Share thread mg : Ok 29: Sort output of hist entries : Ok 30: Cumulate child hist entries : Ok 31: Track with sched_switch : Ok 32: Filter fds with revents mask in a fdarray : Ok 33: Add fd to a fdarray, making it autogrow : Ok 34: kmod_path__parse : Ok 35: Thread map : Ok 36: LLVM search and compile : 36.1: Basic BPF llvm compile : Ok 36.2: kbuild searching : Ok 36.3: Compile source for BPF prologue generation: Ok 36.4: Compile source for BPF relocation : Ok 37: Session topology : Ok 38: BPF filter : 38.1: Basic BPF filtering : Ok 38.2: BPF pinning : Ok 38.3: BPF prologue generation : Ok 38.4: BPF relocation checker : Ok 39: Synthesize thread map : Ok 40: Remove thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok 46: Event times : Ok 47: Read backward ring buffer : Ok 48: Print cpu map : Ok 49: Probe SDT events : Ok 50: is_printable_array : Ok 51: Print bitmap : Ok 52: perf hooks : Ok 53: builtin clang support : Skip (not compiled in) 54: unit_number__scnprintf : Ok 55: x86 rdpmc : Ok 56: Convert perf time to TSC : Ok 57: DWARF unwind : Ok 58: x86 instruction decoder - new instructions : Ok 59: Intel cqm nmi context read : Skip # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_bin_O: make install-bin 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_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libperl_O: make NO_LIBPERL=1 make_no_libelf_O: make NO_LIBELF=1 make_no_gtk2_O: make NO_GTK2=1 make_no_newt_O: make NO_NEWT=1 make_debug_O: make DEBUG=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_help_O: make help make_clean_all_O: make clean all make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_perf_o_O: make perf.o make_tags_O: make tags make_util_map_o_O: make util/map.o make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_slang_O: make NO_SLANG=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_pure_O: make make_install_O: make install make_no_libbionic_O: make NO_LIBBIONIC=1 make_static_O: make LDFLAGS=-static make_doc_O: make doc make_no_demangle_O: make NO_DEMANGLE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libaudit_O: make NO_LIBAUDIT=1 OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2017-04-12 0:51 Arnaldo Carvalho de Melo @ 2017-04-12 5:30 ` Ingo Molnar 2017-04-12 7:13 ` Christian Borntraeger 0 siblings, 1 reply; 53+ messages in thread From: Ingo Molnar @ 2017-04-12 5:30 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Andi Kleen, Andreas Krebbel, Andrew Vagin, Christian Borntraeger, David Ahern, David Carrillo-Cisneros, Don Zickus, He Kuang, Hendrik Brueckner, Jiri Olsa, Kan Liang, Martin Schwidefsky, Masami Hiramatsu, Namhyung Kim, Paul Turner, Peter Zijlstra, Simon Que, stable, #, v4.10+, Stephane Eranian, Taeung Song, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 9df9078ef2086652647248ee6e82ca8f661cb3f5: > > perf/amd/uncore: Fix pr_fmt() prefix (2017-04-11 08:44:59 +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.12-20170411 > > for you to fetch changes up to 986a5bc028a84d487c354a529730b48682d1fb41: > > perf annotate: Use stripped line instead of raw disassemble line (2017-04-11 16:22:23 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Support s390 jump instructions in perf annotate (Christian Borntraeger) > > - When failing to setup multiple events (e.g. '-e irq_vectors:*'), state > which one caused the failure (Yao Jin) > > - Various fixes for pipe mode, where the output of 'perf record' is > written to stdout instead of to a perf.data file, fixing workloads > such as: (David Carrillo-Cisneros) > > $ perf record -o - noploop | perf inject -b > perf.data > > $ perf record -o - noploop | perf annotate > > Infrastructure: > > - Simplify ltrim() implementation (Arnaldo Carvalho de Melo) > > - Use ltrim() and rtrim() in places where ad-hoc equivalents were being > used (Taeung Song) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > perf callchains: Switch from strtok() to strtok_r() when parsing options > perf script: Use strtok_r() when parsing output field list > perf string: Simplify ltrim() implementation > > Christian Borntraeger (2): > perf annotate s390: Fix perf annotate error -95 (4.10 regression) > perf annotate s390: Implement jump types for perf annotate > > David Carrillo-Cisneros (6): > perf inject: Don't proceed if perf_session__process_event() fails > perf inject: Copy events when reordering events in pipe mode > perf tools: Describe pipe mode in perf.data-file-fomat.txt > perf annotate: Process attr and build_id records > perf session: Don't rely on evlist in pipe mode > perf tools: Do not print missing features in pipe-mode > > Jin Yao (1): > perf evsel: Return exact sub event which failed with EPERM for wildcards > > Taeung Song (6): > perf stat: Refactor the code to strip csv output with ltrim() > perf ui browser: Refactor the code to parse color configs with ltrim() > perf pmu: Refactor wordwrap() with ltrim() > perf tools: Refactor the code to strip command name with {l,r}trim() > perf annotate: Refactor the code to parse disassemble lines with {l,r}trim() > perf annotate: Use stripped line instead of raw disassemble line > > tools/perf/Documentation/perf.data-file-format.txt | 19 +++++++- > tools/perf/arch/s390/annotate/instructions.c | 30 ++++++++++++ > tools/perf/builtin-annotate.c | 2 + > tools/perf/builtin-inject.c | 2 + > tools/perf/builtin-script.c | 4 +- > tools/perf/builtin-stat.c | 10 +--- > tools/perf/ui/browser.c | 2 +- > tools/perf/util/annotate.c | 54 +++++++--------------- > tools/perf/util/callchain.c | 4 +- > tools/perf/util/event.c | 11 +---- > tools/perf/util/evsel.c | 8 +++- > tools/perf/util/header.c | 3 ++ > tools/perf/util/ordered-events.c | 3 +- > tools/perf/util/pmu.c | 3 +- > tools/perf/util/session.c | 17 +++++-- > tools/perf/util/string.c | 6 +-- > 16 files changed, 105 insertions(+), 73 deletions(-) > create mode 100644 tools/perf/arch/s390/annotate/instructions.c Pulled, thanks a lot Arnaldo! Note, there was a conflict in tools/perf/util/annotate.c due to the s390 fix in perf/urgent. I've fixed it up, but please double check the conflict resolution I made in 43d5b075c400. Thanks, Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2017-04-12 5:30 ` Ingo Molnar @ 2017-04-12 7:13 ` Christian Borntraeger 2017-04-12 7:24 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Christian Borntraeger @ 2017-04-12 7:13 UTC (permalink / raw) To: Ingo Molnar, Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Andi Kleen, Andreas Krebbel, Andrew Vagin, David Ahern, David Carrillo-Cisneros, Don Zickus, He Kuang, Hendrik Brueckner, Jiri Olsa, Kan Liang, Martin Schwidefsky, Masami Hiramatsu, Namhyung Kim, Paul Turner, Peter Zijlstra, Simon Que, stable, #, v4.10+, Stephane Eranian, Taeung Song, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo On 04/12/2017 07:30 AM, Ingo Molnar wrote: > > * 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 9df9078ef2086652647248ee6e82ca8f661cb3f5: >> >> perf/amd/uncore: Fix pr_fmt() prefix (2017-04-11 08:44:59 +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.12-20170411 >> >> for you to fetch changes up to 986a5bc028a84d487c354a529730b48682d1fb41: >> >> perf annotate: Use stripped line instead of raw disassemble line (2017-04-11 16:22:23 -0300) >> >> ---------------------------------------------------------------- >> perf/core improvements and fixes: >> >> User visible: >> >> - Support s390 jump instructions in perf annotate (Christian Borntraeger) >> >> - When failing to setup multiple events (e.g. '-e irq_vectors:*'), state >> which one caused the failure (Yao Jin) >> >> - Various fixes for pipe mode, where the output of 'perf record' is >> written to stdout instead of to a perf.data file, fixing workloads >> such as: (David Carrillo-Cisneros) >> >> $ perf record -o - noploop | perf inject -b > perf.data >> >> $ perf record -o - noploop | perf annotate >> >> Infrastructure: >> >> - Simplify ltrim() implementation (Arnaldo Carvalho de Melo) >> >> - Use ltrim() and rtrim() in places where ad-hoc equivalents were being >> used (Taeung Song) >> >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> >> >> ---------------------------------------------------------------- >> Arnaldo Carvalho de Melo (3): >> perf callchains: Switch from strtok() to strtok_r() when parsing options >> perf script: Use strtok_r() when parsing output field list >> perf string: Simplify ltrim() implementation >> >> Christian Borntraeger (2): >> perf annotate s390: Fix perf annotate error -95 (4.10 regression) >> perf annotate s390: Implement jump types for perf annotate >> >> David Carrillo-Cisneros (6): >> perf inject: Don't proceed if perf_session__process_event() fails >> perf inject: Copy events when reordering events in pipe mode >> perf tools: Describe pipe mode in perf.data-file-fomat.txt >> perf annotate: Process attr and build_id records >> perf session: Don't rely on evlist in pipe mode >> perf tools: Do not print missing features in pipe-mode >> >> Jin Yao (1): >> perf evsel: Return exact sub event which failed with EPERM for wildcards >> >> Taeung Song (6): >> perf stat: Refactor the code to strip csv output with ltrim() >> perf ui browser: Refactor the code to parse color configs with ltrim() >> perf pmu: Refactor wordwrap() with ltrim() >> perf tools: Refactor the code to strip command name with {l,r}trim() >> perf annotate: Refactor the code to parse disassemble lines with {l,r}trim() >> perf annotate: Use stripped line instead of raw disassemble line >> >> tools/perf/Documentation/perf.data-file-format.txt | 19 +++++++- >> tools/perf/arch/s390/annotate/instructions.c | 30 ++++++++++++ >> tools/perf/builtin-annotate.c | 2 + >> tools/perf/builtin-inject.c | 2 + >> tools/perf/builtin-script.c | 4 +- >> tools/perf/builtin-stat.c | 10 +--- >> tools/perf/ui/browser.c | 2 +- >> tools/perf/util/annotate.c | 54 +++++++--------------- >> tools/perf/util/callchain.c | 4 +- >> tools/perf/util/event.c | 11 +---- >> tools/perf/util/evsel.c | 8 +++- >> tools/perf/util/header.c | 3 ++ >> tools/perf/util/ordered-events.c | 3 +- >> tools/perf/util/pmu.c | 3 +- >> tools/perf/util/session.c | 17 +++++-- >> tools/perf/util/string.c | 6 +-- >> 16 files changed, 105 insertions(+), 73 deletions(-) >> create mode 100644 tools/perf/arch/s390/annotate/instructions.c > > Pulled, thanks a lot Arnaldo! > > Note, there was a conflict in tools/perf/util/annotate.c due to the s390 fix in > perf/urgent. I've fixed it up, but please double check the conflict resolution I > made in 43d5b075c400. > > Thanks, > > Ingo > The merge looks wrong: dbdebdc53 (Ravi Bangoria 2016-11-23 21:33:46 +0530 133) }, 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 134) { 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 135) .name = "s390", d9f8dfa9b (Christian Borntraeger 2017-04-06 09:51:52 +0200 136) .init = s390__annotate_init, e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 137) .objdump = { e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 138) .comment_char = '#', e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 139) }, e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 140) }, 43d5b075c (Ingo Molnar 2017-04-12 07:29:13 +0200 141) { 43d5b075c (Ingo Molnar 2017-04-12 07:29:13 +0200 142) .name = "s390", 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 143) .objdump = { 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 144) .comment_char = '#', 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 145) }, 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 146) }, 786c1b518 (Arnaldo Carvalho de Melo 2016-11-16 15:39:50 -0300 147) }; You can delete line 141-146 ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2017-04-12 7:13 ` Christian Borntraeger @ 2017-04-12 7:24 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2017-04-12 7:24 UTC (permalink / raw) To: Christian Borntraeger Cc: Arnaldo Carvalho de Melo, linux-kernel, Alexander Shishkin, Andi Kleen, Andreas Krebbel, Andrew Vagin, David Ahern, David Carrillo-Cisneros, Don Zickus, He Kuang, Hendrik Brueckner, Jiri Olsa, Kan Liang, Martin Schwidefsky, Masami Hiramatsu, Namhyung Kim, Paul Turner, Peter Zijlstra, Simon Que, stable, #, v4.10+, Stephane Eranian, Taeung Song, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo * Christian Borntraeger <borntraeger@de.ibm.com> wrote: > The merge looks wrong: > > dbdebdc53 (Ravi Bangoria 2016-11-23 21:33:46 +0530 133) }, > 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 134) { > 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 135) .name = "s390", > d9f8dfa9b (Christian Borntraeger 2017-04-06 09:51:52 +0200 136) .init = s390__annotate_init, > e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 137) .objdump = { > e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 138) .comment_char = '#', > e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 139) }, > e77852b32 (Christian Borntraeger 2017-04-06 09:51:51 +0200 140) }, > 43d5b075c (Ingo Molnar 2017-04-12 07:29:13 +0200 141) { > 43d5b075c (Ingo Molnar 2017-04-12 07:29:13 +0200 142) .name = "s390", > 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 143) .objdump = { > 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 144) .comment_char = '#', > 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 145) }, > 3c1a42795 (Christian Borntraeger 2017-04-06 09:51:51 +0200 146) }, > 786c1b518 (Arnaldo Carvalho de Melo 2016-11-16 15:39:50 -0300 147) }; > > You can delete line 141-146 Ok, I've deleted those lines and amended the merge commit - thanks! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2017-02-20 19:08 Arnaldo Carvalho de Melo 2017-02-21 8:08 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-02-20 19:08 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Borislav Petkov, David Ahern, Jan Stancek, Jiri Olsa, kernel-team, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Steven Rostedt, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 0c8967c9df230d2c4dde6649f410b62e01806c22: Merge tag 'perf-core-for-mingo-4.11-20170215' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-02-16 20:53:13 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.11-20170220 for you to fetch changes up to 68ba32352d51474d163d58e084b62a12bb610b21: perf record: Honor --quiet option properly (2017-02-20 11:50:36 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Make -a/--all-cpus be the default target in 'perf record' and 'perf stat', just like it is with 'perf trace' (Jiri Olsa) - Introduce -q/--quiet to the 'annotate', 'diff' and 'report', fix up its behaviour in 'record'. This makes the output more compact by elliminating headers, leaving just the histogram lines (Namhyung Kim) Fixes: - Handle offline/absent CPUs (Jan Stancek) Infrastructure: - Filter out -specs=/a/b/c from CC options when building the python support, allowing that feature to be built with clang (Arnaldo Carvalho de Melo) - Fix DEBUG=1 build with clang (Arnaldo Carvalho de Melo) Trivial: - Fix spelling of 'preempt' in a libtraceevent function name (Steven Rostedt) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): tools perf scripting python: clang doesn't have -spec, remove it perf python: Filter out -specs=/a/b/c from the python binding cc options perf session: Fix DEBUG=1 build with clang Jan Stancek (3): perf cpumap: Add cpu__max_present_cpu() perf header: Make build_cpu_topology skip offline/absent CPUs perf tools: Replace _SC_NPROCESSORS_CONF with max_present_cpu in cpu_topology_map Jiri Olsa (5): perf build: Add special fixdep cleaning rule perf tools: Move new_term arguments into struct parse_events_term template perf tools: Fail on using multiple bits long terms without value perf stat: Add -a as default target perf record: Add -a as default target Namhyung Kim (6): perf utils: Add perf_quiet_option() perf utils: Check verbose flag properly perf report: Add -q/--quiet option perf diff: Add -q/--quiet option perf annotate: Add -q/--quiet option perf record: Honor --quiet option properly Steven Rostedt (VMware) (1): tools lib traceevent: It's preempt not prempt tools/build/Makefile | 4 +- tools/build/Makefile.include | 3 + tools/lib/traceevent/event-parse.c | 4 +- tools/lib/traceevent/event-parse.h | 2 +- tools/perf/Documentation/perf-annotate.txt | 4 ++ tools/perf/Documentation/perf-diff.txt | 4 ++ tools/perf/Documentation/perf-record.txt | 2 +- tools/perf/Documentation/perf-report.txt | 4 ++ tools/perf/Documentation/perf-stat.txt | 2 +- tools/perf/Makefile.config | 7 +++ tools/perf/Makefile.perf | 4 +- tools/perf/builtin-annotate.c | 4 ++ tools/perf/builtin-diff.c | 14 +++-- tools/perf/builtin-mem.c | 4 +- tools/perf/builtin-record.c | 8 ++- tools/perf/builtin-report.c | 21 +++++-- tools/perf/builtin-sched.c | 12 ++-- tools/perf/builtin-stat.c | 11 ++-- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 6 +- tools/perf/pmu-events/json.c | 2 +- tools/perf/tests/attr.c | 2 +- tools/perf/tests/builtin-test.c | 2 +- tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/fdarray.c | 2 +- tools/perf/tests/llvm.c | 2 +- tools/perf/tests/parse-events.c | 2 +- tools/perf/tests/perf-record.c | 4 +- tools/perf/tests/python-use.c | 2 +- tools/perf/tests/thread-map.c | 6 +- tools/perf/tests/topology.c | 4 +- tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/ui/browsers/map.c | 6 +- tools/perf/ui/hist.c | 2 +- tools/perf/util/annotate.c | 2 +- tools/perf/util/cpumap.c | 22 +++++++ tools/perf/util/cpumap.h | 1 + tools/perf/util/debug.c | 17 ++++++ tools/perf/util/debug.h | 1 + tools/perf/util/dso.c | 2 +- tools/perf/util/env.c | 2 +- tools/perf/util/header.c | 33 ++++++---- tools/perf/util/hist.c | 6 +- tools/perf/util/parse-events.c | 71 +++++++++++++--------- tools/perf/util/parse-events.h | 2 + tools/perf/util/parse-events.y | 14 ++--- tools/perf/util/pmu.c | 21 +++++-- tools/perf/util/probe-event.c | 2 +- .../util/scripting-engines/trace-event-python.c | 4 +- tools/perf/util/session.c | 2 +- tools/perf/util/setup.py | 9 ++- tools/perf/util/sort.c | 8 +-- tools/perf/util/stat.c | 2 +- tools/perf/util/symbol-elf.c | 2 +- 54 files changed, 256 insertions(+), 129 deletions(-) Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 android-ndk:r12b-arm: Ok 3 archlinux:latest: Ok 4 centos:5: Ok 5 centos:6: Ok 6 centos:7: Ok 7 debian:7: Ok 8 debian:8: Ok 9 debian:experimental: Ok 10 debian:experimental-x-arm64: Ok 11 debian:experimental-x-mips: Ok 12 debian:experimental-x-mips64: Ok 13 debian:experimental-x-mipsel: Ok 14 fedora:20: Ok 15 fedora:21: Ok 16 fedora:22: Ok 17 fedora:23: Ok 18 fedora:24: Ok 19 fedora:24-x-ARC-uClibc: Ok 20 fedora:25: Ok 21 fedora:rawhide: Ok 22 mageia:5: Ok 23 opensuse:13.2: Ok 24 opensuse:42.1: Ok 25 opensuse:tumbleweed: Ok 26 ubuntu:12.04.5: Ok 27 ubuntu:14.04.4-x-linaro-arm64: Ok 28 ubuntu:15.10: Ok 29 ubuntu:16.04: Ok 30 ubuntu:16.04-x-arm: Ok 31 ubuntu:16.04-x-arm64: Ok 32 ubuntu:16.04-x-powerpc: Ok 33 ubuntu:16.04-x-powerpc64: Ok 34 ubuntu:16.04-x-powerpc64el: Ok 35 ubuntu:16.04-x-s390: Ok 36 ubuntu:16.10: Ok # # uname -a Linux jouet 4.10.0-rc8 #2 SMP Wed Feb 15 15:26:36 BRT 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: PERF_RECORD_* events & perf_sample fields : Ok 7: Parse perf pmu format : Ok 8: DSO data read : Ok 9: DSO data cache : Ok 10: DSO data reopen : Ok 11: Roundtrip evsel->name : Ok 12: Parse sched tracepoints fields : Ok 13: syscalls:sys_enter_openat event fields : Ok 14: Setup struct perf_event_attr : Ok 15: Match and link multiple hists : Ok 16: 'import perf' in python : Ok 17: Breakpoint overflow signal handler : Ok 18: Breakpoint overflow sampling : Ok 19: Number of exit events of a simple workload : Ok 20: Software clock events period values : Ok 21: Object code reading : Ok 22: Sample parsing : Ok 23: Use a dummy software event to keep tracking: Ok 24: Parse with no sample_id_all bit set : Ok 25: Filter hist entries : Ok 26: Lookup mmap thread : Ok 27: Share thread mg : Ok 28: Sort output of hist entries : Ok 29: Cumulate child hist entries : Ok 30: Track with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: kmod_path__parse : Ok 34: Thread map : Ok 35: LLVM search and compile : 35.1: Basic BPF llvm compile : Ok 35.2: kbuild searching : Ok 35.3: Compile source for BPF prologue generation: Ok 35.4: Compile source for BPF relocation : Ok 36: Session topology : Ok 37: BPF filter : 37.1: Basic BPF filtering : Ok 37.2: BPF pinning : Ok 37.3: BPF prologue generation : Ok 37.4: BPF relocation checker : Ok 38: Synthesize thread map : Ok 39: Remove thread map : Ok 40: Synthesize cpu map : Ok 41: Synthesize stat config : Ok 42: Synthesize stat : Ok 43: Synthesize stat round : Ok 44: Synthesize attr update : Ok 45: Event times : Ok 46: Read backward ring buffer : Ok 47: Print cpu map : Ok 48: Probe SDT events : Ok 49: is_printable_array : Ok 50: Print bitmap : Ok 51: perf hooks : Ok 52: builtin clang support : Skip (not compiled in) 53: unit_number__scnprintf : Ok 54: x86 rdpmc : Ok 55: Convert perf time to TSC : Ok 56: DWARF unwind : Ok 57: x86 instruction decoder - new instructions : Ok 58: Intel cqm nmi context read : Skip # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_tags_O: make tags 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_clean_all_O: make clean all make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_install_bin_O: make install-bin make_no_newt_O: make NO_NEWT=1 make_no_slang_O: make NO_SLANG=1 make_doc_O: make doc make_no_libbpf_O: make NO_LIBBPF=1 make_perf_o_O: make perf.o make_install_prefix_O: make install prefix=/tmp/krava make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_help_O: make help make_pure_O: make make_no_libelf_O: make NO_LIBELF=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_debug_O: make DEBUG=1 make_install_O: make install make_no_libbionic_O: make NO_LIBBIONIC=1 make_static_O: make LDFLAGS=-static make_util_map_o_O: make util/map.o make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_gtk2_O: make NO_GTK2=1 make_no_demangle_O: make NO_DEMANGLE=1 OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2017-02-20 19:08 Arnaldo Carvalho de Melo @ 2017-02-21 8:08 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2017-02-21 8:08 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Borislav Petkov, David Ahern, Jan Stancek, Jiri Olsa, kernel-team, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Steven Rostedt, Wang Nan * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > From: Arnaldo Carvalho de Melo <acme@redhat.com> > > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 0c8967c9df230d2c4dde6649f410b62e01806c22: > > Merge tag 'perf-core-for-mingo-4.11-20170215' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-02-16 20:53:13 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.11-20170220 > > for you to fetch changes up to 68ba32352d51474d163d58e084b62a12bb610b21: > > perf record: Honor --quiet option properly (2017-02-20 11:50:36 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Make -a/--all-cpus be the default target in 'perf record' and 'perf stat', > just like it is with 'perf trace' (Jiri Olsa) > > - Introduce -q/--quiet to the 'annotate', 'diff' and 'report', fix up > its behaviour in 'record'. This makes the output more compact by > elliminating headers, leaving just the histogram lines (Namhyung Kim) > > Fixes: > > - Handle offline/absent CPUs (Jan Stancek) > > Infrastructure: > > - Filter out -specs=/a/b/c from CC options when building the python > support, allowing that feature to be built with clang (Arnaldo Carvalho de Melo) > > - Fix DEBUG=1 build with clang (Arnaldo Carvalho de Melo) > > Trivial: > > - Fix spelling of 'preempt' in a libtraceevent function name (Steven Rostedt) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > tools perf scripting python: clang doesn't have -spec, remove it > perf python: Filter out -specs=/a/b/c from the python binding cc options > perf session: Fix DEBUG=1 build with clang > > Jan Stancek (3): > perf cpumap: Add cpu__max_present_cpu() > perf header: Make build_cpu_topology skip offline/absent CPUs > perf tools: Replace _SC_NPROCESSORS_CONF with max_present_cpu in cpu_topology_map > > Jiri Olsa (5): > perf build: Add special fixdep cleaning rule > perf tools: Move new_term arguments into struct parse_events_term template > perf tools: Fail on using multiple bits long terms without value > perf stat: Add -a as default target > perf record: Add -a as default target > > Namhyung Kim (6): > perf utils: Add perf_quiet_option() > perf utils: Check verbose flag properly > perf report: Add -q/--quiet option > perf diff: Add -q/--quiet option > perf annotate: Add -q/--quiet option > perf record: Honor --quiet option properly > > Steven Rostedt (VMware) (1): > tools lib traceevent: It's preempt not prempt > > tools/build/Makefile | 4 +- > tools/build/Makefile.include | 3 + > tools/lib/traceevent/event-parse.c | 4 +- > tools/lib/traceevent/event-parse.h | 2 +- > tools/perf/Documentation/perf-annotate.txt | 4 ++ > tools/perf/Documentation/perf-diff.txt | 4 ++ > tools/perf/Documentation/perf-record.txt | 2 +- > tools/perf/Documentation/perf-report.txt | 4 ++ > tools/perf/Documentation/perf-stat.txt | 2 +- > tools/perf/Makefile.config | 7 +++ > tools/perf/Makefile.perf | 4 +- > tools/perf/builtin-annotate.c | 4 ++ > tools/perf/builtin-diff.c | 14 +++-- > tools/perf/builtin-mem.c | 4 +- > tools/perf/builtin-record.c | 8 ++- > tools/perf/builtin-report.c | 21 +++++-- > tools/perf/builtin-sched.c | 12 ++-- > tools/perf/builtin-stat.c | 11 ++-- > tools/perf/builtin-top.c | 2 +- > tools/perf/builtin-trace.c | 6 +- > tools/perf/pmu-events/json.c | 2 +- > tools/perf/tests/attr.c | 2 +- > tools/perf/tests/builtin-test.c | 2 +- > tools/perf/tests/code-reading.c | 2 +- > tools/perf/tests/fdarray.c | 2 +- > tools/perf/tests/llvm.c | 2 +- > tools/perf/tests/parse-events.c | 2 +- > tools/perf/tests/perf-record.c | 4 +- > tools/perf/tests/python-use.c | 2 +- > tools/perf/tests/thread-map.c | 6 +- > tools/perf/tests/topology.c | 4 +- > tools/perf/tests/vmlinux-kallsyms.c | 2 +- > tools/perf/ui/browsers/map.c | 6 +- > tools/perf/ui/hist.c | 2 +- > tools/perf/util/annotate.c | 2 +- > tools/perf/util/cpumap.c | 22 +++++++ > tools/perf/util/cpumap.h | 1 + > tools/perf/util/debug.c | 17 ++++++ > tools/perf/util/debug.h | 1 + > tools/perf/util/dso.c | 2 +- > tools/perf/util/env.c | 2 +- > tools/perf/util/header.c | 33 ++++++---- > tools/perf/util/hist.c | 6 +- > tools/perf/util/parse-events.c | 71 +++++++++++++--------- > tools/perf/util/parse-events.h | 2 + > tools/perf/util/parse-events.y | 14 ++--- > tools/perf/util/pmu.c | 21 +++++-- > tools/perf/util/probe-event.c | 2 +- > .../util/scripting-engines/trace-event-python.c | 4 +- > tools/perf/util/session.c | 2 +- > tools/perf/util/setup.py | 9 ++- > tools/perf/util/sort.c | 8 +-- > tools/perf/util/stat.c | 2 +- > tools/perf/util/symbol-elf.c | 2 +- > 54 files changed, 256 insertions(+), 129 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2016-11-23 16:40 Arnaldo Carvalho de Melo 2016-11-24 4:10 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-11-23 16:40 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrew Morton, Chris Riyder, David Ahern, Don Zickus, Jiri Olsa, Joe Mario, Kim Phillips, Markus Trippelsdorf, Masami Hiramatsu, Namhyung Kim, Naveen N . Rao, Pawel Moll, Peter Zijlstra, Ravi Bangoria, Russell King, Stephane Eranian, Steven Rostedt, Taeung Song, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> Hi Ingo, Please consider pulling, - Arnaldo Test results at the end. The following changes since commit 6a6b12e2125591e24891e6860410795ea53aed11: Merge tag 'perf-core-for-mingo-20161114' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-15 09:45:04 +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-20161123 for you to fetch changes up to a407b0678bc1c39d70af5fdbe6421c164b69a8c0: perf sched timehist: Add -V/--cpu-visual option (2016-11-23 10:44:09 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New tool: - 'perf sched timehist' provides an analysis of scheduling events. Example usage: perf sched record -- sleep 1 perf sched timehist By default it shows the individual schedule events, including the wait time (time between sched-out and next sched-in events for the task), the task scheduling delay (time between wakeup and actually running) and run time for the task: time cpu task name wait time sch delay run time [tid/pid] (msec) (msec) (msec) -------- ------ ---------------- --------- --------- -------- 1.874569 [0011] gcc[31949] 0.014 0.000 1.148 1.874591 [0010] gcc[31951] 0.000 0.000 0.024 1.874603 [0010] migration/10[59] 3.350 0.004 0.011 1.874604 [0011] <idle> 1.148 0.000 0.035 1.874723 [0005] <idle> 0.016 0.000 1.383 1.874746 [0005] gcc[31949] 0.153 0.078 0.022 ... Times are in msec.usec. (David Ahern, Namhyung Kim) Improvements: - Make 'perf c2c report' support -f/--force, to allow skipping the ownership check for root users, for instance, just like the other tools (Jiri Olsa) - Allow sorting cachelines by total number of HITMs, in addition to local and remote numbers (Jiri Olsa) Fixes: - Make sure errors aren't suppressed by the TUI reset at the end of a 'perf c2c report' session (Jiri Olsa) Infrastructure: - Initial work on having the annotate code better support multiple architectures, including the ability to cross-annotate, i.e. to annotate perf.data files collected on an ARM system on a x86_64 workstation (Arnaldo Carvalho de Melo, Ravi Bangoria, Kim Phillips) - Use USECS_PER_SEC instead of hard coded number in libtraceevent (Steven Rostedt) - Add retrieval of preempt count and latency flags in libtraceevent (Steven Rostedt) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): perf annotate: Start supporting cross arch annotation perf annotate: Allow arches to specify functions to skip perf annotate: Add per arch instructions annotate handlers David Ahern (5): perf sched timehist: Introduce timehist command perf sched timehist: Add summary options perf sched timehist: Add -w/--wakeups option perf sched timehist: Add call graph options perf sched timehist: Add -V/--cpu-visual option Jiri Olsa (6): perf tools: Show event fd in debug output perf c2c report: Setup browser after opening perf.data perf c2c report: Add -f/--force option perf c2c report: Add struct c2c_stats::tot_hitm field perf c2c report: Display total HITMs on default perf c2c: Support cascading options Namhyung Kim (2): perf symbols: Print symbol offsets conditionally perf evsel: Support printing callchains with arrows Steven Rostedt (2): tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number tools lib traceevent: Add retrieval of preempt count and latency flags tools/lib/traceevent/event-parse.c | 41 +- tools/lib/traceevent/event-parse.h | 5 +- tools/perf/Documentation/perf-c2c.txt | 8 + tools/perf/Documentation/perf-sched.txt | 66 +- tools/perf/arch/arm/annotate/instructions.c | 90 +++ tools/perf/arch/x86/annotate/instructions.c | 78 +++ tools/perf/builtin-c2c.c | 80 ++- tools/perf/builtin-sched.c | 914 +++++++++++++++++++++++++++- tools/perf/builtin-top.c | 2 +- tools/perf/ui/browsers/annotate.c | 2 +- tools/perf/ui/gtk/annotate.c | 2 +- tools/perf/util/annotate.c | 251 ++++---- tools/perf/util/annotate.h | 6 +- tools/perf/util/evsel.c | 6 +- tools/perf/util/evsel.h | 1 + tools/perf/util/evsel_fprintf.c | 12 +- tools/perf/util/mem-events.c | 12 +- tools/perf/util/mem-events.h | 1 + tools/perf/util/symbol.h | 3 +- tools/perf/util/symbol_fprintf.c | 11 +- 20 files changed, 1406 insertions(+), 185 deletions(-) create mode 100644 tools/perf/arch/arm/annotate/instructions.c create mode 100644 tools/perf/arch/x86/annotate/instructions.c # uname -a Linux jouet 4.8.6-201.fc24.x86_64 #1 SMP Thu Nov 3 14:38:57 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: detect openat syscall event : Ok 3: detect openat syscall event on all cpus : Ok 4: read samples using the mmap interface : Ok 5: parse events tests : Ok 6: Validate PERF_RECORD_* events & perf_sample fields : Ok 7: Test perf pmu format parsing : Ok 8: Test dso data read : Ok 9: Test dso data cache : Ok 10: Test dso data reopen : Ok 11: roundtrip evsel->name check : Ok 12: Check parsing of sched tracepoints fields : Ok 13: Generate and check syscalls:sys_enter_openat event fields: Ok 14: struct perf_event_attr setup : Ok 15: Test matching and linking multiple hists : Ok 16: Try 'import perf' in python, checking link problems : Ok 17: Test breakpoint overflow signal handler : Ok 18: Test breakpoint overflow sampling : Ok 19: Test number of exit event of a simple workload : Ok 20: Test software clock events have valid period values : Ok 21: Test object code reading : Ok 22: Test sample parsing : Ok 23: Test using a dummy software event to keep tracking : Ok 24: Test parsing with no sample_id_all bit set : Ok 25: Test filtering hist entries : Ok 26: Test mmap thread lookup : Ok 27: Test thread mg sharing : Ok 28: Test output sorting of hist entries : Ok 29: Test cumulation of child hist entries : Ok 30: Test tracking with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: Test kmod_path__parse function : Ok 34: Test thread map : Ok 35: Test LLVM searching and compiling : 35.1: Basic BPF llvm compiling test : Ok 35.2: Test kbuild searching : Ok 35.3: Compile source for BPF prologue generation test : Ok 35.4: Compile source for BPF relocation test : Ok 36: Test topology in session : Ok 37: Test BPF filter : 37.1: Test basic BPF filtering : Ok 37.2: Test BPF prologue generation : Ok 37.3: Test BPF relocation checker : Ok 38: Test thread map synthesize : Ok 39: Test cpu map synthesize : Ok 40: Test stat config synthesize : Ok 41: Test stat synthesize : Ok 42: Test stat round synthesize : Ok 43: Test attr update synthesize : Ok 44: Test events times : Ok 45: Test backward reading from ring buffer : Ok 46: Test cpu map print : Ok 47: Test SDT event probing : Ok 48: Test is_printable_array function : Ok 49: Test bitmap print : Ok 50: x86 rdpmc test : Ok 51: Test converting perf time to TSC : Ok 52: Test dwarf unwind : Ok 53: Test x86 instruction decoder - new instructions : Ok 54: Test intel cqm nmi context read : Skip # # dm 1 alpine:3.4: Ok 2 android-ndk:r12b-arm: Ok 3 archlinux:latest: Ok 4 centos:5: Ok 5 centos:6: Ok 6 centos:7: Ok 7 debian:7: Ok 8 debian:8: Ok 9 debian:experimental: Ok 10 fedora:20: Ok 11 fedora:21: Ok 12 fedora:22: Ok 13 fedora:23: Ok 14 fedora:24: Ok 15 fedora:24-x-ARC-uClibc: Ok 16 fedora:rawhide: Ok 17 mageia:5: Ok 18 opensuse:13.2: Ok 19 opensuse:42.1: Ok 20 opensuse:tumbleweed: Ok 21 ubuntu:12.04.5: Ok 22 ubuntu:14.04: Ok 23 ubuntu:14.04.4: Ok 24 ubuntu:15.10: Ok 25 ubuntu:16.04: Ok 26 ubuntu:16.04-x-arm: Ok 27 ubuntu:16.04-x-arm64: Ok 28 ubuntu:16.04-x-powerpc: Ok 29 ubuntu:16.04-x-powerpc64: Ok 30 ubuntu:16.04-x-powerpc64el: Ok 31 ubuntu:16.04-x-s390: Ok 32 ubuntu:16.10: Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_libperl_O: make NO_LIBPERL=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_install_bin_O: make install-bin make_install_prefix_O: make install prefix=/tmp/krava make_util_map_o_O: make util/map.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libbpf_O: make NO_LIBBPF=1 make_doc_O: make doc make_util_pmu_bison_o_O: make util/pmu-bison.o make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_debug_O: make DEBUG=1 make_perf_o_O: make perf.o make_no_slang_O: make NO_SLANG=1 make_no_newt_O: make NO_NEWT=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_install_O: make install make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_clean_all_O: make clean all make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_help_O: make help make_no_libelf_O: make NO_LIBELF=1 make_tags_O: make tags make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_gtk2_O: make NO_GTK2=1 make_pure_O: make make_static_O: make LDFLAGS=-static OK make: Leaving directory '/home/acme/git/linux/tools/perf' ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2016-11-23 16:40 Arnaldo Carvalho de Melo @ 2016-11-24 4:10 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-11-24 4:10 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrew Morton, Chris Riyder, David Ahern, Don Zickus, Jiri Olsa, Joe Mario, Kim Phillips, Markus Trippelsdorf, Masami Hiramatsu, Namhyung Kim, Naveen N . Rao, Pawel Moll, Peter Zijlstra, Ravi Bangoria, Russell King, Stephane Eranian, Steven Rostedt, Taeung Song, Wang Nan * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > From: Arnaldo Carvalho de Melo <acme@redhat.com> > > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end. > > The following changes since commit 6a6b12e2125591e24891e6860410795ea53aed11: > > Merge tag 'perf-core-for-mingo-20161114' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-15 09:45:04 +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-20161123 > > for you to fetch changes up to a407b0678bc1c39d70af5fdbe6421c164b69a8c0: > > perf sched timehist: Add -V/--cpu-visual option (2016-11-23 10:44:09 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New tool: > > - 'perf sched timehist' provides an analysis of scheduling events. > > Example usage: > perf sched record -- sleep 1 > perf sched timehist > > By default it shows the individual schedule events, including the wait > time (time between sched-out and next sched-in events for the task), the > task scheduling delay (time between wakeup and actually running) and run > time for the task: > > time cpu task name wait time sch delay run time > [tid/pid] (msec) (msec) (msec) > -------- ------ ---------------- --------- --------- -------- > 1.874569 [0011] gcc[31949] 0.014 0.000 1.148 > 1.874591 [0010] gcc[31951] 0.000 0.000 0.024 > 1.874603 [0010] migration/10[59] 3.350 0.004 0.011 > 1.874604 [0011] <idle> 1.148 0.000 0.035 > 1.874723 [0005] <idle> 0.016 0.000 1.383 > 1.874746 [0005] gcc[31949] 0.153 0.078 0.022 > ... > > Times are in msec.usec. (David Ahern, Namhyung Kim) > > Improvements: > > - Make 'perf c2c report' support -f/--force, to allow skipping the > ownership check for root users, for instance, just like the other > tools (Jiri Olsa) > > - Allow sorting cachelines by total number of HITMs, in addition to > local and remote numbers (Jiri Olsa) > > Fixes: > > - Make sure errors aren't suppressed by the TUI reset at the end of > a 'perf c2c report' session (Jiri Olsa) > > Infrastructure: > > - Initial work on having the annotate code better support multiple > architectures, including the ability to cross-annotate, i.e. to > annotate perf.data files collected on an ARM system on a x86_64 > workstation (Arnaldo Carvalho de Melo, Ravi Bangoria, Kim Phillips) > > - Use USECS_PER_SEC instead of hard coded number in libtraceevent (Steven Rostedt) > > - Add retrieval of preempt count and latency flags in libtraceevent (Steven Rostedt) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > perf annotate: Start supporting cross arch annotation > perf annotate: Allow arches to specify functions to skip > perf annotate: Add per arch instructions annotate handlers > > David Ahern (5): > perf sched timehist: Introduce timehist command > perf sched timehist: Add summary options > perf sched timehist: Add -w/--wakeups option > perf sched timehist: Add call graph options > perf sched timehist: Add -V/--cpu-visual option > > Jiri Olsa (6): > perf tools: Show event fd in debug output > perf c2c report: Setup browser after opening perf.data > perf c2c report: Add -f/--force option > perf c2c report: Add struct c2c_stats::tot_hitm field > perf c2c report: Display total HITMs on default > perf c2c: Support cascading options > > Namhyung Kim (2): > perf symbols: Print symbol offsets conditionally > perf evsel: Support printing callchains with arrows > > Steven Rostedt (2): > tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number > tools lib traceevent: Add retrieval of preempt count and latency flags > > tools/lib/traceevent/event-parse.c | 41 +- > tools/lib/traceevent/event-parse.h | 5 +- > tools/perf/Documentation/perf-c2c.txt | 8 + > tools/perf/Documentation/perf-sched.txt | 66 +- > tools/perf/arch/arm/annotate/instructions.c | 90 +++ > tools/perf/arch/x86/annotate/instructions.c | 78 +++ > tools/perf/builtin-c2c.c | 80 ++- > tools/perf/builtin-sched.c | 914 +++++++++++++++++++++++++++- > tools/perf/builtin-top.c | 2 +- > tools/perf/ui/browsers/annotate.c | 2 +- > tools/perf/ui/gtk/annotate.c | 2 +- > tools/perf/util/annotate.c | 251 ++++---- > tools/perf/util/annotate.h | 6 +- > tools/perf/util/evsel.c | 6 +- > tools/perf/util/evsel.h | 1 + > tools/perf/util/evsel_fprintf.c | 12 +- > tools/perf/util/mem-events.c | 12 +- > tools/perf/util/mem-events.h | 1 + > tools/perf/util/symbol.h | 3 +- > tools/perf/util/symbol_fprintf.c | 11 +- > 20 files changed, 1406 insertions(+), 185 deletions(-) > create mode 100644 tools/perf/arch/arm/annotate/instructions.c > create mode 100644 tools/perf/arch/x86/annotate/instructions.c > > # uname -a > Linux jouet 4.8.6-201.fc24.x86_64 #1 SMP Thu Nov 3 14:38:57 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > # perf test > 1: vmlinux symtab matches kallsyms : Ok > 2: detect openat syscall event : Ok > 3: detect openat syscall event on all cpus : Ok > 4: read samples using the mmap interface : Ok > 5: parse events tests : Ok > 6: Validate PERF_RECORD_* events & perf_sample fields : Ok > 7: Test perf pmu format parsing : Ok > 8: Test dso data read : Ok > 9: Test dso data cache : Ok > 10: Test dso data reopen : Ok > 11: roundtrip evsel->name check : Ok > 12: Check parsing of sched tracepoints fields : Ok > 13: Generate and check syscalls:sys_enter_openat event fields: Ok > 14: struct perf_event_attr setup : Ok > 15: Test matching and linking multiple hists : Ok > 16: Try 'import perf' in python, checking link problems : Ok > 17: Test breakpoint overflow signal handler : Ok > 18: Test breakpoint overflow sampling : Ok > 19: Test number of exit event of a simple workload : Ok > 20: Test software clock events have valid period values : Ok > 21: Test object code reading : Ok > 22: Test sample parsing : Ok > 23: Test using a dummy software event to keep tracking : Ok > 24: Test parsing with no sample_id_all bit set : Ok > 25: Test filtering hist entries : Ok > 26: Test mmap thread lookup : Ok > 27: Test thread mg sharing : Ok > 28: Test output sorting of hist entries : Ok > 29: Test cumulation of child hist entries : Ok > 30: Test tracking with sched_switch : Ok > 31: Filter fds with revents mask in a fdarray : Ok > 32: Add fd to a fdarray, making it autogrow : Ok > 33: Test kmod_path__parse function : Ok > 34: Test thread map : Ok > 35: Test LLVM searching and compiling : > 35.1: Basic BPF llvm compiling test : Ok > 35.2: Test kbuild searching : Ok > 35.3: Compile source for BPF prologue generation test : Ok > 35.4: Compile source for BPF relocation test : Ok > 36: Test topology in session : Ok > 37: Test BPF filter : > 37.1: Test basic BPF filtering : Ok > 37.2: Test BPF prologue generation : Ok > 37.3: Test BPF relocation checker : Ok > 38: Test thread map synthesize : Ok > 39: Test cpu map synthesize : Ok > 40: Test stat config synthesize : Ok > 41: Test stat synthesize : Ok > 42: Test stat round synthesize : Ok > 43: Test attr update synthesize : Ok > 44: Test events times : Ok > 45: Test backward reading from ring buffer : Ok > 46: Test cpu map print : Ok > 47: Test SDT event probing : Ok > 48: Test is_printable_array function : Ok > 49: Test bitmap print : Ok > 50: x86 rdpmc test : Ok > 51: Test converting perf time to TSC : Ok > 52: Test dwarf unwind : Ok > 53: Test x86 instruction decoder - new instructions : Ok > 54: Test intel cqm nmi context read : Skip > # > > # dm > 1 alpine:3.4: Ok > 2 android-ndk:r12b-arm: Ok > 3 archlinux:latest: Ok > 4 centos:5: Ok > 5 centos:6: Ok > 6 centos:7: Ok > 7 debian:7: Ok > 8 debian:8: Ok > 9 debian:experimental: Ok > 10 fedora:20: Ok > 11 fedora:21: Ok > 12 fedora:22: Ok > 13 fedora:23: Ok > 14 fedora:24: Ok > 15 fedora:24-x-ARC-uClibc: Ok > 16 fedora:rawhide: Ok > 17 mageia:5: Ok > 18 opensuse:13.2: Ok > 19 opensuse:42.1: Ok > 20 opensuse:tumbleweed: Ok > 21 ubuntu:12.04.5: Ok > 22 ubuntu:14.04: Ok > 23 ubuntu:14.04.4: Ok > 24 ubuntu:15.10: Ok > 25 ubuntu:16.04: Ok > 26 ubuntu:16.04-x-arm: Ok > 27 ubuntu:16.04-x-arm64: Ok > 28 ubuntu:16.04-x-powerpc: Ok > 29 ubuntu:16.04-x-powerpc64: Ok > 30 ubuntu:16.04-x-powerpc64el: Ok > 31 ubuntu:16.04-x-s390: Ok > 32 ubuntu:16.10: Ok > # > > $ make -C tools/perf build-test > make: Entering directory '/home/acme/git/linux/tools/perf' > - tarpkg: ./tests/perf-targz-src-pkg . > make_no_libperl_O: make NO_LIBPERL=1 > make_no_demangle_O: make NO_DEMANGLE=1 > make_no_libnuma_O: make NO_LIBNUMA=1 > make_install_bin_O: make install-bin > make_install_prefix_O: make install prefix=/tmp/krava > make_util_map_o_O: make util/map.o > make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 > make_no_libbpf_O: make NO_LIBBPF=1 > make_doc_O: make doc > make_util_pmu_bison_o_O: make util/pmu-bison.o > make_with_babeltrace_O: make LIBBABELTRACE=1 > make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 > make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 > make_debug_O: make DEBUG=1 > make_perf_o_O: make perf.o > make_no_slang_O: make NO_SLANG=1 > make_no_newt_O: make NO_NEWT=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_install_O: make install > make_no_auxtrace_O: make NO_AUXTRACE=1 > make_no_backtrace_O: make NO_BACKTRACE=1 > make_install_prefix_slash_O: make install prefix=/tmp/krava/ > make_clean_all_O: make clean all > make_no_libpython_O: make NO_LIBPYTHON=1 > make_no_libaudit_O: make NO_LIBAUDIT=1 > make_no_libbionic_O: make NO_LIBBIONIC=1 > make_help_O: make help > make_no_libelf_O: make NO_LIBELF=1 > make_tags_O: make tags > make_no_libunwind_O: make NO_LIBUNWIND=1 > make_no_gtk2_O: make NO_GTK2=1 > make_pure_O: make > make_static_O: make LDFLAGS=-static > OK > make: Leaving directory '/home/acme/git/linux/tools/perf' Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2016-06-27 21:01 Arnaldo Carvalho de Melo 2016-06-28 7:02 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-27 21:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Ananth N Mavinakayanahalli, Andi Kleen, Anton Blanchard, Daniel Axtens, David Ahern, He Kuang, Jiri Olsa, Marc Kleine-Budde, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Neeraj Badlani, Nilay Vaish, Peter Zijlstra, pi3orama, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit d4cf1949f9689314aef962eea95df84a8288d097: perf/x86/intel: Add {rd,wr}lbr_{to,from} wrappers (2016-06-27 11:34:21 +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-20160627 for you to fetch changes up to 6d9c675078e697309c1c06a1051f01de8151c476: perf data ctf: Generate fork and exit events to CTF output (2016-06-27 15:50:23 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Generate comm, fork and exit events when converting perf.data files to CTF (Wang Nan) Documentation: - Document perf.data on disk format (Andi Kleen) Infrastructure: - Add libbabeltrace to build-test (Wang Nan) - 'perf record' prep work to support multiple evlists (Wang Nan) - Remove unused hist_entry__annotate function (Ravi Bangoria) - Add more toolchain triplets (Ravi Bangoria) - Update message for slang devel packages on Ubuntu (Neeraj Badlani) - Generalize handling of 'ret' instructions in the annotate TUI (Naveen N. Rao) - Use proper dso name for is_regular_file, fixing device file handling (Jiri Olsa) Build Fixes: - Add missing config.h include, fixing the build with libabeltrace (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (1): perf tools: Add documentation for perf.data on disk format Jiri Olsa (2): perf data convert: Include config.h header perf symbols: Use proper dso name for is_regular_file Naveen N. Rao (1): perf annotate: Generalize handling of 'ret' instructions Neeraj Badlani (1): perf tools: Update makefile message for installing slang devel package Ravi Bangoria (2): perf annotate: Remove unused hist_entry__annotate function perf tools: Add more toolchain triplets Wang Nan (11): perf build: Add libbabeltrace to build-test perf record: Move mmap setup block to separate function perf record: Prepare reading from multiple evlists in record__mmap_read_all() perf record: Prepare picking perf_event_mmap_page from multiple evlists perf data ctf: Add value_set_string() helper perf data ctf: Pass convert options through opts structure perf data ctf: Add 'all' option perf data ctf: Prepare collect non-sample events perf data ctf: Generate comm event to CTF output perf data ctf: Add '--all' option for 'perf data convert' perf data ctf: Generate fork and exit events to CTF output tools/perf/Documentation/perf-data.txt | 4 + tools/perf/Documentation/perf-file-format.txt | 442 ++++++++++++++++++++++++++ tools/perf/arch/common.c | 17 + tools/perf/builtin-data.c | 11 +- tools/perf/builtin-record.c | 105 ++++-- tools/perf/config/Makefile | 2 +- tools/perf/tests/make | 2 + tools/perf/ui/browsers/annotate.c | 20 +- tools/perf/util/annotate.c | 15 +- tools/perf/util/annotate.h | 3 +- tools/perf/util/data-convert-bt.c | 196 +++++++++++- tools/perf/util/data-convert-bt.h | 4 +- tools/perf/util/data-convert.h | 9 + tools/perf/util/symbol.c | 2 +- 14 files changed, 773 insertions(+), 59 deletions(-) create mode 100644 tools/perf/Documentation/perf-file-format.txt create mode 100644 tools/perf/util/data-convert.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2016-06-27 21:01 Arnaldo Carvalho de Melo @ 2016-06-28 7:02 ` Ingo Molnar 2016-06-28 8:27 ` Jiri Olsa 2016-06-28 14:01 ` Arnaldo Carvalho de Melo 0 siblings, 2 replies; 53+ messages in thread From: Ingo Molnar @ 2016-06-28 7:02 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Ananth N Mavinakayanahalli, Andi Kleen, Anton Blanchard, Daniel Axtens, David Ahern, He Kuang, Jiri Olsa, Marc Kleine-Budde, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Neeraj Badlani, Nilay Vaish, Peter Zijlstra, pi3orama, Ravi Bangoria, Taeung Song, 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 d4cf1949f9689314aef962eea95df84a8288d097: > > perf/x86/intel: Add {rd,wr}lbr_{to,from} wrappers (2016-06-27 11:34:21 +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-20160627 > > for you to fetch changes up to 6d9c675078e697309c1c06a1051f01de8151c476: > > perf data ctf: Generate fork and exit events to CTF output (2016-06-27 15:50:23 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Generate comm, fork and exit events when converting perf.data files to CTF (Wang Nan) > > Documentation: > > - Document perf.data on disk format (Andi Kleen) > > Infrastructure: > > - Add libbabeltrace to build-test (Wang Nan) > > - 'perf record' prep work to support multiple evlists (Wang Nan) > > - Remove unused hist_entry__annotate function (Ravi Bangoria) > > - Add more toolchain triplets (Ravi Bangoria) > > - Update message for slang devel packages on Ubuntu (Neeraj Badlani) > > - Generalize handling of 'ret' instructions in the annotate TUI (Naveen N. Rao) > > - Use proper dso name for is_regular_file, fixing device file handling (Jiri Olsa) > > Build Fixes: > > - Add missing config.h include, fixing the build with libabeltrace (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (1): > perf tools: Add documentation for perf.data on disk format The doc build fails with: asciidoc: FAILED: manpage document title is mandatory Makefile:276: recipe for target 'perf-file-format.xml' failed make[2]: *** [perf-file-format.xml] Error 1 make[2]: *** Waiting for unfinished jobs.... Thanks, Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2016-06-28 7:02 ` Ingo Molnar @ 2016-06-28 8:27 ` Jiri Olsa 2016-06-28 14:01 ` Arnaldo Carvalho de Melo 1 sibling, 0 replies; 53+ messages in thread From: Jiri Olsa @ 2016-06-28 8:27 UTC (permalink / raw) To: Ingo Molnar Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter, Ananth N Mavinakayanahalli, Andi Kleen, Anton Blanchard, Daniel Axtens, David Ahern, He Kuang, Marc Kleine-Budde, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Neeraj Badlani, Nilay Vaish, Peter Zijlstra, pi3orama, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo On Tue, Jun 28, 2016 at 09:02:57AM +0200, Ingo Molnar wrote: SNIP > > - Add missing config.h include, fixing the build with libabeltrace (Jiri Olsa) > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > > > ---------------------------------------------------------------- > > Andi Kleen (1): > > perf tools: Add documentation for perf.data on disk format > > The doc build fails with: > > asciidoc: FAILED: manpage document title is mandatory > Makefile:276: recipe for target 'perf-file-format.xml' failed > make[2]: *** [perf-file-format.xml] Error 1 > make[2]: *** Waiting for unfinished jobs.... > hum, my asciidoc does not complain jirka ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2016-06-28 7:02 ` Ingo Molnar 2016-06-28 8:27 ` Jiri Olsa @ 2016-06-28 14:01 ` Arnaldo Carvalho de Melo 2016-06-28 14:12 ` Arnaldo Carvalho de Melo 2016-06-29 9:36 ` Ingo Molnar 1 sibling, 2 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-28 14:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, Ananth N Mavinakayanahalli, Andi Kleen, Anton Blanchard, Daniel Axtens, David Ahern, He Kuang, Jiri Olsa, Marc Kleine-Budde, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Neeraj Badlani, Nilay Vaish, Peter Zijlstra, pi3orama, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Em Tue, Jun 28, 2016 at 09:02:57AM +0200, Ingo Molnar escreveu: > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > Hi Ingo, > > > > Please consider pulling, > > > > - Arnaldo > > > > The following changes since commit d4cf1949f9689314aef962eea95df84a8288d097: > > > > perf/x86/intel: Add {rd,wr}lbr_{to,from} wrappers (2016-06-27 11:34:21 +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-20160627 > > > > for you to fetch changes up to 6d9c675078e697309c1c06a1051f01de8151c476: > > > > perf data ctf: Generate fork and exit events to CTF output (2016-06-27 15:50:23 -0300) > > > > ---------------------------------------------------------------- > > perf/core improvements and fixes: > > > > New features: > > > > - Generate comm, fork and exit events when converting perf.data files to CTF (Wang Nan) > > > > Documentation: > > > > - Document perf.data on disk format (Andi Kleen) > > > > Infrastructure: > > > > - Add libbabeltrace to build-test (Wang Nan) > > > > - 'perf record' prep work to support multiple evlists (Wang Nan) > > > > - Remove unused hist_entry__annotate function (Ravi Bangoria) > > > > - Add more toolchain triplets (Ravi Bangoria) > > > > - Update message for slang devel packages on Ubuntu (Neeraj Badlani) > > > > - Generalize handling of 'ret' instructions in the annotate TUI (Naveen N. Rao) > > > > - Use proper dso name for is_regular_file, fixing device file handling (Jiri Olsa) > > > > Build Fixes: > > > > - Add missing config.h include, fixing the build with libabeltrace (Jiri Olsa) > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > > > ---------------------------------------------------------------- > > Andi Kleen (1): > > perf tools: Add documentation for perf.data on disk format > > The doc build fails with: > > asciidoc: FAILED: manpage document title is mandatory > Makefile:276: recipe for target 'perf-file-format.xml' failed > make[2]: *** [perf-file-format.xml] Error 1 > make[2]: *** Waiting for unfinished jobs.... Ok, I've created a perf-core-for-mingo-20160628 with that patch removed while we investigate this, please consider pulling that one instead. build-test should've caught this... Reproduced, trying to fix... - Arnaldo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2016-06-28 14:01 ` Arnaldo Carvalho de Melo @ 2016-06-28 14:12 ` Arnaldo Carvalho de Melo 2016-06-29 9:36 ` Ingo Molnar 1 sibling, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-28 14:12 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Ingo Molnar, linux-kernel, Adrian Hunter, Ananth N Mavinakayanahalli, Andi Kleen, Anton Blanchard, Daniel Axtens, David Ahern, He Kuang, Jiri Olsa, Marc Kleine-Budde, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Neeraj Badlani, Nilay Vaish, Peter Zijlstra, pi3orama, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Em Tue, Jun 28, 2016 at 11:01:55AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Jun 28, 2016 at 09:02:57AM +0200, Ingo Molnar escreveu: > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > Andi Kleen (1): > > > perf tools: Add documentation for perf.data on disk format > > The doc build fails with: > > asciidoc: FAILED: manpage document title is mandatory > > Makefile:276: recipe for target 'perf-file-format.xml' failed > > make[2]: *** [perf-file-format.xml] Error 1 > > make[2]: *** Waiting for unfinished jobs.... > Ok, I've created a perf-core-for-mingo-20160628 with that patch removed > while we investigate this, please consider pulling that one instead. > build-test should've caught this... Reproduced, trying to fix... So, when doing the docs install it expects files starting with perf-* will be fed to asciidoc to generate man pages, etc, so the quick fix here is to rename perf-file-format.txt to perf.data-file-format.txt, which I did, so this will go in the next pull request. Volunteers accepted to turn this into asciidoc format so that we can do a man perf-data-file-format or somesuch. - Arnaldo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2016-06-28 14:01 ` Arnaldo Carvalho de Melo 2016-06-28 14:12 ` Arnaldo Carvalho de Melo @ 2016-06-29 9:36 ` Ingo Molnar 1 sibling, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-06-29 9:36 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Ananth N Mavinakayanahalli, Andi Kleen, Anton Blanchard, Daniel Axtens, David Ahern, He Kuang, Jiri Olsa, Marc Kleine-Budde, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Neeraj Badlani, Nilay Vaish, Peter Zijlstra, pi3orama, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Em Tue, Jun 28, 2016 at 09:02:57AM +0200, Ingo Molnar escreveu: > > > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > > Hi Ingo, > > > > > > Please consider pulling, > > > > > > - Arnaldo > > > > > > The following changes since commit d4cf1949f9689314aef962eea95df84a8288d097: > > > > > > perf/x86/intel: Add {rd,wr}lbr_{to,from} wrappers (2016-06-27 11:34:21 +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-20160627 > > > > > > for you to fetch changes up to 6d9c675078e697309c1c06a1051f01de8151c476: > > > > > > perf data ctf: Generate fork and exit events to CTF output (2016-06-27 15:50:23 -0300) > > > > > > ---------------------------------------------------------------- > > > perf/core improvements and fixes: > > > > > > New features: > > > > > > - Generate comm, fork and exit events when converting perf.data files to CTF (Wang Nan) > > > > > > Documentation: > > > > > > - Document perf.data on disk format (Andi Kleen) > > > > > > Infrastructure: > > > > > > - Add libbabeltrace to build-test (Wang Nan) > > > > > > - 'perf record' prep work to support multiple evlists (Wang Nan) > > > > > > - Remove unused hist_entry__annotate function (Ravi Bangoria) > > > > > > - Add more toolchain triplets (Ravi Bangoria) > > > > > > - Update message for slang devel packages on Ubuntu (Neeraj Badlani) > > > > > > - Generalize handling of 'ret' instructions in the annotate TUI (Naveen N. Rao) > > > > > > - Use proper dso name for is_regular_file, fixing device file handling (Jiri Olsa) > > > > > > Build Fixes: > > > > > > - Add missing config.h include, fixing the build with libabeltrace (Jiri Olsa) > > > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > > > > > ---------------------------------------------------------------- > > > Andi Kleen (1): > > > perf tools: Add documentation for perf.data on disk format > > > > The doc build fails with: > > > > asciidoc: FAILED: manpage document title is mandatory > > Makefile:276: recipe for target 'perf-file-format.xml' failed > > make[2]: *** [perf-file-format.xml] Error 1 > > make[2]: *** Waiting for unfinished jobs.... > > Ok, I've created a perf-core-for-mingo-20160628 with that patch removed > while we investigate this, please consider pulling that one instead. Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2015-07-24 1:58 Arnaldo Carvalho de Melo 2015-07-27 15:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-07-24 1:58 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa, Mathieu Poirier, Namhyung Kim, Pawel Moll, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit a11c51acc52822754d66a11c15f6f6edd4d23c55: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-07-21 07:58:06 +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 7c14898ba9386ee5c939bb418643ac6baff52840: perf script: Add option --show-switch-events (2015-07-23 22:51:14 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Introduce PERF_RECORD_SWITCH(_CPU_WIDE) and use it in 'record' to ask for context switches, allowing non priviledged tasks to know when they are switched in and out, which wasn't possible with the other context switch tracepoint and software events, see the patch description for a comprehensive justification (Adrian Hunter) - Stop collecting /proc/kallsyms in perf.data files, saving about 4.5MB on a typical x86-64 system, use the symbol resolution routines used in all the other tools (report, top, etc) now that we can ask libtraceevent to use perf's symbol resolution code. (Arnaldo Carvalho de Melo) User visible fixes: - Expose perf's symbol resolver to libtraceecent, so that its plugins can resolve tracepoint fields to kernel functions, like the 'function' field in the "timer:hrtimer_start tracepoint" (Arnaldo Carvalho de Melo) Infrastructure: - Map propagation of thread and cpu maps improvements, prep work for 'perf stat' new features (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (5): perf: Add PERF_RECORD_SWITCH to indicate context switches perf tools: Add new PERF_RECORD_SWITCH event perf record: Add option --switch-events to select PERF_RECORD_SWITCH events perf script: Don't assume evsel position of tracking events perf script: Add option --show-switch-events Arnaldo Carvalho de Melo (8): perf symbols: Add front end cache for DSO symbol lookup perf symbols: Introduce map__is_(kernel,kmodule)() tools lib traceevent: Allow setting an alternative symbol resolver perf symbols: Provide libtraceevent callback to resolve kernel symbols perf trace: Provide libtracevent with a kernel symbol resolver perf script: Switch from perf.data's kallsyms to perf's symbol resolver perf tools: Stop reading the kallsyms data from perf.data perf tools: Stop copying kallsyms into the perf.data file header Jiri Olsa (5): perf test: Check for refcnt in thread_map test perf evlist: Force perf_evlist__set_maps to propagate maps through events perf evlist: Use bool instead of target argument in propagate_maps() perf evlist: Tolerate NULL maps in propagate_maps perf header: Use argv style storage for cmdline feature data include/uapi/linux/perf_event.h | 31 +++++++++- kernel/events/core.c | 103 +++++++++++++++++++++++++++++++ tools/lib/traceevent/event-parse.c | 68 +++++++++++++++++++- tools/lib/traceevent/event-parse.h | 8 +++ tools/perf/Documentation/perf-record.txt | 4 ++ tools/perf/Documentation/perf-script.txt | 4 ++ tools/perf/builtin-inject.c | 1 + tools/perf/builtin-record.c | 7 +++ tools/perf/builtin-script.c | 48 ++++++++++++-- tools/perf/builtin-trace.c | 3 + tools/perf/perf.h | 1 + tools/perf/tests/thread-map.c | 4 ++ tools/perf/util/dso.h | 4 ++ tools/perf/util/event.c | 28 +++++++++ tools/perf/util/event.h | 12 ++++ tools/perf/util/evlist.c | 28 +++++++-- tools/perf/util/evlist.h | 12 ++-- tools/perf/util/evsel.c | 4 ++ tools/perf/util/header.c | 35 ++++++----- tools/perf/util/header.h | 1 + tools/perf/util/machine.c | 25 ++++++++ tools/perf/util/machine.h | 6 ++ tools/perf/util/map.c | 14 +++++ tools/perf/util/map.h | 7 +++ tools/perf/util/record.c | 10 +++ tools/perf/util/session.c | 21 +++++++ tools/perf/util/symbol.c | 7 ++- tools/perf/util/tool.h | 1 + tools/perf/util/trace-event-info.c | 22 +++---- tools/perf/util/trace-event-parse.c | 30 --------- tools/perf/util/trace-event-read.c | 28 ++++----- tools/perf/util/trace-event.c | 45 +++++++++----- tools/perf/util/trace-event.h | 1 + 33 files changed, 513 insertions(+), 110 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2015-07-24 1:58 Arnaldo Carvalho de Melo @ 2015-07-27 15:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2015-07-27 15:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa, Mathieu Poirier, Namhyung Kim, Pawel Moll, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit a11c51acc52822754d66a11c15f6f6edd4d23c55: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-07-21 07:58:06 +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 7c14898ba9386ee5c939bb418643ac6baff52840: > > perf script: Add option --show-switch-events (2015-07-23 22:51:14 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Introduce PERF_RECORD_SWITCH(_CPU_WIDE) and use it in 'record' to > ask for context switches, allowing non priviledged tasks to know > when they are switched in and out, which wasn't possible with > the other context switch tracepoint and software events, see the > patch description for a comprehensive justification (Adrian Hunter) > > - Stop collecting /proc/kallsyms in perf.data files, saving about > 4.5MB on a typical x86-64 system, use the symbol resolution > routines used in all the other tools (report, top, etc) now that > we can ask libtraceevent to use perf's symbol resolution code. > (Arnaldo Carvalho de Melo) > > User visible fixes: > > - Expose perf's symbol resolver to libtraceecent, so that its plugins can > resolve tracepoint fields to kernel functions, like the 'function' field > in the "timer:hrtimer_start tracepoint" (Arnaldo Carvalho de Melo) > > Infrastructure: > > - Map propagation of thread and cpu maps improvements, prep work for > 'perf stat' new features (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (5): > perf: Add PERF_RECORD_SWITCH to indicate context switches > perf tools: Add new PERF_RECORD_SWITCH event > perf record: Add option --switch-events to select PERF_RECORD_SWITCH events > perf script: Don't assume evsel position of tracking events > perf script: Add option --show-switch-events > > Arnaldo Carvalho de Melo (8): > perf symbols: Add front end cache for DSO symbol lookup > perf symbols: Introduce map__is_(kernel,kmodule)() > tools lib traceevent: Allow setting an alternative symbol resolver > perf symbols: Provide libtraceevent callback to resolve kernel symbols > perf trace: Provide libtracevent with a kernel symbol resolver > perf script: Switch from perf.data's kallsyms to perf's symbol resolver > perf tools: Stop reading the kallsyms data from perf.data > perf tools: Stop copying kallsyms into the perf.data file header > > Jiri Olsa (5): > perf test: Check for refcnt in thread_map test > perf evlist: Force perf_evlist__set_maps to propagate maps through events > perf evlist: Use bool instead of target argument in propagate_maps() > perf evlist: Tolerate NULL maps in propagate_maps > perf header: Use argv style storage for cmdline feature data > > include/uapi/linux/perf_event.h | 31 +++++++++- > kernel/events/core.c | 103 +++++++++++++++++++++++++++++++ > tools/lib/traceevent/event-parse.c | 68 +++++++++++++++++++- > tools/lib/traceevent/event-parse.h | 8 +++ > tools/perf/Documentation/perf-record.txt | 4 ++ > tools/perf/Documentation/perf-script.txt | 4 ++ > tools/perf/builtin-inject.c | 1 + > tools/perf/builtin-record.c | 7 +++ > tools/perf/builtin-script.c | 48 ++++++++++++-- > tools/perf/builtin-trace.c | 3 + > tools/perf/perf.h | 1 + > tools/perf/tests/thread-map.c | 4 ++ > tools/perf/util/dso.h | 4 ++ > tools/perf/util/event.c | 28 +++++++++ > tools/perf/util/event.h | 12 ++++ > tools/perf/util/evlist.c | 28 +++++++-- > tools/perf/util/evlist.h | 12 ++-- > tools/perf/util/evsel.c | 4 ++ > tools/perf/util/header.c | 35 ++++++----- > tools/perf/util/header.h | 1 + > tools/perf/util/machine.c | 25 ++++++++ > tools/perf/util/machine.h | 6 ++ > tools/perf/util/map.c | 14 +++++ > tools/perf/util/map.h | 7 +++ > tools/perf/util/record.c | 10 +++ > tools/perf/util/session.c | 21 +++++++ > tools/perf/util/symbol.c | 7 ++- > tools/perf/util/tool.h | 1 + > tools/perf/util/trace-event-info.c | 22 +++---- > tools/perf/util/trace-event-parse.c | 30 --------- > tools/perf/util/trace-event-read.c | 28 ++++----- > tools/perf/util/trace-event.c | 45 +++++++++----- > tools/perf/util/trace-event.h | 1 + > 33 files changed, 513 insertions(+), 110 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2015-05-18 15:50 Arnaldo Carvalho de Melo 2015-05-20 11:25 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-05-18 15:50 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Andi Kleen, Borislav Petkov, Brendan Gregg, Daniel Borkmann, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Ingo Molnar, Jan Stancek, Jiri Olsa, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt, Vinson Lee, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider applying, - Arnaldo The following changes since commit aa891009ee8863944a96ba4a348102f3d5f5f931: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-15 08:36:33 +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 2d8e405acd787f4b975f73e0f8d9804b272c00f0: perf bench numa: Share sched_getcpu() __weak def with cloexec.c (2015-05-18 12:36:46 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Fix "Command" sort_entry's cmp and collapse function (Jiri Olsa) - Load map's symtab before 'perf probe' glob matching (Wang Nan) - Set vmlinux_path__nr_entries to 0 in vmlinux_path__exit, to fix the use case where this code is called multiple times, which wasn't that common when it was introduced but seems to be now (Wang Nan). Infrastructure: - Protect dso symtab and cache operations with a mutex (Namhyung Kim) - Make all refcnt operations use atomic.h (Arnaldo Carvalho de Melo) - Install libtraceevent.a into libdir (Wang Nan) Build fixes: - Fix one build failure on RHEL5 by making 'perf bench numa' use the __weak sched_getcpu() provided by cloexec.h (Arnaldo Carvalho de Melo) - Fix dwarf-aux.c compilation on i386 (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (6): perf tools: Use atomic.h for the map_groups refcount perf machine: Stop accessing atomic_t::counter directly perf evlist: Use atomic.h for the perf_mmap refcount perf cgroup: Use atomic.h for refcounting perf tools: Elliminate alignment holes perf bench numa: Share sched_getcpu() __weak def with cloexec.c Jiri Olsa (2): perf tools: Fix dwarf-aux.c compilation on i386 perf tools: Fix "Command" sort_entry's cmp and collapse function Namhyung Kim (5): perf tools: Add rm_rf() utility function perf tools: Introduce copyfile_offset() function perf symbols: Protect dso symbol loading using a mutex perf symbols: Protect dso cache tree using dso->lock perf tools: Protect dso cache fd with a mutex Wang Nan (5): perf probe: Load map before glob matching tools include: add __aligned_u64 to types.h. perf tools: Set vmlinux_path__nr_entries to 0 in vmlinux_path__exit tools lib traceevent: Install libtraceevent.a into libdir tools build: Change FEATURE_TESTS and FEATURE_DISPLAY to weak binding tools/build/Makefile.feature | 4 +- tools/include/linux/types.h | 4 ++ tools/lib/traceevent/Makefile | 20 ++++-- tools/perf/bench/numa.c | 1 + tools/perf/builtin-timechart.c | 4 +- tools/perf/tests/thread-mg-share.c | 12 ++-- tools/perf/util/cgroup.c | 10 +-- tools/perf/util/cgroup.h | 4 +- tools/perf/util/dso.c | 134 ++++++++++++++++++++++++++++--------- tools/perf/util/dso.h | 1 + tools/perf/util/dwarf-aux.c | 8 +-- tools/perf/util/evlist.c | 12 ++-- tools/perf/util/evlist.h | 5 +- tools/perf/util/evsel.h | 4 +- tools/perf/util/machine.c | 2 +- tools/perf/util/map.c | 4 +- tools/perf/util/map.h | 6 +- tools/perf/util/probe-event.c | 3 + tools/perf/util/sort.c | 4 +- tools/perf/util/symbol.c | 35 +++++++--- tools/perf/util/thread.h | 2 +- tools/perf/util/util.c | 81 +++++++++++++++++++--- tools/perf/util/util.h | 2 + 23 files changed, 263 insertions(+), 99 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2015-05-18 15:50 Arnaldo Carvalho de Melo @ 2015-05-20 11:25 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2015-05-20 11:25 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Andi Kleen, Borislav Petkov, Brendan Gregg, Daniel Borkmann, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Ingo Molnar, Jan Stancek, Jiri Olsa, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt, Vinson Lee, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider applying, > > - Arnaldo > > The following changes since commit aa891009ee8863944a96ba4a348102f3d5f5f931: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-15 08:36:33 +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 2d8e405acd787f4b975f73e0f8d9804b272c00f0: > > perf bench numa: Share sched_getcpu() __weak def with cloexec.c (2015-05-18 12:36:46 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Fix "Command" sort_entry's cmp and collapse function (Jiri Olsa) > > - Load map's symtab before 'perf probe' glob matching (Wang Nan) > > - Set vmlinux_path__nr_entries to 0 in vmlinux_path__exit, to fix > the use case where this code is called multiple times, which wasn't > that common when it was introduced but seems to be now (Wang Nan). > > Infrastructure: > > - Protect dso symtab and cache operations with a mutex (Namhyung Kim) > > - Make all refcnt operations use atomic.h (Arnaldo Carvalho de Melo) > > - Install libtraceevent.a into libdir (Wang Nan) > > Build fixes: > > - Fix one build failure on RHEL5 by making 'perf bench numa' use the > __weak sched_getcpu() provided by cloexec.h (Arnaldo Carvalho de Melo) > > - Fix dwarf-aux.c compilation on i386 (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (6): > perf tools: Use atomic.h for the map_groups refcount > perf machine: Stop accessing atomic_t::counter directly > perf evlist: Use atomic.h for the perf_mmap refcount > perf cgroup: Use atomic.h for refcounting > perf tools: Elliminate alignment holes > perf bench numa: Share sched_getcpu() __weak def with cloexec.c > > Jiri Olsa (2): > perf tools: Fix dwarf-aux.c compilation on i386 > perf tools: Fix "Command" sort_entry's cmp and collapse function > > Namhyung Kim (5): > perf tools: Add rm_rf() utility function > perf tools: Introduce copyfile_offset() function > perf symbols: Protect dso symbol loading using a mutex > perf symbols: Protect dso cache tree using dso->lock > perf tools: Protect dso cache fd with a mutex > > Wang Nan (5): > perf probe: Load map before glob matching > tools include: add __aligned_u64 to types.h. > perf tools: Set vmlinux_path__nr_entries to 0 in vmlinux_path__exit > tools lib traceevent: Install libtraceevent.a into libdir > tools build: Change FEATURE_TESTS and FEATURE_DISPLAY to weak binding > > tools/build/Makefile.feature | 4 +- > tools/include/linux/types.h | 4 ++ > tools/lib/traceevent/Makefile | 20 ++++-- > tools/perf/bench/numa.c | 1 + > tools/perf/builtin-timechart.c | 4 +- > tools/perf/tests/thread-mg-share.c | 12 ++-- > tools/perf/util/cgroup.c | 10 +-- > tools/perf/util/cgroup.h | 4 +- > tools/perf/util/dso.c | 134 ++++++++++++++++++++++++++++--------- > tools/perf/util/dso.h | 1 + > tools/perf/util/dwarf-aux.c | 8 +-- > tools/perf/util/evlist.c | 12 ++-- > tools/perf/util/evlist.h | 5 +- > tools/perf/util/evsel.h | 4 +- > tools/perf/util/machine.c | 2 +- > tools/perf/util/map.c | 4 +- > tools/perf/util/map.h | 6 +- > tools/perf/util/probe-event.c | 3 + > tools/perf/util/sort.c | 4 +- > tools/perf/util/symbol.c | 35 +++++++--- > tools/perf/util/thread.h | 2 +- > tools/perf/util/util.c | 81 +++++++++++++++++++--- > tools/perf/util/util.h | 2 + > 23 files changed, 263 insertions(+), 99 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2014-12-16 16:57 Arnaldo Carvalho de Melo 2014-12-17 14:50 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-12-16 16:57 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Mitchell Krome, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 41e950c033b7df997d4b38653efe6554be9b96a7: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-12-12 09:09:52 +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 for you to fetch changes up to 67195c75a87232f055ff415fc4624ef01f24fc3d: perf symbols: Fix use after free in filename__read_build_id (2014-12-16 13:38:28 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - The mmap address range for the ring buffer now is calculated using the contents of /proc/sys/kernel/perf_event_mlock_kb. This fixes an -EPERM case where 'trace' was trying to use more than what configured on perf_event_mlock_kb. (Arnaldo Carvalho de Melo) Infrastructure: - Move bitops definitions so that they match the header file hierarchy in the kernel sources where that code came from. (Arnaldo Carvalho de Melo) - Adopt round{down,up}_pow_of_two from the kernel and use it instead of equivalent code, so that we reuse more kernel code and make tools/ look more like kernel source code, to encourage further contributions from kernel hackers (Arnaldo Carvalho de Melo) - Fix use after free in filename__read_build_id (Mitchell Krome) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (17): perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg perf evlist: Clarify sterror_mmap variable names perf evlist: Improve the strerror_mmap method perf trace: Let the perf_evlist__mmap autosize the number of pages to use perf evlist: Do not use hard coded value for a mmap_pages default tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h tools: Move code originally from linux/log2.h to tools/include/linux/ tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/ tools: Whitespace prep patches for moving bitops.h tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib tools: Introduce asm-generic/bitops.h tools: Move bitops.h from tools/perf/util to tools/ tools: Adopt fls_long and deps tools: Adopt rounddown_pow_of_two and deps perf tools: Make the mmap length autotuning more robust tools: Adopt roundup_pow_of_two perf evlist: Use roundup_pow_of_two Mitchell Krome (1): perf symbols: Fix use after free in filename__read_build_id tools/include/asm-generic/bitops.h | 27 +++++ tools/include/asm-generic/bitops/__ffs.h | 43 +++++++ tools/include/asm-generic/bitops/__fls.h | 1 + tools/include/asm-generic/bitops/atomic.h | 22 ++++ tools/include/asm-generic/bitops/find.h | 33 ++++++ tools/include/asm-generic/bitops/fls.h | 1 + tools/include/asm-generic/bitops/fls64.h | 1 + tools/include/linux/bitops.h | 53 +++++++++ tools/include/linux/log2.h | 185 ++++++++++++++++++++++++++++++ tools/lib/util/find_next_bit.c | 89 ++++++++++++++ tools/perf/MANIFEST | 13 ++- tools/perf/Makefile.perf | 14 ++- tools/perf/builtin-trace.c | 2 +- tools/perf/util/evlist.c | 46 ++++++-- tools/perf/util/include/linux/bitops.h | 162 -------------------------- tools/perf/util/symbol-minimal.c | 8 +- tools/perf/util/util.h | 29 ----- 17 files changed, 522 insertions(+), 207 deletions(-) create mode 100644 tools/include/asm-generic/bitops.h create mode 100644 tools/include/asm-generic/bitops/__ffs.h create mode 100644 tools/include/asm-generic/bitops/__fls.h create mode 100644 tools/include/asm-generic/bitops/atomic.h create mode 100644 tools/include/asm-generic/bitops/find.h create mode 100644 tools/include/asm-generic/bitops/fls.h create mode 100644 tools/include/asm-generic/bitops/fls64.h create mode 100644 tools/include/linux/bitops.h create mode 100644 tools/include/linux/log2.h create mode 100644 tools/lib/util/find_next_bit.c delete mode 100644 tools/perf/util/include/linux/bitops.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2014-12-16 16:57 Arnaldo Carvalho de Melo @ 2014-12-17 14:50 ` Arnaldo Carvalho de Melo 2014-12-18 6:24 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-12-17 14:50 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Mitchell Krome, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian Em Tue, Dec 16, 2014 at 01:57:02PM -0300, Arnaldo Carvalho de Melo escreveu: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 41e950c033b7df997d4b38653efe6554be9b96a7: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-12-12 09:09:52 +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 Ingo, Please consider pulling the perf-core-for-mingo-2 signed tag instead, it is exactly the same content modulo removal of some whitespaces at the end of a few lines in tools/perf/Makefile.perf that Jiri found while reading those patches, Thanks, - Arnaldo > for you to fetch changes up to 67195c75a87232f055ff415fc4624ef01f24fc3d: > > perf symbols: Fix use after free in filename__read_build_id (2014-12-16 13:38:28 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - The mmap address range for the ring buffer now is calculated using the > contents of /proc/sys/kernel/perf_event_mlock_kb. > > This fixes an -EPERM case where 'trace' was trying to use more than what > configured on perf_event_mlock_kb. (Arnaldo Carvalho de Melo) > > Infrastructure: > > - Move bitops definitions so that they match the header file hierarchy > in the kernel sources where that code came from. (Arnaldo Carvalho de Melo) > > - Adopt round{down,up}_pow_of_two from the kernel and use it instead of > equivalent code, so that we reuse more kernel code and make tools/ look > more like kernel source code, to encourage further contributions from > kernel hackers (Arnaldo Carvalho de Melo) > > - Fix use after free in filename__read_build_id (Mitchell Krome) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (17): > perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg > perf evlist: Clarify sterror_mmap variable names > perf evlist: Improve the strerror_mmap method > perf trace: Let the perf_evlist__mmap autosize the number of pages to use > perf evlist: Do not use hard coded value for a mmap_pages default > tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h > tools: Move code originally from linux/log2.h to tools/include/linux/ > tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/ > tools: Whitespace prep patches for moving bitops.h > tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib > tools: Introduce asm-generic/bitops.h > tools: Move bitops.h from tools/perf/util to tools/ > tools: Adopt fls_long and deps > tools: Adopt rounddown_pow_of_two and deps > perf tools: Make the mmap length autotuning more robust > tools: Adopt roundup_pow_of_two > perf evlist: Use roundup_pow_of_two > > Mitchell Krome (1): > perf symbols: Fix use after free in filename__read_build_id > > tools/include/asm-generic/bitops.h | 27 +++++ > tools/include/asm-generic/bitops/__ffs.h | 43 +++++++ > tools/include/asm-generic/bitops/__fls.h | 1 + > tools/include/asm-generic/bitops/atomic.h | 22 ++++ > tools/include/asm-generic/bitops/find.h | 33 ++++++ > tools/include/asm-generic/bitops/fls.h | 1 + > tools/include/asm-generic/bitops/fls64.h | 1 + > tools/include/linux/bitops.h | 53 +++++++++ > tools/include/linux/log2.h | 185 ++++++++++++++++++++++++++++++ > tools/lib/util/find_next_bit.c | 89 ++++++++++++++ > tools/perf/MANIFEST | 13 ++- > tools/perf/Makefile.perf | 14 ++- > tools/perf/builtin-trace.c | 2 +- > tools/perf/util/evlist.c | 46 ++++++-- > tools/perf/util/include/linux/bitops.h | 162 -------------------------- > tools/perf/util/symbol-minimal.c | 8 +- > tools/perf/util/util.h | 29 ----- > 17 files changed, 522 insertions(+), 207 deletions(-) > create mode 100644 tools/include/asm-generic/bitops.h > create mode 100644 tools/include/asm-generic/bitops/__ffs.h > create mode 100644 tools/include/asm-generic/bitops/__fls.h > create mode 100644 tools/include/asm-generic/bitops/atomic.h > create mode 100644 tools/include/asm-generic/bitops/find.h > create mode 100644 tools/include/asm-generic/bitops/fls.h > create mode 100644 tools/include/asm-generic/bitops/fls64.h > create mode 100644 tools/include/linux/bitops.h > create mode 100644 tools/include/linux/log2.h > create mode 100644 tools/lib/util/find_next_bit.c > delete mode 100644 tools/perf/util/include/linux/bitops.h > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2014-12-17 14:50 ` Arnaldo Carvalho de Melo @ 2014-12-18 6:24 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2014-12-18 6:24 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Mitchell Krome, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Em Tue, Dec 16, 2014 at 01:57:02PM -0300, Arnaldo Carvalho de Melo escreveu: > > Hi Ingo, > > > > Please consider pulling, > > > > - Arnaldo > > > > The following changes since commit 41e950c033b7df997d4b38653efe6554be9b96a7: > > > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-12-12 09:09:52 +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 > > Ingo, > > Please consider pulling the perf-core-for-mingo-2 signed tag > instead, it is exactly the same content modulo removal of some > whitespaces at the end of a few lines in tools/perf/Makefile.perf that > Jiri found while reading those patches, Pulled, thanks a lot! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2014-12-11 21:25 Arnaldo Carvalho de Melo 2014-12-12 8:10 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-12-11 21:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Yarygin, Andi Kleen, Arjun Sreedharan, Borislav Petkov, Christian Borntraeger, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Kan Liang, Kim Phillips, Matt Mullins, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Rabin Vincent, Stephane Eranian, Steven Rostedt, Tom Huynh, Yann E. MORIN, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit cfa0bd52d0ba9b852f76c7b3f1055edd5e5c7846: Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-12-08 07:45:45 +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 for you to fetch changes up to e09b18d4907992d3d615b215c1abf585721b2810: perf trace: Provide a better explanation when mmap fails (2014-12-11 18:04:10 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Mark events as (x86 only) in help output for 'perf kvm stat live" (Alexander Yarygin) - Provide a better explanation when mmap fails in 'trace' (Arnaldo Carvalho de Melo) - Add --buildid-dir option to set cache directory, i.e. use: $ perf --buildid-dir /path/to/dir tool --tool-options (Jiri Olsa) - Fix memcpy/memset 'perf bench' output (Rabin Vicent) - Fix 'perf test' attr tests size values to cope with machine state on interrupt ABI changes (Jiri Olsa) - Fixup callchain type parameter handling error message (Kan Liang) Infrastructure/cleanups: - calloc/xcalloc: Fix argument order (Arjun Sreedharan) - Move filename__read_int from tools/perf/ to tools/lib, add sysctl__read_int there and use it in place of ad-hoc copies (Arnaldo Carvalho de Melo) - Use single strcmp call instead of two (Jiri Olsa) - Remove extra debugdir variables in 'perf buildid-cache' (Jiri Olsa) - Fix -a segfault related to kcore handling in 'perf buildid-cache' (Jiri Olsa) - Move cpumode resolve code to add_callchain_ip (Kan Liang) - Merge memset into memcpy 'perf bench' (Rabin Vincent) - Change print format from %lu to %PRIu64 in the hists browser (Tom Huynh) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Alexander Yarygin (1): perf kvm stat live: Mark events as (x86 only) in help output Arjun Sreedharan (1): calloc/xcalloc: Fix argument order Arnaldo Carvalho de Melo (5): tools lib fs: Adopt filename__read_int from tools/perf/ tools lib fs: Add sysctl__read_int helper perf tools: Use sysctl__read_int instead of ad-hoc copies perf evlist: Introduce strerror_mmap method perf trace: Provide a better explanation when mmap fails Jiri Olsa (5): perf tools: Use single strcmp call instead of two perf buildid-cache: Remove extra debugdir variables perf buildid cache: Fix -a segfault related to kcore handling perf tools: Add --buildid-dir option to set cache directory perf tests: Fix attr tests size values to cope with machine state on interrupt ABI changes Kan Liang (2): perf callchain: Fixup parameter handling error message perf callchain: Move cpumode resolve code to add_callchain_ip Rabin Vincent (3): perf bench: Prepare memcpy for merge perf bench: Merge memset into memcpy perf bench: Fix memcpy/memset output Tom Huynh (1): perf hists browser: Change print format from %lu to %PRIu64 scripts/kconfig/mconf.c | 4 +- tools/lib/api/fs/fs.c | 34 +++++ tools/lib/api/fs/fs.h | 3 + tools/perf/Documentation/perf.txt | 4 + tools/perf/Makefile.perf | 1 - tools/perf/bench/mem-memcpy.c | 286 ++++++++++++++++++++++++---------- tools/perf/bench/mem-memset.c | 304 ------------------------------------- tools/perf/builtin-buildid-cache.c | 13 +- tools/perf/builtin-kvm.c | 3 +- tools/perf/builtin-trace.c | 12 +- tools/perf/perf.c | 14 +- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/base-stat | 2 +- tools/perf/ui/browsers/hists.c | 2 +- tools/perf/ui/hist.c | 4 +- tools/perf/util/build-id.c | 9 +- tools/perf/util/callchain.c | 2 +- tools/perf/util/config.c | 10 +- tools/perf/util/evlist.c | 23 +++ tools/perf/util/evlist.h | 1 + tools/perf/util/machine.c | 72 +++++---- tools/perf/util/record.c | 11 +- tools/perf/util/util.c | 26 +--- tools/perf/util/util.h | 3 +- tools/thermal/tmon/sysfs.c | 6 +- 25 files changed, 350 insertions(+), 501 deletions(-) delete mode 100644 tools/perf/bench/mem-memset.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2014-12-11 21:25 Arnaldo Carvalho de Melo @ 2014-12-12 8:10 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2014-12-12 8:10 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Yarygin, Andi Kleen, Arjun Sreedharan, Borislav Petkov, Christian Borntraeger, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Kan Liang, Kim Phillips, Matt Mullins, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Rabin Vincent, Stephane Eranian, Steven Rostedt, Tom Huynh, Yann E. MORIN, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit cfa0bd52d0ba9b852f76c7b3f1055edd5e5c7846: > > Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-12-08 07:45:45 +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 > > for you to fetch changes up to e09b18d4907992d3d615b215c1abf585721b2810: > > perf trace: Provide a better explanation when mmap fails (2014-12-11 18:04:10 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Mark events as (x86 only) in help output for 'perf kvm stat live" (Alexander Yarygin) > > - Provide a better explanation when mmap fails in 'trace' (Arnaldo Carvalho de Melo) > > - Add --buildid-dir option to set cache directory, i.e. use: > > $ perf --buildid-dir /path/to/dir tool --tool-options > > (Jiri Olsa) > > - Fix memcpy/memset 'perf bench' output (Rabin Vicent) > > - Fix 'perf test' attr tests size values to cope with machine state on > interrupt ABI changes (Jiri Olsa) > > - Fixup callchain type parameter handling error message (Kan Liang) > > Infrastructure/cleanups: > > - calloc/xcalloc: Fix argument order (Arjun Sreedharan) > > - Move filename__read_int from tools/perf/ to tools/lib, add sysctl__read_int > there and use it in place of ad-hoc copies (Arnaldo Carvalho de Melo) > > - Use single strcmp call instead of two (Jiri Olsa) > > - Remove extra debugdir variables in 'perf buildid-cache' (Jiri Olsa) > > - Fix -a segfault related to kcore handling in 'perf buildid-cache' (Jiri Olsa) > > - Move cpumode resolve code to add_callchain_ip (Kan Liang) > > - Merge memset into memcpy 'perf bench' (Rabin Vincent) > > - Change print format from %lu to %PRIu64 in the hists browser (Tom Huynh) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Alexander Yarygin (1): > perf kvm stat live: Mark events as (x86 only) in help output > > Arjun Sreedharan (1): > calloc/xcalloc: Fix argument order > > Arnaldo Carvalho de Melo (5): > tools lib fs: Adopt filename__read_int from tools/perf/ > tools lib fs: Add sysctl__read_int helper > perf tools: Use sysctl__read_int instead of ad-hoc copies > perf evlist: Introduce strerror_mmap method > perf trace: Provide a better explanation when mmap fails > > Jiri Olsa (5): > perf tools: Use single strcmp call instead of two > perf buildid-cache: Remove extra debugdir variables > perf buildid cache: Fix -a segfault related to kcore handling > perf tools: Add --buildid-dir option to set cache directory > perf tests: Fix attr tests size values to cope with machine state on interrupt ABI changes > > Kan Liang (2): > perf callchain: Fixup parameter handling error message > perf callchain: Move cpumode resolve code to add_callchain_ip > > Rabin Vincent (3): > perf bench: Prepare memcpy for merge > perf bench: Merge memset into memcpy > perf bench: Fix memcpy/memset output > > Tom Huynh (1): > perf hists browser: Change print format from %lu to %PRIu64 > > scripts/kconfig/mconf.c | 4 +- > tools/lib/api/fs/fs.c | 34 +++++ > tools/lib/api/fs/fs.h | 3 + > tools/perf/Documentation/perf.txt | 4 + > tools/perf/Makefile.perf | 1 - > tools/perf/bench/mem-memcpy.c | 286 ++++++++++++++++++++++++---------- > tools/perf/bench/mem-memset.c | 304 ------------------------------------- > tools/perf/builtin-buildid-cache.c | 13 +- > tools/perf/builtin-kvm.c | 3 +- > tools/perf/builtin-trace.c | 12 +- > tools/perf/perf.c | 14 +- > tools/perf/tests/attr/base-record | 2 +- > tools/perf/tests/attr/base-stat | 2 +- > tools/perf/ui/browsers/hists.c | 2 +- > tools/perf/ui/hist.c | 4 +- > tools/perf/util/build-id.c | 9 +- > tools/perf/util/callchain.c | 2 +- > tools/perf/util/config.c | 10 +- > tools/perf/util/evlist.c | 23 +++ > tools/perf/util/evlist.h | 1 + > tools/perf/util/machine.c | 72 +++++---- > tools/perf/util/record.c | 11 +- > tools/perf/util/util.c | 26 +--- > tools/perf/util/util.h | 3 +- > tools/thermal/tmon/sysfs.c | 6 +- > 25 files changed, 350 insertions(+), 501 deletions(-) > delete mode 100644 tools/perf/bench/mem-memset.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2014-08-15 16:49 Arnaldo Carvalho de Melo 2014-08-18 8:18 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-08-15 16:49 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alex Converse, Andi Kleen, Anshuman Khandual, Arun Sharma, Brendan Gregg, Cody P Schafer, David Ahern, Elliott Hughes, Frederic Weisbecker, Haren Myneni, Jiri Olsa, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naohiro Aota, Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit f373da34282560c60f0c197690eecb1b2dc49fc0: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-08-14 10:38:40 +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 759e612bf96627b64fcafe4174b3f6f2dedf2c0d: perf stat: Use strerror_r instead of strerror (2014-08-15 13:08:40 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: . Warn user to rebuild target with debuginfo in 'perf probe' (Masami Hiramatsu) . Don't truncate Intel style addresses in 'annotate'. (Alex Converse) Developer stuff: . Annotate PMU related list_head members with type info. (Cody P Schafer) . Add the triplet used for arm64 by Android (Elliott Hughes) . Replace thread unsafe strerror() with strerror_r() accross the whole tools/perf/ tree (Masami Hiramatsu) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Alex Converse (1): perf annotate: Don't truncate Intel style addresses Cody P Schafer (1): perf tools: Annotate PMU related list_head members with type info Elliott Hughes (1): perf tools: Add arm64 triplets Masami Hiramatsu (14): perf probe: Warn user to rebuild target with debuginfo perf probe: Don't use strerror if strlist__add failed perf: Use strerror_r instead of strerror perf probe: Make error messages thread-safe perf util: Replace strerror with strerror_r for thread-safety perf top: Use strerror_r instead of strerror perf trace: Use strerror_r instead of strerror perf record: Use strerror_r instead of strerror perf test: Use strerror_r instead of strerror perf sched: Use strerror_r instead of strerror perf buildid-cache: Use strerror_r instead of strerror perf kvm: Use strerror_r instead of strerror perf help: Use strerror_r instead of strerror perf stat: Use strerror_r instead of strerror Namhyung Kim (1): perf report: Relax -g option parsing not to limit the option order tools/perf/arch/common.c | 9 +++ tools/perf/builtin-buildid-cache.c | 7 ++- tools/perf/builtin-help.c | 20 +++++-- tools/perf/builtin-kvm.c | 7 ++- tools/perf/builtin-probe.c | 5 +- tools/perf/builtin-record.c | 7 ++- tools/perf/builtin-sched.c | 4 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 6 +- tools/perf/perf.c | 10 +++- tools/perf/tests/builtin-test.c | 4 +- tools/perf/tests/mmap-basic.c | 7 ++- tools/perf/tests/open-syscall-all-cpus.c | 5 +- tools/perf/tests/open-syscall-tp-fields.c | 7 ++- tools/perf/tests/open-syscall.c | 3 +- tools/perf/tests/perf-record.c | 13 +++-- tools/perf/tests/rdpmc.c | 6 +- tools/perf/tests/sw-clock.c | 6 +- tools/perf/tests/task-exit.c | 6 +- tools/perf/util/annotate.c | 12 +++- tools/perf/util/callchain.c | 95 +++++++++++++------------------ tools/perf/util/cloexec.c | 6 +- tools/perf/util/data.c | 8 ++- tools/perf/util/debug.h | 3 + tools/perf/util/dso.c | 8 ++- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 7 ++- tools/perf/util/parse-events.c | 5 +- tools/perf/util/pmu.c | 4 +- tools/perf/util/pmu.h | 6 +- tools/perf/util/probe-event.c | 75 +++++++++++++----------- tools/perf/util/probe-finder.c | 7 ++- tools/perf/util/run-command.c | 9 ++- tools/perf/util/util.c | 5 +- 35 files changed, 234 insertions(+), 154 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/18] perf/core improvements and fixes 2014-08-15 16:49 Arnaldo Carvalho de Melo @ 2014-08-18 8:18 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2014-08-18 8:18 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alex Converse, Andi Kleen, Anshuman Khandual, Arun Sharma, Brendan Gregg, Cody P Schafer, David Ahern, Elliott Hughes, Frederic Weisbecker, Haren Myneni, Jiri Olsa, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naohiro Aota, Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit f373da34282560c60f0c197690eecb1b2dc49fc0: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-08-14 10:38:40 +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 759e612bf96627b64fcafe4174b3f6f2dedf2c0d: > > perf stat: Use strerror_r instead of strerror (2014-08-15 13:08:40 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > . Warn user to rebuild target with debuginfo in 'perf probe' (Masami Hiramatsu) > > . Don't truncate Intel style addresses in 'annotate'. (Alex Converse) > > Developer stuff: > > . Annotate PMU related list_head members with type info. (Cody P Schafer) > > . Add the triplet used for arm64 by Android (Elliott Hughes) > > . Replace thread unsafe strerror() with strerror_r() accross the > whole tools/perf/ tree (Masami Hiramatsu) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Alex Converse (1): > perf annotate: Don't truncate Intel style addresses > > Cody P Schafer (1): > perf tools: Annotate PMU related list_head members with type info > > Elliott Hughes (1): > perf tools: Add arm64 triplets > > Masami Hiramatsu (14): > perf probe: Warn user to rebuild target with debuginfo > perf probe: Don't use strerror if strlist__add failed > perf: Use strerror_r instead of strerror > perf probe: Make error messages thread-safe > perf util: Replace strerror with strerror_r for thread-safety > perf top: Use strerror_r instead of strerror > perf trace: Use strerror_r instead of strerror > perf record: Use strerror_r instead of strerror > perf test: Use strerror_r instead of strerror > perf sched: Use strerror_r instead of strerror > perf buildid-cache: Use strerror_r instead of strerror > perf kvm: Use strerror_r instead of strerror > perf help: Use strerror_r instead of strerror > perf stat: Use strerror_r instead of strerror > > Namhyung Kim (1): > perf report: Relax -g option parsing not to limit the option order > > tools/perf/arch/common.c | 9 +++ > tools/perf/builtin-buildid-cache.c | 7 ++- > tools/perf/builtin-help.c | 20 +++++-- > tools/perf/builtin-kvm.c | 7 ++- > tools/perf/builtin-probe.c | 5 +- > tools/perf/builtin-record.c | 7 ++- > tools/perf/builtin-sched.c | 4 +- > tools/perf/builtin-stat.c | 2 +- > tools/perf/builtin-top.c | 2 +- > tools/perf/builtin-trace.c | 6 +- > tools/perf/perf.c | 10 +++- > tools/perf/tests/builtin-test.c | 4 +- > tools/perf/tests/mmap-basic.c | 7 ++- > tools/perf/tests/open-syscall-all-cpus.c | 5 +- > tools/perf/tests/open-syscall-tp-fields.c | 7 ++- > tools/perf/tests/open-syscall.c | 3 +- > tools/perf/tests/perf-record.c | 13 +++-- > tools/perf/tests/rdpmc.c | 6 +- > tools/perf/tests/sw-clock.c | 6 +- > tools/perf/tests/task-exit.c | 6 +- > tools/perf/util/annotate.c | 12 +++- > tools/perf/util/callchain.c | 95 +++++++++++++------------------ > tools/perf/util/cloexec.c | 6 +- > tools/perf/util/data.c | 8 ++- > tools/perf/util/debug.h | 3 + > tools/perf/util/dso.c | 8 ++- > tools/perf/util/evlist.c | 2 +- > tools/perf/util/evsel.c | 7 ++- > tools/perf/util/parse-events.c | 5 +- > tools/perf/util/pmu.c | 4 +- > tools/perf/util/pmu.h | 6 +- > tools/perf/util/probe-event.c | 75 +++++++++++++----------- > tools/perf/util/probe-finder.c | 7 ++- > tools/perf/util/run-command.c | 9 ++- > tools/perf/util/util.c | 5 +- > 35 files changed, 234 insertions(+), 154 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/18] perf/core improvements and fixes @ 2014-08-15 16:48 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-08-15 16:48 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alex Converse, Andi Kleen, Anshuman Khandual, Arun Sharma, Brendan Gregg, Cody P Schafer, David Ahern, Elliott Hughes, Frederic Weisbecker, Haren Myneni, Jiri Olsa, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naohiro Aota, Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit f373da34282560c60f0c197690eecb1b2dc49fc0: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-08-14 10:38:40 +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 759e612bf96627b64fcafe4174b3f6f2dedf2c0d: perf stat: Use strerror_r instead of strerror (2014-08-15 13:08:40 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: . Warn user to rebuild target with debuginfo in 'perf probe' (Masami Hiramatsu) . Don't truncate Intel style addresses in 'annotate'. (Alex Converse) Developer stuff: . Annotate PMU related list_head members with type info. (Cody P Schafer) . Add the triplet used for arm64 by Android (Elliott Hughes) . Replace thread unsafe strerror() with strerror_r() accross the whole tools/perf/ tree (Masami Hiramatsu) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Alex Converse (1): perf annotate: Don't truncate Intel style addresses Cody P Schafer (1): perf tools: Annotate PMU related list_head members with type info Elliott Hughes (1): perf tools: Add arm64 triplets Masami Hiramatsu (14): perf probe: Warn user to rebuild target with debuginfo perf probe: Don't use strerror if strlist__add failed perf: Use strerror_r instead of strerror perf probe: Make error messages thread-safe perf util: Replace strerror with strerror_r for thread-safety perf top: Use strerror_r instead of strerror perf trace: Use strerror_r instead of strerror perf record: Use strerror_r instead of strerror perf test: Use strerror_r instead of strerror perf sched: Use strerror_r instead of strerror perf buildid-cache: Use strerror_r instead of strerror perf kvm: Use strerror_r instead of strerror perf help: Use strerror_r instead of strerror perf stat: Use strerror_r instead of strerror Namhyung Kim (1): perf report: Relax -g option parsing not to limit the option order tools/perf/arch/common.c | 9 +++ tools/perf/builtin-buildid-cache.c | 7 ++- tools/perf/builtin-help.c | 20 +++++-- tools/perf/builtin-kvm.c | 7 ++- tools/perf/builtin-probe.c | 5 +- tools/perf/builtin-record.c | 7 ++- tools/perf/builtin-sched.c | 4 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 6 +- tools/perf/perf.c | 10 +++- tools/perf/tests/builtin-test.c | 4 +- tools/perf/tests/mmap-basic.c | 7 ++- tools/perf/tests/open-syscall-all-cpus.c | 5 +- tools/perf/tests/open-syscall-tp-fields.c | 7 ++- tools/perf/tests/open-syscall.c | 3 +- tools/perf/tests/perf-record.c | 13 +++-- tools/perf/tests/rdpmc.c | 6 +- tools/perf/tests/sw-clock.c | 6 +- tools/perf/tests/task-exit.c | 6 +- tools/perf/util/annotate.c | 12 +++- tools/perf/util/callchain.c | 95 +++++++++++++------------------ tools/perf/util/cloexec.c | 6 +- tools/perf/util/data.c | 8 ++- tools/perf/util/debug.h | 3 + tools/perf/util/dso.c | 8 ++- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 7 ++- tools/perf/util/parse-events.c | 5 +- tools/perf/util/pmu.c | 4 +- tools/perf/util/pmu.h | 6 +- tools/perf/util/probe-event.c | 75 +++++++++++++----------- tools/perf/util/probe-finder.c | 7 ++- tools/perf/util/run-command.c | 9 ++- tools/perf/util/util.c | 5 +- 35 files changed, 234 insertions(+), 154 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
end of thread, other threads:[~2018-05-19 11:34 UTC | newest] Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-11-06 21:04 [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 01/18] perf tools: Add a thread stack for synthesizing call chains Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 02/18] perf tools: Enhance the thread stack to output call/return data Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 03/18] perf tools: Add branch type to db export Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 04/18] perf tools: Add branch_type and in_tx to Python export Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 05/18] perf tools: Add call information to the database export API Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 06/18] perf tools: Add call information to Python export Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 07/18] perf tools: Defer export of comms that were not 'set' Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 08/18] perf symbols: Preparation for compressed kernel module support Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 09/18] perf tools: Add gzip decompression support for kernel module Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 10/18] perf build-id: Rename dsos__write_buildid_table() Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 11/18] perf build-id: Move build-id related functions to util/build-id.c Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 12/18] perf record: Do not save pathname in ./debug/.build-id directory for vmlinux Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 13/18] perf tools: Fix build-id matching on vmlinux Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name Arnaldo Carvalho de Melo 2014-11-09 7:51 ` Jiri Olsa 2014-11-10 6:13 ` Namhyung Kim 2014-11-10 15:29 ` Jiri Olsa 2014-11-06 21:04 ` [PATCH 15/18] perf tools: Add test_and_set_bit function Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 16/18] perf script perl: Removing event cache as it's no longer needed Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 17/18] perf script python: " Arnaldo Carvalho de Melo 2014-11-06 21:04 ` [PATCH 18/18] perf evsel: Do not call pevent_free_format when deleting tracepoint Arnaldo Carvalho de Melo 2014-11-07 5:24 ` [GIT PULL 00/18] perf/core improvements and fixes Ingo Molnar -- strict thread matches above, loose matches on Subject: below -- 2018-05-19 10:54 Arnaldo Carvalho de Melo 2018-05-19 11:33 ` Ingo Molnar 2017-08-29 19:42 Arnaldo Carvalho de Melo 2017-08-29 21:15 ` Ingo Molnar 2017-04-12 0:51 Arnaldo Carvalho de Melo 2017-04-12 5:30 ` Ingo Molnar 2017-04-12 7:13 ` Christian Borntraeger 2017-04-12 7:24 ` Ingo Molnar 2017-02-20 19:08 Arnaldo Carvalho de Melo 2017-02-21 8:08 ` Ingo Molnar 2016-11-23 16:40 Arnaldo Carvalho de Melo 2016-11-24 4:10 ` Ingo Molnar 2016-06-27 21:01 Arnaldo Carvalho de Melo 2016-06-28 7:02 ` Ingo Molnar 2016-06-28 8:27 ` Jiri Olsa 2016-06-28 14:01 ` Arnaldo Carvalho de Melo 2016-06-28 14:12 ` Arnaldo Carvalho de Melo 2016-06-29 9:36 ` Ingo Molnar 2015-07-24 1:58 Arnaldo Carvalho de Melo 2015-07-27 15:58 ` Ingo Molnar 2015-05-18 15:50 Arnaldo Carvalho de Melo 2015-05-20 11:25 ` Ingo Molnar 2014-12-16 16:57 Arnaldo Carvalho de Melo 2014-12-17 14:50 ` Arnaldo Carvalho de Melo 2014-12-18 6:24 ` Ingo Molnar 2014-12-11 21:25 Arnaldo Carvalho de Melo 2014-12-12 8:10 ` Ingo Molnar 2014-08-15 16:49 Arnaldo Carvalho de Melo 2014-08-18 8:18 ` Ingo Molnar 2014-08-15 16:48 Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).