linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 00/13] perf tools: Various fixes
@ 2016-01-07  9:13 Jiri Olsa
  2016-01-07  9:13 ` [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions Jiri Olsa
                   ` (12 more replies)
  0 siblings, 13 replies; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

hi,
sending several changes together:
  - leftover for the stat enable/disable changes with Adrian's patch
  - fixes for issues Noel found with DWARF unwind
  - asorted small fixes

v2 changes:
  - store data mmaps automaticaly for dwarf unwind,
    not unconditionaly [Namhyung]

Also available in:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/fixes

thanks,
jirka


---
Adrian Hunter (1):
      perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does)

Jiri Olsa (11):
      perf tools: Remove perf_evlist__(enable|disable)_event functions
      perf tools: Use find_map function in access_dso_mem
      perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree
      perf tools libdw: Check for mmaps also in MAP__VARIABLE tree
      perf record: Store data mmaps for dwarf unwind
      perf tools: Do not show trace command if it's not compiled in
      perf script: Align event name properly
      perf tools: Include all tools/lib directory for tags/cscope/TAGS targets
      perf tools: Remove list entry from struct sort_entry
      perf tools: Add overhead/overhead_children keys defaults via string
      perf diff: Use perf_hpp__register_sort_field interface

Namhyung Kim (1):
      perf tools: Export a couple of hist functions

 tools/perf/Makefile.perf             |  2 +-
 tools/perf/arch/x86/util/intel-bts.c |  4 ++--
 tools/perf/arch/x86/util/intel-pt.c  |  4 ++--
 tools/perf/builtin-diff.c            |  2 +-
 tools/perf/builtin-record.c          |  1 +
 tools/perf/builtin-script.c          | 24 ++++++++++++++++++++++--
 tools/perf/command-list.txt          |  2 +-
 tools/perf/tests/keep-tracking.c     |  2 +-
 tools/perf/tests/switch-tracking.c   |  6 +++---
 tools/perf/ui/hist.c                 | 12 ------------
 tools/perf/util/evlist.c             | 44 +-------------------------------------------
 tools/perf/util/evlist.h             |  4 ----
 tools/perf/util/generate-cmdlist.sh  | 15 +++++++++++++++
 tools/perf/util/hist.c               | 19 ++++++++++++-------
 tools/perf/util/hist.h               |  5 +++++
 tools/perf/util/sort.c               | 39 +++++++++++++++++++++++++++++++++++++++
 tools/perf/util/sort.h               |  2 --
 tools/perf/util/unwind-libdw.c       | 10 ++++++++++
 tools/perf/util/unwind-libunwind.c   | 20 ++++++++++++++------
 19 files changed, 130 insertions(+), 87 deletions(-)

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
@ 2016-01-07  9:13 ` Jiri Olsa
  2016-01-09 16:40   ` [tip:perf/core] perf evlist: Remove perf_evlist__(enable|disable) _event functions tip-bot for Jiri Olsa
  2016-01-07  9:13 ` [PATCH 02/13] perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does) Jiri Olsa
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

Replacing them with perf_evsel__(enable|disable).

Link: http://lkml.kernel.org/n/tip-bbyjpha9wc4ifn0ebfkm0mnl@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/arch/x86/util/intel-bts.c |  4 ++--
 tools/perf/arch/x86/util/intel-pt.c  |  4 ++--
 tools/perf/tests/keep-tracking.c     |  2 +-
 tools/perf/tests/switch-tracking.c   |  6 +++---
 tools/perf/util/evlist.c             | 42 ------------------------------------
 tools/perf/util/evlist.h             |  4 ----
 6 files changed, 8 insertions(+), 54 deletions(-)

diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
index 9b94ce520917..8d8150f1cf9b 100644
--- a/tools/perf/arch/x86/util/intel-bts.c
+++ b/tools/perf/arch/x86/util/intel-bts.c
@@ -327,7 +327,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evlist__disable_event(btsr->evlist, evsel);
+			return perf_evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
@@ -340,7 +340,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evlist__enable_event(btsr->evlist, evsel);
+			return perf_evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index b64d46285ebb..f05daacc9e78 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -725,7 +725,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evlist__disable_event(ptr->evlist, evsel);
+			return perf_evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
@@ -738,7 +738,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evlist__enable_event(ptr->evlist, evsel);
+			return perf_evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index a337a6da1f39..7b27943ecfef 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -124,7 +124,7 @@ int test__keep_tracking(int subtest __maybe_unused)
 
 	evsel = perf_evlist__last(evlist);
 
-	CHECK__(perf_evlist__disable_event(evlist, evsel));
+	CHECK__(perf_evsel__disable(evsel));
 
 	comm = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index dfbd8d69ce89..ebd80168d51e 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -455,7 +455,7 @@ int test__switch_tracking(int subtest __maybe_unused)
 
 	perf_evlist__enable(evlist);
 
-	err = perf_evlist__disable_event(evlist, cpu_clocks_evsel);
+	err = perf_evsel__disable(cpu_clocks_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
@@ -474,7 +474,7 @@ int test__switch_tracking(int subtest __maybe_unused)
 		goto out_err;
 	}
 
-	err = perf_evlist__disable_event(evlist, cycles_evsel);
+	err = perf_evsel__disable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
@@ -500,7 +500,7 @@ int test__switch_tracking(int subtest __maybe_unused)
 		goto out_err;
 	}
 
-	err = perf_evlist__enable_event(evlist, cycles_evsel);
+	err = perf_evsel__enable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index b9eac0daa0b9..05efa910a090 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -365,48 +365,6 @@ void perf_evlist__toggle_enable(struct perf_evlist *evlist)
 	(evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist);
 }
 
-int perf_evlist__disable_event(struct perf_evlist *evlist,
-			       struct perf_evsel *evsel)
-{
-	int cpu, thread, err;
-	int nr_cpus = cpu_map__nr(evlist->cpus);
-	int nr_threads = perf_evlist__nr_threads(evlist, evsel);
-
-	if (!evsel->fd)
-		return 0;
-
-	for (cpu = 0; cpu < nr_cpus; cpu++) {
-		for (thread = 0; thread < nr_threads; thread++) {
-			err = ioctl(FD(evsel, cpu, thread),
-				    PERF_EVENT_IOC_DISABLE, 0);
-			if (err)
-				return err;
-		}
-	}
-	return 0;
-}
-
-int perf_evlist__enable_event(struct perf_evlist *evlist,
-			      struct perf_evsel *evsel)
-{
-	int cpu, thread, err;
-	int nr_cpus = cpu_map__nr(evlist->cpus);
-	int nr_threads = perf_evlist__nr_threads(evlist, evsel);
-
-	if (!evsel->fd)
-		return -EINVAL;
-
-	for (cpu = 0; cpu < nr_cpus; cpu++) {
-		for (thread = 0; thread < nr_threads; thread++) {
-			err = ioctl(FD(evsel, cpu, thread),
-				    PERF_EVENT_IOC_ENABLE, 0);
-			if (err)
-				return err;
-		}
-	}
-	return 0;
-}
-
 static int perf_evlist__enable_event_cpu(struct perf_evlist *evlist,
 					 struct perf_evsel *evsel, int cpu)
 {
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 139a50038097..25c6c824d870 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -152,10 +152,6 @@ void perf_evlist__disable(struct perf_evlist *evlist);
 void perf_evlist__enable(struct perf_evlist *evlist);
 void perf_evlist__toggle_enable(struct perf_evlist *evlist);
 
-int perf_evlist__disable_event(struct perf_evlist *evlist,
-			       struct perf_evsel *evsel);
-int perf_evlist__enable_event(struct perf_evlist *evlist,
-			      struct perf_evsel *evsel);
 int perf_evlist__enable_event_idx(struct perf_evlist *evlist,
 				  struct perf_evsel *evsel, int idx);
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 02/13] perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does)
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
  2016-01-07  9:13 ` [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions Jiri Olsa
@ 2016-01-07  9:13 ` Jiri Olsa
  2016-01-09 16:40   ` [tip:perf/core] perf evlist: " tip-bot for Adrian Hunter
  2016-01-07  9:14 ` [PATCH 03/13] perf tools: Use find_map function in access_dso_mem Jiri Olsa
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

From: Adrian Hunter <adrian.hunter@intel.com>

'perf record' uses perf_evsel__open() to open events and passes the evsel->cpus
and evsel->threads.  Many tests and some tools instead use perf_evlist__open()
which passes instead evlist->cpus and evlist->threads.

Make perf_evlist__open() follow the 'perf record' behaviour so that a consistent
approach is taken.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/evlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 05efa910a090..43f4c400a171 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1428,7 +1428,7 @@ int perf_evlist__open(struct perf_evlist *evlist)
 	perf_evlist__update_id_pos(evlist);
 
 	evlist__for_each(evlist, evsel) {
-		err = perf_evsel__open(evsel, evlist->cpus, evlist->threads);
+		err = perf_evsel__open(evsel, evsel->cpus, evsel->threads);
 		if (err < 0)
 			goto out_err;
 	}
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 03/13] perf tools: Use find_map function in access_dso_mem
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
  2016-01-07  9:13 ` [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions Jiri Olsa
  2016-01-07  9:13 ` [PATCH 02/13] perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does) Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:41   ` [tip:perf/core] perf unwind: " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree Jiri Olsa
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

The find_map helper is already there, so let's use it.

Also we're going to introduce wider search in following
patch, so it'll be easier to make this change on single
place.

Tested-by: Noel Grandin <noelgrandin@gmail.com>
Link: http://lkml.kernel.org/n/tip-9grtz49b9i4ysfzmuf9z5txj@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/unwind-libunwind.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 3c258a0e4092..f37859c04317 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -416,20 +416,19 @@ get_proc_name(unw_addr_space_t __maybe_unused as,
 static int access_dso_mem(struct unwind_info *ui, unw_word_t addr,
 			  unw_word_t *data)
 {
-	struct addr_location al;
+	struct map *map;
 	ssize_t size;
 
-	thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
-			      MAP__FUNCTION, addr, &al);
-	if (!al.map) {
+	map = find_map(addr, ui);
+	if (!map) {
 		pr_debug("unwind: no map for %lx\n", (unsigned long)addr);
 		return -1;
 	}
 
-	if (!al.map->dso)
+	if (!map->dso)
 		return -1;
 
-	size = dso__data_read_addr(al.map->dso, al.map, ui->machine,
+	size = dso__data_read_addr(map->dso, map, ui->machine,
 				   addr, (u8 *) data, sizeof(*data));
 
 	return !(size == sizeof(*data));
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (2 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 03/13] perf tools: Use find_map function in access_dso_mem Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:41   ` [tip:perf/core] perf unwind: " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 05/13] perf tools libdw: " Jiri Olsa
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

We've seen cases (softice) where DWARF unwinder went
through non executable mmaps, which we need to lookup
in MAP__VARIABLE tree.

Reported-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Link: http://lkml.kernel.org/n/tip-@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/unwind-libunwind.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index f37859c04317..ee7e372297e5 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -319,6 +319,15 @@ static struct map *find_map(unw_word_t ip, struct unwind_info *ui)
 
 	thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
 			      MAP__FUNCTION, ip, &al);
+	if (!al.map) {
+		/*
+		 * We've seen cases (softice) where DWARF unwinder went
+		 * through non executable mmaps, which we need to lookup
+		 * in MAP__VARIABLE tree.
+		 */
+		thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
+				      MAP__VARIABLE, ip, &al);
+	}
 	return al.map;
 }
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 05/13] perf tools libdw: Check for mmaps also in MAP__VARIABLE tree
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (3 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:41   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 06/13] perf record: Store data mmaps for dwarf unwind Jiri Olsa
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

We've seen cases (softice) where DWARF unwinder went
through non executable mmaps, which we need to lookup
in MAP__VARIABLE tree.

Reported-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Link: http://lkml.kernel.org/n/tip-pd37evgxxggiu5sfomog8gtw@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/unwind-libdw.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index db8142ba7cb9..cf5e250bc78e 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -96,6 +96,16 @@ static int access_dso_mem(struct unwind_info *ui, Dwarf_Addr addr,
 	thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
 			      MAP__FUNCTION, addr, &al);
 	if (!al.map) {
+		/*
+		 * We've seen cases (softice) where DWARF unwinder went
+		 * through non executable mmaps, which we need to lookup
+		 * in MAP__VARIABLE tree.
+		 */
+		thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
+				      MAP__VARIABLE, addr, &al);
+	}
+
+	if (!al.map) {
 		pr_debug("unwind: no map for %lx\n", (unsigned long)addr);
 		return -1;
 	}
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 06/13] perf record: Store data mmaps for dwarf unwind
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (4 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 05/13] perf tools libdw: " Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-07 11:12   ` Namhyung Kim
  2016-01-07  9:14 ` [PATCH 07/13] perf tools: Do not show trace command if it's not compiled in Jiri Olsa
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

Currently we don't synthesize data mmap by default. It depends
on -d option, that enables data address sampling.

But we've seen cases (softice) where DWARF unwinder went through
non executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Making data mmaps to be synthesized for dwarf unwind as well.

Reported-by: Noel Grandin <noelgrandin@gmail.com>
Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-record.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 9c5cdc2c4471..920b93edb497 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -804,6 +804,7 @@ int record_parse_callchain_opt(const struct option *opt,
 	int ret;
 	struct record_opts *record = (struct record_opts *)opt->value;
 
+	record->sample_address = true;
 	record->callgraph_set = true;
 	callchain_param.enabled = !unset;
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 07/13] perf tools: Do not show trace command if it's not compiled in
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (5 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 06/13] perf record: Store data mmaps for dwarf unwind Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:37   ` [tip:perf/core] perf tools: Do not show trace command if it' s " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 08/13] perf script: Align event name properly Jiri Olsa
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

The trace command still appears in help message when you
run simple 'perf' command.

It's because the generate-cmdlist.sh does not care about the
HAVE_LIBAUDIT_SUPPORT dependency of trace command and puts
it into generated common_cmds array.

Wrapping trace command under HAVE_LIBAUDIT_SUPPORT dependency,
which will exclude it from common_cmds array if HAVE_LIBAUDIT_SUPPORT
is not set.

Link: http://lkml.kernel.org/n/tip-eys6x7vq4y9363s2wkjwan3k@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/command-list.txt         |  2 +-
 tools/perf/util/generate-cmdlist.sh | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/tools/perf/command-list.txt b/tools/perf/command-list.txt
index acc3ea7d90b7..ab5cbaa170d0 100644
--- a/tools/perf/command-list.txt
+++ b/tools/perf/command-list.txt
@@ -26,4 +26,4 @@ perf-stat			mainporcelain common
 perf-test			mainporcelain common
 perf-timechart			mainporcelain common
 perf-top			mainporcelain common
-perf-trace			mainporcelain common
+perf-trace			mainporcelain audit
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 36a885d2cd22..0ac2037c970c 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -36,4 +36,19 @@ do
      }' "Documentation/perf-$cmd.txt"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
+
+echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* audit*/\1/p' command-list.txt |
+sort |
+while read cmd
+do
+     sed -n '
+     /^NAME/,/perf-'"$cmd"'/H
+     ${
+            x
+            s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
+	    p
+     }' "Documentation/perf-$cmd.txt"
+done
+echo "#endif /* HAVE_LIBELF_SUPPORT */"
 echo "};"
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 08/13] perf script: Align event name properly
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (6 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 07/13] perf tools: Do not show trace command if it's not compiled in Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 09/13] perf tools: Include all tools/lib directory for tags/cscope/TAGS targets Jiri Olsa
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

Adding code to align event names, so we get aligned output
in case of multiple events with different names.

Before:
  $ perf script
  :13757 13757 163918.230829: cpu/mem-snp-none/P: ffff88085f20d010
  :13757 13757 163918.230832: cpu/mem-loads,ldlat=30/P:     7f5a5f719f00
  :13757 13757 163918.230835: cpu/mem-loads,ldlat=30/P:     7f5a5f719f00
  :13758 13758 163918.230838: cpu/mem-snp-none/P: ffff88085f4ad810
  :13758 13758 163918.154093: cpu/mem-stores/P: ffff88085bb53f28
  :13757 13757 163918.155264: cpu/mem-snp-hitm/P:           601080
  ...

After:
  $ perf script
  :13757 13757 163918.228831:       cpu/mem-snp-none/P: ffffffff81a841c0
  :13757 13757 163918.228834: cpu/mem-loads,ldlat=30/P:     7f5a5f719f08
  :13757 13757 163918.228837: cpu/mem-loads,ldlat=30/P:     7f5a5f719f08
  :13758 13758 163918.228837:       cpu/mem-snp-none/P: ffff88085f4ad800
  :13758 13758 163918.154093:         cpu/mem-stores/P: ffff88085bb53f28
  :13757 13757 163918.155264:       cpu/mem-snp-hitm/P:           601080
  ...

Acked-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/n/tip-hsrwmiogt9menjsg7uaxqvq2@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-script.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 5e2f9d20a296..c691214d820f 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -617,9 +617,24 @@ struct perf_script {
 	bool			allocated;
 	struct cpu_map		*cpus;
 	struct thread_map	*threads;
+	int			name_width;
 };
 
-static void process_event(struct perf_script *script __maybe_unused, union perf_event *event,
+static int perf_evlist__max_name_len(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel;
+	int max = 0;
+
+	evlist__for_each(evlist, evsel) {
+		int len = strlen(perf_evsel__name(evsel));
+
+		max = MAX(len, max);
+	}
+
+	return max;
+}
+
+static void process_event(struct perf_script *script, union perf_event *event,
 			  struct perf_sample *sample, struct perf_evsel *evsel,
 			  struct addr_location *al)
 {
@@ -636,7 +651,12 @@ static void process_event(struct perf_script *script __maybe_unused, union perf_
 
 	if (PRINT_FIELD(EVNAME)) {
 		const char *evname = perf_evsel__name(evsel);
-		printf("%s: ", evname ? evname : "[unknown]");
+
+		if (!script->name_width)
+			script->name_width = perf_evlist__max_name_len(script->session->evlist);
+
+		printf("%*s: ", script->name_width,
+		       evname ? evname : "[unknown]");
 	}
 
 	if (print_flags)
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 09/13] perf tools: Include all tools/lib directory for tags/cscope/TAGS targets
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (7 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 08/13] perf script: Align event name properly Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:38   ` [tip:perf/core] perf tools: Include all tools/ lib " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 10/13] perf tools: Remove list entry from struct sort_entry Jiri Olsa
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

Besides lockdep we use all the 'tools/lib' code in perf,
so include it completely in tags.

Link: http://lkml.kernel.org/n/tip-ifg26o4gy40i3aeq95xvj67r@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 404e3b1c4e31..1025ea79b90b 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -488,7 +488,7 @@ INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
 $(DOC_TARGETS):
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
 
-TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol ../include ../lib/bpf
+TAG_FOLDERS= . ../lib ../include
 TAG_FILES= ../../include/uapi/linux/perf_event.h
 
 TAGS:
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 10/13] perf tools: Remove list entry from struct sort_entry
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (8 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 09/13] perf tools: Include all tools/lib directory for tags/cscope/TAGS targets Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-07 11:13   ` Namhyung Kim
  2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string Jiri Olsa
                   ` (2 subsequent siblings)
  12 siblings, 2 replies; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

It's no longer needed.

Link: http://lkml.kernel.org/n/tip-geutga492nuhc5d8rncw8834@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/sort.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index dec536b6ab3d..687bbb124428 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -214,8 +214,6 @@ enum sort_type {
  */
 
 struct sort_entry {
-	struct list_head list;
-
 	const char *se_header;
 
 	int64_t (*se_cmp)(struct hist_entry *, struct hist_entry *);
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (9 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 10/13] perf tools: Remove list entry from struct sort_entry Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-07 11:17   ` Namhyung Kim
  2016-01-09 16:39   ` [tip:perf/core] perf tools: Add overhead/ overhead_children " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface Jiri Olsa
  2016-01-07  9:14 ` [PATCH 13/13] perf tools: Export a couple of hist functions Jiri Olsa
  12 siblings, 2 replies; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

We currently set 'overhead' and 'overhead_children'
as default sort keys within perf_hpp__init function
by directly adding into the sort list.

This patch adds 'overhead' and 'overhead_children'
in text form into sort_keys and let them be added
by standard sort dimension interface.

We need to eliminate dirrect sort_list additions to
b able to add support for hists specific sort keys.

Link: http://lkml.kernel.org/n/tip-thk6jds1pi6j2jy82ywnxniy@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/ui/hist.c   | 12 ------------
 tools/perf/util/sort.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 8263c0eb9fb5..bf2a66e254ea 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -443,7 +443,6 @@ LIST_HEAD(perf_hpp__sort_list);
 
 void perf_hpp__init(void)
 {
-	struct list_head *list;
 	int i;
 
 	for (i = 0; i < PERF_HPP__MAX_INDEX; i++) {
@@ -484,17 +483,6 @@ void perf_hpp__init(void)
 
 	if (symbol_conf.show_total_period)
 		hpp_dimension__add_output(PERF_HPP__PERIOD);
-
-	/* prepend overhead field for backward compatiblity.  */
-	list = &perf_hpp__format[PERF_HPP__OVERHEAD].sort_list;
-	if (list_empty(list))
-		list_add(list, &perf_hpp__sort_list);
-
-	if (symbol_conf.cumulate_callchain) {
-		list = &perf_hpp__format[PERF_HPP__OVERHEAD_ACC].sort_list;
-		if (list_empty(list))
-			list_add(list, &perf_hpp__sort_list);
-	}
 }
 
 void perf_hpp__column_register(struct perf_hpp_fmt *format)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 04e2a5cb19e3..ec722346e6ff 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2252,6 +2252,34 @@ static int setup_sort_order(struct perf_evlist *evlist)
 	return 0;
 }
 
+/*
+ * Adds 'pre,' prefix into 'str' is 'pre' is
+ * not already part of 'str'.
+ */
+static char *prefix_if_not_in(const char *pre, char *str)
+{
+	char *n;
+
+	if (!str || strstr(str, pre))
+		return str;
+
+	if (asprintf(&n, "%s,%s", pre, str) < 0)
+		return NULL;
+
+	free(str);
+	return n;
+}
+
+static char *setup_overhead(char *keys)
+{
+	keys = prefix_if_not_in("overhead", keys);
+
+	if (symbol_conf.cumulate_callchain)
+		keys = prefix_if_not_in("overhead_children", keys);
+
+	return keys;
+}
+
 static int __setup_sorting(struct perf_evlist *evlist)
 {
 	char *tmp, *tok, *str;
@@ -2281,6 +2309,17 @@ static int __setup_sorting(struct perf_evlist *evlist)
 		return -ENOMEM;
 	}
 
+	/*
+	 * Prepend overhead fields for backward compatibility.
+	 */
+	if (!is_strict_order(field_order)) {
+		str = setup_overhead(str);
+		if (str == NULL) {
+			error("Not enough memory to setup overhead keys");
+			return -ENOMEM;
+		}
+	}
+
 	for (tok = strtok_r(str, ", ", &tmp);
 			tok; tok = strtok_r(NULL, ", ", &tmp)) {
 		ret = sort_dimension__add(tok, evlist);
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (10 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-07 11:17   ` Namhyung Kim
  2016-01-09 16:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2016-01-07  9:14 ` [PATCH 13/13] perf tools: Export a couple of hist functions Jiri Olsa
  12 siblings, 2 replies; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

Using perf_hpp__register_sort_field interface
instead of directly adding the entry.

Link: http://lkml.kernel.org/n/tip-m1vdmvod7vcbdit0ix7bjp7z@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-diff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 87063835d741..36ccc2b8827f 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1207,7 +1207,7 @@ static int ui_init(void)
 		BUG_ON(1);
 	}
 
-	list_add(&fmt->sort_list, &perf_hpp__sort_list);
+	perf_hpp__register_sort_field(fmt);
 	return 0;
 }
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 13/13] perf tools: Export a couple of hist functions
  2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
                   ` (11 preceding siblings ...)
  2016-01-07  9:14 ` [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface Jiri Olsa
@ 2016-01-07  9:14 ` Jiri Olsa
  2016-01-09 16:39   ` [tip:perf/core] perf hists: " tip-bot for Namhyung Kim
  12 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07  9:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Noel Grandin, Adrian Hunter

From: Namhyung Kim <namhyung@kernel.org>

These are necessary for multi threaded sample processing:

 - hists__get__get_rotate_entries_in()
 - hists__collapse_insert_entry()
 - __hists__init()

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/hist.c | 19 ++++++++++++-------
 tools/perf/util/hist.h |  5 +++++
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index afc9b8f1b36c..f2d5c5c287c4 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1006,9 +1006,8 @@ void hist_entry__delete(struct hist_entry *he)
  * collapse the histogram
  */
 
-static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
-					 struct rb_root *root,
-					 struct hist_entry *he)
+bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
+				  struct rb_root *root, struct hist_entry *he)
 {
 	struct rb_node **p = &root->rb_node;
 	struct rb_node *parent = NULL;
@@ -1048,7 +1047,7 @@ static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
 	return true;
 }
 
-static struct rb_root *hists__get_rotate_entries_in(struct hists *hists)
+struct rb_root *hists__get_rotate_entries_in(struct hists *hists)
 {
 	struct rb_root *root;
 
@@ -1583,10 +1582,8 @@ int perf_hist_config(const char *var, const char *value)
 	return 0;
 }
 
-static int hists_evsel__init(struct perf_evsel *evsel)
+int __hists__init(struct hists *hists)
 {
-	struct hists *hists = evsel__hists(evsel);
-
 	memset(hists, 0, sizeof(*hists));
 	hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT;
 	hists->entries_in = &hists->entries_in_array[0];
@@ -1626,6 +1623,14 @@ static void hists_evsel__exit(struct perf_evsel *evsel)
 	hists__delete_all_entries(hists);
 }
 
+static int hists_evsel__init(struct perf_evsel *evsel)
+{
+	struct hists *hists = evsel__hists(evsel);
+
+	__hists__init(hists);
+	return 0;
+}
+
 /*
  * XXX We probably need a hists_evsel__exit() to free the hist_entries
  * stored in the rbtree...
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index cb8f37349972..d4ec4822a103 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -185,6 +185,11 @@ static inline struct hists *evsel__hists(struct perf_evsel *evsel)
 }
 
 int hists__init(void);
+int __hists__init(struct hists *hists);
+
+struct rb_root *hists__get_rotate_entries_in(struct hists *hists);
+bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
+				  struct rb_root *root, struct hist_entry *he);
 
 struct perf_hpp {
 	char *buf;
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH 06/13] perf record: Store data mmaps for dwarf unwind
  2016-01-07  9:14 ` [PATCH 06/13] perf record: Store data mmaps for dwarf unwind Jiri Olsa
@ 2016-01-07 11:12   ` Namhyung Kim
  2016-01-07 12:39     ` [PATCHv2 " Jiri Olsa
  0 siblings, 1 reply; 35+ messages in thread
From: Namhyung Kim @ 2016-01-07 11:12 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 10:14:03AM +0100, Jiri Olsa wrote:
> Currently we don't synthesize data mmap by default. It depends
> on -d option, that enables data address sampling.
> 
> But we've seen cases (softice) where DWARF unwinder went through
> non executable mmaps, which we need to lookup in MAP__VARIABLE tree.
> 
> Making data mmaps to be synthesized for dwarf unwind as well.
> 
> Reported-by: Noel Grandin <noelgrandin@gmail.com>
> Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/builtin-record.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 9c5cdc2c4471..920b93edb497 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -804,6 +804,7 @@ int record_parse_callchain_opt(const struct option *opt,
>  	int ret;
>  	struct record_opts *record = (struct record_opts *)opt->value;
>  
> +	record->sample_address = true;

It seems unconditionally set, no?

Thanks,
Namhyung


>  	record->callgraph_set = true;
>  	callchain_param.enabled = !unset;
>  
> -- 
> 2.4.3
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 10/13] perf tools: Remove list entry from struct sort_entry
  2016-01-07  9:14 ` [PATCH 10/13] perf tools: Remove list entry from struct sort_entry Jiri Olsa
@ 2016-01-07 11:13   ` Namhyung Kim
  2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: Namhyung Kim @ 2016-01-07 11:13 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 10:14:07AM +0100, Jiri Olsa wrote:
> It's no longer needed.
> 
> Link: http://lkml.kernel.org/n/tip-geutga492nuhc5d8rncw8834@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/util/sort.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
> index dec536b6ab3d..687bbb124428 100644
> --- a/tools/perf/util/sort.h
> +++ b/tools/perf/util/sort.h
> @@ -214,8 +214,6 @@ enum sort_type {
>   */
>  
>  struct sort_entry {
> -	struct list_head list;
> -
>  	const char *se_header;
>  
>  	int64_t (*se_cmp)(struct hist_entry *, struct hist_entry *);
> -- 
> 2.4.3
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string
  2016-01-07  9:14 ` [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string Jiri Olsa
@ 2016-01-07 11:17   ` Namhyung Kim
  2016-01-09 16:39   ` [tip:perf/core] perf tools: Add overhead/ overhead_children " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: Namhyung Kim @ 2016-01-07 11:17 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 10:14:08AM +0100, Jiri Olsa wrote:
> We currently set 'overhead' and 'overhead_children'
> as default sort keys within perf_hpp__init function
> by directly adding into the sort list.
> 
> This patch adds 'overhead' and 'overhead_children'
> in text form into sort_keys and let them be added
> by standard sort dimension interface.
> 
> We need to eliminate dirrect sort_list additions to
> b able to add support for hists specific sort keys.
> 
> Link: http://lkml.kernel.org/n/tip-thk6jds1pi6j2jy82ywnxniy@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/ui/hist.c   | 12 ------------
>  tools/perf/util/sort.c | 39 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 39 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
> index 8263c0eb9fb5..bf2a66e254ea 100644
> --- a/tools/perf/ui/hist.c
> +++ b/tools/perf/ui/hist.c
> @@ -443,7 +443,6 @@ LIST_HEAD(perf_hpp__sort_list);
>  
>  void perf_hpp__init(void)
>  {
> -	struct list_head *list;
>  	int i;
>  
>  	for (i = 0; i < PERF_HPP__MAX_INDEX; i++) {
> @@ -484,17 +483,6 @@ void perf_hpp__init(void)
>  
>  	if (symbol_conf.show_total_period)
>  		hpp_dimension__add_output(PERF_HPP__PERIOD);
> -
> -	/* prepend overhead field for backward compatiblity.  */
> -	list = &perf_hpp__format[PERF_HPP__OVERHEAD].sort_list;
> -	if (list_empty(list))
> -		list_add(list, &perf_hpp__sort_list);
> -
> -	if (symbol_conf.cumulate_callchain) {
> -		list = &perf_hpp__format[PERF_HPP__OVERHEAD_ACC].sort_list;
> -		if (list_empty(list))
> -			list_add(list, &perf_hpp__sort_list);
> -	}
>  }
>  
>  void perf_hpp__column_register(struct perf_hpp_fmt *format)
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index 04e2a5cb19e3..ec722346e6ff 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -2252,6 +2252,34 @@ static int setup_sort_order(struct perf_evlist *evlist)
>  	return 0;
>  }
>  
> +/*
> + * Adds 'pre,' prefix into 'str' is 'pre' is
> + * not already part of 'str'.
> + */
> +static char *prefix_if_not_in(const char *pre, char *str)
> +{
> +	char *n;
> +
> +	if (!str || strstr(str, pre))
> +		return str;
> +
> +	if (asprintf(&n, "%s,%s", pre, str) < 0)
> +		return NULL;
> +
> +	free(str);
> +	return n;
> +}
> +
> +static char *setup_overhead(char *keys)
> +{
> +	keys = prefix_if_not_in("overhead", keys);
> +
> +	if (symbol_conf.cumulate_callchain)
> +		keys = prefix_if_not_in("overhead_children", keys);
> +
> +	return keys;
> +}
> +
>  static int __setup_sorting(struct perf_evlist *evlist)
>  {
>  	char *tmp, *tok, *str;
> @@ -2281,6 +2309,17 @@ static int __setup_sorting(struct perf_evlist *evlist)
>  		return -ENOMEM;
>  	}
>  
> +	/*
> +	 * Prepend overhead fields for backward compatibility.
> +	 */
> +	if (!is_strict_order(field_order)) {
> +		str = setup_overhead(str);
> +		if (str == NULL) {
> +			error("Not enough memory to setup overhead keys");
> +			return -ENOMEM;
> +		}
> +	}
> +
>  	for (tok = strtok_r(str, ", ", &tmp);
>  			tok; tok = strtok_r(NULL, ", ", &tmp)) {
>  		ret = sort_dimension__add(tok, evlist);
> -- 
> 2.4.3
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface
  2016-01-07  9:14 ` [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface Jiri Olsa
@ 2016-01-07 11:17   ` Namhyung Kim
  2016-01-09 16:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: Namhyung Kim @ 2016-01-07 11:17 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 10:14:09AM +0100, Jiri Olsa wrote:
> Using perf_hpp__register_sort_field interface
> instead of directly adding the entry.
> 
> Link: http://lkml.kernel.org/n/tip-m1vdmvod7vcbdit0ix7bjp7z@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/builtin-diff.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
> index 87063835d741..36ccc2b8827f 100644
> --- a/tools/perf/builtin-diff.c
> +++ b/tools/perf/builtin-diff.c
> @@ -1207,7 +1207,7 @@ static int ui_init(void)
>  		BUG_ON(1);
>  	}
>  
> -	list_add(&fmt->sort_list, &perf_hpp__sort_list);
> +	perf_hpp__register_sort_field(fmt);
>  	return 0;
>  }
>  
> -- 
> 2.4.3
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCHv2 06/13] perf record: Store data mmaps for dwarf unwind
  2016-01-07 11:12   ` Namhyung Kim
@ 2016-01-07 12:39     ` Jiri Olsa
  2016-01-07 13:14       ` Namhyung Kim
  0 siblings, 1 reply; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07 12:39 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo, lkml, David Ahern,
	Ingo Molnar, Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 08:12:39PM +0900, Namhyung Kim wrote:
> On Thu, Jan 07, 2016 at 10:14:03AM +0100, Jiri Olsa wrote:
> > Currently we don't synthesize data mmap by default. It depends
> > on -d option, that enables data address sampling.
> > 
> > But we've seen cases (softice) where DWARF unwinder went through
> > non executable mmaps, which we need to lookup in MAP__VARIABLE tree.
> > 
> > Making data mmaps to be synthesized for dwarf unwind as well.
> > 
> > Reported-by: Noel Grandin <noelgrandin@gmail.com>
> > Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/perf/builtin-record.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> > index 9c5cdc2c4471..920b93edb497 100644
> > --- a/tools/perf/builtin-record.c
> > +++ b/tools/perf/builtin-record.c
> > @@ -804,6 +804,7 @@ int record_parse_callchain_opt(const struct option *opt,
> >  	int ret;
> >  	struct record_opts *record = (struct record_opts *)opt->value;
> >  
> > +	record->sample_address = true;
> 
> It seems unconditionally set, no?

ouch, I missed the unset cond down there.. v2 attached

thanks,
jirka


---
Currently we don't synthesize data mmap by default. It depends
on -d option, that enables data address sampling.

But we've seen cases (softice) where DWARF unwinder went through
non executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Making data mmaps to be synthesized for dwarf unwind as well.

Reported-by: Noel Grandin <noelgrandin@gmail.com>
Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-record.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 9c5cdc2c4471..465bde77f49b 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -815,8 +815,11 @@ int record_parse_callchain_opt(const struct option *opt,
 	}
 
 	ret = parse_callchain_record_opt(arg, &callchain_param);
-	if (!ret)
+	if (!ret) {
+		/* Enable data address sampling for DWARF unwind. */
+		record->sample_address = true;
 		callchain_debug();
+	}
 
 	return ret;
 }
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCHv2 06/13] perf record: Store data mmaps for dwarf unwind
  2016-01-07 12:39     ` [PATCHv2 " Jiri Olsa
@ 2016-01-07 13:14       ` Namhyung Kim
  2016-01-07 13:30         ` [PATCHv3 " Jiri Olsa
  0 siblings, 1 reply; 35+ messages in thread
From: Namhyung Kim @ 2016-01-07 13:14 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo, lkml, David Ahern,
	Ingo Molnar, Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 01:39:28PM +0100, Jiri Olsa wrote:
> Currently we don't synthesize data mmap by default. It depends
> on -d option, that enables data address sampling.
> 
> But we've seen cases (softice) where DWARF unwinder went through
> non executable mmaps, which we need to lookup in MAP__VARIABLE tree.
> 
> Making data mmaps to be synthesized for dwarf unwind as well.
> 
> Reported-by: Noel Grandin <noelgrandin@gmail.com>
> Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/builtin-record.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 9c5cdc2c4471..465bde77f49b 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -815,8 +815,11 @@ int record_parse_callchain_opt(const struct option *opt,
>  	}
>  
>  	ret = parse_callchain_record_opt(arg, &callchain_param);
> -	if (!ret)
> +	if (!ret) {
> +		/* Enable data address sampling for DWARF unwind. */
> +		record->sample_address = true;

How does it guarantee that it enables data address sampling only for
DWARF unwind?  Maybe you want this?

		if (callchain_param.record_mode == CALLCHAIN_DWARF)
			record->sample_address = true;


Thanks,
Namhyung


>  		callchain_debug();
> +	}
>  
>  	return ret;
>  }
> -- 
> 2.4.3
> 

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCHv3 06/13] perf record: Store data mmaps for dwarf unwind
  2016-01-07 13:14       ` Namhyung Kim
@ 2016-01-07 13:30         ` Jiri Olsa
  2016-01-07 20:42           ` Arnaldo Carvalho de Melo
  2016-01-09 16:42           ` [tip:perf/core] " tip-bot for Jiri Olsa
  0 siblings, 2 replies; 35+ messages in thread
From: Jiri Olsa @ 2016-01-07 13:30 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo, lkml, David Ahern,
	Ingo Molnar, Peter Zijlstra, Noel Grandin, Adrian Hunter

On Thu, Jan 07, 2016 at 10:14:14PM +0900, Namhyung Kim wrote:
> On Thu, Jan 07, 2016 at 01:39:28PM +0100, Jiri Olsa wrote:
> > Currently we don't synthesize data mmap by default. It depends
> > on -d option, that enables data address sampling.
> > 
> > But we've seen cases (softice) where DWARF unwinder went through
> > non executable mmaps, which we need to lookup in MAP__VARIABLE tree.
> > 
> > Making data mmaps to be synthesized for dwarf unwind as well.
> > 
> > Reported-by: Noel Grandin <noelgrandin@gmail.com>
> > Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/perf/builtin-record.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> > index 9c5cdc2c4471..465bde77f49b 100644
> > --- a/tools/perf/builtin-record.c
> > +++ b/tools/perf/builtin-record.c
> > @@ -815,8 +815,11 @@ int record_parse_callchain_opt(const struct option *opt,
> >  	}
> >  
> >  	ret = parse_callchain_record_opt(arg, &callchain_param);
> > -	if (!ret)
> > +	if (!ret) {
> > +		/* Enable data address sampling for DWARF unwind. */
> > +		record->sample_address = true;
> 
> How does it guarantee that it enables data address sampling only for
> DWARF unwind?  Maybe you want this?
> 
> 		if (callchain_param.record_mode == CALLCHAIN_DWARF)
> 			record->sample_address = true;

ugh.. too much coofee.. :-\ third time's a charm, v3 attached

thanks,
jirka


---
Currently we don't synthesize data mmap by default. It depends
on -d option, that enables data address sampling.

But we've seen cases (softice) where DWARF unwinder went through
non executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Making data mmaps to be synthesized for dwarf unwind as well.

Reported-by: Noel Grandin <noelgrandin@gmail.com>
Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-record.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 9c5cdc2c4471..dc4e0adf5c5b 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -815,8 +815,12 @@ int record_parse_callchain_opt(const struct option *opt,
 	}
 
 	ret = parse_callchain_record_opt(arg, &callchain_param);
-	if (!ret)
+	if (!ret) {
+		/* Enable data address sampling for DWARF unwind. */
+		if (callchain_param.record_mode == CALLCHAIN_DWARF)
+			record->sample_address = true;
 		callchain_debug();
+	}
 
 	return ret;
 }
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCHv3 06/13] perf record: Store data mmaps for dwarf unwind
  2016-01-07 13:30         ` [PATCHv3 " Jiri Olsa
@ 2016-01-07 20:42           ` Arnaldo Carvalho de Melo
  2016-01-09 16:42           ` [tip:perf/core] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-07 20:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Namhyung Kim, Jiri Olsa, lkml, David Ahern, Ingo Molnar,
	Peter Zijlstra, Noel Grandin, Adrian Hunter

Em Thu, Jan 07, 2016 at 02:30:22PM +0100, Jiri Olsa escreveu:
> On Thu, Jan 07, 2016 at 10:14:14PM +0900, Namhyung Kim wrote:
> > On Thu, Jan 07, 2016 at 01:39:28PM +0100, Jiri Olsa wrote:
> > > Currently we don't synthesize data mmap by default. It depends
> > > on -d option, that enables data address sampling.
> > > 
> > > But we've seen cases (softice) where DWARF unwinder went through
> > > non executable mmaps, which we need to lookup in MAP__VARIABLE tree.
> > > 
> > > Making data mmaps to be synthesized for dwarf unwind as well.
> > > 
> > > Reported-by: Noel Grandin <noelgrandin@gmail.com>
> > > Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
> > > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > > ---
> > >  tools/perf/builtin-record.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> > > index 9c5cdc2c4471..465bde77f49b 100644
> > > --- a/tools/perf/builtin-record.c
> > > +++ b/tools/perf/builtin-record.c
> > > @@ -815,8 +815,11 @@ int record_parse_callchain_opt(const struct option *opt,
> > >  	}
> > >  
> > >  	ret = parse_callchain_record_opt(arg, &callchain_param);
> > > -	if (!ret)
> > > +	if (!ret) {
> > > +		/* Enable data address sampling for DWARF unwind. */
> > > +		record->sample_address = true;
> > 
> > How does it guarantee that it enables data address sampling only for
> > DWARF unwind?  Maybe you want this?
> > 
> > 		if (callchain_param.record_mode == CALLCHAIN_DWARF)
> > 			record->sample_address = true;
> 
> ugh.. too much coofee.. :-\ third time's a charm, v3 attached

Noel, have you tested this latest patch? Does it fix things for you in
this latest iteration?

If so, can I stick a "Reported-and-Tested-by: Noel Grandin <>" to this?
 
> thanks,
> jirka
> 
> 
> ---
> Currently we don't synthesize data mmap by default. It depends
> on -d option, that enables data address sampling.
> 
> But we've seen cases (softice) where DWARF unwinder went through
> non executable mmaps, which we need to lookup in MAP__VARIABLE tree.
> 
> Making data mmaps to be synthesized for dwarf unwind as well.
> 
> Reported-by: Noel Grandin <noelgrandin@gmail.com>
> Link: http://lkml.kernel.org/n/tip-lh02yir6qfycn8zr892rmlgg@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/builtin-record.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 9c5cdc2c4471..dc4e0adf5c5b 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -815,8 +815,12 @@ int record_parse_callchain_opt(const struct option *opt,
>  	}
>  
>  	ret = parse_callchain_record_opt(arg, &callchain_param);
> -	if (!ret)
> +	if (!ret) {
> +		/* Enable data address sampling for DWARF unwind. */
> +		if (callchain_param.record_mode == CALLCHAIN_DWARF)
> +			record->sample_address = true;
>  		callchain_debug();
> +	}
>  
>  	return ret;
>  }
> -- 
> 2.4.3

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf tools: Do not show trace command if it' s not compiled in
  2016-01-07  9:14 ` [PATCH 07/13] perf tools: Do not show trace command if it's not compiled in Jiri Olsa
@ 2016-01-09 16:37   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, jolsa, adrian.hunter, a.p.zijlstra, mingo, acme,
	linux-kernel, tglx, dsahern, hpa, noelgrandin

Commit-ID:  cbd08b7335c9d559f424dcef7bea333605597490
Gitweb:     http://git.kernel.org/tip/cbd08b7335c9d559f424dcef7bea333605597490
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:04 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:46:17 -0300

perf tools: Do not show trace command if it's not compiled in

The trace command still appears in help message when you run simple
'perf' command.

It's because the generate-cmdlist.sh does not care about the
HAVE_LIBAUDIT_SUPPORT dependency of trace command and puts it into
generated common_cmds array.

Wrapping trace command under HAVE_LIBAUDIT_SUPPORT dependency, which
will exclude it from common_cmds array if HAVE_LIBAUDIT_SUPPORT is not
set.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-8-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/command-list.txt         |  2 +-
 tools/perf/util/generate-cmdlist.sh | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/tools/perf/command-list.txt b/tools/perf/command-list.txt
index acc3ea7..ab5cbaa 100644
--- a/tools/perf/command-list.txt
+++ b/tools/perf/command-list.txt
@@ -26,4 +26,4 @@ perf-stat			mainporcelain common
 perf-test			mainporcelain common
 perf-timechart			mainporcelain common
 perf-top			mainporcelain common
-perf-trace			mainporcelain common
+perf-trace			mainporcelain audit
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 36a885d..0ac2037 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -36,4 +36,19 @@ do
      }' "Documentation/perf-$cmd.txt"
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
+
+echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
+sed -n -e 's/^perf-\([^ 	]*\)[ 	].* audit*/\1/p' command-list.txt |
+sort |
+while read cmd
+do
+     sed -n '
+     /^NAME/,/perf-'"$cmd"'/H
+     ${
+            x
+            s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
+	    p
+     }' "Documentation/perf-$cmd.txt"
+done
+echo "#endif /* HAVE_LIBELF_SUPPORT */"
 echo "};"

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf script: Align event name properly
  2016-01-07  9:14 ` [PATCH 08/13] perf script: Align event name properly Jiri Olsa
@ 2016-01-09 16:38   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: a.p.zijlstra, linux-kernel, acme, dsahern, adrian.hunter, tglx,
	namhyung, noelgrandin, jolsa, hpa, mingo

Commit-ID:  9cdbc409626b29ab30f06a6393db6763f040f753
Gitweb:     http://git.kernel.org/tip/9cdbc409626b29ab30f06a6393db6763f040f753
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:05 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:57:26 -0300

perf script: Align event name properly

Adding code to align event names, so we get aligned output in case of
multiple events with different names.

Before:
  $ perf script
  :13757 13757 163918.230829: cpu/mem-snp-none/P: ffff88085f20d010
  :13757 13757 163918.230832: cpu/mem-loads,ldlat=30/P:     7f5a5f719f00
  :13757 13757 163918.230835: cpu/mem-loads,ldlat=30/P:     7f5a5f719f00
  :13758 13758 163918.230838: cpu/mem-snp-none/P: ffff88085f4ad810
  :13758 13758 163918.154093: cpu/mem-stores/P: ffff88085bb53f28
  :13757 13757 163918.155264: cpu/mem-snp-hitm/P:           601080
  ...

After:
  $ perf script
  :13757 13757 163918.228831:       cpu/mem-snp-none/P: ffffffff81a841c0
  :13757 13757 163918.228834: cpu/mem-loads,ldlat=30/P:     7f5a5f719f08
  :13757 13757 163918.228837: cpu/mem-loads,ldlat=30/P:     7f5a5f719f08
  :13758 13758 163918.228837:       cpu/mem-snp-none/P: ffff88085f4ad800
  :13758 13758 163918.154093:         cpu/mem-stores/P: ffff88085bb53f28
  :13757 13757 163918.155264:       cpu/mem-snp-hitm/P:           601080
  ...

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 5e2f9d2..c691214 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -617,9 +617,24 @@ struct perf_script {
 	bool			allocated;
 	struct cpu_map		*cpus;
 	struct thread_map	*threads;
+	int			name_width;
 };
 
-static void process_event(struct perf_script *script __maybe_unused, union perf_event *event,
+static int perf_evlist__max_name_len(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel;
+	int max = 0;
+
+	evlist__for_each(evlist, evsel) {
+		int len = strlen(perf_evsel__name(evsel));
+
+		max = MAX(len, max);
+	}
+
+	return max;
+}
+
+static void process_event(struct perf_script *script, union perf_event *event,
 			  struct perf_sample *sample, struct perf_evsel *evsel,
 			  struct addr_location *al)
 {
@@ -636,7 +651,12 @@ static void process_event(struct perf_script *script __maybe_unused, union perf_
 
 	if (PRINT_FIELD(EVNAME)) {
 		const char *evname = perf_evsel__name(evsel);
-		printf("%s: ", evname ? evname : "[unknown]");
+
+		if (!script->name_width)
+			script->name_width = perf_evlist__max_name_len(script->session->evlist);
+
+		printf("%*s: ", script->name_width,
+		       evname ? evname : "[unknown]");
 	}
 
 	if (print_flags)

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf tools: Include all tools/ lib directory for tags/cscope/TAGS targets
  2016-01-07  9:14 ` [PATCH 09/13] perf tools: Include all tools/lib directory for tags/cscope/TAGS targets Jiri Olsa
@ 2016-01-09 16:38   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, dsahern, jolsa, tglx, noelgrandin, a.p.zijlstra, acme,
	mingo, linux-kernel, adrian.hunter, hpa

Commit-ID:  685c84154cef61dd7d961f36ab92f13c3ef5d354
Gitweb:     http://git.kernel.org/tip/685c84154cef61dd7d961f36ab92f13c3ef5d354
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:06 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:57:46 -0300

perf tools: Include all tools/lib directory for tags/cscope/TAGS targets

Besides lockdep we use all the 'tools/lib' code in perf, so include it
completely in tags.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-10-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 404e3b1..1025ea7 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -488,7 +488,7 @@ INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
 $(DOC_TARGETS):
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
 
-TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol ../include ../lib/bpf
+TAG_FOLDERS= . ../lib ../include
 TAG_FILES= ../../include/uapi/linux/perf_event.h
 
 TAGS:

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf tools: Remove list entry from struct sort_entry
  2016-01-07  9:14 ` [PATCH 10/13] perf tools: Remove list entry from struct sort_entry Jiri Olsa
  2016-01-07 11:13   ` Namhyung Kim
@ 2016-01-09 16:38   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, tglx, noelgrandin, dsahern, acme, namhyung, mingo,
	linux-kernel, adrian.hunter, a.p.zijlstra, jolsa

Commit-ID:  bb4ced29f5d5ff1d4d51b602dad34a0d15495a67
Gitweb:     http://git.kernel.org/tip/bb4ced29f5d5ff1d4d51b602dad34a0d15495a67
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:07 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:58:04 -0300

perf tools: Remove list entry from struct sort_entry

It's no longer needed.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-11-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index dec536b..687bbb12 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -214,8 +214,6 @@ enum sort_type {
  */
 
 struct sort_entry {
-	struct list_head list;
-
 	const char *se_header;
 
 	int64_t (*se_cmp)(struct hist_entry *, struct hist_entry *);

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf tools: Add overhead/ overhead_children keys defaults via string
  2016-01-07  9:14 ` [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string Jiri Olsa
  2016-01-07 11:17   ` Namhyung Kim
@ 2016-01-09 16:39   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, mingo, hpa, linux-kernel, a.p.zijlstra, adrian.hunter,
	acme, dsahern, jolsa, namhyung, noelgrandin

Commit-ID:  b97511c5bc94ef12613f485ab82f989df04088da
Gitweb:     http://git.kernel.org/tip/b97511c5bc94ef12613f485ab82f989df04088da
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:08 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:58:58 -0300

perf tools: Add overhead/overhead_children keys defaults via string

We currently set 'overhead' and 'overhead_children' as default sort keys
within perf_hpp__init function by directly adding into the sort list.

This patch adds 'overhead' and 'overhead_children' in text form into
sort_keys and let them be added by standard sort dimension interface.

We need to eliminate dirrect sort_list additions to be able to add
support for hists specific sort keys.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-12-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c   | 12 ------------
 tools/perf/util/sort.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 8263c0e..bf2a66e 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -443,7 +443,6 @@ LIST_HEAD(perf_hpp__sort_list);
 
 void perf_hpp__init(void)
 {
-	struct list_head *list;
 	int i;
 
 	for (i = 0; i < PERF_HPP__MAX_INDEX; i++) {
@@ -484,17 +483,6 @@ void perf_hpp__init(void)
 
 	if (symbol_conf.show_total_period)
 		hpp_dimension__add_output(PERF_HPP__PERIOD);
-
-	/* prepend overhead field for backward compatiblity.  */
-	list = &perf_hpp__format[PERF_HPP__OVERHEAD].sort_list;
-	if (list_empty(list))
-		list_add(list, &perf_hpp__sort_list);
-
-	if (symbol_conf.cumulate_callchain) {
-		list = &perf_hpp__format[PERF_HPP__OVERHEAD_ACC].sort_list;
-		if (list_empty(list))
-			list_add(list, &perf_hpp__sort_list);
-	}
 }
 
 void perf_hpp__column_register(struct perf_hpp_fmt *format)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 04e2a5c..ec72234 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2252,6 +2252,34 @@ static int setup_sort_order(struct perf_evlist *evlist)
 	return 0;
 }
 
+/*
+ * Adds 'pre,' prefix into 'str' is 'pre' is
+ * not already part of 'str'.
+ */
+static char *prefix_if_not_in(const char *pre, char *str)
+{
+	char *n;
+
+	if (!str || strstr(str, pre))
+		return str;
+
+	if (asprintf(&n, "%s,%s", pre, str) < 0)
+		return NULL;
+
+	free(str);
+	return n;
+}
+
+static char *setup_overhead(char *keys)
+{
+	keys = prefix_if_not_in("overhead", keys);
+
+	if (symbol_conf.cumulate_callchain)
+		keys = prefix_if_not_in("overhead_children", keys);
+
+	return keys;
+}
+
 static int __setup_sorting(struct perf_evlist *evlist)
 {
 	char *tmp, *tok, *str;
@@ -2281,6 +2309,17 @@ static int __setup_sorting(struct perf_evlist *evlist)
 		return -ENOMEM;
 	}
 
+	/*
+	 * Prepend overhead fields for backward compatibility.
+	 */
+	if (!is_strict_order(field_order)) {
+		str = setup_overhead(str);
+		if (str == NULL) {
+			error("Not enough memory to setup overhead keys");
+			return -ENOMEM;
+		}
+	}
+
 	for (tok = strtok_r(str, ", ", &tmp);
 			tok; tok = strtok_r(NULL, ", ", &tmp)) {
 		ret = sort_dimension__add(tok, evlist);

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf diff: Use perf_hpp__register_sort_field interface
  2016-01-07  9:14 ` [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface Jiri Olsa
  2016-01-07 11:17   ` Namhyung Kim
@ 2016-01-09 16:39   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, acme, noelgrandin, tglx, namhyung, adrian.hunter, dsahern,
	jolsa, mingo, a.p.zijlstra, linux-kernel

Commit-ID:  21e6d8428664293f203be3004dcd8d70f68ebdb9
Gitweb:     http://git.kernel.org/tip/21e6d8428664293f203be3004dcd8d70f68ebdb9
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:09 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:59:30 -0300

perf diff: Use perf_hpp__register_sort_field interface

Using perf_hpp__register_sort_field interface instead of directly adding
the entry.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-13-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-diff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 8706383..36ccc2b 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1207,7 +1207,7 @@ static int ui_init(void)
 		BUG_ON(1);
 	}
 
-	list_add(&fmt->sort_list, &perf_hpp__sort_list);
+	perf_hpp__register_sort_field(fmt);
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf hists: Export a couple of hist functions
  2016-01-07  9:14 ` [PATCH 13/13] perf tools: Export a couple of hist functions Jiri Olsa
@ 2016-01-09 16:39   ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Namhyung Kim @ 2016-01-09 16:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, a.p.zijlstra, namhyung, dsahern, noelgrandin, acme, tglx,
	adrian.hunter, hpa, linux-kernel

Commit-ID:  fc284be9d88528dd2a28d5471e40a6acde6c3036
Gitweb:     http://git.kernel.org/tip/fc284be9d88528dd2a28d5471e40a6acde6c3036
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:10 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 12:59:48 -0300

perf hists: Export a couple of hist functions

These are necessary for multi threaded sample processing:

 - hists__get__get_rotate_entries_in()
 - hists__collapse_insert_entry()
 - __hists__init()

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-14-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 19 ++++++++++++-------
 tools/perf/util/hist.h |  5 +++++
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 888776b..c226303 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1007,9 +1007,8 @@ void hist_entry__delete(struct hist_entry *he)
  * collapse the histogram
  */
 
-static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
-					 struct rb_root *root,
-					 struct hist_entry *he)
+bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
+				  struct rb_root *root, struct hist_entry *he)
 {
 	struct rb_node **p = &root->rb_node;
 	struct rb_node *parent = NULL;
@@ -1049,7 +1048,7 @@ static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
 	return true;
 }
 
-static struct rb_root *hists__get_rotate_entries_in(struct hists *hists)
+struct rb_root *hists__get_rotate_entries_in(struct hists *hists)
 {
 	struct rb_root *root;
 
@@ -1584,10 +1583,8 @@ int perf_hist_config(const char *var, const char *value)
 	return 0;
 }
 
-static int hists_evsel__init(struct perf_evsel *evsel)
+int __hists__init(struct hists *hists)
 {
-	struct hists *hists = evsel__hists(evsel);
-
 	memset(hists, 0, sizeof(*hists));
 	hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT;
 	hists->entries_in = &hists->entries_in_array[0];
@@ -1627,6 +1624,14 @@ static void hists_evsel__exit(struct perf_evsel *evsel)
 	hists__delete_all_entries(hists);
 }
 
+static int hists_evsel__init(struct perf_evsel *evsel)
+{
+	struct hists *hists = evsel__hists(evsel);
+
+	__hists__init(hists);
+	return 0;
+}
+
 /*
  * XXX We probably need a hists_evsel__exit() to free the hist_entries
  * stored in the rbtree...
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index cb8f373..d4ec482 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -185,6 +185,11 @@ static inline struct hists *evsel__hists(struct perf_evsel *evsel)
 }
 
 int hists__init(void);
+int __hists__init(struct hists *hists);
+
+struct rb_root *hists__get_rotate_entries_in(struct hists *hists);
+bool hists__collapse_insert_entry(struct hists *hists __maybe_unused,
+				  struct rb_root *root, struct hist_entry *he);
 
 struct perf_hpp {
 	char *buf;

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf evlist: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does)
  2016-01-07  9:13 ` [PATCH 02/13] perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does) Jiri Olsa
@ 2016-01-09 16:40   ` tip-bot for Adrian Hunter
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Adrian Hunter @ 2016-01-09 16:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, a.p.zijlstra, linux-kernel, hpa, tglx, acme, noelgrandin,
	namhyung, adrian.hunter, dsahern

Commit-ID:  23df7f798435796aff07d641456326b81cb34a77
Gitweb:     http://git.kernel.org/tip/23df7f798435796aff07d641456326b81cb34a77
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Thu, 7 Jan 2016 10:13:59 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:15:11 -0300

perf evlist: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does)

'perf record' uses perf_evsel__open() to open events and passes the
evsel->cpus and evsel->threads.  Many tests and some tools instead use
perf_evlist__open() which passes instead evlist->cpus and
evlist->threads.

Make perf_evlist__open() follow the 'perf record' behaviour so that a
consistent approach is taken.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index fa6dbf0..29e085b2 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1498,7 +1498,7 @@ int perf_evlist__open(struct perf_evlist *evlist)
 	perf_evlist__update_id_pos(evlist);
 
 	evlist__for_each(evlist, evsel) {
-		err = perf_evsel__open(evsel, evlist->cpus, evlist->threads);
+		err = perf_evsel__open(evsel, evsel->cpus, evsel->threads);
 		if (err < 0)
 			goto out_err;
 	}

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf evlist: Remove perf_evlist__(enable|disable) _event functions
  2016-01-07  9:13 ` [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions Jiri Olsa
@ 2016-01-09 16:40   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: noelgrandin, acme, linux-kernel, hpa, dsahern, a.p.zijlstra,
	mingo, jolsa, namhyung, tglx, adrian.hunter

Commit-ID:  d2190a8091124f832c8862ace3a3d7d70a2506a5
Gitweb:     http://git.kernel.org/tip/d2190a8091124f832c8862ace3a3d7d70a2506a5
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:13:58 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:15:43 -0300

perf evlist: Remove perf_evlist__(enable|disable)_event functions

Replacing them with perf_evsel__(enable|disable).

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Noel Grandin <noelgrandin@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/intel-bts.c |  4 ++--
 tools/perf/arch/x86/util/intel-pt.c  |  4 ++--
 tools/perf/tests/keep-tracking.c     |  2 +-
 tools/perf/tests/switch-tracking.c   |  6 +++---
 tools/perf/util/evlist.c             | 42 ------------------------------------
 tools/perf/util/evlist.h             |  4 ----
 6 files changed, 8 insertions(+), 54 deletions(-)

diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
index 9b94ce5..8d8150f 100644
--- a/tools/perf/arch/x86/util/intel-bts.c
+++ b/tools/perf/arch/x86/util/intel-bts.c
@@ -327,7 +327,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evlist__disable_event(btsr->evlist, evsel);
+			return perf_evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
@@ -340,7 +340,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evlist__enable_event(btsr->evlist, evsel);
+			return perf_evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index b64d462..f05daac 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -725,7 +725,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evlist__disable_event(ptr->evlist, evsel);
+			return perf_evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
@@ -738,7 +738,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evlist__enable_event(ptr->evlist, evsel);
+			return perf_evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index 6158132..ddb78fa 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -123,7 +123,7 @@ int test__keep_tracking(int subtest __maybe_unused)
 
 	evsel = perf_evlist__last(evlist);
 
-	CHECK__(perf_evlist__disable_event(evlist, evsel));
+	CHECK__(perf_evsel__disable(evsel));
 
 	comm = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index dfbd8d6..ebd8016 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -455,7 +455,7 @@ int test__switch_tracking(int subtest __maybe_unused)
 
 	perf_evlist__enable(evlist);
 
-	err = perf_evlist__disable_event(evlist, cpu_clocks_evsel);
+	err = perf_evsel__disable(cpu_clocks_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
@@ -474,7 +474,7 @@ int test__switch_tracking(int subtest __maybe_unused)
 		goto out_err;
 	}
 
-	err = perf_evlist__disable_event(evlist, cycles_evsel);
+	err = perf_evsel__disable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
@@ -500,7 +500,7 @@ int test__switch_tracking(int subtest __maybe_unused)
 		goto out_err;
 	}
 
-	err = perf_evlist__enable_event(evlist, cycles_evsel);
+	err = perf_evsel__enable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 29e085b2..d81f13d 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -393,48 +393,6 @@ void perf_evlist__toggle_enable(struct perf_evlist *evlist)
 	(evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist);
 }
 
-int perf_evlist__disable_event(struct perf_evlist *evlist,
-			       struct perf_evsel *evsel)
-{
-	int cpu, thread, err;
-	int nr_cpus = cpu_map__nr(evlist->cpus);
-	int nr_threads = perf_evlist__nr_threads(evlist, evsel);
-
-	if (!evsel->fd)
-		return 0;
-
-	for (cpu = 0; cpu < nr_cpus; cpu++) {
-		for (thread = 0; thread < nr_threads; thread++) {
-			err = ioctl(FD(evsel, cpu, thread),
-				    PERF_EVENT_IOC_DISABLE, 0);
-			if (err)
-				return err;
-		}
-	}
-	return 0;
-}
-
-int perf_evlist__enable_event(struct perf_evlist *evlist,
-			      struct perf_evsel *evsel)
-{
-	int cpu, thread, err;
-	int nr_cpus = cpu_map__nr(evlist->cpus);
-	int nr_threads = perf_evlist__nr_threads(evlist, evsel);
-
-	if (!evsel->fd)
-		return -EINVAL;
-
-	for (cpu = 0; cpu < nr_cpus; cpu++) {
-		for (thread = 0; thread < nr_threads; thread++) {
-			err = ioctl(FD(evsel, cpu, thread),
-				    PERF_EVENT_IOC_ENABLE, 0);
-			if (err)
-				return err;
-		}
-	}
-	return 0;
-}
-
 static int perf_evlist__enable_event_cpu(struct perf_evlist *evlist,
 					 struct perf_evsel *evsel, int cpu)
 {
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 3b7e1e2..7c4d9a2 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -155,10 +155,6 @@ void perf_evlist__disable(struct perf_evlist *evlist);
 void perf_evlist__enable(struct perf_evlist *evlist);
 void perf_evlist__toggle_enable(struct perf_evlist *evlist);
 
-int perf_evlist__disable_event(struct perf_evlist *evlist,
-			       struct perf_evsel *evsel);
-int perf_evlist__enable_event(struct perf_evlist *evlist,
-			      struct perf_evsel *evsel);
 int perf_evlist__enable_event_idx(struct perf_evlist *evlist,
 				  struct perf_evsel *evsel, int idx);
 

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf unwind: Use find_map function in access_dso_mem
  2016-01-07  9:14 ` [PATCH 03/13] perf tools: Use find_map function in access_dso_mem Jiri Olsa
@ 2016-01-09 16:41   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, jolsa, tglx, mingo, adrian.hunter, acme, a.p.zijlstra,
	dsahern, noelgrandin, hpa, linux-kernel

Commit-ID:  f22ed827a8d5ff5a85e7c8e865baaaaf71a8d0cc
Gitweb:     http://git.kernel.org/tip/f22ed827a8d5ff5a85e7c8e865baaaaf71a8d0cc
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:00 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:16:12 -0300

perf unwind: Use find_map function in access_dso_mem

The find_map helper is already there, so let's use it.

Also we're going to introduce wider search in following patch, so it'll
be easier to make this change on single place.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/unwind-libunwind.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 3c258a0..f37859c 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -416,20 +416,19 @@ get_proc_name(unw_addr_space_t __maybe_unused as,
 static int access_dso_mem(struct unwind_info *ui, unw_word_t addr,
 			  unw_word_t *data)
 {
-	struct addr_location al;
+	struct map *map;
 	ssize_t size;
 
-	thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
-			      MAP__FUNCTION, addr, &al);
-	if (!al.map) {
+	map = find_map(addr, ui);
+	if (!map) {
 		pr_debug("unwind: no map for %lx\n", (unsigned long)addr);
 		return -1;
 	}
 
-	if (!al.map->dso)
+	if (!map->dso)
 		return -1;
 
-	size = dso__data_read_addr(al.map->dso, al.map, ui->machine,
+	size = dso__data_read_addr(map->dso, map, ui->machine,
 				   addr, (u8 *) data, sizeof(*data));
 
 	return !(size == sizeof(*data));

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf unwind: Check for mmaps also in MAP__VARIABLE tree
  2016-01-07  9:14 ` [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree Jiri Olsa
@ 2016-01-09 16:41   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: noelgrandin, tglx, mingo, namhyung, jolsa, adrian.hunter,
	linux-kernel, a.p.zijlstra, dsahern, acme, hpa

Commit-ID:  0ddf5246f70ecc04e1bb4c4dc2be65977d1c03a7
Gitweb:     http://git.kernel.org/tip/0ddf5246f70ecc04e1bb4c4dc2be65977d1c03a7
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:01 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:16:34 -0300

perf unwind: Check for mmaps also in MAP__VARIABLE tree

We've seen cases (softice) where DWARF unwinder went through non
executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Reported-and-Tested-by: Noel Grandin <noelgrandin@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/unwind-libunwind.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index f37859c..ee7e372 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -319,6 +319,15 @@ static struct map *find_map(unw_word_t ip, struct unwind_info *ui)
 
 	thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
 			      MAP__FUNCTION, ip, &al);
+	if (!al.map) {
+		/*
+		 * We've seen cases (softice) where DWARF unwinder went
+		 * through non executable mmaps, which we need to lookup
+		 * in MAP__VARIABLE tree.
+		 */
+		thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
+				      MAP__VARIABLE, ip, &al);
+	}
 	return al.map;
 }
 

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf libdw: Check for mmaps also in MAP__VARIABLE tree
  2016-01-07  9:14 ` [PATCH 05/13] perf tools libdw: " Jiri Olsa
@ 2016-01-09 16:41   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: adrian.hunter, tglx, noelgrandin, mingo, namhyung, jolsa,
	dsahern, hpa, a.p.zijlstra, acme, linux-kernel

Commit-ID:  0ba98149f8c8b6b2ba36be9938afb731fa719004
Gitweb:     http://git.kernel.org/tip/0ba98149f8c8b6b2ba36be9938afb731fa719004
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 7 Jan 2016 10:14:02 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:16:57 -0300

perf libdw: Check for mmaps also in MAP__VARIABLE tree

We've seen cases (softice) where DWARF unwinder went through non
executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Reported-and-Tested-by: Noel Grandin <noelgrandin@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/unwind-libdw.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index db8142b..cf5e250 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -96,6 +96,16 @@ static int access_dso_mem(struct unwind_info *ui, Dwarf_Addr addr,
 	thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
 			      MAP__FUNCTION, addr, &al);
 	if (!al.map) {
+		/*
+		 * We've seen cases (softice) where DWARF unwinder went
+		 * through non executable mmaps, which we need to lookup
+		 * in MAP__VARIABLE tree.
+		 */
+		thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER,
+				      MAP__VARIABLE, addr, &al);
+	}
+
+	if (!al.map) {
 		pr_debug("unwind: no map for %lx\n", (unsigned long)addr);
 		return -1;
 	}

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [tip:perf/core] perf record: Store data mmaps for dwarf unwind
  2016-01-07 13:30         ` [PATCHv3 " Jiri Olsa
  2016-01-07 20:42           ` Arnaldo Carvalho de Melo
@ 2016-01-09 16:42           ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 35+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:42 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, jolsa, namhyung, mingo, acme, a.p.zijlstra, tglx,
	dsahern, noelgrandin, hpa, adrian.hunter, jolsa

Commit-ID:  5c0cf22477eaa890beeb4bc3554e5bebbea4b007
Gitweb:     http://git.kernel.org/tip/5c0cf22477eaa890beeb4bc3554e5bebbea4b007
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Thu, 7 Jan 2016 14:30:22 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 8 Jan 2016 14:17:45 -0300

perf record: Store data mmaps for dwarf unwind

Currently we don't synthesize data mmap by default. It depends on -d
option, that enables data address sampling.

But we've seen cases (softice) where DWARF unwinder went through non
executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Making data mmaps to be synthesized for dwarf unwind as well.

Reported-by: Noel Grandin <noelgrandin@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20160107133022.GA32115@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 9c5cdc2c4..dc4e0ad 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -815,8 +815,12 @@ int record_parse_callchain_opt(const struct option *opt,
 	}
 
 	ret = parse_callchain_record_opt(arg, &callchain_param);
-	if (!ret)
+	if (!ret) {
+		/* Enable data address sampling for DWARF unwind. */
+		if (callchain_param.record_mode == CALLCHAIN_DWARF)
+			record->sample_address = true;
 		callchain_debug();
+	}
 
 	return ret;
 }

^ permalink raw reply related	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2016-01-09 16:42 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07  9:13 [PATCHv2 00/13] perf tools: Various fixes Jiri Olsa
2016-01-07  9:13 ` [PATCH 01/13] perf tools: Remove perf_evlist__(enable|disable)_event functions Jiri Olsa
2016-01-09 16:40   ` [tip:perf/core] perf evlist: Remove perf_evlist__(enable|disable) _event functions tip-bot for Jiri Olsa
2016-01-07  9:13 ` [PATCH 02/13] perf tools: Make perf_evlist__open() open evsels with their cpus and threads (like perf record does) Jiri Olsa
2016-01-09 16:40   ` [tip:perf/core] perf evlist: " tip-bot for Adrian Hunter
2016-01-07  9:14 ` [PATCH 03/13] perf tools: Use find_map function in access_dso_mem Jiri Olsa
2016-01-09 16:41   ` [tip:perf/core] perf unwind: " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 04/13] perf tools libunwind: Check for mmaps also in MAP__VARIABLE tree Jiri Olsa
2016-01-09 16:41   ` [tip:perf/core] perf unwind: " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 05/13] perf tools libdw: " Jiri Olsa
2016-01-09 16:41   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 06/13] perf record: Store data mmaps for dwarf unwind Jiri Olsa
2016-01-07 11:12   ` Namhyung Kim
2016-01-07 12:39     ` [PATCHv2 " Jiri Olsa
2016-01-07 13:14       ` Namhyung Kim
2016-01-07 13:30         ` [PATCHv3 " Jiri Olsa
2016-01-07 20:42           ` Arnaldo Carvalho de Melo
2016-01-09 16:42           ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 07/13] perf tools: Do not show trace command if it's not compiled in Jiri Olsa
2016-01-09 16:37   ` [tip:perf/core] perf tools: Do not show trace command if it' s " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 08/13] perf script: Align event name properly Jiri Olsa
2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 09/13] perf tools: Include all tools/lib directory for tags/cscope/TAGS targets Jiri Olsa
2016-01-09 16:38   ` [tip:perf/core] perf tools: Include all tools/ lib " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 10/13] perf tools: Remove list entry from struct sort_entry Jiri Olsa
2016-01-07 11:13   ` Namhyung Kim
2016-01-09 16:38   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 11/13] perf tools: Add overhead/overhead_children keys defaults via string Jiri Olsa
2016-01-07 11:17   ` Namhyung Kim
2016-01-09 16:39   ` [tip:perf/core] perf tools: Add overhead/ overhead_children " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 12/13] perf diff: Use perf_hpp__register_sort_field interface Jiri Olsa
2016-01-07 11:17   ` Namhyung Kim
2016-01-09 16:39   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-01-07  9:14 ` [PATCH 13/13] perf tools: Export a couple of hist functions Jiri Olsa
2016-01-09 16:39   ` [tip:perf/core] perf hists: " tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).