* [GIT PULL 00/49] perf/core improvements and fixes
@ 2013-12-27 20:46 Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 35/49] perf kvm: Fix kvm report without guestmount Arnaldo Carvalho de Melo
` (15 more replies)
0 siblings, 16 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Arun Sharma, Chunwei Chen, Corey Ashford, David Ahern,
David A. Long, Dongsheng Yang, Frederic Weisbecker, Jiri Olsa,
Masami Hiramatsu, Mike Galbraith, Namhyung Kim, Oleg Nesterov,
Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Srikar Dronamraju,
stable, Stephane Eranian, Steven Rostedt, systemtap,
yrl.pp-manager.tt, Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Hi Ingo,
This one has the 34 out of 35 patches from the previous pull req, removing
the 'perf stat' one about not printing stats for workloads we failed to start, that
requires more thinking and introduced a regression.
I'm suppressing those first 34 patches, they are unchanged from last pull
req.
Please consider pulling, the next one probably will be in 2014 :-)
Best Regards and happy holidays!
- Arnaldo
The following changes since commit fa6e8e5f7cbf85f364ebd5a90525dbbe9de2083b:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-12-18 14:07:26 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
for you to fetch changes up to 74cf249d5cf7de84c88cca69a2f13b13d500ff94:
perf tools: Use zfree to help detect use after free bugs (2013-12-27 17:08:19 -0300)
----------------------------------------------------------------
User visible changes:
Improvements:
. Support showing source code, asking for variables to be collected
at probe time and other 'perf probe' operations that use DWARF information.
This supports only binaries with debugging information at this time, detached
debuginfo (aka debuginfo packages) support should come in later patches.
(Masami Hiramatsu)
. Add a perf.data file header window in the 'perf report' TUI, associated
with the 'i' hotkey, providing a counterpart to the --header option in the
stdio UI. (Namhyung Kim)
. Guest related improvements to 'perf kvm', including allowing to
specify a directory with guest specific /proc information. (Dongsheng Yang)
. Print session information only if --stdio is given (Namhyung Kim)
Developer stuff:
Fixes:
. Get rid of a duplicate va_end() in error reporting (Namhyung Kim)
. If a hist entry doesn't have symbol information, compare it with its
address. Affects upcoming new feature (--cumulate) (Namhyung Kim)
Improvements:
. Make libtraceevent install target quieter (Jiri Olsa)
. Make tests/make output more compact (Jiri Olsa)
. Ignore generated files in feature-checks (Chunwei Chen)
New APIs:
. Introduce pevent_filter_strerror() in libtraceevent, similar in
purpose to libc's strerror() function. (Namhyung Kim)
Refactorings:
. Use perf_data_file methods to write output file in 'record' and
'inject' (Jiri Olsa)
. Use pr_*() functions where applicable in 'report' (Namhyumg Kim)
. Add 'machine' 'addr_location' struct to have full picture (machine,
thread, map, symbol, addr) for a (partially) resolved address, reducing
function signatures (Arnaldo Carvalho de Melo)
. Reduce code duplication in the histogram entry creation/insertion. (Arnaldo Carvalho de Melo)
. Auto allocate annotation histogram data structures, (Arnaldo Carvalho de Melo)
. No need to test against NULL before calling free, also set
freed memory in struct pointers to NULL, to help fixing use after
free bugs. (Arnaldo Carvalho de Melo>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (19):
perf annotate: Auto allocate symbol per addr hist buckets
perf hists: Leave symbol addr hist bucket auto alloc to symbol layer
perf annotate: Add inc_samples method to addr_map_symbol
perf top: Use hist_entry__inc_addr_sample
perf annotate: Adopt methods from hists
perf annotate: Make symbol__inc_addr_samples private
perf report: Introduce helpers for processing callchains
perf record: Simplify perf_record__write
perf record: Rename 'perf_record' to plain 'record'
perf tools: Rename 'perf_record_opts' to 'record_opts
perf report: Rename 'perf_report' to 'report'
perf ui browser: Remove misplaced __maybe_unused
perf scripting python: Shorten function signatures
perf scripting perl: Shorten function signatures
perf mem: Remove unused parameter from dump_raw_samples()
perf symbols: Add 'machine' member to struct addr_location
perf tools: No need to test against NULL before calling free()
perf tools: Introduce zfree
perf tools: Use zfree to help detect use after free bugs
Chunwei Chen (1):
perf config: Ignore generated files in feature-checks
Dongsheng Yang (6):
perf kvm: Fix kvm report without guestmount.
perf tools: Add support for PERF_RECORD_MISC_GUEST_USER in thread__find_addr_map().
perf tools: Find the proc info under machine->root_dir.
perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest.
perf tools: Use machine->pid for tgid if machine is guest.
perf tools: Do not synthesize the treads of default guest.
Jiri Olsa (11):
perf inject: Handle output file via perf_data_file object
perf record: Use perf_data_file__write for output file
perf tests: Factor make install tests
perf tools: Making QUIET_(CLEAN|INSTAL) variables global
tools lib traceevent: Remove print_app_build variable
tools lib traceevent: Use global QUIET_CC build output
tools lib traceevent: Add global QUIET_CC_FPIC build output
tools lib traceevent: Use global QUIET_LINK build output
tools lib traceevent: Use global QUIET_INSTALL build output
tools lib traceevent: Use global QUIET_CLEAN build output
tools lib traceevent: Use global 'O' processing code
Masami Hiramatsu (2):
perf probe: Expand given path to absolute path
perf probe: Support basic dwarf-based operations on uprobe events
Namhyung Kim (10):
perf sort: Compare addresses if no symbol info
perf sort: Do not compare dso again
perf hists: Do not pass period and weight to add_hist_entry()
tools lib traceevent: Introduce pevent_filter_strerror()
perf tools: Get rid of a duplicate va_end() in error reporting routine
perf report: Use pr_*() functions where applicable
perf report: Print session information only if --stdio is given
perf ui/tui: Protect windows by ui__lock
perf ui/tui: Split help message for perf top and report
perf ui/tui: Implement header window
tools/lib/traceevent/Makefile | 85 +++----
tools/lib/traceevent/event-parse.c | 17 +-
tools/lib/traceevent/event-parse.h | 7 +-
tools/lib/traceevent/parse-filter.c | 98 ++++----
tools/perf/Makefile.perf | 1 +
tools/perf/arch/common.c | 3 +-
tools/perf/builtin-annotate.c | 13 +-
tools/perf/builtin-diff.c | 2 +-
tools/perf/builtin-inject.c | 65 +++---
tools/perf/builtin-kvm.c | 6 +-
tools/perf/builtin-mem.c | 5 +-
tools/perf/builtin-probe.c | 17 +-
tools/perf/builtin-record.c | 94 ++++----
tools/perf/builtin-report.c | 259 +++++++--------------
tools/perf/builtin-sched.c | 2 +-
tools/perf/builtin-script.c | 22 +-
tools/perf/builtin-stat.c | 6 +-
tools/perf/builtin-timechart.c | 3 +-
tools/perf/builtin-top.c | 23 +-
tools/perf/builtin-trace.c | 14 +-
tools/perf/config/Makefile | 6 +-
tools/perf/config/feature-checks/.gitignore | 2 +
tools/perf/config/feature-checks/Makefile | 110 ++++-----
tools/perf/config/utilities.mak | 7 -
tools/perf/perf.h | 2 +-
tools/perf/tests/code-reading.c | 2 +-
tools/perf/tests/keep-tracking.c | 2 +-
tools/perf/tests/make | 38 ++-
tools/perf/tests/open-syscall-tp-fields.c | 2 +-
tools/perf/tests/perf-record.c | 2 +-
tools/perf/tests/perf-time-to-tsc.c | 2 +-
tools/perf/ui/browser.c | 8 +-
tools/perf/ui/browser.h | 2 +
tools/perf/ui/browsers/header.c | 127 ++++++++++
tools/perf/ui/browsers/hists.c | 63 +++--
tools/perf/ui/browsers/scripts.c | 3 +-
tools/perf/ui/gtk/util.c | 3 +-
tools/perf/ui/stdio/hist.c | 2 +-
tools/perf/ui/tui/util.c | 19 +-
tools/perf/util/alias.c | 6 +-
tools/perf/util/annotate.c | 73 ++++--
tools/perf/util/annotate.h | 9 +-
tools/perf/util/callchain.h | 2 +-
tools/perf/util/cgroup.c | 2 +-
tools/perf/util/comm.c | 2 +-
tools/perf/util/debug.c | 1 -
tools/perf/util/dso.c | 9 +-
tools/perf/util/event.c | 45 ++--
tools/perf/util/evlist.c | 9 +-
tools/perf/util/evlist.h | 7 +-
tools/perf/util/evsel.c | 17 +-
tools/perf/util/evsel.h | 4 +-
tools/perf/util/header.c | 15 +-
tools/perf/util/help.c | 7 +-
tools/perf/util/hist.c | 27 +--
tools/perf/util/hist.h | 3 -
tools/perf/util/machine.c | 12 +-
tools/perf/util/parse-events.c | 8 +-
tools/perf/util/pmu.c | 2 +-
tools/perf/util/probe-event.c | 234 +++++++++++++------
tools/perf/util/probe-event.h | 1 +
tools/perf/util/probe-finder.c | 33 +--
tools/perf/util/record.c | 9 +-
.../perf/util/scripting-engines/trace-event-perl.c | 22 +-
.../util/scripting-engines/trace-event-python.c | 28 +--
tools/perf/util/session.c | 33 +--
tools/perf/util/session.h | 2 +-
tools/perf/util/sort.c | 22 +-
tools/perf/util/srcline.c | 6 +-
tools/perf/util/strbuf.c | 2 +-
tools/perf/util/strfilter.c | 2 +-
tools/perf/util/string.c | 2 +-
tools/perf/util/strlist.c | 3 +-
tools/perf/util/svghelper.c | 5 +-
tools/perf/util/symbol-elf.c | 2 +-
tools/perf/util/symbol-minimal.c | 3 +-
tools/perf/util/symbol.c | 11 +-
tools/perf/util/symbol.h | 1 +
tools/perf/util/thread_map.c | 20 +-
tools/perf/util/top.c | 2 +-
tools/perf/util/top.h | 2 +-
tools/perf/util/trace-event-info.c | 10 +-
tools/perf/util/trace-event-scripting.c | 3 +-
tools/perf/util/trace-event.h | 1 -
tools/perf/util/util.h | 2 +
tools/perf/util/values.c | 14 +-
tools/scripts/Makefile.include | 4 +
87 files changed, 1001 insertions(+), 882 deletions(-)
create mode 100644 tools/perf/config/feature-checks/.gitignore
create mode 100644 tools/perf/ui/browsers/header.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 35/49] perf kvm: Fix kvm report without guestmount.
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 36/49] perf tools: Add support for PERF_RECORD_MISC_GUEST_USER in thread__find_addr_map() Arnaldo Carvalho de Melo
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Dongsheng Yang, stable, #, 3.3+, David Ahern,
Arnaldo Carvalho de Melo
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Currently, if we use perf kvm --guestkallsyms --guestmodules report, we
can not get the perf information from perf data file. All sample are
shown as unknown.
Reproducing steps:
# perf kvm --guestkallsyms /tmp/kallsyms --guestmodules /tmp/modules record -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.624 MB perf.data.guest (~27260 samples) ]
# perf kvm --guestkallsyms /tmp/kallsyms --guestmodules /tmp/modules report |grep %
100.00% [guest/6471] [unknown] [g] 0xffffffff8164f330
This bug was introduced by 207b57926 (perf kvm: Fix regression with guest machine creation).
In original code, it uses perf_session__find_machine(), it means we deliver symbol to machine
which has the same pid, if no machine found, deliver it to *default* guest. But if we use
perf_session__findnew_machine() here, if no machine was found, new machine with pid will be built
and added. Then the default guest which with pid == 0 will never get a symbol.
And because the new machine initialized here has no kernel map created, the symbol delivered to
it will be marked as "unknown".
This patch here is to revert commit 207b57926 and fix the SEGFAULT bug in another way.
Verification steps:
# ./perf kvm --guestkallsyms /home/kallsyms --guestmodules /home/modules record -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.651 MB perf.data.guest (~28437 samples) ]
# ./perf kvm --guestkallsyms /home/kallsyms --guestmodules /home/modules report |grep %
22.64% :6471 [guest.kernel.kallsyms] [g] update_rq_clock.part.70
19.99% :6471 [guest.kernel.kallsyms] [g] d_free
18.46% :6471 [guest.kernel.kallsyms] [g] bio_phys_segments
16.25% :6471 [guest.kernel.kallsyms] [g] dequeue_task
12.78% :6471 [guest.kernel.kallsyms] [g] __switch_to
7.91% :6471 [guest.kernel.kallsyms] [g] scheduler_tick
1.75% :6471 [guest.kernel.kallsyms] [g] native_apic_mem_write
0.21% :6471 [guest.kernel.kallsyms] [g] apic_timer_interrupt
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: stable@vger.kernel.org # 3.3+
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1387564907-3045-1-git-send-email-yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/session.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index cbacaab3e9c4..d3a857be9682 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -830,6 +830,7 @@ static struct machine *
struct perf_sample *sample)
{
const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
+ struct machine *machine;
if (perf_guest &&
((cpumode == PERF_RECORD_MISC_GUEST_KERNEL) ||
@@ -842,7 +843,11 @@ static struct machine *
else
pid = sample->pid;
- return perf_session__findnew_machine(session, pid);
+ machine = perf_session__find_machine(session, pid);
+ if (!machine)
+ machine = perf_session__findnew_machine(session,
+ DEFAULT_GUEST_KERNEL_ID);
+ return machine;
}
return &session->machines.host;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 36/49] perf tools: Add support for PERF_RECORD_MISC_GUEST_USER in thread__find_addr_map().
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 35/49] perf kvm: Fix kvm report without guestmount Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 37/49] perf tools: Find the proc info under machine->root_dir Arnaldo Carvalho de Melo
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Dongsheng Yang, David Ahern, Jiri Olsa,
Namhyung Kim, Arnaldo Carvalho de Melo
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
This patch remove a TODO in thread__find_addr_map() and add support of
PERF_RECORD_MISC_GUEST_USER.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.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>
Link: http://lkml.kernel.org/r/3dd652201171a19c910b500984c7c3590e77603b.1387572416.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/event.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index fe2022799161..484e99464a00 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -659,15 +659,10 @@ void thread__find_addr_map(struct thread *thread,
al->level = 'g';
mg = &machine->kmaps;
load_map = true;
+ } else if (cpumode == PERF_RECORD_MISC_GUEST_USER && perf_guest) {
+ al->level = 'u';
} else {
- /*
- * 'u' means guest os user space.
- * TODO: We don't support guest user space. Might support late.
- */
- if (cpumode == PERF_RECORD_MISC_GUEST_USER && perf_guest)
- al->level = 'u';
- else
- al->level = 'H';
+ al->level = 'H';
al->map = NULL;
if ((cpumode == PERF_RECORD_MISC_GUEST_USER ||
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 37/49] perf tools: Find the proc info under machine->root_dir.
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 35/49] perf kvm: Fix kvm report without guestmount Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 36/49] perf tools: Add support for PERF_RECORD_MISC_GUEST_USER in thread__find_addr_map() Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 38/49] perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest Arnaldo Carvalho de Melo
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Dongsheng Yang, David Ahern, Jiri Olsa,
Namhyung Kim, Arnaldo Carvalho de Melo
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
When we synthesize the threads, we are looking for the infomation under
/proc. But it is only for host.
This patch look for the path of proc under machine->root_dir, then
XXX__synthesize_threads() functions can support guest machines.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.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>
Link: http://lkml.kernel.org/r/927b937da9177a079abafe4532fa9c9b60b5c4b7.1387572416.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/event.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 484e99464a00..a61726ea01a9 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -129,7 +129,8 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool,
goto out;
}
- snprintf(filename, sizeof(filename), "/proc/%d/task", pid);
+ snprintf(filename, sizeof(filename), "%s/proc/%d/task",
+ machine->root_dir, pid);
tasks = opendir(filename);
if (tasks == NULL) {
@@ -178,7 +179,8 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
FILE *fp;
int rc = 0;
- snprintf(filename, sizeof(filename), "/proc/%d/maps", pid);
+ snprintf(filename, sizeof(filename), "%s/proc/%d/maps",
+ machine->root_dir, pid);
fp = fopen(filename, "r");
if (fp == NULL) {
@@ -387,6 +389,7 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
struct machine *machine, bool mmap_data)
{
DIR *proc;
+ char proc_path[PATH_MAX];
struct dirent dirent, *next;
union perf_event *comm_event, *mmap_event;
int err = -1;
@@ -399,7 +402,9 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
if (mmap_event == NULL)
goto out_free_comm;
- proc = opendir("/proc");
+ snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir);
+ proc = opendir(proc_path);
+
if (proc == NULL)
goto out_free_mmap;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 38/49] perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest.
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 37/49] perf tools: Find the proc info under machine->root_dir Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 39/49] perf tools: Use machine->pid for tgid " Arnaldo Carvalho de Melo
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Dongsheng Yang, David Ahern, Jiri Olsa,
Namhyung Kim, Arnaldo Carvalho de Melo
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
When we synthesize the mmap events of user space, if machine is guest,
we should set the event->header.misc to PERF_RECORD_MISC_GUEST_USER,
rather than PERF_RECORD_MISC_USER.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.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>
Link: http://lkml.kernel.org/r/e6f8ff6505d2db8a4b21bff8e448bb9be0bcff35.1387572416.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/event.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index a61726ea01a9..07c07833de53 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -220,7 +220,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
/*
* Just like the kernel, see __perf_event_mmap in kernel/perf_event.c
*/
- event->header.misc = PERF_RECORD_MISC_USER;
+ if (machine__is_host(machine))
+ event->header.misc = PERF_RECORD_MISC_USER;
+ else
+ event->header.misc = PERF_RECORD_MISC_GUEST_USER;
if (prot[2] != 'x') {
if (!mmap_data || prot[0] != 'r')
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 39/49] perf tools: Use machine->pid for tgid if machine is guest.
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 38/49] perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 40/49] perf tools: Do not synthesize the treads of default guest Arnaldo Carvalho de Melo
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Dongsheng Yang, David Ahern, Jiri Olsa,
Namhyung Kim, Arnaldo Carvalho de Melo
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
When we synthesize an comm event, if machine is guest, we should
use the pid of machine as the event->comm.pid, rather than tgid
of thread.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.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>
Link: http://lkml.kernel.org/r/22455abe107c618a361e7b667ad0f098f7c9b4a3.1387572416.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/event.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 07c07833de53..2905771a1f49 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -106,8 +106,12 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool,
memset(&event->comm, 0, sizeof(event->comm));
- tgid = perf_event__get_comm_tgid(pid, event->comm.comm,
- sizeof(event->comm.comm));
+ if (machine__is_host(machine))
+ tgid = perf_event__get_comm_tgid(pid, event->comm.comm,
+ sizeof(event->comm.comm));
+ else
+ tgid = machine->pid;
+
if (tgid < 0)
goto out;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 40/49] perf tools: Do not synthesize the treads of default guest.
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 39/49] perf tools: Use machine->pid for tgid " Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 41/49] perf config: Ignore generated files in feature-checks Arnaldo Carvalho de Melo
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Dongsheng Yang, David Ahern, Jiri Olsa,
Namhyung Kim, Arnaldo Carvalho de Melo
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
As the default guest is designed to handle orphan kernel symboles with
--guestkallsysms and --guestmodules, it has no user space.
So we should skip synthesizing threads if machine is default guest.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.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>
Link: http://lkml.kernel.org/r/e9ddb5dac6f963169657218b12ceb3c2030f54e8.1387572416.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/event.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2905771a1f49..45a76c69a9ed 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -133,6 +133,9 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool,
goto out;
}
+ if (machine__is_default_guest(machine))
+ return 0;
+
snprintf(filename, sizeof(filename), "%s/proc/%d/task",
machine->root_dir, pid);
@@ -183,6 +186,9 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
FILE *fp;
int rc = 0;
+ if (machine__is_default_guest(machine))
+ return 0;
+
snprintf(filename, sizeof(filename), "%s/proc/%d/maps",
machine->root_dir, pid);
@@ -409,6 +415,9 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
if (mmap_event == NULL)
goto out_free_comm;
+ if (machine__is_default_guest(machine))
+ return 0;
+
snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir);
proc = opendir(proc_path);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 41/49] perf config: Ignore generated files in feature-checks
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (5 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 40/49] perf tools: Do not synthesize the treads of default guest Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 42/49] perf probe: Expand given path to absolute path Arnaldo Carvalho de Melo
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Chunwei Chen, Jiri Olsa, Arnaldo Carvalho de Melo
From: Chunwei Chen <tuxoko@gmail.com>
1. Rename the test-* binary files to test-*.bin for easier pattern matching as
suggested by Ingo.
2. Ignore *.bin and *.d files.
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/52B52B9B.50708@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/Makefile | 6 +-
tools/perf/config/feature-checks/.gitignore | 2 +
tools/perf/config/feature-checks/Makefile | 110 ++++++++++++++--------------
3 files changed, 60 insertions(+), 58 deletions(-)
create mode 100644 tools/perf/config/feature-checks/.gitignore
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 5a1f4df3c3a8..14faeeb0d752 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -126,7 +126,7 @@ endif
feature_check = $(eval $(feature_check_code))
define feature_check_code
- feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1 >/dev/null 2>/dev/null && echo 1 || echo 0)
+ feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
endef
feature_set = $(eval $(feature_set_code))
@@ -173,7 +173,7 @@ CORE_FEATURE_TESTS = \
# to skip the print-out of the long features list if the file
# existed before and after it was built:
#
-ifeq ($(wildcard $(OUTPUT)config/feature-checks/test-all),)
+ifeq ($(wildcard $(OUTPUT)config/feature-checks/test-all.bin),)
test-all-failed := 1
else
test-all-failed := 0
@@ -203,7 +203,7 @@ ifeq ($(feature-all), 1)
#
$(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
else
- $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(CORE_FEATURE_TESTS) >/dev/null 2>&1)
+ $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(addsuffix .bin,$(CORE_FEATURE_TESTS)) >/dev/null 2>&1)
$(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
endif
diff --git a/tools/perf/config/feature-checks/.gitignore b/tools/perf/config/feature-checks/.gitignore
new file mode 100644
index 000000000000..80f3da0c3515
--- /dev/null
+++ b/tools/perf/config/feature-checks/.gitignore
@@ -0,0 +1,2 @@
+*.d
+*.bin
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index bc86462e80a2..7cf6fcdacebe 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -1,90 +1,90 @@
FILES= \
- test-all \
- test-backtrace \
- test-bionic \
- test-dwarf \
- test-fortify-source \
- test-glibc \
- test-gtk2 \
- test-gtk2-infobar \
- test-hello \
- test-libaudit \
- test-libbfd \
- test-liberty \
- test-liberty-z \
- test-cplus-demangle \
- test-libelf \
- test-libelf-getphdrnum \
- test-libelf-mmap \
- test-libnuma \
- test-libperl \
- test-libpython \
- test-libpython-version \
- test-libslang \
- test-libunwind \
- test-libunwind-debug-frame \
- test-on-exit \
- test-stackprotector-all \
- test-timerfd
+ test-all.bin \
+ test-backtrace.bin \
+ test-bionic.bin \
+ test-dwarf.bin \
+ test-fortify-source.bin \
+ test-glibc.bin \
+ test-gtk2.bin \
+ test-gtk2-infobar.bin \
+ test-hello.bin \
+ test-libaudit.bin \
+ test-libbfd.bin \
+ test-liberty.bin \
+ test-liberty-z.bin \
+ test-cplus-demangle.bin \
+ test-libelf.bin \
+ test-libelf-getphdrnum.bin \
+ test-libelf-mmap.bin \
+ test-libnuma.bin \
+ test-libperl.bin \
+ test-libpython.bin \
+ test-libpython-version.bin \
+ test-libslang.bin \
+ test-libunwind.bin \
+ test-libunwind-debug-frame.bin \
+ test-on-exit.bin \
+ test-stackprotector-all.bin \
+ test-timerfd.bin
CC := $(CC) -MD
all: $(FILES)
-BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $@.c $(LDFLAGS)
+BUILD = $(CC) $(CFLAGS) -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@) $(LDFLAGS)
###############################
-test-all:
+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
-test-hello:
+test-hello.bin:
$(BUILD)
-test-stackprotector-all:
+test-stackprotector-all.bin:
$(BUILD) -Werror -fstack-protector-all
-test-fortify-source:
+test-fortify-source.bin:
$(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
-test-bionic:
+test-bionic.bin:
$(BUILD)
-test-libelf:
+test-libelf.bin:
$(BUILD) -lelf
-test-glibc:
+test-glibc.bin:
$(BUILD)
-test-dwarf:
+test-dwarf.bin:
$(BUILD) -ldw
-test-libelf-mmap:
+test-libelf-mmap.bin:
$(BUILD) -lelf
-test-libelf-getphdrnum:
+test-libelf-getphdrnum.bin:
$(BUILD) -lelf
-test-libnuma:
+test-libnuma.bin:
$(BUILD) -lnuma
-test-libunwind:
+test-libunwind.bin:
$(BUILD) -lelf
-test-libunwind-debug-frame:
+test-libunwind-debug-frame.bin:
$(BUILD) -lelf
-test-libaudit:
+test-libaudit.bin:
$(BUILD) -laudit
-test-libslang:
+test-libslang.bin:
$(BUILD) -I/usr/include/slang -lslang
-test-gtk2:
+test-gtk2.bin:
$(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
-test-gtk2-infobar:
+test-gtk2-infobar.bin:
$(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
grep-libs = $(filter -l%,$(1))
@@ -96,7 +96,7 @@ PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
-test-libperl:
+test-libperl.bin:
$(BUILD) $(FLAGS_PERL_EMBED)
override PYTHON := python
@@ -113,31 +113,31 @@ PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
-test-libpython:
+test-libpython.bin:
$(BUILD) $(FLAGS_PYTHON_EMBED)
-test-libpython-version:
+test-libpython-version.bin:
$(BUILD) $(FLAGS_PYTHON_EMBED)
-test-libbfd:
+test-libbfd.bin:
$(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
-test-liberty:
+test-liberty.bin:
$(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
-test-liberty-z:
+test-liberty-z.bin:
$(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
-test-cplus-demangle:
+test-cplus-demangle.bin:
$(BUILD) -liberty
-test-on-exit:
+test-on-exit.bin:
$(BUILD)
-test-backtrace:
+test-backtrace.bin:
$(BUILD)
-test-timerfd:
+test-timerfd.bin:
$(BUILD)
-include *.d
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 42/49] perf probe: Expand given path to absolute path
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (6 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 41/49] perf config: Ignore generated files in feature-checks Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 43/49] perf probe: Support basic dwarf-based operations on uprobe events Arnaldo Carvalho de Melo
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Masami Hiramatsu, David A. Long,
Steven Rostedt (Red Hat), David Ahern, Namhyung Kim,
Oleg Nesterov, Srikar Dronamraju, systemtap, yrl.pp-manager.tt,
Arnaldo Carvalho de Melo
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Expand given path to absolute path in the option parser, except for a
module name.
Since realpath at later stage in processing several probe point, can be
called several times (even if currently doesn't, it can happen when we
expands the feature), it is waste of the performance.
Processing it once at the early stage can avoid that.
Changes from previous one:
- Fix not to print null string.
- Allocate memory for given path/module name everytime.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: "David A. Long" <dave.long@linaro.org>
Cc: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: systemtap@sourceware.org
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20131226054150.22364.12187.stgit@kbuild-fedora.novalocal
[ Clarified the pr_warning message as per David Ahern's suggestion ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-probe.c | 15 ++++++++++++++-
tools/perf/util/probe-event.c | 11 ++---------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index c98ccb570509..1792a3f1f4ce 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -169,6 +169,7 @@ static int opt_set_target(const struct option *opt, const char *str,
int unset __maybe_unused)
{
int ret = -ENOENT;
+ char *tmp;
if (str && !params.target) {
if (!strcmp(opt->long_name, "exec"))
@@ -180,7 +181,19 @@ static int opt_set_target(const struct option *opt, const char *str,
else
return ret;
- params.target = str;
+ /* Expand given path to absolute path, except for modulename */
+ if (params.uprobes || strchr(str, '/')) {
+ tmp = realpath(str, NULL);
+ if (!tmp) {
+ pr_warning("Failed to get the absolute path of %s: %m\n", str);
+ return ret;
+ }
+ } else {
+ tmp = strdup(str);
+ if (!tmp)
+ return -ENOMEM;
+ }
+ params.target = tmp;
ret = 0;
}
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 544ac1898a9f..68013b91377c 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2281,7 +2281,7 @@ static int convert_name_to_addr(struct perf_probe_event *pev, const char *exec)
struct perf_probe_point *pp = &pev->point;
struct symbol *sym;
struct map *map = NULL;
- char *function = NULL, *name = NULL;
+ char *function = NULL;
int ret = -EINVAL;
unsigned long long vaddr = 0;
@@ -2297,12 +2297,7 @@ static int convert_name_to_addr(struct perf_probe_event *pev, const char *exec)
goto out;
}
- name = realpath(exec, NULL);
- if (!name) {
- pr_warning("Cannot find realpath for %s.\n", exec);
- goto out;
- }
- map = dso__new_map(name);
+ map = dso__new_map(exec);
if (!map) {
pr_warning("Cannot find appropriate DSO for %s.\n", exec);
goto out;
@@ -2367,7 +2362,5 @@ out:
}
if (function)
free(function);
- if (name)
- free(name);
return ret;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 43/49] perf probe: Support basic dwarf-based operations on uprobe events
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (7 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 42/49] perf probe: Expand given path to absolute path Arnaldo Carvalho de Melo
@ 2013-12-27 20:46 ` Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 44/49] perf ui/tui: Protect windows by ui__lock Arnaldo Carvalho de Melo
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:46 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Masami Hiramatsu, David Ahern, David A. Long,
Namhyung Kim, Oleg Nesterov, Srikar Dronamraju, Steven Rostedt,
systemtap, yrl.pp-manager.tt, Arnaldo Carvalho de Melo
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Support basic dwarf(debuginfo) based operations for uprobe events. With
this change, perf probe can analyze debuginfo of user application binary
to set up new uprobe event.
This allows perf-probe --add(with local variables, line numbers) and
--line works with -x option. (Actually, --vars has already accepted -x
option)
For example, the following command shows the probe-able lines of a given
user space function. Something that so far was only available in the
'perf probe' tool for kernel space functions:
# ./perf probe -x perf --line map__load
<map__load@/home/fedora/ksrc/linux-2.6/tools/perf/util/map.c:0>
0 int map__load(struct map *map, symbol_filter_t filter)
1 {
2 const char *name = map->dso->long_name;
int nr;
5 if (dso__loaded(map->dso, map->type))
6 return 0;
8 nr = dso__load(map->dso, map, filter);
9 if (nr < 0) {
10 if (map->dso->has_build_id) {
And this shows the available variables at the given line of the
function.
# ./perf probe -x perf --vars map__load:8
Available variables at map__load:8
@<map__load+96>
char* name
struct map* map
symbol_filter_t filter
@<map__find_symbol+112>
char* name
symbol_filter_t filter
@<map__find_symbol_by_name+136>
char* name
symbol_filter_t filter
@<map_groups__find_symbol_by_name+176>
char* name
struct map* map
symbol_filter_t filter
And lastly, we can now define probe(s) with all available
variables on the given line:
# ./perf probe -x perf --add 'map__load:8 $vars'
Added new events:
probe_perf:map__load (on map__load:8 with $vars)
probe_perf:map__load_1 (on map__load:8 with $vars)
probe_perf:map__load_2 (on map__load:8 with $vars)
probe_perf:map__load_3 (on map__load:8 with $vars)
You can now use it in all perf tools, such as:
perf record -e probe_perf:map__load_3 -aR sleep 1
Changes from previous version:
- Add examples in the patch description.
- Use .text section start address and dwarf symbol address
for calculating the offset of given symbol, instead of
searching the symbol in symtab again.
With this change, we can safely handle multiple local
function instances (e.g. scnprintf in perf).
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: David A. Long <dave.long@linaro.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: systemtap@sourceware.org
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20131226054152.22364.47021.stgit@kbuild-fedora.novalocal
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-probe.c | 2 +-
tools/perf/util/probe-event.c | 151 ++++++++++++++++++++++++++++++++++++-----
tools/perf/util/probe-event.h | 1 +
tools/perf/util/probe-finder.c | 1 +
4 files changed, 138 insertions(+), 17 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 1792a3f1f4ce..43ff33d0007b 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -424,7 +424,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
}
#ifdef HAVE_DWARF_SUPPORT
- if (params.show_lines && !params.uprobes) {
+ if (params.show_lines) {
if (params.mod_events) {
pr_err(" Error: Don't use --line with"
" --add/--del.\n");
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 68013b91377c..72b56aef105e 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -172,6 +172,52 @@ const char *kernel_get_module_path(const char *module)
return (dso) ? dso->long_name : NULL;
}
+/* Copied from unwind.c */
+static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
+ GElf_Shdr *shp, const char *name)
+{
+ Elf_Scn *sec = NULL;
+
+ while ((sec = elf_nextscn(elf, sec)) != NULL) {
+ char *str;
+
+ gelf_getshdr(sec, shp);
+ str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name);
+ if (!strcmp(name, str))
+ break;
+ }
+
+ return sec;
+}
+
+static int get_text_start_address(const char *exec, unsigned long *address)
+{
+ Elf *elf;
+ GElf_Ehdr ehdr;
+ GElf_Shdr shdr;
+ int fd, ret = -ENOENT;
+
+ fd = open(exec, O_RDONLY);
+ if (fd < 0)
+ return -errno;
+
+ elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
+ if (elf == NULL)
+ return -EINVAL;
+
+ if (gelf_getehdr(elf, &ehdr) == NULL)
+ goto out;
+
+ if (!elf_section_by_name(elf, &ehdr, &shdr, ".text"))
+ goto out;
+
+ *address = shdr.sh_addr - shdr.sh_offset;
+ ret = 0;
+out:
+ elf_end(elf);
+ return ret;
+}
+
static int init_user_exec(void)
{
int ret = 0;
@@ -186,6 +232,37 @@ static int init_user_exec(void)
return ret;
}
+static int convert_exec_to_group(const char *exec, char **result)
+{
+ char *ptr1, *ptr2, *exec_copy;
+ char buf[64];
+ int ret;
+
+ exec_copy = strdup(exec);
+ if (!exec_copy)
+ return -ENOMEM;
+
+ ptr1 = basename(exec_copy);
+ if (!ptr1) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ ptr2 = strpbrk(ptr1, "-._");
+ if (ptr2)
+ *ptr2 = '\0';
+ ret = e_snprintf(buf, 64, "%s_%s", PERFPROBE_GROUP, ptr1);
+ if (ret < 0)
+ goto out;
+
+ *result = strdup(buf);
+ ret = *result ? 0 : -ENOMEM;
+
+out:
+ free(exec_copy);
+ return ret;
+}
+
static int convert_to_perf_probe_point(struct probe_trace_point *tp,
struct perf_probe_point *pp)
{
@@ -261,6 +338,40 @@ static int kprobe_convert_to_perf_probe(struct probe_trace_point *tp,
return 0;
}
+static int add_exec_to_probe_trace_events(struct probe_trace_event *tevs,
+ int ntevs, const char *exec)
+{
+ int i, ret = 0;
+ unsigned long offset, stext = 0;
+ char buf[32];
+
+ if (!exec)
+ return 0;
+
+ ret = get_text_start_address(exec, &stext);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i < ntevs && ret >= 0; i++) {
+ offset = tevs[i].point.address - stext;
+ offset += tevs[i].point.offset;
+ tevs[i].point.offset = 0;
+ free(tevs[i].point.symbol);
+ ret = e_snprintf(buf, 32, "0x%lx", offset);
+ if (ret < 0)
+ break;
+ tevs[i].point.module = strdup(exec);
+ tevs[i].point.symbol = strdup(buf);
+ if (!tevs[i].point.symbol || !tevs[i].point.module) {
+ ret = -ENOMEM;
+ break;
+ }
+ tevs[i].uprobes = true;
+ }
+
+ return ret;
+}
+
static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
int ntevs, const char *module)
{
@@ -305,15 +416,6 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
struct debuginfo *dinfo;
int ntevs, ret = 0;
- if (pev->uprobes) {
- if (need_dwarf) {
- pr_warning("Debuginfo-analysis is not yet supported"
- " with -x/--exec option.\n");
- return -ENOSYS;
- }
- return convert_name_to_addr(pev, target);
- }
-
dinfo = open_debuginfo(target);
if (!dinfo) {
@@ -332,9 +434,14 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
if (ntevs > 0) { /* Succeeded to find trace events */
pr_debug("find %d probe_trace_events.\n", ntevs);
- if (target)
- ret = add_module_to_probe_trace_events(*tevs, ntevs,
- target);
+ if (target) {
+ if (pev->uprobes)
+ ret = add_exec_to_probe_trace_events(*tevs,
+ ntevs, target);
+ else
+ ret = add_module_to_probe_trace_events(*tevs,
+ ntevs, target);
+ }
return ret < 0 ? ret : ntevs;
}
@@ -654,9 +761,6 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
return -ENOSYS;
}
- if (pev->uprobes)
- return convert_name_to_addr(pev, target);
-
return 0;
}
@@ -1913,14 +2017,29 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
int max_tevs, const char *target)
{
struct symbol *sym;
- int ret = 0, i;
+ int ret, i;
struct probe_trace_event *tev;
+ if (pev->uprobes && !pev->group) {
+ /* Replace group name if not given */
+ ret = convert_exec_to_group(target, &pev->group);
+ if (ret != 0) {
+ pr_warning("Failed to make a group name.\n");
+ return ret;
+ }
+ }
+
/* Convert perf_probe_event with debuginfo */
ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, target);
if (ret != 0)
return ret; /* Found in debuginfo or got an error */
+ if (pev->uprobes) {
+ ret = convert_name_to_addr(pev, target);
+ if (ret < 0)
+ return ret;
+ }
+
/* Allocate trace event buffer */
tev = *tevs = zalloc(sizeof(struct probe_trace_event));
if (tev == NULL)
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index f9f3de8b4220..d481c46e0796 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -12,6 +12,7 @@ struct probe_trace_point {
char *symbol; /* Base symbol */
char *module; /* Module name */
unsigned long offset; /* Offset from symbol */
+ unsigned long address; /* Actual address of the trace point */
bool retprobe; /* Return probe flag */
};
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index ffb657ffd327..7db7e05ccb89 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -729,6 +729,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod,
return -ENOENT;
}
tp->offset = (unsigned long)(paddr - sym.st_value);
+ tp->address = (unsigned long)paddr;
tp->symbol = strdup(symbol);
if (!tp->symbol)
return -ENOMEM;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 44/49] perf ui/tui: Protect windows by ui__lock
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (8 preceding siblings ...)
2013-12-27 20:46 ` [PATCH 43/49] perf probe: Support basic dwarf-based operations on uprobe events Arnaldo Carvalho de Melo
@ 2013-12-27 20:47 ` Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 45/49] perf ui/tui: Split help message for perf top and report Arnaldo Carvalho de Melo
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Namhyung Kim, Namhyung Kim, David Ahern, Jiri Olsa,
Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo
From: Namhyung Kim <namhyung.kim@lge.com>
Sometimes perf top TUI breaks display with concurrent help/input window
and pr_* messages since they're not protected by ui__lock.
You can check it by pressing (and not releasing) 'h' key on a "perf top
-vvv" TUI session.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1388036284-32342-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/tui/util.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c
index 092902e30cee..bf890f72fe80 100644
--- a/tools/perf/ui/tui/util.c
+++ b/tools/perf/ui/tui/util.c
@@ -92,6 +92,8 @@ int ui_browser__input_window(const char *title, const char *text, char *input,
t = sep + 1;
}
+ pthread_mutex_lock(&ui__lock);
+
max_len += 2;
nr_lines += 8;
y = SLtt_Screen_Rows / 2 - nr_lines / 2;
@@ -120,13 +122,19 @@ int ui_browser__input_window(const char *title, const char *text, char *input,
SLsmg_write_nstring((char *)exit_msg, max_len);
SLsmg_refresh();
+ pthread_mutex_unlock(&ui__lock);
+
x += 2;
len = 0;
key = ui__getch(delay_secs);
while (key != K_TIMER && key != K_ENTER && key != K_ESC) {
+ pthread_mutex_lock(&ui__lock);
+
if (key == K_BKSPC) {
- if (len == 0)
+ if (len == 0) {
+ pthread_mutex_unlock(&ui__lock);
goto next_key;
+ }
SLsmg_gotorc(y, x + --len);
SLsmg_write_char(' ');
} else {
@@ -136,6 +144,8 @@ int ui_browser__input_window(const char *title, const char *text, char *input,
}
SLsmg_refresh();
+ pthread_mutex_unlock(&ui__lock);
+
/* XXX more graceful overflow handling needed */
if (len == sizeof(buf) - 1) {
ui_helpline__push("maximum size of symbol name reached!");
@@ -174,6 +184,8 @@ int ui__question_window(const char *title, const char *text,
t = sep + 1;
}
+ pthread_mutex_lock(&ui__lock);
+
max_len += 2;
nr_lines += 4;
y = SLtt_Screen_Rows / 2 - nr_lines / 2,
@@ -195,6 +207,9 @@ int ui__question_window(const char *title, const char *text,
SLsmg_gotorc(y + nr_lines - 1, x);
SLsmg_write_nstring((char *)exit_msg, max_len);
SLsmg_refresh();
+
+ pthread_mutex_unlock(&ui__lock);
+
return ui__getch(delay_secs);
}
@@ -215,9 +230,7 @@ static int __ui__warning(const char *title, const char *format, va_list args)
if (vasprintf(&s, format, args) > 0) {
int key;
- pthread_mutex_lock(&ui__lock);
key = ui__question_window(title, s, "Press any key...", 0);
- pthread_mutex_unlock(&ui__lock);
free(s);
return key;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 45/49] perf ui/tui: Split help message for perf top and report
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (9 preceding siblings ...)
2013-12-27 20:47 ` [PATCH 44/49] perf ui/tui: Protect windows by ui__lock Arnaldo Carvalho de Melo
@ 2013-12-27 20:47 ` Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 46/49] perf ui/tui: Implement header window Arnaldo Carvalho de Melo
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Namhyung Kim, Namhyung Kim, David Ahern, Jiri Olsa,
Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo
From: Namhyung Kim <namhyung.kim@lge.com>
Some hotkeys don't work for perf top so split help messages for them.
It'll be helpful to a future modification. Also sort the message by
alphabetical order of the hotkey.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1388036284-32342-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/hists.c | 49 ++++++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index a440e03cd8c2..d43ec79ea4e3 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1400,6 +1400,35 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
char script_opt[64];
int delay_secs = hbt ? hbt->refresh : 0;
+#define HIST_BROWSER_HELP_COMMON \
+ "h/?/F1 Show this window\n" \
+ "UP/DOWN/PGUP\n" \
+ "PGDN/SPACE Navigate\n" \
+ "q/ESC/CTRL+C Exit browser\n\n" \
+ "For multiple event sessions:\n\n" \
+ "TAB/UNTAB Switch events\n\n" \
+ "For symbolic views (--sort has sym):\n\n" \
+ "-> Zoom into DSO/Threads & Annotate current symbol\n" \
+ "<- Zoom out\n" \
+ "a Annotate current symbol\n" \
+ "C Collapse all callchains\n" \
+ "d Zoom into current DSO\n" \
+ "E Expand all callchains\n" \
+
+ /* help messages are sorted by lexical order of the hotkey */
+ const char report_help[] = HIST_BROWSER_HELP_COMMON
+ "P Print histograms to perf.hist.N\n"
+ "r Run available scripts\n"
+ "s Switch to another data file in PWD\n"
+ "t Zoom into current Thread\n"
+ "V Verbose (DSO names in callchains, etc)\n"
+ "/ Filter symbol by name";
+ const char top_help[] = HIST_BROWSER_HELP_COMMON
+ "P Print histograms to perf.hist.N\n"
+ "t Zoom into current Thread\n"
+ "V Verbose (DSO names in callchains, etc)\n"
+ "/ Filter symbol by name";
+
if (browser == NULL)
return -1;
@@ -1488,25 +1517,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
case 'h':
case '?':
ui_browser__help_window(&browser->b,
- "h/?/F1 Show this window\n"
- "UP/DOWN/PGUP\n"
- "PGDN/SPACE Navigate\n"
- "q/ESC/CTRL+C Exit browser\n\n"
- "For multiple event sessions:\n\n"
- "TAB/UNTAB Switch events\n\n"
- "For symbolic views (--sort has sym):\n\n"
- "-> Zoom into DSO/Threads & Annotate current symbol\n"
- "<- Zoom out\n"
- "a Annotate current symbol\n"
- "C Collapse all callchains\n"
- "E Expand all callchains\n"
- "d Zoom into current DSO\n"
- "t Zoom into current Thread\n"
- "r Run available scripts('perf report' only)\n"
- "s Switch to another data file in PWD ('perf report' only)\n"
- "P Print histograms to perf.hist.N\n"
- "V Verbose (DSO names in callchains, etc)\n"
- "/ Filter symbol by name");
+ is_report_browser(hbt) ? report_help : top_help);
continue;
case K_ENTER:
case K_RIGHT:
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 46/49] perf ui/tui: Implement header window
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (10 preceding siblings ...)
2013-12-27 20:47 ` [PATCH 45/49] perf ui/tui: Split help message for perf top and report Arnaldo Carvalho de Melo
@ 2013-12-27 20:47 ` Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 47/49] perf tools: No need to test against NULL before calling free() Arnaldo Carvalho de Melo
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Namhyung Kim, Namhyung Kim, David Ahern, Jiri Olsa,
Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo
From: Namhyung Kim <namhyung.kim@lge.com>
Implement a simple, full-screen header window which shows session header
(metadata) information. Press 'i' key to display the header window.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1388036284-32342-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile.perf | 1 +
tools/perf/ui/browser.h | 2 +
| 127 ++++++++++++++++++++++++++++++++++++++++
tools/perf/ui/browsers/hists.c | 6 ++
4 files changed, 136 insertions(+)
create mode 100644 tools/perf/ui/browsers/header.c
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 97a2145e4cc6..3638b0bd20dc 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -489,6 +489,7 @@ ifndef NO_SLANG
LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
LIB_OBJS += $(OUTPUT)ui/browsers/map.o
LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
+ LIB_OBJS += $(OUTPUT)ui/browsers/header.o
LIB_OBJS += $(OUTPUT)ui/tui/setup.o
LIB_OBJS += $(OUTPUT)ui/tui/util.o
LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index 7d45d2f53601..118cca29dd26 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -59,6 +59,8 @@ int ui_browser__help_window(struct ui_browser *browser, const char *text);
bool ui_browser__dialog_yesno(struct ui_browser *browser, const char *text);
int ui_browser__input_window(const char *title, const char *text, char *input,
const char *exit_msg, int delay_sec);
+struct perf_session_env;
+int tui__header_window(struct perf_session_env *env);
void ui_browser__argv_seek(struct ui_browser *browser, off_t offset, int whence);
unsigned int ui_browser__argv_refresh(struct ui_browser *browser);
--git a/tools/perf/ui/browsers/header.c b/tools/perf/ui/browsers/header.c
new file mode 100644
index 000000000000..89c16b988618
--- /dev/null
+++ b/tools/perf/ui/browsers/header.c
@@ -0,0 +1,127 @@
+#include "util/cache.h"
+#include "util/debug.h"
+#include "ui/browser.h"
+#include "ui/ui.h"
+#include "ui/util.h"
+#include "ui/libslang.h"
+#include "util/header.h"
+#include "util/session.h"
+
+static void ui_browser__argv_write(struct ui_browser *browser,
+ void *entry, int row)
+{
+ char **arg = entry;
+ char *str = *arg;
+ char empty[] = " ";
+ bool current_entry = ui_browser__is_current_entry(browser, row);
+ unsigned long offset = (unsigned long)browser->priv;
+
+ if (offset >= strlen(str))
+ str = empty;
+ else
+ str = str + offset;
+
+ ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED :
+ HE_COLORSET_NORMAL);
+
+ slsmg_write_nstring(str, browser->width);
+}
+
+static int list_menu__run(struct ui_browser *menu)
+{
+ int key;
+ unsigned long offset;
+ const char help[] =
+ "h/?/F1 Show this window\n"
+ "UP/DOWN/PGUP\n"
+ "PGDN/SPACE\n"
+ "LEFT/RIGHT Navigate\n"
+ "q/ESC/CTRL+C Exit browser";
+
+ if (ui_browser__show(menu, "Header information", "Press 'q' to exit") < 0)
+ return -1;
+
+ while (1) {
+ key = ui_browser__run(menu, 0);
+
+ switch (key) {
+ case K_RIGHT:
+ offset = (unsigned long)menu->priv;
+ offset += 10;
+ menu->priv = (void *)offset;
+ continue;
+ case K_LEFT:
+ offset = (unsigned long)menu->priv;
+ if (offset >= 10)
+ offset -= 10;
+ menu->priv = (void *)offset;
+ continue;
+ case K_F1:
+ case 'h':
+ case '?':
+ ui_browser__help_window(menu, help);
+ continue;
+ case K_ESC:
+ case 'q':
+ case CTRL('c'):
+ key = -1;
+ break;
+ default:
+ continue;
+ }
+
+ break;
+ }
+
+ ui_browser__hide(menu);
+ return key;
+}
+
+static int ui__list_menu(int argc, char * const argv[])
+{
+ struct ui_browser menu = {
+ .entries = (void *)argv,
+ .refresh = ui_browser__argv_refresh,
+ .seek = ui_browser__argv_seek,
+ .write = ui_browser__argv_write,
+ .nr_entries = argc,
+ };
+
+ return list_menu__run(&menu);
+}
+
+int tui__header_window(struct perf_session_env *env)
+{
+ int i, argc = 0;
+ char **argv;
+ struct perf_session *session;
+ char *ptr, *pos;
+ size_t size;
+ FILE *fp = open_memstream(&ptr, &size);
+
+ session = container_of(env, struct perf_session, header.env);
+ perf_header__fprintf_info(session, fp, true);
+ fclose(fp);
+
+ for (pos = ptr, argc = 0; (pos = strchr(pos, '\n')) != NULL; pos++)
+ argc++;
+
+ argv = calloc(argc + 1, sizeof(*argv));
+ if (argv == NULL)
+ goto out;
+
+ argv[0] = pos = ptr;
+ for (i = 1; (pos = strchr(pos, '\n')) != NULL; i++) {
+ *pos++ = '\0';
+ argv[i] = pos;
+ }
+
+ BUG_ON(i != argc + 1);
+
+ ui__list_menu(argc, argv);
+
+out:
+ free(argv);
+ free(ptr);
+ return 0;
+}
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index d43ec79ea4e3..0d9dd99507ee 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1417,6 +1417,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
/* help messages are sorted by lexical order of the hotkey */
const char report_help[] = HIST_BROWSER_HELP_COMMON
+ "i Show header information\n"
"P Print histograms to perf.hist.N\n"
"r Run available scripts\n"
"s Switch to another data file in PWD\n"
@@ -1513,6 +1514,11 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
if (is_report_browser(hbt))
goto do_data_switch;
continue;
+ case 'i':
+ /* env->arch is NULL for live-mode (i.e. perf top) */
+ if (env->arch)
+ tui__header_window(env);
+ continue;
case K_F1:
case 'h':
case '?':
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 47/49] perf tools: No need to test against NULL before calling free()
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (11 preceding siblings ...)
2013-12-27 20:47 ` [PATCH 46/49] perf ui/tui: Implement header window Arnaldo Carvalho de Melo
@ 2013-12-27 20:47 ` Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 48/49] perf tools: Introduce zfree Arnaldo Carvalho de Melo
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Its perfectly fine to call free(NULL), so no need to clutter the source
code with all those superfluous testing.
Cc: 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: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-uux5wpvevlerd42gqer13e7n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-kvm.c | 4 +-
tools/perf/ui/browsers/scripts.c | 3 +-
| 6 +--
tools/perf/util/probe-event.c | 62 ++++++++--------------
tools/perf/util/probe-finder.c | 12 ++---
.../perf/util/scripting-engines/trace-event-perl.c | 3 +-
.../util/scripting-engines/trace-event-python.c | 3 +-
7 files changed, 31 insertions(+), 62 deletions(-)
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 5a80da6ba413..a6ec1052c291 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1158,9 +1158,7 @@ out:
if (kvm->timerfd >= 0)
close(kvm->timerfd);
- if (pollfds)
- free(pollfds);
-
+ free(pollfds);
return err;
}
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index d63c68ea02a8..402d2bd30b09 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -173,8 +173,7 @@ int script_browse(const char *script_opt)
if (script.b.width > AVERAGE_LINE_LEN)
script.b.width = AVERAGE_LINE_LEN;
- if (line)
- free(line);
+ free(line);
pclose(fp);
script.nr_lines = nr_entries;
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 61c54213704b..10730b0af804 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1232,10 +1232,8 @@ static void free_event_desc(struct perf_evsel *events)
return;
for (evsel = events; evsel->attr.size; evsel++) {
- if (evsel->name)
- free(evsel->name);
- if (evsel->id)
- free(evsel->id);
+ free(evsel->name);
+ free(evsel->id);
}
free(events);
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 72b56aef105e..095a98ec7444 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -401,9 +401,7 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
}
}
- if (tmp)
- free(tmp);
-
+ free(tmp);
return ret;
}
@@ -1382,8 +1380,7 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp)
error:
pr_debug("Failed to synthesize perf probe point: %s\n",
strerror(-ret));
- if (buf)
- free(buf);
+ free(buf);
return NULL;
}
@@ -1584,34 +1581,25 @@ void clear_perf_probe_event(struct perf_probe_event *pev)
struct perf_probe_arg_field *field, *next;
int i;
- if (pev->event)
- free(pev->event);
- if (pev->group)
- free(pev->group);
- if (pp->file)
- free(pp->file);
- if (pp->function)
- free(pp->function);
- if (pp->lazy_line)
- free(pp->lazy_line);
+ free(pev->event);
+ free(pev->group);
+ free(pp->file);
+ free(pp->function);
+ free(pp->lazy_line);
+
for (i = 0; i < pev->nargs; i++) {
- if (pev->args[i].name)
- free(pev->args[i].name);
- if (pev->args[i].var)
- free(pev->args[i].var);
- if (pev->args[i].type)
- free(pev->args[i].type);
+ free(pev->args[i].name);
+ free(pev->args[i].var);
+ free(pev->args[i].type);
field = pev->args[i].field;
while (field) {
next = field->next;
- if (field->name)
- free(field->name);
+ free(field->name);
free(field);
field = next;
}
}
- if (pev->args)
- free(pev->args);
+ free(pev->args);
memset(pev, 0, sizeof(*pev));
}
@@ -1620,21 +1608,14 @@ static void clear_probe_trace_event(struct probe_trace_event *tev)
struct probe_trace_arg_ref *ref, *next;
int i;
- if (tev->event)
- free(tev->event);
- if (tev->group)
- free(tev->group);
- if (tev->point.symbol)
- free(tev->point.symbol);
- if (tev->point.module)
- free(tev->point.module);
+ free(tev->event);
+ free(tev->group);
+ free(tev->point.symbol);
+ free(tev->point.module);
for (i = 0; i < tev->nargs; i++) {
- if (tev->args[i].name)
- free(tev->args[i].name);
- if (tev->args[i].value)
- free(tev->args[i].value);
- if (tev->args[i].type)
- free(tev->args[i].type);
+ free(tev->args[i].name);
+ free(tev->args[i].value);
+ free(tev->args[i].type);
ref = tev->args[i].ref;
while (ref) {
next = ref->next;
@@ -1642,8 +1623,7 @@ static void clear_probe_trace_event(struct probe_trace_event *tev)
ref = next;
}
}
- if (tev->args)
- free(tev->args);
+ free(tev->args);
memset(tev, 0, sizeof(*tev));
}
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 7db7e05ccb89..8c087359b7ce 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1414,10 +1414,8 @@ int debuginfo__find_available_vars_at(struct debuginfo *dbg,
if (ret < 0) {
/* Free vlist for error */
while (af.nvls--) {
- if (af.vls[af.nvls].point.symbol)
- free(af.vls[af.nvls].point.symbol);
- if (af.vls[af.nvls].vars)
- strlist__delete(af.vls[af.nvls].vars);
+ free(af.vls[af.nvls].point.symbol);
+ strlist__delete(af.vls[af.nvls].vars);
}
free(af.vls);
*vls = NULL;
@@ -1524,10 +1522,8 @@ post:
if (fname) {
ppt->file = strdup(fname);
if (ppt->file == NULL) {
- if (ppt->function) {
- free(ppt->function);
- ppt->function = NULL;
- }
+ free(ppt->function);
+ ppt->function = NULL;
ret = -ENOMEM;
goto end;
}
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index 3773c4841cab..e108207c5de0 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -194,8 +194,7 @@ static void define_event_symbols(struct event_format *event,
zero_flag_atom = 0;
break;
case PRINT_FIELD:
- if (cur_field_name)
- free(cur_field_name);
+ free(cur_field_name);
cur_field_name = strdup(args->field.name);
break;
case PRINT_FLAGS:
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index b258de6357ac..cd9774df3750 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -161,8 +161,7 @@ static void define_event_symbols(struct event_format *event,
zero_flag_atom = 0;
break;
case PRINT_FIELD:
- if (cur_field_name)
- free(cur_field_name);
+ free(cur_field_name);
cur_field_name = strdup(args->field.name);
break;
case PRINT_FLAGS:
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 48/49] perf tools: Introduce zfree
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (12 preceding siblings ...)
2013-12-27 20:47 ` [PATCH 47/49] perf tools: No need to test against NULL before calling free() Arnaldo Carvalho de Melo
@ 2013-12-27 20:47 ` Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 49/49] perf tools: Use zfree to help detect use after free bugs Arnaldo Carvalho de Melo
2014-01-12 16:41 ` [GIT PULL 00/49] perf/core improvements and fixes Ingo Molnar
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian
From: Arnaldo Carvalho de Melo <acme@redhat.com>
For the frequent idiom of:
free(ptr);
ptr = NULL;
Make it expect a pointer to the pointer being freed, so that it becomes
clear at first sight that the variable being freed is being modified.
Cc: 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: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-pfw02ezuab37kha18wlut7ir@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/arch/common.c | 3 +--
tools/perf/builtin-annotate.c | 3 +--
tools/perf/builtin-stat.c | 6 ++----
tools/perf/builtin-timechart.c | 3 +--
tools/perf/builtin-trace.c | 12 ++++--------
tools/perf/ui/browser.c | 6 ++----
tools/perf/ui/browsers/hists.c | 6 ++----
tools/perf/ui/gtk/util.c | 3 +--
tools/perf/util/alias.c | 6 ++----
tools/perf/util/annotate.c | 12 ++++--------
tools/perf/util/dso.c | 9 +++------
tools/perf/util/evlist.c | 9 +++------
tools/perf/util/evsel.c | 6 ++----
| 3 +--
tools/perf/util/help.c | 3 +--
tools/perf/util/machine.c | 12 +++++-------
tools/perf/util/probe-event.c | 6 ++----
tools/perf/util/probe-finder.c | 24 ++++++++----------------
tools/perf/util/symbol.c | 9 +++------
tools/perf/util/thread_map.c | 10 ++++------
tools/perf/util/trace-event-info.c | 6 ++----
tools/perf/util/util.h | 2 ++
22 files changed, 56 insertions(+), 103 deletions(-)
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
index aacef07ebf31..42faf369211c 100644
--- a/tools/perf/arch/common.c
+++ b/tools/perf/arch/common.c
@@ -154,8 +154,7 @@ static int perf_session_env__lookup_binutils_path(struct perf_session_env *env,
}
if (lookup_path(buf))
goto out;
- free(buf);
- buf = NULL;
+ zfree(&buf);
}
if (!strcmp(arch, "arm"))
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4136f9970fd5..ab65057a0317 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -180,8 +180,7 @@ find_next:
* symbol, free he->ms.sym->src to signal we already
* processed this symbol.
*/
- free(notes->src);
- notes->src = NULL;
+ zfree(¬es->src);
}
}
}
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index dab98b50c9fe..106a5e5b7842 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -185,8 +185,7 @@ static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel)
static void perf_evsel__free_stat_priv(struct perf_evsel *evsel)
{
- free(evsel->priv);
- evsel->priv = NULL;
+ zfree(&evsel->priv);
}
static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel)
@@ -208,8 +207,7 @@ static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel)
static void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel)
{
- free(evsel->prev_raw_counts);
- evsel->prev_raw_counts = NULL;
+ zfree(&evsel->prev_raw_counts);
}
static void perf_evlist__free_stats(struct perf_evlist *evlist)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 20d4212fa337..652af0b66a62 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -488,8 +488,7 @@ static const char *cat_backtrace(union perf_event *event,
* It seems the callchain is corrupted.
* Discard all.
*/
- free(p);
- p = NULL;
+ zfree(&p);
goto exit;
}
continue;
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f64b5b0aa8b1..c5b4bc51175c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -146,8 +146,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel,
static void perf_evsel__delete_priv(struct perf_evsel *evsel)
{
- free(evsel->priv);
- evsel->priv = NULL;
+ zfree(&evsel->priv);
perf_evsel__delete(evsel);
}
@@ -165,8 +164,7 @@ static int perf_evsel__init_syscall_tp(struct perf_evsel *evsel, void *handler)
return -ENOMEM;
out_delete:
- free(evsel->priv);
- evsel->priv = NULL;
+ zfree(&evsel->priv);
return -ENOENT;
}
@@ -1278,10 +1276,8 @@ static size_t syscall_arg__scnprintf_close_fd(char *bf, size_t size,
size_t printed = syscall_arg__scnprintf_fd(bf, size, arg);
struct thread_trace *ttrace = arg->thread->priv;
- if (ttrace && fd >= 0 && fd <= ttrace->paths.max) {
- free(ttrace->paths.table[fd]);
- ttrace->paths.table[fd] = NULL;
- }
+ if (ttrace && fd >= 0 && fd <= ttrace->paths.max)
+ zfree(&ttrace->paths.table[fd]);
return printed;
}
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index 94223d404f43..d11541d4d7d7 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -256,8 +256,7 @@ int ui_browser__show(struct ui_browser *browser, const char *title,
__ui_browser__show_title(browser, title);
browser->title = title;
- free(browser->helpline);
- browser->helpline = NULL;
+ zfree(&browser->helpline);
va_start(ap, helpline);
err = vasprintf(&browser->helpline, helpline, ap);
@@ -272,8 +271,7 @@ void ui_browser__hide(struct ui_browser *browser)
{
pthread_mutex_lock(&ui__lock);
ui_helpline__pop();
- free(browser->helpline);
- browser->helpline = NULL;
+ zfree(&browser->helpline);
pthread_mutex_unlock(&ui__lock);
}
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 0d9dd99507ee..022d1731b801 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1267,10 +1267,8 @@ static inline void free_popup_options(char **options, int n)
{
int i;
- for (i = 0; i < n; ++i) {
- free(options[i]);
- options[i] = NULL;
- }
+ for (i = 0; i < n; ++i)
+ zfree(&options[i]);
}
/* Check whether the browser is for 'top' or 'report' */
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
index 696c1fbe4248..52e7fc48af9f 100644
--- a/tools/perf/ui/gtk/util.c
+++ b/tools/perf/ui/gtk/util.c
@@ -23,8 +23,7 @@ int perf_gtk__deactivate_context(struct perf_gtk_context **ctx)
if (!perf_gtk__is_active_context(*ctx))
return -1;
- free(*ctx);
- *ctx = NULL;
+ zfree(ctx);
return 0;
}
diff --git a/tools/perf/util/alias.c b/tools/perf/util/alias.c
index e6d134773d0a..c0b43ee40d95 100644
--- a/tools/perf/util/alias.c
+++ b/tools/perf/util/alias.c
@@ -55,8 +55,7 @@ int split_cmdline(char *cmdline, const char ***argv)
src++;
c = cmdline[src];
if (!c) {
- free(*argv);
- *argv = NULL;
+ zfree(argv);
return error("cmdline ends with \\");
}
}
@@ -68,8 +67,7 @@ int split_cmdline(char *cmdline, const char ***argv)
cmdline[dst] = 0;
if (quoted) {
- free(*argv);
- *argv = NULL;
+ zfree(argv);
return error("unclosed quote");
}
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 27ab7b59dbf4..a78721d14694 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -185,8 +185,7 @@ static int lock__parse(struct ins_operands *ops)
return 0;
out_free_ops:
- free(ops->locked.ops);
- ops->locked.ops = NULL;
+ zfree(&ops->locked.ops);
return 0;
}
@@ -256,8 +255,7 @@ static int mov__parse(struct ins_operands *ops)
return 0;
out_free_source:
- free(ops->source.raw);
- ops->source.raw = NULL;
+ zfree(&ops->source.raw);
return -1;
}
@@ -560,8 +558,7 @@ static int disasm_line__parse(char *line, char **namep, char **rawp)
return 0;
out_free_name:
- free(*namep);
- *namep = NULL;
+ zfree(namep);
return -1;
}
@@ -1113,8 +1110,7 @@ static void symbol__free_source_line(struct symbol *sym, int len)
src_line = (void *)src_line + sizeof_src_line;
}
- free(notes->src->lines);
- notes->src->lines = NULL;
+ zfree(¬es->src->lines);
}
/* Get the filename:line for the colored entries */
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 4ddeecb9ff85..4045d086d9d9 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -497,21 +497,18 @@ void dso__delete(struct dso *dso)
symbols__delete(&dso->symbols[i]);
if (dso->short_name_allocated) {
- free((char *)dso->short_name);
- dso->short_name = NULL;
+ zfree((char **)&dso->short_name);
dso->short_name_allocated = false;
}
if (dso->long_name_allocated) {
- free((char *)dso->long_name);
- dso->long_name = NULL;
+ zfree((char **)&dso->long_name);
dso->long_name_allocated = false;
}
dso_cache__free(&dso->cache);
dso__free_a2l(dso);
- free(dso->symsrc_filename);
- dso->symsrc_filename = NULL;
+ zfree(&dso->symsrc_filename);
free(dso);
}
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index da3182914984..b08a7ecdcea1 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -101,10 +101,8 @@ static void perf_evlist__purge(struct perf_evlist *evlist)
void perf_evlist__exit(struct perf_evlist *evlist)
{
- free(evlist->mmap);
- free(evlist->pollfd);
- evlist->mmap = NULL;
- evlist->pollfd = NULL;
+ zfree(&evlist->mmap);
+ zfree(&evlist->pollfd);
}
void perf_evlist__delete(struct perf_evlist *evlist)
@@ -587,8 +585,7 @@ void perf_evlist__munmap(struct perf_evlist *evlist)
for (i = 0; i < evlist->nr_mmaps; i++)
__perf_evlist__munmap(evlist, i);
- free(evlist->mmap);
- evlist->mmap = NULL;
+ zfree(&evlist->mmap);
}
static int perf_evlist__alloc_mmap(struct perf_evlist *evlist)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 6874e0485693..93b6031d5459 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -750,8 +750,7 @@ void perf_evsel__free_id(struct perf_evsel *evsel)
{
xyarray__delete(evsel->sample_id);
evsel->sample_id = NULL;
- free(evsel->id);
- evsel->id = NULL;
+ zfree(&evsel->id);
}
void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
@@ -1960,8 +1959,7 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
evsel->attr.type = PERF_TYPE_SOFTWARE;
evsel->attr.config = PERF_COUNT_SW_CPU_CLOCK;
- free(evsel->name);
- evsel->name = NULL;
+ zfree(&evsel->name);
return true;
}
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 10730b0af804..20f3a9c97bd8 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1324,8 +1324,7 @@ read_event_desc(struct perf_header *ph, int fd)
}
}
out:
- if (buf)
- free(buf);
+ free(buf);
return events;
error:
if (events)
diff --git a/tools/perf/util/help.c b/tools/perf/util/help.c
index 8b1f6e891b8a..7b68978e50d2 100644
--- a/tools/perf/util/help.c
+++ b/tools/perf/util/help.c
@@ -263,9 +263,8 @@ static void add_cmd_list(struct cmdnames *cmds, struct cmdnames *old)
for (i = 0; i < old->cnt; i++)
cmds->names[cmds->cnt++] = old->names[i];
- free(old->names);
+ zfree(&old->names);
old->cnt = 0;
- old->names = NULL;
}
const char *help_unknown_cmd(const char *cmd)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index c78cc84f433e..a98538dc465a 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -102,8 +102,7 @@ void machine__exit(struct machine *machine)
map_groups__exit(&machine->kmaps);
dsos__delete(&machine->user_dsos);
dsos__delete(&machine->kernel_dsos);
- free(machine->root_dir);
- machine->root_dir = NULL;
+ zfree(&machine->root_dir);
}
void machine__delete(struct machine *machine)
@@ -562,11 +561,10 @@ void machine__destroy_kernel_maps(struct machine *machine)
* on one of them.
*/
if (type == MAP__FUNCTION) {
- free((char *)kmap->ref_reloc_sym->name);
- kmap->ref_reloc_sym->name = NULL;
- free(kmap->ref_reloc_sym);
- }
- kmap->ref_reloc_sym = NULL;
+ zfree((char **)&kmap->ref_reloc_sym->name);
+ zfree(&kmap->ref_reloc_sym);
+ } else
+ kmap->ref_reloc_sym = NULL;
}
map__delete(machine->vmlinux_maps[type]);
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 095a98ec7444..4d3cd1a0278a 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -506,15 +506,13 @@ static int get_real_path(const char *raw_path, const char *comp_dir,
case EFAULT:
raw_path = strchr(++raw_path, '/');
if (!raw_path) {
- free(*new_path);
- *new_path = NULL;
+ zfree(new_path);
return -ENOENT;
}
continue;
default:
- free(*new_path);
- *new_path = NULL;
+ zfree(new_path);
return -errno;
}
}
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 8c087359b7ce..6d8796e38d7f 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -226,10 +226,8 @@ struct debuginfo *debuginfo__new(const char *path)
if (!dbg)
return NULL;
- if (debuginfo__init_offline_dwarf(dbg, path) < 0) {
- free(dbg);
- dbg = NULL;
- }
+ if (debuginfo__init_offline_dwarf(dbg, path) < 0)
+ zfree(&dbg);
return dbg;
}
@@ -241,10 +239,8 @@ struct debuginfo *debuginfo__new_online_kernel(unsigned long addr)
if (!dbg)
return NULL;
- if (debuginfo__init_online_kernel_dwarf(dbg, (Dwarf_Addr)addr) < 0) {
- free(dbg);
- dbg = NULL;
- }
+ if (debuginfo__init_online_kernel_dwarf(dbg, (Dwarf_Addr)addr) < 0)
+ zfree(&dbg);
return dbg;
}
@@ -1302,8 +1298,7 @@ int debuginfo__find_trace_events(struct debuginfo *dbg,
ret = debuginfo__find_probes(dbg, &tf.pf);
if (ret < 0) {
- free(*tevs);
- *tevs = NULL;
+ zfree(tevs);
return ret;
}
@@ -1417,8 +1412,7 @@ int debuginfo__find_available_vars_at(struct debuginfo *dbg,
free(af.vls[af.nvls].point.symbol);
strlist__delete(af.vls[af.nvls].vars);
}
- free(af.vls);
- *vls = NULL;
+ zfree(vls);
return ret;
}
@@ -1522,8 +1516,7 @@ post:
if (fname) {
ppt->file = strdup(fname);
if (ppt->file == NULL) {
- free(ppt->function);
- ppt->function = NULL;
+ zfree(&ppt->function);
ret = -ENOMEM;
goto end;
}
@@ -1577,8 +1570,7 @@ static int find_line_range_by_line(Dwarf_Die *sp_die, struct line_finder *lf)
else
ret = 0; /* Lines are not found */
else {
- free(lf->lr->path);
- lf->lr->path = NULL;
+ zfree(&lf->lr->path);
}
return ret;
}
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 923d00040bbf..fd9e1a4fad16 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1621,13 +1621,10 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
static void vmlinux_path__exit(void)
{
- while (--vmlinux_path__nr_entries >= 0) {
- free(vmlinux_path[vmlinux_path__nr_entries]);
- vmlinux_path[vmlinux_path__nr_entries] = NULL;
- }
+ while (--vmlinux_path__nr_entries >= 0)
+ zfree(&vmlinux_path[vmlinux_path__nr_entries]);
- free(vmlinux_path);
- vmlinux_path = NULL;
+ zfree(&vmlinux_path);
}
static int vmlinux_path__init(void)
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index 9b5f856cc280..cf44644a4058 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -9,6 +9,7 @@
#include "strlist.h"
#include <string.h>
#include "thread_map.h"
+#include "util.h"
/* Skip "." and ".." directories */
static int filter(const struct dirent *dir)
@@ -138,8 +139,7 @@ out_free_namelist:
free(namelist);
out_free_closedir:
- free(threads);
- threads = NULL;
+ zfree(&threads);
goto out_closedir;
}
@@ -210,8 +210,7 @@ out_free_namelist:
free(namelist);
out_free_threads:
- free(threads);
- threads = NULL;
+ zfree(&threads);
goto out;
}
@@ -262,8 +261,7 @@ out:
return threads;
out_free_threads:
- free(threads);
- threads = NULL;
+ zfree(&threads);
goto out;
}
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index c354b95a2348..9f73bf43862c 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -562,10 +562,8 @@ out:
output_fd = fd;
}
- if (err) {
- free(tdata);
- tdata = NULL;
- }
+ if (err)
+ zfree(&tdata);
put_tracepoints_path(tps);
return tdata;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 9a2c268ad718..6995d66f225c 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -186,6 +186,8 @@ static inline void *zalloc(size_t size)
return calloc(1, size);
}
+#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
+
static inline int has_extension(const char *filename, const char *ext)
{
size_t len = strlen(filename);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 49/49] perf tools: Use zfree to help detect use after free bugs
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (13 preceding siblings ...)
2013-12-27 20:47 ` [PATCH 48/49] perf tools: Introduce zfree Arnaldo Carvalho de Melo
@ 2013-12-27 20:47 ` Arnaldo Carvalho de Melo
2014-01-12 16:41 ` [GIT PULL 00/49] perf/core improvements and fixes Ingo Molnar
15 siblings, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-27 20:47 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Several areas already used this technique, so do some audit to
consistently use it elsewhere.
Cc: 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: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-9sbere0kkplwe45ak6rk4a1f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-diff.c | 2 +-
tools/perf/builtin-sched.c | 2 +-
tools/perf/builtin-script.c | 6 +++---
tools/perf/ui/browsers/hists.c | 2 +-
tools/perf/ui/stdio/hist.c | 2 +-
tools/perf/util/annotate.c | 20 ++++++++++----------
tools/perf/util/cgroup.c | 2 +-
tools/perf/util/comm.c | 2 +-
tools/perf/util/evsel.c | 8 ++++----
| 10 +++++-----
tools/perf/util/help.c | 4 ++--
tools/perf/util/hist.c | 6 +++---
tools/perf/util/parse-events.c | 8 ++++----
tools/perf/util/pmu.c | 2 +-
tools/perf/util/probe-event.c | 8 ++++----
tools/perf/util/probe-finder.c | 2 +-
tools/perf/util/session.c | 24 ++++++++++++------------
tools/perf/util/srcline.c | 6 +++---
tools/perf/util/strbuf.c | 2 +-
tools/perf/util/strfilter.c | 2 +-
tools/perf/util/string.c | 2 +-
tools/perf/util/strlist.c | 3 ++-
tools/perf/util/svghelper.c | 5 +++--
tools/perf/util/symbol-elf.c | 2 +-
tools/perf/util/symbol-minimal.c | 3 ++-
tools/perf/util/symbol.c | 2 +-
tools/perf/util/thread_map.c | 10 +++++-----
tools/perf/util/trace-event-info.c | 4 ++--
tools/perf/util/values.c | 14 +++++++-------
29 files changed, 84 insertions(+), 81 deletions(-)
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 2a85cc9a2d09..e6a0844bc2f0 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -654,7 +654,7 @@ static void data__free(struct data__file *d)
for (col = 0; col < PERF_HPP_DIFF__MAX_INDEX; col++) {
struct diff_hpp_fmt *fmt = &d->fmt[col];
- free(fmt->header);
+ zfree(&fmt->header);
}
}
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 0f3c65518a2c..6a76a07b6789 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -469,7 +469,7 @@ static void *thread_func(void *ctx)
char comm2[22];
int fd;
- free(parms);
+ zfree(&parms);
sprintf(comm2, ":%s", this_task->comm);
prctl(PR_SET_NAME, comm2);
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 62ef190c4320..6040000bdfa6 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1102,9 +1102,9 @@ static struct script_desc *script_desc__new(const char *name)
static void script_desc__delete(struct script_desc *s)
{
- free(s->name);
- free(s->half_liner);
- free(s->args);
+ zfree(&s->name);
+ zfree(&s->half_liner);
+ zfree(&s->args);
free(s);
}
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 022d1731b801..a7045ea6d1d5 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1327,7 +1327,7 @@ static int switch_data_file(void)
abs_path[nr_options] = strdup(path);
if (!abs_path[nr_options]) {
- free(options[nr_options]);
+ zfree(&options[nr_options]);
ui__warning("Can't search all data files due to memory shortage.\n");
fclose(file);
break;
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index c244cb524ef2..831fbb77d1ff 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -510,7 +510,7 @@ print_entries:
free(line);
out:
- free(rem_sq_bracket);
+ zfree(&rem_sq_bracket);
return ret;
}
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index a78721d14694..469eb679fb9d 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -26,10 +26,10 @@ static int disasm_line__parse(char *line, char **namep, char **rawp);
static void ins__delete(struct ins_operands *ops)
{
- free(ops->source.raw);
- free(ops->source.name);
- free(ops->target.raw);
- free(ops->target.name);
+ zfree(&ops->source.raw);
+ zfree(&ops->source.name);
+ zfree(&ops->target.raw);
+ zfree(&ops->target.name);
}
static int ins__raw_scnprintf(struct ins *ins, char *bf, size_t size,
@@ -204,9 +204,9 @@ static int lock__scnprintf(struct ins *ins, char *bf, size_t size,
static void lock__delete(struct ins_operands *ops)
{
- free(ops->locked.ops);
- free(ops->target.raw);
- free(ops->target.name);
+ zfree(&ops->locked.ops);
+ zfree(&ops->target.raw);
+ zfree(&ops->target.name);
}
static struct ins_ops lock_ops = {
@@ -583,7 +583,7 @@ static struct disasm_line *disasm_line__new(s64 offset, char *line, size_t privs
return dl;
out_free_line:
- free(dl->line);
+ zfree(&dl->line);
out_delete:
free(dl);
return NULL;
@@ -591,8 +591,8 @@ out_delete:
void disasm_line__free(struct disasm_line *dl)
{
- free(dl->line);
- free(dl->name);
+ zfree(&dl->line);
+ zfree(&dl->name);
if (dl->ins && dl->ins->ops->free)
dl->ins->ops->free(&dl->ops);
else
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 96bbda1ddb83..0922aa4218c2 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -133,7 +133,7 @@ void close_cgroup(struct cgroup_sel *cgrp)
/* XXX: not reentrant */
if (--cgrp->refcnt == 0) {
close(cgrp->fd);
- free(cgrp->name);
+ zfree(&cgrp->name);
free(cgrp);
}
}
diff --git a/tools/perf/util/comm.c b/tools/perf/util/comm.c
index ee0df0e24cdb..67d1e404c0cb 100644
--- a/tools/perf/util/comm.c
+++ b/tools/perf/util/comm.c
@@ -21,7 +21,7 @@ static void comm_str__put(struct comm_str *cs)
{
if (!--cs->ref) {
rb_erase(&cs->rb_node, &comm_str_root);
- free(cs->str);
+ zfree(&cs->str);
free(cs);
}
}
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 93b6031d5459..ade8d9c1c431 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -208,7 +208,7 @@ struct perf_evsel *perf_evsel__newtp_idx(const char *sys, const char *name, int
return evsel;
out_free:
- free(evsel->name);
+ zfree(&evsel->name);
free(evsel);
return NULL;
}
@@ -766,7 +766,7 @@ void perf_evsel__close_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
void perf_evsel__free_counts(struct perf_evsel *evsel)
{
- free(evsel->counts);
+ zfree(&evsel->counts);
}
void perf_evsel__exit(struct perf_evsel *evsel)
@@ -780,10 +780,10 @@ void perf_evsel__delete(struct perf_evsel *evsel)
{
perf_evsel__exit(evsel);
close_cgroup(evsel->cgrp);
- free(evsel->group_name);
+ zfree(&evsel->group_name);
if (evsel->tp_format)
pevent_free_format(evsel->tp_format);
- free(evsel->name);
+ zfree(&evsel->name);
free(evsel);
}
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 20f3a9c97bd8..a4a60b7887ee 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -800,10 +800,10 @@ static void free_cpu_topo(struct cpu_topo *tp)
return;
for (i = 0 ; i < tp->core_sib; i++)
- free(tp->core_siblings[i]);
+ zfree(&tp->core_siblings[i]);
for (i = 0 ; i < tp->thread_sib; i++)
- free(tp->thread_siblings[i]);
+ zfree(&tp->thread_siblings[i]);
free(tp);
}
@@ -1232,8 +1232,8 @@ static void free_event_desc(struct perf_evsel *events)
return;
for (evsel = events; evsel->attr.size; evsel++) {
- free(evsel->name);
- free(evsel->id);
+ zfree(&evsel->name);
+ zfree(&evsel->id);
}
free(events);
@@ -2105,7 +2105,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
ret = 0;
out_free:
for (i = 0; i < nr_groups; i++)
- free(desc[i].name);
+ zfree(&desc[i].name);
free(desc);
return ret;
diff --git a/tools/perf/util/help.c b/tools/perf/util/help.c
index 7b68978e50d2..86c37c472263 100644
--- a/tools/perf/util/help.c
+++ b/tools/perf/util/help.c
@@ -22,8 +22,8 @@ static void clean_cmdnames(struct cmdnames *cmds)
unsigned int i;
for (i = 0; i < cmds->cnt; ++i)
- free(cmds->names[i]);
- free(cmds->names);
+ zfree(&cmds->names[i]);
+ zfree(&cmds->names);
cmds->cnt = 0;
cmds->alloc = 0;
}
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 6cd4823a7a8b..4ed3e883240d 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -372,7 +372,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists,
* This mem info was allocated from machine__resolve_mem
* and will not be used anymore.
*/
- free(entry->mem_info);
+ zfree(&entry->mem_info);
/* If the map of an existing hist_entry has
* become out-of-date due to an exec() or
@@ -475,8 +475,8 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
void hist_entry__free(struct hist_entry *he)
{
- free(he->branch_info);
- free(he->mem_info);
+ zfree(&he->branch_info);
+ zfree(&he->mem_info);
free_srcline(he->srcline);
free(he);
}
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 094c28ba2fae..0153435b8427 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -204,7 +204,7 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
}
path->name = malloc(MAX_EVENT_LENGTH);
if (!path->name) {
- free(path->system);
+ zfree(&path->system);
free(path);
return NULL;
}
@@ -236,8 +236,8 @@ struct tracepoint_path *tracepoint_name_to_path(const char *name)
path->name = strdup(str+1);
if (path->system == NULL || path->name == NULL) {
- free(path->system);
- free(path->name);
+ zfree(&path->system);
+ zfree(&path->name);
free(path);
path = NULL;
}
@@ -917,7 +917,7 @@ int parse_events_terms(struct list_head *terms, const char *str)
ret = parse_events__scanner(str, &data, PE_START_TERMS);
if (!ret) {
list_splice(data.terms, terms);
- free(data.terms);
+ zfree(&data.terms);
return 0;
}
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 56fc10a5e288..0934d645ebdc 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -755,7 +755,7 @@ void print_pmu_events(const char *event_glob, bool name_only)
continue;
}
printf(" %-50s [Kernel PMU event]\n", aliases[j]);
- free(aliases[j]);
+ zfree(&aliases[j]);
printed++;
}
if (printed)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 4d3cd1a0278a..86ed8580c3cb 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -356,7 +356,7 @@ static int add_exec_to_probe_trace_events(struct probe_trace_event *tevs,
offset = tevs[i].point.address - stext;
offset += tevs[i].point.offset;
tevs[i].point.offset = 0;
- free(tevs[i].point.symbol);
+ zfree(&tevs[i].point.symbol);
ret = e_snprintf(buf, 32, "0x%lx", offset);
if (ret < 0)
break;
@@ -683,7 +683,7 @@ static int show_available_vars_at(struct debuginfo *dinfo,
*/
fprintf(stdout, "\t@<%s+%lu>\n", vl->point.symbol,
vl->point.offset);
- free(vl->point.symbol);
+ zfree(&vl->point.symbol);
nvars = 0;
if (vl->vars) {
strlist__for_each(node, vl->vars) {
@@ -1592,7 +1592,7 @@ void clear_perf_probe_event(struct perf_probe_event *pev)
field = pev->args[i].field;
while (field) {
next = field->next;
- free(field->name);
+ zfree(&field->name);
free(field);
field = next;
}
@@ -2153,7 +2153,7 @@ end:
for (i = 0; i < npevs; i++) {
for (j = 0; j < pkgs[i].ntevs; j++)
clear_probe_trace_event(&pkgs[i].tevs[j]);
- free(pkgs[i].tevs);
+ zfree(&pkgs[i].tevs);
}
free(pkgs);
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 6d8796e38d7f..061edb162b5b 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1409,7 +1409,7 @@ int debuginfo__find_available_vars_at(struct debuginfo *dbg,
if (ret < 0) {
/* Free vlist for error */
while (af.nvls--) {
- free(af.vls[af.nvls].point.symbol);
+ zfree(&af.vls[af.nvls].point.symbol);
strlist__delete(af.vls[af.nvls].vars);
}
zfree(vls);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index d3a857be9682..8ffe29c55d0f 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -132,18 +132,18 @@ static void perf_session__delete_threads(struct perf_session *session)
static void perf_session_env__delete(struct perf_session_env *env)
{
- free(env->hostname);
- free(env->os_release);
- free(env->version);
- free(env->arch);
- free(env->cpu_desc);
- free(env->cpuid);
-
- free(env->cmdline);
- free(env->sibling_cores);
- free(env->sibling_threads);
- free(env->numa_nodes);
- free(env->pmu_mappings);
+ zfree(&env->hostname);
+ zfree(&env->os_release);
+ zfree(&env->version);
+ zfree(&env->arch);
+ zfree(&env->cpu_desc);
+ zfree(&env->cpuid);
+
+ zfree(&env->cmdline);
+ zfree(&env->sibling_cores);
+ zfree(&env->sibling_threads);
+ zfree(&env->numa_nodes);
+ zfree(&env->pmu_mappings);
}
void perf_session__delete(struct perf_session *session)
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index 58b2bd8f38c9..7e67879ebd25 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -129,7 +129,7 @@ static struct a2l_data *addr2line_init(const char *path)
out:
if (a2l) {
- free((void *)a2l->input);
+ zfree((void **)&a2l->input);
free(a2l);
}
bfd_close(abfd);
@@ -140,8 +140,8 @@ static void addr2line_cleanup(struct a2l_data *a2l)
{
if (a2l->abfd)
bfd_close(a2l->abfd);
- free((void *)a2l->input);
- free(a2l->syms);
+ zfree((void **)&a2l->input);
+ zfree(&a2l->syms);
free(a2l);
}
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index cfa906882e2c..4abe23550c73 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -28,7 +28,7 @@ void strbuf_init(struct strbuf *sb, ssize_t hint)
void strbuf_release(struct strbuf *sb)
{
if (sb->alloc) {
- free(sb->buf);
+ zfree(&sb->buf);
strbuf_init(sb, 0);
}
}
diff --git a/tools/perf/util/strfilter.c b/tools/perf/util/strfilter.c
index 3edd0538161f..79a757a2a15c 100644
--- a/tools/perf/util/strfilter.c
+++ b/tools/perf/util/strfilter.c
@@ -14,7 +14,7 @@ static void strfilter_node__delete(struct strfilter_node *node)
{
if (node) {
if (node->p && !is_operator(*node->p))
- free((char *)node->p);
+ zfree((char **)&node->p);
strfilter_node__delete(node->l);
strfilter_node__delete(node->r);
free(node);
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index f0b0c008c507..2553e5b55b89 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -128,7 +128,7 @@ void argv_free(char **argv)
{
char **p;
for (p = argv; *p; p++)
- free(*p);
+ zfree(p);
free(argv);
}
diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
index eabdce0a2daa..61a90bf24b4d 100644
--- a/tools/perf/util/strlist.c
+++ b/tools/perf/util/strlist.c
@@ -5,6 +5,7 @@
*/
#include "strlist.h"
+#include "util.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -38,7 +39,7 @@ out_delete:
static void str_node__delete(struct str_node *snode, bool dupstr)
{
if (dupstr)
- free((void *)snode->s);
+ zfree((void **)&snode->s);
free(snode);
}
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index 56a84f2cc46d..43262b83c541 100644
--- a/tools/perf/util/svghelper.c
+++ b/tools/perf/util/svghelper.c
@@ -21,6 +21,7 @@
#include "perf.h"
#include "svghelper.h"
+#include "util.h"
#include "cpumap.h"
static u64 first_time, last_time;
@@ -708,8 +709,8 @@ int svg_build_topology_map(char *sib_core, int sib_core_nr,
return 0;
exit:
- free(t.sib_core);
- free(t.sib_thr);
+ zfree(&t.sib_core);
+ zfree(&t.sib_thr);
return -1;
}
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index bf0ce29567b6..4b0a127a4d3b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -554,7 +554,7 @@ bool symsrc__has_symtab(struct symsrc *ss)
void symsrc__destroy(struct symsrc *ss)
{
- free(ss->name);
+ zfree(&ss->name);
elf_end(ss->elf);
close(ss->fd);
}
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index ac7070a2f2b6..bd15f490d04f 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -1,4 +1,5 @@
#include "symbol.h"
+#include "util.h"
#include <stdio.h>
#include <fcntl.h>
@@ -275,7 +276,7 @@ bool symsrc__has_symtab(struct symsrc *ss __maybe_unused)
void symsrc__destroy(struct symsrc *ss)
{
- free(ss->name);
+ zfree(&ss->name);
close(ss->fd);
}
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index fd9e1a4fad16..39ce9adbaaf0 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -796,7 +796,7 @@ static void delete_modules(struct rb_root *modules)
mi = rb_entry(next, struct module_info, rb_node);
next = rb_next(&mi->rb_node);
rb_erase(&mi->rb_node, modules);
- free(mi->name);
+ zfree(&mi->name);
free(mi);
}
}
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index cf44644a4058..5d3215912105 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -41,7 +41,7 @@ struct thread_map *thread_map__new_by_pid(pid_t pid)
}
for (i=0; i<items; i++)
- free(namelist[i]);
+ zfree(&namelist[i]);
free(namelist);
return threads;
@@ -118,7 +118,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
threads->map[threads->nr + i] = atoi(namelist[i]->d_name);
for (i = 0; i < items; i++)
- free(namelist[i]);
+ zfree(&namelist[i]);
free(namelist);
threads->nr += items;
@@ -135,7 +135,7 @@ out_free_threads:
out_free_namelist:
for (i = 0; i < items; i++)
- free(namelist[i]);
+ zfree(&namelist[i]);
free(namelist);
out_free_closedir:
@@ -194,7 +194,7 @@ static struct thread_map *thread_map__new_by_pid_str(const char *pid_str)
for (i = 0; i < items; i++) {
threads->map[j++] = atoi(namelist[i]->d_name);
- free(namelist[i]);
+ zfree(&namelist[i]);
}
threads->nr = total_tasks;
free(namelist);
@@ -206,7 +206,7 @@ out:
out_free_namelist:
for (i = 0; i < items; i++)
- free(namelist[i]);
+ zfree(&namelist[i]);
free(namelist);
out_free_threads:
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index 9f73bf43862c..7e6fcfe8b438 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -397,8 +397,8 @@ put_tracepoints_path(struct tracepoint_path *tps)
struct tracepoint_path *t = tps;
tps = tps->next;
- free(t->name);
- free(t->system);
+ zfree(&t->name);
+ zfree(&t->system);
free(t);
}
}
diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c
index 697c8b4e59cc..0fb3c1fcd3e6 100644
--- a/tools/perf/util/values.c
+++ b/tools/perf/util/values.c
@@ -31,14 +31,14 @@ void perf_read_values_destroy(struct perf_read_values *values)
return;
for (i = 0; i < values->threads; i++)
- free(values->value[i]);
- free(values->value);
- free(values->pid);
- free(values->tid);
- free(values->counterrawid);
+ zfree(&values->value[i]);
+ zfree(&values->value);
+ zfree(&values->pid);
+ zfree(&values->tid);
+ zfree(&values->counterrawid);
for (i = 0; i < values->counters; i++)
- free(values->countername[i]);
- free(values->countername);
+ zfree(&values->countername[i]);
+ zfree(&values->countername);
}
static void perf_read_values__enlarge_threads(struct perf_read_values *values)
--
1.8.1.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [GIT PULL 00/49] perf/core improvements and fixes
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (14 preceding siblings ...)
2013-12-27 20:47 ` [PATCH 49/49] perf tools: Use zfree to help detect use after free bugs Arnaldo Carvalho de Melo
@ 2014-01-12 16:41 ` Ingo Molnar
15 siblings, 0 replies; 17+ messages in thread
From: Ingo Molnar @ 2014-01-12 16:41 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Arun Sharma, Chunwei Chen, Corey Ashford, David Ahern,
David A. Long, Dongsheng Yang, Frederic Weisbecker, Jiri Olsa,
Masami Hiramatsu, Mike Galbraith, Namhyung Kim, Oleg Nesterov,
Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Srikar Dronamraju,
stable, Stephane Eranian, Steven Rostedt, systemtap,
yrl.pp-manager.tt, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
>
> Hi Ingo,
>
> This one has the 34 out of 35 patches from the previous pull req, removing
> the 'perf stat' one about not printing stats for workloads we failed to start, that
> requires more thinking and introduced a regression.
>
> I'm suppressing those first 34 patches, they are unchanged from last pull
> req.
>
> Please consider pulling, the next one probably will be in 2014 :-)
>
> Best Regards and happy holidays!
>
> - Arnaldo
>
> The following changes since commit fa6e8e5f7cbf85f364ebd5a90525dbbe9de2083b:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-12-18 14:07:26 +0100)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
>
> for you to fetch changes up to 74cf249d5cf7de84c88cca69a2f13b13d500ff94:
>
> perf tools: Use zfree to help detect use after free bugs (2013-12-27 17:08:19 -0300)
>
> ----------------------------------------------------------------
> User visible changes:
>
> Improvements:
>
> . Support showing source code, asking for variables to be collected
> at probe time and other 'perf probe' operations that use DWARF information.
>
> This supports only binaries with debugging information at this time, detached
> debuginfo (aka debuginfo packages) support should come in later patches.
> (Masami Hiramatsu)
>
> . Add a perf.data file header window in the 'perf report' TUI, associated
> with the 'i' hotkey, providing a counterpart to the --header option in the
> stdio UI. (Namhyung Kim)
>
> . Guest related improvements to 'perf kvm', including allowing to
> specify a directory with guest specific /proc information. (Dongsheng Yang)
>
> . Print session information only if --stdio is given (Namhyung Kim)
>
> Developer stuff:
>
> Fixes:
>
> . Get rid of a duplicate va_end() in error reporting (Namhyung Kim)
>
> . If a hist entry doesn't have symbol information, compare it with its
> address. Affects upcoming new feature (--cumulate) (Namhyung Kim)
>
> Improvements:
>
> . Make libtraceevent install target quieter (Jiri Olsa)
>
> . Make tests/make output more compact (Jiri Olsa)
>
> . Ignore generated files in feature-checks (Chunwei Chen)
>
> New APIs:
>
> . Introduce pevent_filter_strerror() in libtraceevent, similar in
> purpose to libc's strerror() function. (Namhyung Kim)
>
> Refactorings:
>
> . Use perf_data_file methods to write output file in 'record' and
> 'inject' (Jiri Olsa)
>
> . Use pr_*() functions where applicable in 'report' (Namhyumg Kim)
>
> . Add 'machine' 'addr_location' struct to have full picture (machine,
> thread, map, symbol, addr) for a (partially) resolved address, reducing
> function signatures (Arnaldo Carvalho de Melo)
>
> . Reduce code duplication in the histogram entry creation/insertion. (Arnaldo Carvalho de Melo)
>
> . Auto allocate annotation histogram data structures, (Arnaldo Carvalho de Melo)
>
> . No need to test against NULL before calling free, also set
> freed memory in struct pointers to NULL, to help fixing use after
> free bugs. (Arnaldo Carvalho de Melo>
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (19):
> perf annotate: Auto allocate symbol per addr hist buckets
> perf hists: Leave symbol addr hist bucket auto alloc to symbol layer
> perf annotate: Add inc_samples method to addr_map_symbol
> perf top: Use hist_entry__inc_addr_sample
> perf annotate: Adopt methods from hists
> perf annotate: Make symbol__inc_addr_samples private
> perf report: Introduce helpers for processing callchains
> perf record: Simplify perf_record__write
> perf record: Rename 'perf_record' to plain 'record'
> perf tools: Rename 'perf_record_opts' to 'record_opts
> perf report: Rename 'perf_report' to 'report'
> perf ui browser: Remove misplaced __maybe_unused
> perf scripting python: Shorten function signatures
> perf scripting perl: Shorten function signatures
> perf mem: Remove unused parameter from dump_raw_samples()
> perf symbols: Add 'machine' member to struct addr_location
> perf tools: No need to test against NULL before calling free()
> perf tools: Introduce zfree
> perf tools: Use zfree to help detect use after free bugs
>
> Chunwei Chen (1):
> perf config: Ignore generated files in feature-checks
>
> Dongsheng Yang (6):
> perf kvm: Fix kvm report without guestmount.
> perf tools: Add support for PERF_RECORD_MISC_GUEST_USER in thread__find_addr_map().
> perf tools: Find the proc info under machine->root_dir.
> perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest.
> perf tools: Use machine->pid for tgid if machine is guest.
> perf tools: Do not synthesize the treads of default guest.
>
> Jiri Olsa (11):
> perf inject: Handle output file via perf_data_file object
> perf record: Use perf_data_file__write for output file
> perf tests: Factor make install tests
> perf tools: Making QUIET_(CLEAN|INSTAL) variables global
> tools lib traceevent: Remove print_app_build variable
> tools lib traceevent: Use global QUIET_CC build output
> tools lib traceevent: Add global QUIET_CC_FPIC build output
> tools lib traceevent: Use global QUIET_LINK build output
> tools lib traceevent: Use global QUIET_INSTALL build output
> tools lib traceevent: Use global QUIET_CLEAN build output
> tools lib traceevent: Use global 'O' processing code
>
> Masami Hiramatsu (2):
> perf probe: Expand given path to absolute path
> perf probe: Support basic dwarf-based operations on uprobe events
>
> Namhyung Kim (10):
> perf sort: Compare addresses if no symbol info
> perf sort: Do not compare dso again
> perf hists: Do not pass period and weight to add_hist_entry()
> tools lib traceevent: Introduce pevent_filter_strerror()
> perf tools: Get rid of a duplicate va_end() in error reporting routine
> perf report: Use pr_*() functions where applicable
> perf report: Print session information only if --stdio is given
> perf ui/tui: Protect windows by ui__lock
> perf ui/tui: Split help message for perf top and report
> perf ui/tui: Implement header window
>
> tools/lib/traceevent/Makefile | 85 +++----
> tools/lib/traceevent/event-parse.c | 17 +-
> tools/lib/traceevent/event-parse.h | 7 +-
> tools/lib/traceevent/parse-filter.c | 98 ++++----
> tools/perf/Makefile.perf | 1 +
> tools/perf/arch/common.c | 3 +-
> tools/perf/builtin-annotate.c | 13 +-
> tools/perf/builtin-diff.c | 2 +-
> tools/perf/builtin-inject.c | 65 +++---
> tools/perf/builtin-kvm.c | 6 +-
> tools/perf/builtin-mem.c | 5 +-
> tools/perf/builtin-probe.c | 17 +-
> tools/perf/builtin-record.c | 94 ++++----
> tools/perf/builtin-report.c | 259 +++++++--------------
> tools/perf/builtin-sched.c | 2 +-
> tools/perf/builtin-script.c | 22 +-
> tools/perf/builtin-stat.c | 6 +-
> tools/perf/builtin-timechart.c | 3 +-
> tools/perf/builtin-top.c | 23 +-
> tools/perf/builtin-trace.c | 14 +-
> tools/perf/config/Makefile | 6 +-
> tools/perf/config/feature-checks/.gitignore | 2 +
> tools/perf/config/feature-checks/Makefile | 110 ++++-----
> tools/perf/config/utilities.mak | 7 -
> tools/perf/perf.h | 2 +-
> tools/perf/tests/code-reading.c | 2 +-
> tools/perf/tests/keep-tracking.c | 2 +-
> tools/perf/tests/make | 38 ++-
> tools/perf/tests/open-syscall-tp-fields.c | 2 +-
> tools/perf/tests/perf-record.c | 2 +-
> tools/perf/tests/perf-time-to-tsc.c | 2 +-
> tools/perf/ui/browser.c | 8 +-
> tools/perf/ui/browser.h | 2 +
> tools/perf/ui/browsers/header.c | 127 ++++++++++
> tools/perf/ui/browsers/hists.c | 63 +++--
> tools/perf/ui/browsers/scripts.c | 3 +-
> tools/perf/ui/gtk/util.c | 3 +-
> tools/perf/ui/stdio/hist.c | 2 +-
> tools/perf/ui/tui/util.c | 19 +-
> tools/perf/util/alias.c | 6 +-
> tools/perf/util/annotate.c | 73 ++++--
> tools/perf/util/annotate.h | 9 +-
> tools/perf/util/callchain.h | 2 +-
> tools/perf/util/cgroup.c | 2 +-
> tools/perf/util/comm.c | 2 +-
> tools/perf/util/debug.c | 1 -
> tools/perf/util/dso.c | 9 +-
> tools/perf/util/event.c | 45 ++--
> tools/perf/util/evlist.c | 9 +-
> tools/perf/util/evlist.h | 7 +-
> tools/perf/util/evsel.c | 17 +-
> tools/perf/util/evsel.h | 4 +-
> tools/perf/util/header.c | 15 +-
> tools/perf/util/help.c | 7 +-
> tools/perf/util/hist.c | 27 +--
> tools/perf/util/hist.h | 3 -
> tools/perf/util/machine.c | 12 +-
> tools/perf/util/parse-events.c | 8 +-
> tools/perf/util/pmu.c | 2 +-
> tools/perf/util/probe-event.c | 234 +++++++++++++------
> tools/perf/util/probe-event.h | 1 +
> tools/perf/util/probe-finder.c | 33 +--
> tools/perf/util/record.c | 9 +-
> .../perf/util/scripting-engines/trace-event-perl.c | 22 +-
> .../util/scripting-engines/trace-event-python.c | 28 +--
> tools/perf/util/session.c | 33 +--
> tools/perf/util/session.h | 2 +-
> tools/perf/util/sort.c | 22 +-
> tools/perf/util/srcline.c | 6 +-
> tools/perf/util/strbuf.c | 2 +-
> tools/perf/util/strfilter.c | 2 +-
> tools/perf/util/string.c | 2 +-
> tools/perf/util/strlist.c | 3 +-
> tools/perf/util/svghelper.c | 5 +-
> tools/perf/util/symbol-elf.c | 2 +-
> tools/perf/util/symbol-minimal.c | 3 +-
> tools/perf/util/symbol.c | 11 +-
> tools/perf/util/symbol.h | 1 +
> tools/perf/util/thread_map.c | 20 +-
> tools/perf/util/top.c | 2 +-
> tools/perf/util/top.h | 2 +-
> tools/perf/util/trace-event-info.c | 10 +-
> tools/perf/util/trace-event-scripting.c | 3 +-
> tools/perf/util/trace-event.h | 1 -
> tools/perf/util/util.h | 2 +
> tools/perf/util/values.c | 14 +-
> tools/scripts/Makefile.include | 4 +
> 87 files changed, 1001 insertions(+), 882 deletions(-)
> create mode 100644 tools/perf/config/feature-checks/.gitignore
> create mode 100644 tools/perf/ui/browsers/header.c
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2014-01-12 16:41 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-27 20:46 [GIT PULL 00/49] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 35/49] perf kvm: Fix kvm report without guestmount Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 36/49] perf tools: Add support for PERF_RECORD_MISC_GUEST_USER in thread__find_addr_map() Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 37/49] perf tools: Find the proc info under machine->root_dir Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 38/49] perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 39/49] perf tools: Use machine->pid for tgid " Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 40/49] perf tools: Do not synthesize the treads of default guest Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 41/49] perf config: Ignore generated files in feature-checks Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 42/49] perf probe: Expand given path to absolute path Arnaldo Carvalho de Melo
2013-12-27 20:46 ` [PATCH 43/49] perf probe: Support basic dwarf-based operations on uprobe events Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 44/49] perf ui/tui: Protect windows by ui__lock Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 45/49] perf ui/tui: Split help message for perf top and report Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 46/49] perf ui/tui: Implement header window Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 47/49] perf tools: No need to test against NULL before calling free() Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 48/49] perf tools: Introduce zfree Arnaldo Carvalho de Melo
2013-12-27 20:47 ` [PATCH 49/49] perf tools: Use zfree to help detect use after free bugs Arnaldo Carvalho de Melo
2014-01-12 16:41 ` [GIT PULL 00/49] perf/core improvements and fixes Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.