linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/25] perf/core improvements and fixes
@ 2015-03-24 16:19 Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 01/25] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir Arnaldo Carvalho de Melo
                   ` (23 more replies)
  0 siblings, 24 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andrew Morton, Borislav Petkov, Corey Ashford, David Ahern,
	Don Zickus, Frederic Weisbecker, He Kuang, Javi Merino,
	Jiri Olsa, Joonsoo Kim, Josef Bacik, Masami Hiramatsu,
	Minchan Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Shawn Bohrer, Stephane Eranian, Steven Rostedt, Vinson Lee,
	Wang Nan, Yann Droneaud, Yunlong Song, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling.

- Arnaldo

The following changes since commit 963a70b8a2d65538f7d58b2b84a2ae10a3ecb6ea:

  Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-03-22 10:56:19 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to e03eaa400cf8b8bded86cc5c41018a1c69152f16:

  perf tools: Add pid/tid filtering to report and script commands (2015-03-24 13:02:46 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Improve support of compressed kernel modules (Jiri Olsa)

- Add --kallsyms option to 'perf diff' (David Ahern)

- Add pid/tid filtering to 'report' and 'script' commands (David Ahern)

- Add support for __print_array() in libtraceevent (Javi Merino)

- Save DSO loading errno to better report errors (Arnaldo Carvalho de Melo)

- Fix 'probe' to get ummapped symbol address on kernel (Masami Hiramatsu)

- Print big numbers using thousands' group in 'kmem' (Namhyung Kim)

- Remove (null) value of "Sort order" for perf mem report (Yunlong Song)

Infrastructure:

- Handle NULL comm name in libtracevent (Josef Bacik)

- Libtraceevent synchronization with trace-cmd repo (Steven Rostedt)

- Work around lack of sched_getcpu in glibc < 2.6. (Vinson Lee)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf target: Simplify handling of strerror_r return
      perf symbols: Save DSO loading errno to better report errors

David Ahern (2):
      perf diff: Add kallsyms option
      perf tools: Add pid/tid filtering to report and script commands

Javi Merino (2):
      tools lib traceevent: Factor out allocating and processing args
      tools lib traceevent: Add support for __print_array()

Jiri Olsa (7):
      perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir
      perf tools: Use kmod_path__parse in decompress_kmodule
      perf tools: Use kmod_path__parse in is_kernel_module
      perf tools: Remove compressed argument from is_kernel_module
      perf tools: Remove is_kmodule_extension function
      perf tools: Try to lookup kernel module map before creating one
      perf annotate: Allow annotation for decompressed kernel modules

Josef Bacik (1):
      tools lib traceevent: Handle NULL comm name

Masami Hiramatsu (1):
      perf probe: Fix to get ummapped symbol address on kernel

Namhyung Kim (1):
      perf kmem: Print big numbers using thousands' group

Steven Rostedt (1):
      tools lib traceevent: Make plugin options either string or boolean

Steven Rostedt (Red Hat) (6):
      tools lib traceevent: Copy trace_clock and free it
      tools lib traceevent: Handle %z in bprint format
      tools lib traceevent: Add pevent_data_pid_from_comm()
      tools lib traceevent kbuffer: Remove extra update to data pointer in PADDING
      tools lib traceevent: Add way to find sub buffer boundary
      tools lib traceevent: Free filter tokens in process_filter()

Vinson Lee (1):
      perf tools: Work around lack of sched_getcpu in glibc < 2.6.

Yunlong Song (1):
      perf tools: Remove (null) value of "Sort order" for perf mem report

 tools/lib/traceevent/event-parse.c                 | 267 ++++++++++++++++++---
 tools/lib/traceevent/event-parse.h                 |  21 +-
 tools/lib/traceevent/event-plugin.c                |  60 ++++-
 tools/lib/traceevent/kbuffer-parse.c               |  12 +-
 tools/lib/traceevent/kbuffer.h                     |   1 +
 tools/lib/traceevent/parse-filter.c                |   2 +
 tools/perf/Documentation/perf-diff.txt             |   3 +
 tools/perf/Documentation/perf-report.txt           |   5 +
 tools/perf/Documentation/perf-script.txt           |   6 +
 tools/perf/builtin-diff.c                          |   2 +
 tools/perf/builtin-kmem.c                          |  11 +-
 tools/perf/builtin-report.c                        |   6 +-
 tools/perf/builtin-script.c                        |   4 +
 tools/perf/builtin-top.c                           |   6 +-
 tools/perf/util/annotate.c                         |  32 ++-
 tools/perf/util/cloexec.c                          |   6 +
 tools/perf/util/cloexec.h                          |   6 +
 tools/perf/util/dso.c                              |  61 +++--
 tools/perf/util/dso.h                              |  31 ++-
 tools/perf/util/header.c                           |   2 +-
 tools/perf/util/machine.c                          |  72 ++++--
 tools/perf/util/probe-event.c                      |   5 +-
 .../perf/util/scripting-engines/trace-event-perl.c |   5 +
 .../util/scripting-engines/trace-event-python.c    |   5 +
 tools/perf/util/sort.h                             |   1 +
 tools/perf/util/symbol-elf.c                       |  57 +++--
 tools/perf/util/symbol-minimal.c                   |   7 +-
 tools/perf/util/symbol.c                           |  31 ++-
 tools/perf/util/symbol.h                           |   7 +
 tools/perf/util/target.c                           |   7 +-
 tools/perf/util/thread.h                           |  11 +
 31 files changed, 621 insertions(+), 131 deletions(-)

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

* [PATCH 01/25] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 02/25] perf tools: Use kmod_path__parse in decompress_kmodule Arnaldo Carvalho de Melo
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Replacing the file name parsing with kmod_path__parse
and moving the dso update into new separate function.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-q0ed76ajcyoaofotntrg5sla@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 65 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 41 insertions(+), 24 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index eb95b883fb44..6ca61a3427a6 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -851,6 +851,39 @@ static char *get_kernel_version(const char *root_dir)
 	return strdup(name);
 }
 
+static bool is_kmod_dso(struct dso *dso)
+{
+	return dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE ||
+	       dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE;
+}
+
+static int map_groups__set_module_path(struct map_groups *mg, const char *path,
+				       struct kmod_path *m)
+{
+	struct map *map;
+	char *long_name;
+
+	map = map_groups__find_by_name(mg, MAP__FUNCTION, m->name);
+	if (map == NULL)
+		return 0;
+
+	long_name = strdup(path);
+	if (long_name == NULL)
+		return -ENOMEM;
+
+	dso__set_long_name(map->dso, long_name, true);
+	dso__kernel_module_get_build_id(map->dso, "");
+
+	/*
+	 * Full name could reveal us kmod compression, so
+	 * we need to update the symtab_type if needed.
+	 */
+	if (m->comp && is_kmod_dso(map->dso))
+		map->dso->symtab_type++;
+
+	return 0;
+}
+
 static int map_groups__set_modules_path_dir(struct map_groups *mg,
 				const char *dir_name, int depth)
 {
@@ -889,35 +922,19 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
 			if (ret < 0)
 				goto out;
 		} else {
-			char *dot = strrchr(dent->d_name, '.'),
-			     dso_name[PATH_MAX];
-			struct map *map;
-			char *long_name;
+			struct kmod_path m;
 
-			if (dot == NULL)
-				continue;
+			ret = kmod_path__parse_name(&m, dent->d_name);
+			if (ret)
+				goto out;
 
-			/* On some system, modules are compressed like .ko.gz */
-			if (is_supported_compression(dot + 1) &&
-			    is_kmodule_extension(dot - 2))
-				dot -= 3;
+			if (m.kmod)
+				ret = map_groups__set_module_path(mg, path, &m);
 
-			snprintf(dso_name, sizeof(dso_name), "[%.*s]",
-				 (int)(dot - dent->d_name), dent->d_name);
+			free(m.name);
 
-			strxfrchar(dso_name, '-', '_');
-			map = map_groups__find_by_name(mg, MAP__FUNCTION,
-						       dso_name);
-			if (map == NULL)
-				continue;
-
-			long_name = strdup(path);
-			if (long_name == NULL) {
-				ret = -1;
+			if (ret)
 				goto out;
-			}
-			dso__set_long_name(map->dso, long_name, true);
-			dso__kernel_module_get_build_id(map->dso, "");
 		}
 	}
 
-- 
1.9.3


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

* [PATCH 02/25] perf tools: Use kmod_path__parse in decompress_kmodule
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 01/25] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 03/25] perf tools: Use kmod_path__parse in is_kernel_module Arnaldo Carvalho de Melo
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Replacing the file name parsing with kmod_path__parse.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-zpyyitlte7lwe2ywi51rj4n5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol-elf.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 62742e46c010..78ffde9df9bf 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -579,32 +579,34 @@ static int dso__swap_init(struct dso *dso, unsigned char eidata)
 static int decompress_kmodule(struct dso *dso, const char *name,
 			      enum dso_binary_type type)
 {
-	int fd;
-	const char *ext = strrchr(name, '.');
+	int fd = -1;
 	char tmpbuf[] = "/tmp/perf-kmod-XXXXXX";
+	struct kmod_path m;
 
 	if (type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
 	    type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP &&
 	    type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
 		return -1;
 
-	if (!ext || !is_supported_compression(ext + 1)) {
-		ext = strrchr(dso->name, '.');
-		if (!ext || !is_supported_compression(ext + 1))
-			return -1;
-	}
+	if (type == DSO_BINARY_TYPE__BUILD_ID_CACHE)
+		name = dso->long_name;
+
+	if (kmod_path__parse_ext(&m, name) || !m.comp)
+		return -1;
 
 	fd = mkstemp(tmpbuf);
 	if (fd < 0)
-		return -1;
+		goto out;
 
-	if (!decompress_to_file(ext + 1, name, fd)) {
+	if (!decompress_to_file(m.ext, name, fd)) {
 		close(fd);
 		fd = -1;
 	}
 
 	unlink(tmpbuf);
 
+out:
+	free(m.ext);
 	return fd;
 }
 
-- 
1.9.3


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

* [PATCH 03/25] perf tools: Use kmod_path__parse in is_kernel_module
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 01/25] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 02/25] perf tools: Use kmod_path__parse in decompress_kmodule Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 04/25] perf tools: Remove compressed argument from is_kernel_module Arnaldo Carvalho de Melo
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Replacing the current parsing code with kmod_path__parse function call.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-r9mpbbgkp39wp1cdmv13ddq0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dso.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 7a7c54b42b41..f37548322c9d 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -178,19 +178,15 @@ bool is_kmodule_extension(const char *ext)
 
 bool is_kernel_module(const char *pathname, bool *compressed)
 {
-	const char *ext = strrchr(pathname, '.');
+	struct kmod_path m;
 
-	if (ext == NULL)
-		return false;
+	if (kmod_path__parse(&m, pathname))
+		return NULL;
 
-	if (is_supported_compression(ext + 1)) {
-		if (compressed)
-			*compressed = true;
-		ext -= 3;
-	} else if (compressed)
-		*compressed = false;
+	if (compressed)
+		*compressed = m.comp;
 
-	return is_kmodule_extension(ext + 1);
+	return m.kmod;
 }
 
 bool decompress_to_file(const char *ext, const char *filename, int output_fd)
-- 
1.9.3


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

* [PATCH 04/25] perf tools: Remove compressed argument from is_kernel_module
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 03/25] perf tools: Use kmod_path__parse in is_kernel_module Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 05/25] perf tools: Remove is_kmodule_extension function Arnaldo Carvalho de Melo
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

We no longer need the 'compressed' argument, because all
current users use 'NULL' for it.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-d72q2s7ggbmy2yzhumux4zzw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dso.c     | 5 +----
 tools/perf/util/dso.h     | 2 +-
 tools/perf/util/header.c  | 2 +-
 tools/perf/util/machine.c | 2 +-
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index f37548322c9d..8803a69fc260 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -176,16 +176,13 @@ bool is_kmodule_extension(const char *ext)
 	return false;
 }
 
-bool is_kernel_module(const char *pathname, bool *compressed)
+bool is_kernel_module(const char *pathname)
 {
 	struct kmod_path m;
 
 	if (kmod_path__parse(&m, pathname))
 		return NULL;
 
-	if (compressed)
-		*compressed = m.comp;
-
 	return m.kmod;
 }
 
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 3c81d8378bc7..54dd03a490ce 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -191,7 +191,7 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
 				   char *root_dir, char *filename, size_t size);
 bool is_supported_compression(const char *ext);
 bool is_kmodule_extension(const char *ext);
-bool is_kernel_module(const char *pathname, bool *compressed);
+bool is_kernel_module(const char *pathname);
 bool decompress_to_file(const char *ext, const char *filename, int output_fd);
 bool dso__needs_decompress(struct dso *dso);
 
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 1f407f7352a7..fb432153e2aa 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1266,7 +1266,7 @@ static int __event_process_build_id(struct build_id_event *bev,
 
 		dso__set_build_id(dso, &bev->build_id);
 
-		if (!is_kernel_module(filename, NULL))
+		if (!is_kernel_module(filename))
 			dso->kernel = dso_type;
 
 		build_id__sprintf(dso->build_id, sizeof(dso->build_id),
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 6ca61a3427a6..1de5438ad070 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1104,7 +1104,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
 		struct dso *dso;
 
 		list_for_each_entry(dso, &machine->kernel_dsos.head, node) {
-			if (is_kernel_module(dso->long_name, NULL))
+			if (is_kernel_module(dso->long_name))
 				continue;
 
 			kernel = dso;
-- 
1.9.3


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

* [PATCH 05/25] perf tools: Remove is_kmodule_extension function
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 04/25] perf tools: Remove compressed argument from is_kernel_module Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 06/25] perf tools: Try to lookup kernel module map before creating one Arnaldo Carvalho de Melo
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Because 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: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bb84vlg76t78q8y8fdeed2qn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dso.c | 11 -----------
 tools/perf/util/dso.h |  1 -
 2 files changed, 12 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 8803a69fc260..0d3667f92023 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -165,17 +165,6 @@ bool is_supported_compression(const char *ext)
 	return false;
 }
 
-bool is_kmodule_extension(const char *ext)
-{
-	if (strncmp(ext, "ko", 2))
-		return false;
-
-	if (ext[2] == '\0' || (ext[2] == '.' && is_supported_compression(ext+3)))
-		return true;
-
-	return false;
-}
-
 bool is_kernel_module(const char *pathname)
 {
 	struct kmod_path m;
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 54dd03a490ce..88f345cc5be2 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -190,7 +190,6 @@ char dso__symtab_origin(const struct dso *dso);
 int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type type,
 				   char *root_dir, char *filename, size_t size);
 bool is_supported_compression(const char *ext);
-bool is_kmodule_extension(const char *ext);
 bool is_kernel_module(const char *pathname);
 bool decompress_to_file(const char *ext, const char *filename, int output_fd);
 bool dso__needs_decompress(struct dso *dso);
-- 
1.9.3


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

* [PATCH 06/25] perf tools: Try to lookup kernel module map before creating one
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 05/25] perf tools: Remove is_kmodule_extension function Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 07/25] perf annotate: Allow annotation for decompressed kernel modules Arnaldo Carvalho de Melo
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Currently we assume machine__new_module is called only once for each
module so we create its map&dso unconditionally.

However it's possible that it's called multiple times for same module.
Like for perf record:

  1) via machine__create_module during machine init
  2) via kernel MMAP event processing

Trying to lookup kernel module map before creating one.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-kx76xfqpnrpho5hdaapbqm09@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 1de5438ad070..e3353307330c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -498,6 +498,11 @@ struct map *machine__new_module(struct machine *machine, u64 start,
 	if (kmod_path__parse_name(&m, filename))
 		return NULL;
 
+	map = map_groups__find_by_name(&machine->kmaps, MAP__FUNCTION,
+				       m.name);
+	if (map)
+		goto out;
+
 	dso = machine__module_dso(machine, &m, filename);
 	if (dso == NULL)
 		goto out;
-- 
1.9.3


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

* [PATCH 07/25] perf annotate: Allow annotation for decompressed kernel modules
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 06/25] perf tools: Try to lookup kernel module map before creating one Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 08/25] perf tools: Remove (null) value of "Sort order" for perf mem report Arnaldo Carvalho de Melo
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Decompressing kernel module file for objdump command if needed.
Annotation commands now display annotation for compressed kernel
modules.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-x4jcytk2d5qjmnjvb0w75q3f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 61bf9128e1f2..b72086eca943 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1008,6 +1008,32 @@ fallback:
 			}
 			filename = symfs_filename;
 		}
+	} else if (dso__needs_decompress(dso)) {
+		char tmp[PATH_MAX];
+		struct kmod_path m;
+		int fd;
+		bool ret;
+
+		if (kmod_path__parse_ext(&m, symfs_filename))
+			goto out_free_filename;
+
+		snprintf(tmp, PATH_MAX, "/tmp/perf-kmod-XXXXXX");
+
+		fd = mkstemp(tmp);
+		if (fd < 0) {
+			free(m.ext);
+			goto out_free_filename;
+		}
+
+		ret = decompress_to_file(m.ext, symfs_filename, fd);
+
+		free(m.ext);
+		close(fd);
+
+		if (!ret)
+			goto out_free_filename;
+
+		strcpy(symfs_filename, tmp);
 	}
 
 	snprintf(command, sizeof(command),
@@ -1027,7 +1053,7 @@ fallback:
 
 	file = popen(command, "r");
 	if (!file)
-		goto out_free_filename;
+		goto out_remove_tmp;
 
 	while (!feof(file))
 		if (symbol__parse_objdump_line(sym, map, file, privsize,
@@ -1042,6 +1068,10 @@ fallback:
 		delete_last_nop(sym);
 
 	pclose(file);
+
+out_remove_tmp:
+	if (dso__needs_decompress(dso))
+		unlink(symfs_filename);
 out_free_filename:
 	if (delete_extract)
 		kcore_extract__delete(&kce);
-- 
1.9.3


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

* [PATCH 08/25] perf tools: Remove (null) value of "Sort order" for perf mem report
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 07/25] perf annotate: Allow annotation for decompressed kernel modules Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 09/25] perf probe: Fix to get ummapped symbol address on kernel Arnaldo Carvalho de Melo
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Yunlong Song, Paul Mackerras, Peter Zijlstra,
	Wang Nan, Arnaldo Carvalho de Melo

From: Yunlong Song <yunlong.song@huawei.com>

When '--sort' is not set, 'perf mem report" will print a null pointer as
the output value of sort order, so fix it.

Example:

Before this patch:

 $ perf mem report
 # To display the perf.data header info, please use --header/--header-only options.
 #
 # Samples: 18  of event 'cpu/mem-loads/pp'
 # Total weight : 188
 # Sort order   : (null)
 #
 ...

After this patch:

 $ perf mem report
 # To display the perf.data header info, please use --header/--header-only options.
 #
 # Samples: 18  of event 'cpu/mem-loads/pp'
 # Total weight : 188
 # Sort order   : local_weight,mem,sym,dso,symbol_daddr,dso_daddr,snoop,tlb,locked
 #
 ...

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1427082605-12881-1-git-send-email-yunlong.song@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-report.c | 2 +-
 tools/perf/util/sort.h      | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0ae482689e3c..81c2f3b97c50 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -304,7 +304,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
 
 	if (rep->mem_mode) {
 		ret += fprintf(fp, "\n# Total weight : %" PRIu64, nr_events);
-		ret += fprintf(fp, "\n# Sort order   : %s", sort_order);
+		ret += fprintf(fp, "\n# Sort order   : %s", sort_order ? : default_mem_sort_order);
 	} else
 		ret += fprintf(fp, "\n# Event count (approx.): %" PRIu64, nr_events);
 	return ret + fprintf(fp, "\n#\n");
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 9c01b83eebca..846036a921dc 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -44,6 +44,7 @@ extern struct sort_entry sort_dso_to;
 extern struct sort_entry sort_sym_from;
 extern struct sort_entry sort_sym_to;
 extern enum sort_type sort__first_dimension;
+extern const char default_mem_sort_order[];
 
 struct he_stat {
 	u64			period;
-- 
1.9.3


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

* [PATCH 09/25] perf probe: Fix to get ummapped symbol address on kernel
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 08/25] perf tools: Remove (null) value of "Sort order" for perf mem report Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 10/25] tools lib traceevent: Factor out allocating and processing args Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masami Hiramatsu, He Kuang, Namhyung Kim,
	Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo

From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Fix to get correctly unmapped symbol address on kernel.  This allows us
to probe on syscall symbols which are aliases of SyS_ functions with
using debuginfo.

Without this fix:
  ----
  # ./perf probe -a sys_write
  Failed to find debug information for address 3b0100
  Probe point 'sys_write' not found.
    Error: Failed to add events.
  ----
The address 0x3b0100 is a mapped address, and not usable
in debuginfo.

With this fix:
  ----
  # ./perf probe -a sys_write
  Added new event:
    probe:sys_write      (on sys_write)

  You can now use it in all perf tools, such as:

          perf record -e probe:sys_write -aR sleep 1
  ----

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20150322114022.32639.19096.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 6b95985db5b0..8feac0774c41 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -310,7 +310,10 @@ static int find_alternative_probe_point(struct debuginfo *dinfo,
 
 	/* Find the address of given function */
 	map__for_each_symbol_by_name(map, pp->function, sym) {
-		address = sym->start;
+		if (uprobes)
+			address = sym->start;
+		else
+			address = map->unmap_ip(map, sym->start);
 		break;
 	}
 	if (!address) {
-- 
1.9.3


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

* [PATCH 10/25] tools lib traceevent: Factor out allocating and processing args
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 09/25] perf probe: Fix to get ummapped symbol address on kernel Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 11/25] perf kmem: Print big numbers using thousands' group Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Javi Merino, Jiri Olsa, Arnaldo Carvalho de Melo

From: Javi Merino <javi.merino@arm.com>

The sequence of allocating the print_arg field, calling process_arg()
and verifying that the next event delimiter is repeated twice in
process_hex() and will also be used for process_int_array().

Factor it out to a function to avoid writing the same code again and
again.

Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1426875176-30244-2-git-send-email-javi.merino@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c | 77 ++++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 37 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index d7c37a7d9255..8e5e4f6137bb 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -2014,6 +2014,38 @@ process_entry(struct event_format *event __maybe_unused, struct print_arg *arg,
 	return EVENT_ERROR;
 }
 
+static int alloc_and_process_delim(struct event_format *event, char *next_token,
+				   struct print_arg **print_arg)
+{
+	struct print_arg *field;
+	enum event_type type;
+	char *token;
+	int ret = 0;
+
+	field = alloc_arg();
+	if (!field) {
+		do_warning_event(event, "%s: not enough memory!", __func__);
+		errno = ENOMEM;
+		return -1;
+	}
+
+	type = process_arg(event, field, &token);
+
+	if (test_type_token(type, token, EVENT_DELIM, next_token)) {
+		errno = EINVAL;
+		ret = -1;
+		free_arg(field);
+		goto out_free_token;
+	}
+
+	*print_arg = field;
+
+out_free_token:
+	free_token(token);
+
+	return ret;
+}
+
 static char *arg_eval (struct print_arg *arg);
 
 static unsigned long long
@@ -2486,49 +2518,20 @@ out_free:
 static enum event_type
 process_hex(struct event_format *event, struct print_arg *arg, char **tok)
 {
-	struct print_arg *field;
-	enum event_type type;
-	char *token = NULL;
-
 	memset(arg, 0, sizeof(*arg));
 	arg->type = PRINT_HEX;
 
-	field = alloc_arg();
-	if (!field) {
-		do_warning_event(event, "%s: not enough memory!", __func__);
-		goto out_free;
-	}
-
-	type = process_arg(event, field, &token);
-
-	if (test_type_token(type, token, EVENT_DELIM, ","))
-		goto out_free;
-
-	arg->hex.field = field;
-
-	free_token(token);
-
-	field = alloc_arg();
-	if (!field) {
-		do_warning_event(event, "%s: not enough memory!", __func__);
-		*tok = NULL;
-		return EVENT_ERROR;
-	}
-
-	type = process_arg(event, field, &token);
-
-	if (test_type_token(type, token, EVENT_DELIM, ")"))
-		goto out_free;
+	if (alloc_and_process_delim(event, ",", &arg->hex.field))
+		goto out;
 
-	arg->hex.size = field;
+	if (alloc_and_process_delim(event, ")", &arg->hex.size))
+		goto free_field;
 
-	free_token(token);
-	type = read_token_item(tok);
-	return type;
+	return read_token_item(tok);
 
- out_free:
-	free_arg(field);
-	free_token(token);
+free_field:
+	free_arg(arg->hex.field);
+out:
 	*tok = NULL;
 	return EVENT_ERROR;
 }
-- 
1.9.3


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

* [PATCH 11/25] perf kmem: Print big numbers using thousands' group
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 10/25] tools lib traceevent: Factor out allocating and processing args Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 13/25] perf target: Simplify handling of strerror_r return Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, David Ahern, Jiri Olsa, Joonsoo Kim,
	Minchan Kim, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

Like perf stat, this makes easy to read the numbers on stat like below:

  # perf kmem stat

  SUMMARY
  =======
  Total bytes requested: 9,770,900
  Total bytes allocated: 9,782,712
  Total bytes wasted on internal fragmentation: 11,812
  Internal fragmentation: 0.120744%
  Cross CPU allocations: 74/152,819

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1427092244-22764-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kmem.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 8c85aeb3327a..64d3623d45a0 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -20,6 +20,7 @@
 
 #include <linux/rbtree.h>
 #include <linux/string.h>
+#include <locale.h>
 
 struct alloc_stat;
 typedef int (*sort_fn_t)(struct alloc_stat *, struct alloc_stat *);
@@ -325,13 +326,13 @@ static void __print_result(struct rb_root *root, struct perf_session *session,
 static void print_summary(void)
 {
 	printf("\nSUMMARY\n=======\n");
-	printf("Total bytes requested: %lu\n", total_requested);
-	printf("Total bytes allocated: %lu\n", total_allocated);
-	printf("Total bytes wasted on internal fragmentation: %lu\n",
+	printf("Total bytes requested: %'lu\n", total_requested);
+	printf("Total bytes allocated: %'lu\n", total_allocated);
+	printf("Total bytes wasted on internal fragmentation: %'lu\n",
 	       total_allocated - total_requested);
 	printf("Internal fragmentation: %f%%\n",
 	       fragmentation(total_requested, total_allocated));
-	printf("Cross CPU allocations: %lu/%lu\n", nr_cross_allocs, nr_allocs);
+	printf("Cross CPU allocations: %'lu/%'lu\n", nr_cross_allocs, nr_allocs);
 }
 
 static void print_result(struct perf_session *session)
@@ -706,6 +707,8 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
 	symbol__init(&session->header.env);
 
 	if (!strcmp(argv[0], "stat")) {
+		setlocale(LC_ALL, "");
+
 		if (cpu__setup_cpunode_map())
 			goto out_delete;
 
-- 
1.9.3


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

* [PATCH 13/25] perf target: Simplify handling of strerror_r return
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 11/25] perf kmem: Print big numbers using thousands' group Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
	Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

To deal with forwarding the strerror_r (GNU) return we need to check if
the returned value is the buffer we passed or maybe some constant
(unknown error), simplify that action by using scnprintf, that will do
all the buflen size checks, trimming if needed.

Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-d0ik6i5gjew56j0qphql28ou@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/target.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c
index e74c5963dc7a..a53603b27e52 100644
--- a/tools/perf/util/target.c
+++ b/tools/perf/util/target.c
@@ -123,11 +123,8 @@ int target__strerror(struct target *target, int errnum,
 	if (errnum >= 0) {
 		const char *err = strerror_r(errnum, buf, buflen);
 
-		if (err != buf) {
-			size_t len = strlen(err);
-			memcpy(buf, err, min(buflen - 1, len));
-			*(buf + min(buflen - 1, len)) = '\0';
-		}
+		if (err != buf)
+			scnprintf(buf, buflen, "%s", err);
 
 		return 0;
 	}
-- 
1.9.3


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

* [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 13/25] perf target: Simplify handling of strerror_r return Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-27 10:32   ` Borislav Petkov
  2015-03-24 16:19 ` [PATCH 15/25] tools lib traceevent: Handle NULL comm name Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  23 siblings, 1 reply; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
	Namhyung Kim, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Before, when some problem happened while trying to load the kernel
symtab, 'perf top' would show:

      ┌─Warning:───────────────────────────┐
      │The vmlinux file can't be used.     │
      │Kernel samples will not be resolved.│
      │                                    │
      │                                    │
      │Press any key...                    │
      └────────────────────────────────────┘

Now, it reports:

  # perf top --vmlinux /dev/null

      ┌─Warning:───────────────────────────────────────────┐
      │The /tmp/passwd file can't be used: Invalid ELF file│
      │Kernel samples will not be resolved.                │
      │                                                    │
      │                                                    │
      │Press any key...                                    │
      └────────────────────────────────────────────────────┘

This is possible because we now register the reason for not being able
to load the symtab in the dso->load_errno member, and provide a
dso__strerror_load() routine to format this error into a strerror like
string with a short reason for the error while loading.

That can be just forwarding the dso__strerror_load() call to
strerror_r(), or, for a separate errno range providing a custom message.

Reported-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-u5rb5uq63xqhkfb8uv2lxd5u@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-top.c         |  6 ++++--
 tools/perf/util/dso.c            | 33 +++++++++++++++++++++++++++++++++
 tools/perf/util/dso.h            | 28 ++++++++++++++++++++++++++++
 tools/perf/util/symbol-elf.c     | 37 +++++++++++++++++++++++++++----------
 tools/perf/util/symbol-minimal.c |  7 ++++---
 5 files changed, 96 insertions(+), 15 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 5fb8723c7128..1cb3436276d1 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -757,8 +757,10 @@ static void perf_event__process_sample(struct perf_tool *tool,
 		    al.map == machine->vmlinux_maps[MAP__FUNCTION] &&
 		    RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) {
 			if (symbol_conf.vmlinux_name) {
-				ui__warning("The %s file can't be used.\n%s",
-					    symbol_conf.vmlinux_name, msg);
+				char serr[256];
+				dso__strerror_load(al.map->dso, serr, sizeof(serr));
+				ui__warning("The %s file can't be used: %s\n%s",
+					    symbol_conf.vmlinux_name, serr, msg);
 			} else {
 				ui__warning("A vmlinux file was not found.\n%s",
 					    msg);
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 0d3667f92023..fc0ddd5792a9 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -1137,3 +1137,36 @@ enum dso_type dso__type(struct dso *dso, struct machine *machine)
 
 	return dso__type_fd(fd);
 }
+
+int dso__strerror_load(struct dso *dso, char *buf, size_t buflen)
+{
+	int idx, errnum = dso->load_errno;
+	/*
+	 * This must have a same ordering as the enum dso_load_errno.
+	 */
+	static const char *dso_load__error_str[] = {
+	"Internal tools/perf/ library error",
+	"Invalid ELF file",
+	"Can not read build id",
+	"Mismatching build id",
+	"Decompression failure",
+	};
+
+	BUG_ON(buflen == 0);
+
+	if (errnum >= 0) {
+		const char *err = strerror_r(errnum, buf, buflen);
+
+		if (err != buf)
+			scnprintf(buf, buflen, "%s", err);
+
+		return 0;
+	}
+
+	if (errnum <  __DSO_LOAD_ERRNO__START || errnum >= __DSO_LOAD_ERRNO__END)
+		return -1;
+
+	idx = errnum - __DSO_LOAD_ERRNO__START;
+	scnprintf(buf, buflen, "%s", dso_load__error_str[idx]);
+	return 0;
+}
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 88f345cc5be2..e0901b4ed8de 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -60,6 +60,31 @@ enum dso_type {
 	DSO__TYPE_X32BIT,
 };
 
+enum dso_load_errno {
+	DSO_LOAD_ERRNO__SUCCESS		= 0,
+
+	/*
+	 * Choose an arbitrary negative big number not to clash with standard
+	 * errno since SUS requires the errno has distinct positive values.
+	 * See 'Issue 6' in the link below.
+	 *
+	 * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
+	 */
+	__DSO_LOAD_ERRNO__START		= -10000,
+
+	DSO_LOAD_ERRNO__INTERNAL_ERROR	= __DSO_LOAD_ERRNO__START,
+
+	/* for symsrc__init() */
+	DSO_LOAD_ERRNO__INVALID_ELF,
+	DSO_LOAD_ERRNO__CANNOT_READ_BUILDID,
+	DSO_LOAD_ERRNO__MISMATCHING_BUILDID,
+
+	/* for decompress_kmodule */
+	DSO_LOAD_ERRNO__DECOMPRESSION_FAILURE,
+
+	__DSO_LOAD_ERRNO__END,
+};
+
 #define DSO__SWAP(dso, type, val)			\
 ({							\
 	type ____r = val;				\
@@ -113,6 +138,7 @@ struct dso {
 	enum dso_swap_type	needs_swap;
 	enum dso_binary_type	symtab_type;
 	enum dso_binary_type	binary_type;
+	enum dso_load_errno	load_errno;
 	u8		 adjust_symbols:1;
 	u8		 has_build_id:1;
 	u8		 has_srcline:1;
@@ -294,4 +320,6 @@ void dso__free_a2l(struct dso *dso);
 
 enum dso_type dso__type(struct dso *dso, struct machine *machine);
 
+int dso__strerror_load(struct dso *dso, char *buf, size_t buflen);
+
 #endif /* __PERF_DSO */
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 78ffde9df9bf..476268c99431 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -595,10 +595,13 @@ static int decompress_kmodule(struct dso *dso, const char *name,
 		return -1;
 
 	fd = mkstemp(tmpbuf);
-	if (fd < 0)
+	if (fd < 0) {
+		dso->load_errno = errno;
 		goto out;
+	}
 
 	if (!decompress_to_file(m.ext, name, fd)) {
+		dso->load_errno = DSO_LOAD_ERRNO__DECOMPRESSION_FAILURE;
 		close(fd);
 		fd = -1;
 	}
@@ -635,37 +638,49 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 	Elf *elf;
 	int fd;
 
-	if (dso__needs_decompress(dso))
+	if (dso__needs_decompress(dso)) {
 		fd = decompress_kmodule(dso, name, type);
-	else
+		if (fd < 0)
+			return -1;
+	} else {
 		fd = open(name, O_RDONLY);
-
-	if (fd < 0)
-		return -1;
+		if (fd < 0) {
+			dso->load_errno = errno;
+			return -1;
+		}
+	}
 
 	elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
 	if (elf == NULL) {
 		pr_debug("%s: cannot read %s ELF file.\n", __func__, name);
+		dso->load_errno = DSO_LOAD_ERRNO__INVALID_ELF;
 		goto out_close;
 	}
 
 	if (gelf_getehdr(elf, &ehdr) == NULL) {
+		dso->load_errno = DSO_LOAD_ERRNO__INVALID_ELF;
 		pr_debug("%s: cannot get elf header.\n", __func__);
 		goto out_elf_end;
 	}
 
-	if (dso__swap_init(dso, ehdr.e_ident[EI_DATA]))
+	if (dso__swap_init(dso, ehdr.e_ident[EI_DATA])) {
+		dso->load_errno = DSO_LOAD_ERRNO__INTERNAL_ERROR;
 		goto out_elf_end;
+	}
 
 	/* Always reject images with a mismatched build-id: */
 	if (dso->has_build_id) {
 		u8 build_id[BUILD_ID_SIZE];
 
-		if (elf_read_build_id(elf, build_id, BUILD_ID_SIZE) < 0)
+		if (elf_read_build_id(elf, build_id, BUILD_ID_SIZE) < 0) {
+			dso->load_errno = DSO_LOAD_ERRNO__CANNOT_READ_BUILDID;
 			goto out_elf_end;
+		}
 
-		if (!dso__build_id_equal(dso, build_id))
+		if (!dso__build_id_equal(dso, build_id)) {
+			dso->load_errno = DSO_LOAD_ERRNO__MISMATCHING_BUILDID;
 			goto out_elf_end;
+		}
 	}
 
 	ss->is_64_bit = (gelf_getclass(elf) == ELFCLASS64);
@@ -701,8 +716,10 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 	}
 
 	ss->name   = strdup(name);
-	if (!ss->name)
+	if (!ss->name) {
+		dso->load_errno = errno;
 		goto out_elf_end;
+	}
 
 	ss->elf    = elf;
 	ss->fd     = fd;
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index d7efb03b3f9a..fd8477cacf88 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -246,13 +246,12 @@ out:
 	return ret;
 }
 
-int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
-		 const char *name,
+int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 	         enum dso_binary_type type)
 {
 	int fd = open(name, O_RDONLY);
 	if (fd < 0)
-		return -1;
+		goto out_errno;
 
 	ss->name = strdup(name);
 	if (!ss->name)
@@ -264,6 +263,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
 	return 0;
 out_close:
 	close(fd);
+out_errno:
+	dso->load_errno = errno;
 	return -1;
 }
 
-- 
1.9.3


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

* [PATCH 15/25] tools lib traceevent: Handle NULL comm name
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 16/25] tools lib traceevent: Copy trace_clock and free it Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Josef Bacik, Andrew Morton, Jiri Olsa,
	Namhyung Kim, Steven Rostedt, Arnaldo Carvalho de Melo

From: Josef Bacik <jbacik@fb.com>

It is possible that a pid has no associated comm attached to it, although it
can still be passed to pevent_register_comm().

But if comm is NULL, it will cause strdup() to segfault. To prevent this
from happening, if comm is NULL use the default "<...>" name for the
pid.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135922.549965495@goodmis.org
Link: http://lkml.kernel.org/p/1403799732-30308-1-git-send-email-jbacik@fb.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 8e5e4f6137bb..31d4e7da191c 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -304,7 +304,10 @@ int pevent_register_comm(struct pevent *pevent, const char *comm, int pid)
 	if (!item)
 		return -1;
 
-	item->comm = strdup(comm);
+	if (comm)
+		item->comm = strdup(comm);
+	else
+		item->comm = strdup("<...>");
 	if (!item->comm) {
 		free(item);
 		return -1;
-- 
1.9.3


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

* [PATCH 16/25] tools lib traceevent: Copy trace_clock and free it
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 15/25] tools lib traceevent: Handle NULL comm name Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 17/25] tools lib traceevent: Handle %z in bprint format Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt (Red Hat),
	Andrew Morton, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The pevent->trace_clock should not be a direct pointer to what was
given. It should be copied and freed.

Note, valgrind pointed this out when a caller passed in a pointer that
needed to be freed and it never was. Ideally, pevent should copy it
(which this change does), and free the copy. It's up to the caller to
free the clock string passed in.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135922.695906738@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c | 10 ++++++++--
 tools/lib/traceevent/event-parse.h |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 31d4e7da191c..e71c472d6a81 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -321,9 +321,14 @@ int pevent_register_comm(struct pevent *pevent, const char *comm, int pid)
 	return 0;
 }
 
-void pevent_register_trace_clock(struct pevent *pevent, char *trace_clock)
+int pevent_register_trace_clock(struct pevent *pevent, const char *trace_clock)
 {
-	pevent->trace_clock = trace_clock;
+	pevent->trace_clock = strdup(trace_clock);
+	if (!pevent->trace_clock) {
+		errno = ENOMEM;
+		return -1;
+	}
+	return 0;
 }
 
 struct func_map {
@@ -6352,6 +6357,7 @@ void pevent_free(struct pevent *pevent)
 		free_handler(handle);
 	}
 
+	free(pevent->trace_clock);
 	free(pevent->events);
 	free(pevent->sort_events);
 
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 6abda54d76f2..84e554f84574 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -599,7 +599,7 @@ enum trace_flag_type {
 };
 
 int pevent_register_comm(struct pevent *pevent, const char *comm, int pid);
-void pevent_register_trace_clock(struct pevent *pevent, char *trace_clock);
+int pevent_register_trace_clock(struct pevent *pevent, const char *trace_clock);
 int pevent_register_function(struct pevent *pevent, char *name,
 			     unsigned long long addr, char *mod);
 int pevent_register_print_string(struct pevent *pevent, const char *fmt,
-- 
1.9.3


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

* [PATCH 17/25] tools lib traceevent: Handle %z in bprint format
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 16/25] tools lib traceevent: Copy trace_clock and free it Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 18/25] tools lib traceevent: Add pevent_data_pid_from_comm() Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt (Red Hat),
	Andrew Morton, Jiri Olsa, Namhyung Kim, Shawn Bohrer,
	Arnaldo Carvalho de Melo

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The %z printf specifier was not handled making trace_printk()s in the
kernel that used this break on output.

Reported-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Shawn Bohrer <shawn.bohrer@gmail.com>
Link: http://lkml.kernel.org/r/20150324135922.844361717@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index e71c472d6a81..bdb1dd618e0e 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4008,6 +4008,10 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc
 				goto process_again;
 			case '.':
 				goto process_again;
+			case 'z':
+			case 'Z':
+				ls = 1;
+				goto process_again;
 			case 'p':
 				ls = 1;
 				/* fall through */
-- 
1.9.3


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

* [PATCH 18/25] tools lib traceevent: Add pevent_data_pid_from_comm()
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 17/25] tools lib traceevent: Handle %z in bprint format Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 19/25] tools lib traceevent: Make plugin options either string or boolean Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt (Red Hat),
	Andrew Morton, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

There is a pevent_data_comm_from_pid() that returns the cmdline stored for
a given pid in order for users to map pids to comms, but there's no method
to convert a comm back to a pid. This is useful for filters that specify
a comm instead of a PID (it's faster than searching each individual event).

Add a way to retrieve a comm from a pid. Since there can be more than one
pid associated to a comm, it returns a data structure that lets the user
iterate over all the saved comms for a given pid.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135923.001103479@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c | 90 ++++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/event-parse.h |  5 +++
 2 files changed, 95 insertions(+)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index bdb1dd618e0e..bc227225c7f4 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4954,6 +4954,96 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid)
 	return comm;
 }
 
+static struct cmdline *
+pid_from_cmdlist(struct pevent *pevent, const char *comm, struct cmdline *next)
+{
+	struct cmdline_list *cmdlist = (struct cmdline_list *)next;
+
+	if (cmdlist)
+		cmdlist = cmdlist->next;
+	else
+		cmdlist = pevent->cmdlist;
+
+	while (cmdlist && strcmp(cmdlist->comm, comm) != 0)
+		cmdlist = cmdlist->next;
+
+	return (struct cmdline *)cmdlist;
+}
+
+/**
+ * pevent_data_pid_from_comm - return the pid from a given comm
+ * @pevent: a handle to the pevent
+ * @comm: the cmdline to find the pid from
+ * @next: the cmdline structure to find the next comm
+ *
+ * This returns the cmdline structure that holds a pid for a given
+ * comm, or NULL if none found. As there may be more than one pid for
+ * a given comm, the result of this call can be passed back into
+ * a recurring call in the @next paramater, and then it will find the
+ * next pid.
+ * Also, it does a linear seach, so it may be slow.
+ */
+struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *comm,
+					  struct cmdline *next)
+{
+	struct cmdline *cmdline;
+
+	/*
+	 * If the cmdlines have not been converted yet, then use
+	 * the list.
+	 */
+	if (!pevent->cmdlines)
+		return pid_from_cmdlist(pevent, comm, next);
+
+	if (next) {
+		/*
+		 * The next pointer could have been still from
+		 * a previous call before cmdlines were created
+		 */
+		if (next < pevent->cmdlines ||
+		    next >= pevent->cmdlines + pevent->cmdline_count)
+			next = NULL;
+		else
+			cmdline  = next++;
+	}
+
+	if (!next)
+		cmdline = pevent->cmdlines;
+
+	while (cmdline < pevent->cmdlines + pevent->cmdline_count) {
+		if (strcmp(cmdline->comm, comm) == 0)
+			return cmdline;
+		cmdline++;
+	}
+	return NULL;
+}
+
+/**
+ * pevent_cmdline_pid - return the pid associated to a given cmdline
+ * @cmdline: The cmdline structure to get the pid from
+ *
+ * Returns the pid for a give cmdline. If @cmdline is NULL, then
+ * -1 is returned.
+ */
+int pevent_cmdline_pid(struct pevent *pevent, struct cmdline *cmdline)
+{
+	struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
+
+	if (!cmdline)
+		return -1;
+
+	/*
+	 * If cmdlines have not been created yet, or cmdline is
+	 * not part of the array, then treat it as a cmdlist instead.
+	 */
+	if (!pevent->cmdlines ||
+	    cmdline < pevent->cmdlines ||
+	    cmdline >= pevent->cmdlines + pevent->cmdline_count)
+		return cmdlist->pid;
+
+	return cmdline->pid;
+}
+
 /**
  * pevent_data_comm_from_pid - parse the data into the print format
  * @s: the trace_seq to write to
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 84e554f84574..8bd7c6a4cbd7 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -678,6 +678,11 @@ int pevent_data_type(struct pevent *pevent, struct pevent_record *rec);
 struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type);
 int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec);
 const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid);
+struct cmdline;
+struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *comm,
+					  struct cmdline *next);
+int pevent_cmdline_pid(struct pevent *pevent, struct cmdline *cmdline);
+
 void pevent_event_info(struct trace_seq *s, struct event_format *event,
 		       struct pevent_record *record);
 int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum,
-- 
1.9.3


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

* [PATCH 19/25] tools lib traceevent: Make plugin options either string or boolean
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 18/25] tools lib traceevent: Add pevent_data_pid_from_comm() Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 21/25] tools lib traceevent: Add way to find sub buffer boundary Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt, Steven Rostedt, Andrew Morton,
	Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo

From: Steven Rostedt <srostedt@redhat.com>

When a plugin option is defined, by default it is a boolean (true or false).

If the option is something else, then it needs to set its "value" field to
a default string other than NULL (can be just "").

If the value is not set then the option is considered boolean, and the
updating of the option value will be handled accordingly.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135923.308372986@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.h  |  6 +++-
 tools/lib/traceevent/event-plugin.c | 60 +++++++++++++++++++++++++++++++++----
 2 files changed, 59 insertions(+), 7 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 8bd7c6a4cbd7..8ca1b8ee50da 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -116,7 +116,7 @@ struct pevent_plugin_option {
 	char				*name;
 	char				*plugin_alias;
 	char				*description;
-	char				*value;
+	const char			*value;
 	void				*priv;
 	int				set;
 };
@@ -154,6 +154,10 @@ struct pevent_plugin_option {
  *   .plugin_alias is used to give a shorter name to access
  *   the vairable. Useful if a plugin handles more than one event.
  *
+ *   If .value is not set, then it is considered a boolean and only
+ *   .set will be processed. If .value is defined, then it is considered
+ *   a string option and .set will be ignored.
+ *
  * PEVENT_PLUGIN_ALIAS: (optional)
  *   The name to use for finding options (uses filename if not defined)
  */
diff --git a/tools/lib/traceevent/event-plugin.c b/tools/lib/traceevent/event-plugin.c
index 136162c03af1..a16756ae3526 100644
--- a/tools/lib/traceevent/event-plugin.c
+++ b/tools/lib/traceevent/event-plugin.c
@@ -18,6 +18,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
+#include <ctype.h>
 #include <stdio.h>
 #include <string.h>
 #include <dlfcn.h>
@@ -49,6 +50,52 @@ struct plugin_list {
 	void			*handle;
 };
 
+static void lower_case(char *str)
+{
+	if (!str)
+		return;
+	for (; *str; str++)
+		*str = tolower(*str);
+}
+
+static int update_option_value(struct pevent_plugin_option *op, const char *val)
+{
+	char *op_val;
+
+	if (!val) {
+		/* toggle, only if option is boolean */
+		if (op->value)
+			/* Warn? */
+			return 0;
+		op->set ^= 1;
+		return 0;
+	}
+
+	/*
+	 * If the option has a value then it takes a string
+	 * otherwise the option is a boolean.
+	 */
+	if (op->value) {
+		op->value = val;
+		return 0;
+	}
+
+	/* Option is boolean, must be either "1", "0", "true" or "false" */
+
+	op_val = strdup(val);
+	if (!op_val)
+		return -1;
+	lower_case(op_val);
+
+	if (strcmp(val, "1") == 0 || strcmp(val, "true") == 0)
+		op->set = 1;
+	else if (strcmp(val, "0") == 0 || strcmp(val, "false") == 0)
+		op->set = 0;
+	free(op_val);
+
+	return 0;
+}
+
 /**
  * traceevent_plugin_list_options - get list of plugin options
  *
@@ -120,6 +167,7 @@ update_option(const char *file, struct pevent_plugin_option *option)
 {
 	struct trace_plugin_options *op;
 	char *plugin;
+	int ret = 0;
 
 	if (option->plugin_alias) {
 		plugin = strdup(option->plugin_alias);
@@ -144,9 +192,10 @@ update_option(const char *file, struct pevent_plugin_option *option)
 		if (strcmp(op->option, option->name) != 0)
 			continue;
 
-		option->value = op->value;
-		option->set ^= 1;
-		goto out;
+		ret = update_option_value(option, op->value);
+		if (ret)
+			goto out;
+		break;
 	}
 
 	/* first look for unnamed options */
@@ -156,14 +205,13 @@ update_option(const char *file, struct pevent_plugin_option *option)
 		if (strcmp(op->option, option->name) != 0)
 			continue;
 
-		option->value = op->value;
-		option->set ^= 1;
+		ret = update_option_value(option, op->value);
 		break;
 	}
 
  out:
 	free(plugin);
-	return 0;
+	return ret;
 }
 
 /**
-- 
1.9.3


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

* [PATCH 21/25] tools lib traceevent: Add way to find sub buffer boundary
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 19/25] tools lib traceevent: Make plugin options either string or boolean Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 22/25] tools lib traceevent: Free filter tokens in process_filter() Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt (Red Hat),
	Andrew Morton, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

For debugging purposes, it may be helpful for the kbuffer library to flag
when crossing a sub buffer.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135923.650983637@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/kbuffer-parse.c | 11 +++++++++++
 tools/lib/traceevent/kbuffer.h       |  1 +
 2 files changed, 12 insertions(+)

diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c
index deb3569ab004..3bcada3ae05a 100644
--- a/tools/lib/traceevent/kbuffer-parse.c
+++ b/tools/lib/traceevent/kbuffer-parse.c
@@ -729,3 +729,14 @@ void kbuffer_set_old_format(struct kbuffer *kbuf)
 
 	kbuf->next_event = __old_next_event;
 }
+
+/**
+ * kbuffer_start_of_data - return offset of where data starts on subbuffer
+ * @kbuf:	The kbuffer
+ *
+ * Returns the location on the subbuffer where the data starts.
+ */
+int kbuffer_start_of_data(struct kbuffer *kbuf)
+{
+	return kbuf->start;
+}
diff --git a/tools/lib/traceevent/kbuffer.h b/tools/lib/traceevent/kbuffer.h
index c831f64b17a0..03dce757553f 100644
--- a/tools/lib/traceevent/kbuffer.h
+++ b/tools/lib/traceevent/kbuffer.h
@@ -63,5 +63,6 @@ int kbuffer_missed_events(struct kbuffer *kbuf);
 int kbuffer_subbuffer_size(struct kbuffer *kbuf);
 
 void kbuffer_set_old_format(struct kbuffer *kbuf);
+int kbuffer_start_of_data(struct kbuffer *kbuf);
 
 #endif /* _K_BUFFER_H */
-- 
1.9.3


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

* [PATCH 22/25] tools lib traceevent: Free filter tokens in process_filter()
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 21/25] tools lib traceevent: Add way to find sub buffer boundary Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 23/25] tools lib traceevent: Add support for __print_array() Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt (Red Hat),
	Andrew Morton, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

valgrind showed that the filter token wasn't being freed properly in
process_filter().

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135923.817723903@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/parse-filter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index b50234402fc2..0144b3d1bb77 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1058,6 +1058,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 					*parg = current_op;
 				else
 					*parg = current_exp;
+				free(token);
 				return PEVENT_ERRNO__UNBALANCED_PAREN;
 			}
 			break;
@@ -1168,6 +1169,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 
 	*parg = current_op;
 
+	free(token);
 	return 0;
 
  fail_alloc:
-- 
1.9.3


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

* [PATCH 23/25] tools lib traceevent: Add support for __print_array()
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (19 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 22/25] tools lib traceevent: Free filter tokens in process_filter() Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 24/25] perf diff: Add kallsyms option Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Javi Merino, Jiri Olsa, Arnaldo Carvalho de Melo

From: Javi Merino <javi.merino@arm.com>

Since 6ea22486ba46 ("tracing: Add array printing helper") trace can
generate traces with variable element size arrays.  Add support to
parse them.

Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1427195239-15730-1-git-send-email-javi.merino@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c                 | 93 ++++++++++++++++++++++
 tools/lib/traceevent/event-parse.h                 |  8 ++
 .../perf/util/scripting-engines/trace-event-perl.c |  5 ++
 .../util/scripting-engines/trace-event-python.c    |  5 ++
 4 files changed, 111 insertions(+)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index bc227225c7f4..b6d11eea8a57 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -766,6 +766,11 @@ static void free_arg(struct print_arg *arg)
 		free_arg(arg->hex.field);
 		free_arg(arg->hex.size);
 		break;
+	case PRINT_INT_ARRAY:
+		free_arg(arg->int_array.field);
+		free_arg(arg->int_array.count);
+		free_arg(arg->int_array.el_size);
+		break;
 	case PRINT_TYPE:
 		free(arg->typecast.type);
 		free_arg(arg->typecast.item);
@@ -2545,6 +2550,32 @@ out:
 }
 
 static enum event_type
+process_int_array(struct event_format *event, struct print_arg *arg, char **tok)
+{
+	memset(arg, 0, sizeof(*arg));
+	arg->type = PRINT_INT_ARRAY;
+
+	if (alloc_and_process_delim(event, ",", &arg->int_array.field))
+		goto out;
+
+	if (alloc_and_process_delim(event, ",", &arg->int_array.count))
+		goto free_field;
+
+	if (alloc_and_process_delim(event, ")", &arg->int_array.el_size))
+		goto free_size;
+
+	return read_token_item(tok);
+
+free_size:
+	free_arg(arg->int_array.count);
+free_field:
+	free_arg(arg->int_array.field);
+out:
+	*tok = NULL;
+	return EVENT_ERROR;
+}
+
+static enum event_type
 process_dynamic_array(struct event_format *event, struct print_arg *arg, char **tok)
 {
 	struct format_field *field;
@@ -2839,6 +2870,10 @@ process_function(struct event_format *event, struct print_arg *arg,
 		free_token(token);
 		return process_hex(event, arg, tok);
 	}
+	if (strcmp(token, "__print_array") == 0) {
+		free_token(token);
+		return process_int_array(event, arg, tok);
+	}
 	if (strcmp(token, "__get_str") == 0) {
 		free_token(token);
 		return process_str(event, arg, tok);
@@ -3367,6 +3402,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
 		break;
 	case PRINT_FLAGS:
 	case PRINT_SYMBOL:
+	case PRINT_INT_ARRAY:
 	case PRINT_HEX:
 		break;
 	case PRINT_TYPE:
@@ -3777,6 +3813,54 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
 		}
 		break;
 
+	case PRINT_INT_ARRAY: {
+		void *num;
+		int el_size;
+
+		if (arg->int_array.field->type == PRINT_DYNAMIC_ARRAY) {
+			unsigned long offset;
+			struct format_field *field =
+				arg->int_array.field->dynarray.field;
+			offset = pevent_read_number(pevent,
+						    data + field->offset,
+						    field->size);
+			num = data + (offset & 0xffff);
+		} else {
+			field = arg->int_array.field->field.field;
+			if (!field) {
+				str = arg->int_array.field->field.name;
+				field = pevent_find_any_field(event, str);
+				if (!field)
+					goto out_warning_field;
+				arg->int_array.field->field.field = field;
+			}
+			num = data + field->offset;
+		}
+		len = eval_num_arg(data, size, event, arg->int_array.count);
+		el_size = eval_num_arg(data, size, event,
+				       arg->int_array.el_size);
+		for (i = 0; i < len; i++) {
+			if (i)
+				trace_seq_putc(s, ' ');
+
+			if (el_size == 1) {
+				trace_seq_printf(s, "%u", *(uint8_t *)num);
+			} else if (el_size == 2) {
+				trace_seq_printf(s, "%u", *(uint16_t *)num);
+			} else if (el_size == 4) {
+				trace_seq_printf(s, "%u", *(uint32_t *)num);
+			} else if (el_size == 8) {
+				trace_seq_printf(s, "%lu", *(uint64_t *)num);
+			} else {
+				trace_seq_printf(s, "BAD SIZE:%d 0x%x",
+						 el_size, *(uint8_t *)num);
+				el_size = 1;
+			}
+
+			num += el_size;
+		}
+		break;
+	}
 	case PRINT_TYPE:
 		break;
 	case PRINT_STRING: {
@@ -5361,6 +5445,15 @@ static void print_args(struct print_arg *args)
 		print_args(args->hex.size);
 		printf(")");
 		break;
+	case PRINT_INT_ARRAY:
+		printf("__print_array(");
+		print_args(args->int_array.field);
+		printf(", ");
+		print_args(args->int_array.count);
+		printf(", ");
+		print_args(args->int_array.el_size);
+		printf(")");
+		break;
 	case PRINT_STRING:
 	case PRINT_BSTRING:
 		printf("__get_str(%s)", args->string.string);
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 8ca1b8ee50da..86a5839fb048 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -251,6 +251,12 @@ struct print_arg_hex {
 	struct print_arg	*size;
 };
 
+struct print_arg_int_array {
+	struct print_arg	*field;
+	struct print_arg	*count;
+	struct print_arg	*el_size;
+};
+
 struct print_arg_dynarray {
 	struct format_field	*field;
 	struct print_arg	*index;
@@ -279,6 +285,7 @@ enum print_arg_type {
 	PRINT_FLAGS,
 	PRINT_SYMBOL,
 	PRINT_HEX,
+	PRINT_INT_ARRAY,
 	PRINT_TYPE,
 	PRINT_STRING,
 	PRINT_BSTRING,
@@ -298,6 +305,7 @@ struct print_arg {
 		struct print_arg_flags		flags;
 		struct print_arg_symbol		symbol;
 		struct print_arg_hex		hex;
+		struct print_arg_int_array	int_array;
 		struct print_arg_func		func;
 		struct print_arg_string		string;
 		struct print_arg_bitmask	bitmask;
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index 22ebc46226e7..8171fed4136e 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -214,6 +214,11 @@ static void define_event_symbols(struct event_format *event,
 		define_event_symbols(event, ev_name, args->hex.field);
 		define_event_symbols(event, ev_name, args->hex.size);
 		break;
+	case PRINT_INT_ARRAY:
+		define_event_symbols(event, ev_name, args->int_array.field);
+		define_event_symbols(event, ev_name, args->int_array.count);
+		define_event_symbols(event, ev_name, args->int_array.el_size);
+		break;
 	case PRINT_BSTRING:
 	case PRINT_DYNAMIC_ARRAY:
 	case PRINT_STRING:
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 0c815a40a6e8..2ec5dfb5a456 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -231,6 +231,11 @@ static void define_event_symbols(struct event_format *event,
 		define_event_symbols(event, ev_name, args->hex.field);
 		define_event_symbols(event, ev_name, args->hex.size);
 		break;
+	case PRINT_INT_ARRAY:
+		define_event_symbols(event, ev_name, args->int_array.field);
+		define_event_symbols(event, ev_name, args->int_array.count);
+		define_event_symbols(event, ev_name, args->int_array.el_size);
+		break;
 	case PRINT_STRING:
 		break;
 	case PRINT_TYPE:
-- 
1.9.3


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

* [PATCH 24/25] perf diff: Add kallsyms option
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (20 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 23/25] tools lib traceevent: Add support for __print_array() Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:19 ` [PATCH 25/25] perf tools: Add pid/tid filtering to report and script commands Arnaldo Carvalho de Melo
  2015-03-24 16:26 ` [GIT PULL 00/25] perf/core improvements and fixes Ingo Molnar
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, David Ahern, Jiri Olsa, Arnaldo Carvalho de Melo

From: David Ahern <dsahern@gmail.com>

Required for off-box analysis to convert kernel addresses.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1427212317-7018-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-diff.txt | 3 +++
 tools/perf/builtin-diff.c              | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/tools/perf/Documentation/perf-diff.txt b/tools/perf/Documentation/perf-diff.txt
index 518266192d67..d1deb573877f 100644
--- a/tools/perf/Documentation/perf-diff.txt
+++ b/tools/perf/Documentation/perf-diff.txt
@@ -31,6 +31,9 @@ OPTIONS
 --dump-raw-trace::
         Dump raw trace in ASCII.
 
+--kallsyms=<file>::
+        kallsyms pathname
+
 -m::
 --modules::
         Load module symbols. WARNING: use only with -k and LIVE kernel
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 473887d1d61a..df6307b4050a 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -791,6 +791,8 @@ static const struct option options[] = {
 	OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
 		    "dump raw trace in ASCII"),
 	OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
+	OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
+		   "file", "kallsyms pathname"),
 	OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
 		    "load module symbols - WARNING: use only with -k and LIVE kernel"),
 	OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
-- 
1.9.3


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

* [PATCH 25/25] perf tools: Add pid/tid filtering to report and script commands
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (21 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 24/25] perf diff: Add kallsyms option Arnaldo Carvalho de Melo
@ 2015-03-24 16:19 ` Arnaldo Carvalho de Melo
  2015-03-24 16:26 ` [GIT PULL 00/25] perf/core improvements and fixes Ingo Molnar
  23 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-24 16:19 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, David Ahern, Adrian Hunter, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Stephane Eranian,
	Arnaldo Carvalho de Melo

From: David Ahern <dsahern@gmail.com>

The 'record' and 'top' tools already allow a user to specify a CSV of
pids and/or tids of tasks to collect data.

Add those options to the 'report' and 'script' analysis commands to only
consider samples related to the given pids/tids.

This is also inline with the existing comm option.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1427212361-7066-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-report.txt |  5 +++++
 tools/perf/Documentation/perf-script.txt |  6 ++++++
 tools/perf/builtin-report.c              |  4 ++++
 tools/perf/builtin-script.c              |  4 ++++
 tools/perf/util/symbol.c                 | 31 ++++++++++++++++++++++++++++++-
 tools/perf/util/symbol.h                 |  7 +++++++
 tools/perf/util/thread.h                 | 11 +++++++++++
 7 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index dd7cccdde498..4879cf638824 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -40,6 +40,11 @@ OPTIONS
 	Only consider symbols in these comms. CSV that understands
 	file://filename entries.  This option will affect the percentage of
 	the overhead column.  See --percentage for more info.
+--pid=::
+        Only show events for given process ID (comma separated list).
+
+--tid=::
+        Only show events for given thread ID (comma separated list).
 -d::
 --dsos=::
 	Only consider symbols in these dsos. CSV that understands
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index a21eec05bc42..79445750fcb3 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -193,6 +193,12 @@ OPTIONS
 	Only display events for these comms. CSV that understands
 	file://filename entries.
 
+--pid=::
+	Only show events for given process ID (comma separated list).
+
+--tid=::
+	Only show events for given thread ID (comma separated list).
+
 -I::
 --show-info::
 	Display extended information about the perf.data file. This adds
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 81c2f3b97c50..b5b2ad4ca9c4 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -669,6 +669,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
 		   "only consider symbols in these dsos"),
 	OPT_STRING('c', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
 		   "only consider symbols in these comms"),
+	OPT_STRING(0, "pid", &symbol_conf.pid_list_str, "pid[,pid...]",
+		   "only consider symbols in these pids"),
+	OPT_STRING(0, "tid", &symbol_conf.tid_list_str, "tid[,tid...]",
+		   "only consider symbols in these tids"),
 	OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]",
 		   "only consider these symbols"),
 	OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter",
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index f2a348b57b8f..662366ceb572 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1562,6 +1562,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_STRING('C', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
 	OPT_STRING('c', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
 		   "only display events for these comms"),
+	OPT_STRING(0, "pid", &symbol_conf.pid_list_str, "pid[,pid...]",
+		   "only consider symbols in these pids"),
+	OPT_STRING(0, "tid", &symbol_conf.tid_list_str, "tid[,tid...]",
+		   "only consider symbols in these tids"),
 	OPT_BOOLEAN('I', "show-info", &show_full_info,
 		    "display extended information from perf.data file"),
 	OPT_BOOLEAN('\0', "show-kernel-path", &symbol_conf.show_kernel_path,
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index a69066865a55..fddeb9073039 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -15,6 +15,7 @@
 #include "machine.h"
 #include "symbol.h"
 #include "strlist.h"
+#include "intlist.h"
 #include "header.h"
 
 #include <elf.h>
@@ -1859,6 +1860,20 @@ int setup_list(struct strlist **list, const char *list_str,
 	return 0;
 }
 
+int setup_intlist(struct intlist **list, const char *list_str,
+		  const char *list_name)
+{
+	if (list_str == NULL)
+		return 0;
+
+	*list = intlist__new(list_str);
+	if (!*list) {
+		pr_err("problems parsing %s list\n", list_name);
+		return -1;
+	}
+	return 0;
+}
+
 static bool symbol__read_kptr_restrict(void)
 {
 	bool value = false;
@@ -1909,9 +1924,17 @@ int symbol__init(struct perf_session_env *env)
 		       symbol_conf.comm_list_str, "comm") < 0)
 		goto out_free_dso_list;
 
+	if (setup_intlist(&symbol_conf.pid_list,
+		       symbol_conf.pid_list_str, "pid") < 0)
+		goto out_free_comm_list;
+
+	if (setup_intlist(&symbol_conf.tid_list,
+		       symbol_conf.tid_list_str, "tid") < 0)
+		goto out_free_pid_list;
+
 	if (setup_list(&symbol_conf.sym_list,
 		       symbol_conf.sym_list_str, "symbol") < 0)
-		goto out_free_comm_list;
+		goto out_free_tid_list;
 
 	/*
 	 * A path to symbols of "/" is identical to ""
@@ -1930,6 +1953,10 @@ int symbol__init(struct perf_session_env *env)
 	symbol_conf.initialized = true;
 	return 0;
 
+out_free_tid_list:
+	intlist__delete(symbol_conf.tid_list);
+out_free_pid_list:
+	intlist__delete(symbol_conf.pid_list);
 out_free_comm_list:
 	strlist__delete(symbol_conf.comm_list);
 out_free_dso_list:
@@ -1944,6 +1971,8 @@ void symbol__exit(void)
 	strlist__delete(symbol_conf.sym_list);
 	strlist__delete(symbol_conf.dso_list);
 	strlist__delete(symbol_conf.comm_list);
+	intlist__delete(symbol_conf.tid_list);
+	intlist__delete(symbol_conf.pid_list);
 	vmlinux_path__exit();
 	symbol_conf.sym_list = symbol_conf.dso_list = symbol_conf.comm_list = NULL;
 	symbol_conf.initialized = false;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index efdaaa544041..09561500164a 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -78,6 +78,7 @@ static inline size_t symbol__size(const struct symbol *sym)
 }
 
 struct strlist;
+struct intlist;
 
 struct symbol_conf {
 	unsigned short	priv_size;
@@ -115,6 +116,8 @@ struct symbol_conf {
 	const char	*guestmount;
 	const char	*dso_list_str,
 			*comm_list_str,
+			*pid_list_str,
+			*tid_list_str,
 			*sym_list_str,
 			*col_width_list_str;
        struct strlist	*dso_list,
@@ -124,6 +127,8 @@ struct symbol_conf {
 			*dso_to_list,
 			*sym_from_list,
 			*sym_to_list;
+	struct intlist	*pid_list,
+			*tid_list;
 	const char	*symfs;
 };
 
@@ -295,5 +300,7 @@ int compare_proc_modules(const char *from, const char *to);
 
 int setup_list(struct strlist **list, const char *list_str,
 	       const char *list_name);
+int setup_intlist(struct intlist **list, const char *list_str,
+		  const char *list_name);
 
 #endif /* __PERF_SYMBOL */
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 783b6688d2f7..9b8a54dc34a8 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -7,6 +7,7 @@
 #include <sys/types.h>
 #include "symbol.h"
 #include <strlist.h>
+#include <intlist.h>
 
 struct thread_stack;
 
@@ -100,6 +101,16 @@ static inline bool thread__is_filtered(struct thread *thread)
 		return true;
 	}
 
+	if (symbol_conf.pid_list &&
+	    !intlist__has_entry(symbol_conf.pid_list, thread->pid_)) {
+		return true;
+	}
+
+	if (symbol_conf.tid_list &&
+	    !intlist__has_entry(symbol_conf.tid_list, thread->tid)) {
+		return true;
+	}
+
 	return false;
 }
 
-- 
1.9.3


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

* Re: [GIT PULL 00/25] perf/core improvements and fixes
  2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (22 preceding siblings ...)
  2015-03-24 16:19 ` [PATCH 25/25] perf tools: Add pid/tid filtering to report and script commands Arnaldo Carvalho de Melo
@ 2015-03-24 16:26 ` Ingo Molnar
  23 siblings, 0 replies; 38+ messages in thread
From: Ingo Molnar @ 2015-03-24 16:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andrew Morton, Borislav Petkov,
	Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker,
	He Kuang, Javi Merino, Jiri Olsa, Joonsoo Kim, Josef Bacik,
	Masami Hiramatsu, Minchan Kim, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Shawn Bohrer, Stephane Eranian, Steven Rostedt,
	Vinson Lee, Wang Nan, Yann Droneaud, Yunlong Song,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling.
> 
> - Arnaldo
> 
> The following changes since commit 963a70b8a2d65538f7d58b2b84a2ae10a3ecb6ea:
> 
>   Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-03-22 10:56:19 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to e03eaa400cf8b8bded86cc5c41018a1c69152f16:
> 
>   perf tools: Add pid/tid filtering to report and script commands (2015-03-24 13:02:46 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Improve support of compressed kernel modules (Jiri Olsa)
> 
> - Add --kallsyms option to 'perf diff' (David Ahern)
> 
> - Add pid/tid filtering to 'report' and 'script' commands (David Ahern)
> 
> - Add support for __print_array() in libtraceevent (Javi Merino)
> 
> - Save DSO loading errno to better report errors (Arnaldo Carvalho de Melo)
> 
> - Fix 'probe' to get ummapped symbol address on kernel (Masami Hiramatsu)
> 
> - Print big numbers using thousands' group in 'kmem' (Namhyung Kim)
> 
> - Remove (null) value of "Sort order" for perf mem report (Yunlong Song)
> 
> Infrastructure:
> 
> - Handle NULL comm name in libtracevent (Josef Bacik)
> 
> - Libtraceevent synchronization with trace-cmd repo (Steven Rostedt)
> 
> - Work around lack of sched_getcpu in glibc < 2.6. (Vinson Lee)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf target: Simplify handling of strerror_r return
>       perf symbols: Save DSO loading errno to better report errors
> 
> David Ahern (2):
>       perf diff: Add kallsyms option
>       perf tools: Add pid/tid filtering to report and script commands
> 
> Javi Merino (2):
>       tools lib traceevent: Factor out allocating and processing args
>       tools lib traceevent: Add support for __print_array()
> 
> Jiri Olsa (7):
>       perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir
>       perf tools: Use kmod_path__parse in decompress_kmodule
>       perf tools: Use kmod_path__parse in is_kernel_module
>       perf tools: Remove compressed argument from is_kernel_module
>       perf tools: Remove is_kmodule_extension function
>       perf tools: Try to lookup kernel module map before creating one
>       perf annotate: Allow annotation for decompressed kernel modules
> 
> Josef Bacik (1):
>       tools lib traceevent: Handle NULL comm name
> 
> Masami Hiramatsu (1):
>       perf probe: Fix to get ummapped symbol address on kernel
> 
> Namhyung Kim (1):
>       perf kmem: Print big numbers using thousands' group
> 
> Steven Rostedt (1):
>       tools lib traceevent: Make plugin options either string or boolean
> 
> Steven Rostedt (Red Hat) (6):
>       tools lib traceevent: Copy trace_clock and free it
>       tools lib traceevent: Handle %z in bprint format
>       tools lib traceevent: Add pevent_data_pid_from_comm()
>       tools lib traceevent kbuffer: Remove extra update to data pointer in PADDING
>       tools lib traceevent: Add way to find sub buffer boundary
>       tools lib traceevent: Free filter tokens in process_filter()
> 
> Vinson Lee (1):
>       perf tools: Work around lack of sched_getcpu in glibc < 2.6.
> 
> Yunlong Song (1):
>       perf tools: Remove (null) value of "Sort order" for perf mem report
> 
>  tools/lib/traceevent/event-parse.c                 | 267 ++++++++++++++++++---
>  tools/lib/traceevent/event-parse.h                 |  21 +-
>  tools/lib/traceevent/event-plugin.c                |  60 ++++-
>  tools/lib/traceevent/kbuffer-parse.c               |  12 +-
>  tools/lib/traceevent/kbuffer.h                     |   1 +
>  tools/lib/traceevent/parse-filter.c                |   2 +
>  tools/perf/Documentation/perf-diff.txt             |   3 +
>  tools/perf/Documentation/perf-report.txt           |   5 +
>  tools/perf/Documentation/perf-script.txt           |   6 +
>  tools/perf/builtin-diff.c                          |   2 +
>  tools/perf/builtin-kmem.c                          |  11 +-
>  tools/perf/builtin-report.c                        |   6 +-
>  tools/perf/builtin-script.c                        |   4 +
>  tools/perf/builtin-top.c                           |   6 +-
>  tools/perf/util/annotate.c                         |  32 ++-
>  tools/perf/util/cloexec.c                          |   6 +
>  tools/perf/util/cloexec.h                          |   6 +
>  tools/perf/util/dso.c                              |  61 +++--
>  tools/perf/util/dso.h                              |  31 ++-
>  tools/perf/util/header.c                           |   2 +-
>  tools/perf/util/machine.c                          |  72 ++++--
>  tools/perf/util/probe-event.c                      |   5 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |   5 +
>  .../util/scripting-engines/trace-event-python.c    |   5 +
>  tools/perf/util/sort.h                             |   1 +
>  tools/perf/util/symbol-elf.c                       |  57 +++--
>  tools/perf/util/symbol-minimal.c                   |   7 +-
>  tools/perf/util/symbol.c                           |  31 ++-
>  tools/perf/util/symbol.h                           |   7 +
>  tools/perf/util/target.c                           |   7 +-
>  tools/perf/util/thread.h                           |  11 +
>  31 files changed, 621 insertions(+), 131 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors
  2015-03-24 16:19 ` [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors Arnaldo Carvalho de Melo
@ 2015-03-27 10:32   ` Borislav Petkov
  2015-03-27 14:37     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 38+ messages in thread
From: Borislav Petkov @ 2015-03-27 10:32 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
	Adrian Hunter, David Ahern, Don Zickus, Frederic Weisbecker,
	Namhyung Kim, Stephane Eranian

On Tue, Mar 24, 2015 at 01:19:29PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Before, when some problem happened while trying to load the kernel
> symtab, 'perf top' would show:
> 
>       ┌─Warning:───────────────────────────┐
>       │The vmlinux file can't be used.     │
>       │Kernel samples will not be resolved.│
>       │                                    │
>       │                                    │
>       │Press any key...                    │
>       └────────────────────────────────────┘
> 
> Now, it reports:
> 
>   # perf top --vmlinux /dev/null
> 
>       ┌─Warning:───────────────────────────────────────────┐
>       │The /tmp/passwd file can't be used: Invalid ELF file│
>       │Kernel samples will not be resolved.                │
>       │                                                    │
>       │                                                    │
>       │Press any key...                                    │
>       └────────────────────────────────────────────────────┘
> 
> This is possible because we now register the reason for not being able
> to load the symtab in the dso->load_errno member, and provide a
> dso__strerror_load() routine to format this error into a strerror like
> string with a short reason for the error while loading.
> 
> That can be just forwarding the dso__strerror_load() call to
> strerror_r(), or, for a separate errno range providing a custom message.
> 
> Reported-by: Ingo Molnar <mingo@kernel.org>
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Don Zickus <dzickus@redhat.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Stephane Eranian <eranian@google.com>
> Link: http://lkml.kernel.org/n/tip-u5rb5uq63xqhkfb8uv2lxd5u@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

...

> @@ -1137,3 +1137,36 @@ enum dso_type dso__type(struct dso *dso, struct machine *machine)
>  
>  	return dso__type_fd(fd);
>  }
> +
> +int dso__strerror_load(struct dso *dso, char *buf, size_t buflen)
> +{
> +	int idx, errnum = dso->load_errno;
> +	/*
> +	 * This must have a same ordering as the enum dso_load_errno.
> +	 */
> +	static const char *dso_load__error_str[] = {
> +	"Internal tools/perf/ library error",
> +	"Invalid ELF file",
> +	"Can not read build id",
> +	"Mismatching build id",
> +	"Decompression failure",
> +	};

You could define this str array by using the dso_load_errno defines so
that they're always in sync:

	static const char *dso_load__error_str[] = {
		[DSO_LOAD_ERRNO__INTERNAL_ERROR - __DSO_LOAD_ERRNO__START] = "Internal tools/perf/ library error",
		[DSO_LOAD_ERRNO__INVALID_ELF - __DSO_LOAD_ERRNO__START] = "Invalid ELF file",
		...

and even use a small macro to hide the __DSO_LOAD_ERRNO__START thing.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

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

* Re: [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors
  2015-03-27 10:32   ` Borislav Petkov
@ 2015-03-27 14:37     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-27 14:37 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, linux-kernel,
	Adrian Hunter, David Ahern, Don Zickus, Frederic Weisbecker,
	Namhyung Kim, Stephane Eranian

Em Fri, Mar 27, 2015 at 11:32:43AM +0100, Borislav Petkov escreveu:
> On Tue, Mar 24, 2015 at 01:19:29PM -0300, Arnaldo Carvalho de Melo wrote:
> > +	/*
> > +	 * This must have a same ordering as the enum dso_load_errno.
> > +	 */
> > +	static const char *dso_load__error_str[] = {
> > +	"Internal tools/perf/ library error",
> > +	"Invalid ELF file",
> > +	"Can not read build id",
> > +	"Mismatching build id",
> > +	"Decompression failure",
> > +	};
> 
> You could define this str array by using the dso_load_errno defines so
> that they're always in sync:
> 
> 	static const char *dso_load__error_str[] = {
> 		[DSO_LOAD_ERRNO__INTERNAL_ERROR - __DSO_LOAD_ERRNO__START] = "Internal tools/perf/ library error",
> 		[DSO_LOAD_ERRNO__INVALID_ELF - __DSO_LOAD_ERRNO__START] = "Invalid ELF file",
> 		...
> 
> and even use a small macro to hide the __DSO_LOAD_ERRNO__START thing.

Right, good idea, I'll change both this and the code that was used as a
template.

- Arnaldo

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

* Re: [GIT PULL 00/25] perf/core improvements and fixes
  2017-06-21 18:02 Arnaldo Carvalho de Melo
@ 2017-06-21 18:13 ` Ingo Molnar
  0 siblings, 0 replies; 38+ messages in thread
From: Ingo Molnar @ 2017-06-21 18:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, David Ahern, Jiri Olsa,
	Kan Liang, linuxppc-dev, Milian Wolff, Namhyung Kim,
	Naveen N . Rao, Paolo Bonzini, Peter Zijlstra, Ravi Bangoria,
	Robert Elliott, Stephane Eranian, Thomas Gleixner, Wang Nan,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 007b811b4041989ec2dc91b9614aa2c41332723e:
> 
>   Merge tag 'perf-core-for-mingo-4.13-20170719' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-06-20 10:49:08 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.13-20170621
> 
> for you to fetch changes up to 701516ae3dec801084bc913d21e03fce15c61a0b:
> 
>   perf script: Fix message because field list option is -F not -f (2017-06-21 11:35:53 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements ad fixes:
> 
> New features:
> 
> - Add support to measure SMI cost in 'perf stat' (Kan Liang)
> 
> - Add support for unwinding callchains in powerpc with libdw (Paolo Bonzini)
> 
> Fixes:
> 
> - Fix message: cpu list option is -C not -c (Adrian Hunter)
> 
> - Fix 'perf script' message: field list option is -F not -f (Adrian Hunter)
> 
> - Intel PT fixes: (Adrian Hunter)
> 
>   o Fix missing stack clear
>   o Ensure IP is zero when state is INTEL_PT_STATE_NO_IP
>   o Fix last_ip usage
>   o Ensure never to set 'last_ip' when packet 'count' is zero
>   o Clear FUP flag on error
>   o Fix transactions_sample_type
> 
> Infrastructure:
> 
> - Intel PT cleanups/refactorings (Adrian Hunter)
> 
>   o Use FUP always when scanning for an IP
>   o Add missing __fallthrough
>   o Remove redundant initial_skip checks
>   o Allow decoding with branch tracing disabled
>   o Add default config for pass-through branch enable
>   o Add documentation for new config terms
>   o Add decoder support for ptwrite and power event packets
>   o Add reserved byte to CBR packet payload
>   o Add decoder support for CBR events
> 
> - Move  find_process() to the only place that uses it, skimming some
>   more fat from util.[ch] (Arnaldo Carvalho de Melo)
> 
> - Do parameter validation earlier on fetch_kernel_version() (Arnaldo Carvalho de Melo)
> 
> - Remove unused _ALL_SOURCE define (Arnaldo Carvalho de Melo)
> 
> - Add sysfs__write_int function (Kan Liang)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (19):
>       perf intel-pt: Move decoder error setting into one condition
>       perf intel-pt: Improve sample timestamp
>       perf intel-pt: Fix missing stack clear
>       perf intel-pt: Ensure IP is zero when state is INTEL_PT_STATE_NO_IP
>       perf intel-pt: Fix last_ip usage
>       perf intel-pt: Ensure never to set 'last_ip' when packet 'count' is zero
>       perf intel-pt: Use FUP always when scanning for an IP
>       perf intel-pt: Clear FUP flag on error
>       perf intel-pt: Add missing __fallthrough
>       perf intel-pt: Allow decoding with branch tracing disabled
>       perf intel-pt: Add default config for pass-through branch enable
>       perf intel-pt: Add documentation for new config terms
>       perf intel-pt: Add decoder support for ptwrite and power event packets
>       perf intel-pt: Add reserved byte to CBR packet payload
>       perf intel-pt: Add decoder support for CBR events
>       perf intel-pt: Remove redundant initial_skip checks
>       perf intel-pt: Fix transactions_sample_type
>       perf tools: Fix message because cpu list option is -C not -c
>       perf script: Fix message because field list option is -F not -f
> 
> Arnaldo Carvalho de Melo (3):
>       perf evsel: Adopt find_process()
>       perf tools: Do parameter validation earlier on fetch_kernel_version()
>       perf tools: Remove unused _ALL_SOURCE define
> 
> Kan Liang (2):
>       tools lib api fs: Add sysfs__write_int function
>       perf stat: Add support to measure SMI cost
> 
> Paolo Bonzini (1):
>       perf unwind: Support for powerpc
> 
>  tools/lib/api/fs/fs.c                              |  30 +++
>  tools/lib/api/fs/fs.h                              |   4 +
>  tools/perf/Documentation/intel-pt.txt              |  36 +++
>  tools/perf/Documentation/perf-stat.txt             |  14 +
>  tools/perf/Makefile.config                         |   2 +-
>  tools/perf/arch/powerpc/util/Build                 |   2 +
>  tools/perf/arch/powerpc/util/unwind-libdw.c        |  73 ++++++
>  tools/perf/arch/x86/util/intel-pt.c                |   5 +
>  tools/perf/builtin-script.c                        |   2 +-
>  tools/perf/builtin-stat.c                          |  49 ++++
>  tools/perf/util/evsel.c                            |  39 +++
>  .../perf/util/intel-pt-decoder/intel-pt-decoder.c  | 290 +++++++++++++++++++--
>  .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |  13 +
>  .../util/intel-pt-decoder/intel-pt-pkt-decoder.c   | 110 +++++++-
>  .../util/intel-pt-decoder/intel-pt-pkt-decoder.h   |   7 +
>  tools/perf/util/intel-pt.c                         |  23 +-
>  tools/perf/util/session.c                          |   2 +-
>  tools/perf/util/stat-shadow.c                      |  33 +++
>  tools/perf/util/stat.c                             |   2 +
>  tools/perf/util/stat.h                             |   2 +
>  tools/perf/util/util.c                             |  52 +---
>  tools/perf/util/util.h                             |   3 -
>  22 files changed, 710 insertions(+), 83 deletions(-)
>  create mode 100644 tools/perf/arch/powerpc/util/unwind-libdw.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/25] perf/core improvements and fixes
@ 2017-06-21 18:02 Arnaldo Carvalho de Melo
  2017-06-21 18:13 ` Ingo Molnar
  0 siblings, 1 reply; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-21 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, linuxppc-dev,
	Milian Wolff, Namhyung Kim, Naveen N . Rao, Paolo Bonzini,
	Peter Zijlstra, Ravi Bangoria, Robert Elliott, Stephane Eranian,
	Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit 007b811b4041989ec2dc91b9614aa2c41332723e:

  Merge tag 'perf-core-for-mingo-4.13-20170719' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-06-20 10:49:08 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.13-20170621

for you to fetch changes up to 701516ae3dec801084bc913d21e03fce15c61a0b:

  perf script: Fix message because field list option is -F not -f (2017-06-21 11:35:53 -0300)

----------------------------------------------------------------
perf/core improvements ad fixes:

New features:

- Add support to measure SMI cost in 'perf stat' (Kan Liang)

- Add support for unwinding callchains in powerpc with libdw (Paolo Bonzini)

Fixes:

- Fix message: cpu list option is -C not -c (Adrian Hunter)

- Fix 'perf script' message: field list option is -F not -f (Adrian Hunter)

- Intel PT fixes: (Adrian Hunter)

  o Fix missing stack clear
  o Ensure IP is zero when state is INTEL_PT_STATE_NO_IP
  o Fix last_ip usage
  o Ensure never to set 'last_ip' when packet 'count' is zero
  o Clear FUP flag on error
  o Fix transactions_sample_type

Infrastructure:

- Intel PT cleanups/refactorings (Adrian Hunter)

  o Use FUP always when scanning for an IP
  o Add missing __fallthrough
  o Remove redundant initial_skip checks
  o Allow decoding with branch tracing disabled
  o Add default config for pass-through branch enable
  o Add documentation for new config terms
  o Add decoder support for ptwrite and power event packets
  o Add reserved byte to CBR packet payload
  o Add decoder support for CBR events

- Move  find_process() to the only place that uses it, skimming some
  more fat from util.[ch] (Arnaldo Carvalho de Melo)

- Do parameter validation earlier on fetch_kernel_version() (Arnaldo Carvalho de Melo)

- Remove unused _ALL_SOURCE define (Arnaldo Carvalho de Melo)

- Add sysfs__write_int function (Kan Liang)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (19):
      perf intel-pt: Move decoder error setting into one condition
      perf intel-pt: Improve sample timestamp
      perf intel-pt: Fix missing stack clear
      perf intel-pt: Ensure IP is zero when state is INTEL_PT_STATE_NO_IP
      perf intel-pt: Fix last_ip usage
      perf intel-pt: Ensure never to set 'last_ip' when packet 'count' is zero
      perf intel-pt: Use FUP always when scanning for an IP
      perf intel-pt: Clear FUP flag on error
      perf intel-pt: Add missing __fallthrough
      perf intel-pt: Allow decoding with branch tracing disabled
      perf intel-pt: Add default config for pass-through branch enable
      perf intel-pt: Add documentation for new config terms
      perf intel-pt: Add decoder support for ptwrite and power event packets
      perf intel-pt: Add reserved byte to CBR packet payload
      perf intel-pt: Add decoder support for CBR events
      perf intel-pt: Remove redundant initial_skip checks
      perf intel-pt: Fix transactions_sample_type
      perf tools: Fix message because cpu list option is -C not -c
      perf script: Fix message because field list option is -F not -f

Arnaldo Carvalho de Melo (3):
      perf evsel: Adopt find_process()
      perf tools: Do parameter validation earlier on fetch_kernel_version()
      perf tools: Remove unused _ALL_SOURCE define

Kan Liang (2):
      tools lib api fs: Add sysfs__write_int function
      perf stat: Add support to measure SMI cost

Paolo Bonzini (1):
      perf unwind: Support for powerpc

 tools/lib/api/fs/fs.c                              |  30 +++
 tools/lib/api/fs/fs.h                              |   4 +
 tools/perf/Documentation/intel-pt.txt              |  36 +++
 tools/perf/Documentation/perf-stat.txt             |  14 +
 tools/perf/Makefile.config                         |   2 +-
 tools/perf/arch/powerpc/util/Build                 |   2 +
 tools/perf/arch/powerpc/util/unwind-libdw.c        |  73 ++++++
 tools/perf/arch/x86/util/intel-pt.c                |   5 +
 tools/perf/builtin-script.c                        |   2 +-
 tools/perf/builtin-stat.c                          |  49 ++++
 tools/perf/util/evsel.c                            |  39 +++
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  | 290 +++++++++++++++++++--
 .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |  13 +
 .../util/intel-pt-decoder/intel-pt-pkt-decoder.c   | 110 +++++++-
 .../util/intel-pt-decoder/intel-pt-pkt-decoder.h   |   7 +
 tools/perf/util/intel-pt.c                         |  23 +-
 tools/perf/util/session.c                          |   2 +-
 tools/perf/util/stat-shadow.c                      |  33 +++
 tools/perf/util/stat.c                             |   2 +
 tools/perf/util/stat.h                             |   2 +
 tools/perf/util/util.c                             |  52 +---
 tools/perf/util/util.h                             |   3 -
 22 files changed, 710 insertions(+), 83 deletions(-)
 create mode 100644 tools/perf/arch/powerpc/util/unwind-libdw.c

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

Several are cross builds, the ones with -x-ARCH, and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.

The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.

Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:3.6: Ok
   4 alpine:edge: Ok
   5 android-ndk:r12b-arm: Ok
   6 archlinux:latest: Ok
   7 centos:5: Ok
   8 centos:6: Ok
   9 centos:7: Ok
  10 debian:7: Ok
  11 debian:8: Ok
  12 debian:9: Ok
  13 debian:experimental: Ok
  14 debian:experimental-x-arm64: Ok
  15 debian:experimental-x-mips: Ok
  16 debian:experimental-x-mips64: Ok
  17 debian:experimental-x-mipsel: Ok
  18 fedora:20: Ok
  19 fedora:21: Ok
  20 fedora:22: Ok
  21 fedora:23: Ok
  22 fedora:24: Ok
  23 fedora:24-x-ARC-uClibc: Ok
  24 fedora:25: Ok
  25 fedora:rawhide: Ok
  26 mageia:5: Ok
  27 opensuse:13.2: Ok
  28 opensuse:42.1: Ok
  29 opensuse:tumbleweed: Ok
  30 ubuntu:12.04.5: Ok
  31 ubuntu:14.04.4: Ok
  32 ubuntu:14.04.4-x-linaro-arm64: Ok
  33 ubuntu:15.10: Ok
  34 ubuntu:16.04: Ok
  35 ubuntu:16.04-x-arm: Ok
  36 ubuntu:16.04-x-arm64: Ok
  37 ubuntu:16.04-x-powerpc: Ok
  38 ubuntu:16.04-x-powerpc64: Ok
  39 ubuntu:16.04-x-powerpc64el: Ok
  40 ubuntu:16.04-x-s390: Ok
  41 ubuntu:16.10: Ok
  42 ubuntu:17.04: Ok
  # 

  # uname -a
  Linux jouet 4.12.0-rc4+ #1 SMP Fri Jun 9 12:59:23 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms            : Ok
   2: Detect openat syscall event                : Ok
   3: Detect openat syscall event on all cpus    : Ok
   4: Read samples using the mmap interface      : Ok
   5: Parse event definition strings             : Ok
   6: Simple expression parser                   : Ok
   7: PERF_RECORD_* events & perf_sample fields  : Ok
   8: Parse perf pmu format                      : Ok
   9: DSO data read                              : Ok
  10: DSO data cache                             : Ok
  11: DSO data reopen                            : Ok
  12: Roundtrip evsel->name                      : Ok
  13: Parse sched tracepoints fields             : Ok
  14: syscalls:sys_enter_openat event fields     : Ok
  15: Setup struct perf_event_attr               : Ok
  16: Match and link multiple hists              : Ok
  17: 'import perf' in python                    : Ok
  18: Breakpoint overflow signal handler         : Ok
  19: Breakpoint overflow sampling               : Ok
  20: Number of exit events of a simple workload : Ok
  21: Software clock events period values        : Ok
  22: Object code reading                        : Ok
  23: Sample parsing                             : Ok
  24: Use a dummy software event to keep tracking: Ok
  25: Parse with no sample_id_all bit set        : Ok
  26: Filter hist entries                        : Ok
  27: Lookup mmap thread                         : Ok
  28: Share thread mg                            : Ok
  29: Sort output of hist entries                : Ok
  30: Cumulate child hist entries                : Ok
  31: Track with sched_switch                    : Ok
  32: Filter fds with revents mask in a fdarray  : Ok
  33: Add fd to a fdarray, making it autogrow    : Ok
  34: kmod_path__parse                           : Ok
  35: Thread map                                 : Ok
  36: LLVM search and compile                    :
  36.1: Basic BPF llvm compile                    : Ok
  36.2: kbuild searching                          : Ok
  36.3: Compile source for BPF prologue generation: Ok
  36.4: Compile source for BPF relocation         : Ok
  37: Session topology                           : Ok
  38: BPF filter                                 :
  38.1: Basic BPF filtering                      : Ok
  38.2: BPF pinning                              : Ok
  38.3: BPF prologue generation                  : Ok
  38.4: BPF relocation checker                   : Ok
  39: Synthesize thread map                      : Ok
  40: Remove thread map                          : Ok
  41: Synthesize cpu map                         : Ok
  42: Synthesize stat config                     : Ok
  43: Synthesize stat                            : Ok
  44: Synthesize stat round                      : Ok
  45: Synthesize attr update                     : Ok
  46: Event times                                : Ok
  47: Read backward ring buffer                  : Ok
  48: Print cpu map                              : Ok
  49: Probe SDT events                           : Ok
  50: is_printable_array                         : Ok
  51: Print bitmap                               : Ok
  52: perf hooks                                 : Ok
  53: builtin clang support                      : Skip (not compiled in)
  54: unit_number__scnprintf                     : Ok
  55: x86 rdpmc                                  : Ok
  56: Convert perf time to TSC                   : Ok
  57: DWARF unwind                               : Ok
  58: x86 instruction decoder - new instructions : Ok
  59: Intel cqm nmi context read                 : Skip
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
               make_no_slang_O: make NO_SLANG=1
              make_clean_all_O: make clean all
                make_no_gtk2_O: make NO_GTK2=1
             make_no_libperl_O: make NO_LIBPERL=1
            make_no_auxtrace_O: make NO_AUXTRACE=1
                    make_doc_O: make doc
           make_no_libbionic_O: make NO_LIBBIONIC=1
           make_no_backtrace_O: make NO_BACKTRACE=1
              make_no_libelf_O: make NO_LIBELF=1
            make_no_libaudit_O: make NO_LIBAUDIT=1
             make_no_libnuma_O: make NO_LIBNUMA=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
            make_no_demangle_O: make NO_DEMANGLE=1
             make_util_map_o_O: make util/map.o
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
         make_with_clangllvm_O: make LIBCLANGLLVM=1
           make_no_libunwind_O: make NO_LIBUNWIND=1
           make_no_libpython_O: make NO_LIBPYTHON=1
                 make_perf_o_O: make perf.o
                   make_tags_O: make tags
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
            make_install_bin_O: make install-bin
                  make_debug_O: make DEBUG=1
              make_no_libbpf_O: make NO_LIBBPF=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
                   make_pure_O: make
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
         make_install_prefix_O: make install prefix=/tmp/krava
                make_install_O: make install
                   make_help_O: make help
                 make_static_O: make LDFLAGS=-static
                make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
                make_no_newt_O: make NO_NEWT=1
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $ 

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

* Re: [GIT PULL 00/25] perf/core improvements and fixes
  2015-05-27 15:38 Arnaldo Carvalho de Melo
@ 2015-05-27 16:43 ` Ingo Molnar
  0 siblings, 0 replies; 38+ messages in thread
From: Ingo Molnar @ 2015-05-27 16:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern,
	Don Zickus, Frederic Weisbecker, Jiri Olsa, Josef Bacik,
	kernel-team, Luigi Semenzato, Martin Liska, Masami Hiramatsu,
	Namhyung Kim, Nam T . Nguyen, Paul Mackerras, Peter Zijlstra,
	Richard Weinberger, Simon Que, Stephane Eranian,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Now with the intel PT patches removed except for one, for a problem I
> found when trying it on a machine without that feature and that Adrian improved
> things to make it clear it wasn't available.
> 
> 	Ah two patches from Masami, for perf probe, were added.
> 
> 	Please consider applying,
> 
> Regards,
> 
> - Arnaldo
> 
> The following changes since commit a82d24edfeaf1ed244cf8b969916840c6feb5165:
> 
>   perf/x86/intel/pt: Remove redundant variable declaration (2015-05-27 09:17:48 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to dddc7ee32fa13efc66afa71ebd83bce545c8392a:
> 
>   perf probe: Fix an error when deleting probes successfully (2015-05-27 12:21:46 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Add option in 'perf sched' to merge like comms to lat output (Josef Bacik)
> 
> - Improve 'perf probe' error messages when not finding a
>   suitable vmlinux (Masami Hiramatsu)
> 
> Infrastructure:
> 
> - Use atomic.h for various pre-existing reference counts (Arnaldo Carvalho de Melo)
> 
> - Leg work for refcounting 'struct map' (Arnaldo Carvalho de Melo)
> 
> - Assign default value for some pointers (Martin Liška)
> 
> - Improve setting of gcc debug option (Martin Liška)
> 
> - Separate the tests and tools in installation (Nam T. Nguyen)
> 
> - Reduce number of arguments of hist_entry_iter__add() (Namhyung Kim)
> 
> - DSO data cache fixes (Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (5):
>       perf tools: Fix function declarations needed by parse-events.y
>       perf tools: Fix parse_events_error dereferences
>       perf build: Fix libunwind feature detection on 32-bit x86
>       perf session: Fix perf_session__peek_event()
>       perf tools: Disallow PMU events intel_pt and intel_bts until there is support
> 
> Arnaldo Carvalho de Melo (10):
>       perf hists: Rename add_hist_entry to hists__findnew_entry
>       perf comm: Use atomic.h for refcounting
>       perf machine: Do not call map_groups__delete(), drop refcnt instead
>       perf tools: Rename maps__next
>       perf tools: Remove redundant initialization of thread linkage members
>       perf tools: Nuke unused map_groups__flush()
>       perf tools: Import rb_erase_init from block/ in the kernel sources
>       perf machine: Mark removed threads as such
>       perf tools: Leave DSO destruction to the map destruction
>       perf tools: Use maps__first()/map__next()
> 
> Josef Bacik (1):
>       perf sched: Add option to merge like comms to lat output
> 
> Martin Liska (1):
>       perf tools: Improve setting of gcc debug option
> 
> Martin Liška (1):
>       perf tools: Assign default value for some pointers
> 
> Masami Hiramatsu (2):
>       perf probe: Show the error reason comes from invalid DSO
>       perf probe: Fix an error when deleting probes successfully
> 
> Nam T. Nguyen (1):
>       perf tools: Separate the tests and tools in installation
> 
> Namhyung Kim (4):
>       perf hists: Reducing arguments of hist_entry_iter__add()
>       perf tools: Fix dso__data_read_offset() file opening
>       perf tools: Get rid of dso__data_fd() from dso__data_size()
>       perf tools: Add dso__data_get/put_fd()
> 
>  tools/perf/Makefile.perf               |  6 ++-
>  tools/perf/arch/common.c               |  2 +-
>  tools/perf/builtin-report.c            |  9 ++--
>  tools/perf/builtin-sched.c             | 77 +++++++++++++++++++++++++++--
>  tools/perf/builtin-top.c               |  7 +--
>  tools/perf/config/Makefile             |  4 +-
>  tools/perf/config/utilities.mak        | 19 ++++++++
>  tools/perf/tests/dso-data.c            | 11 +++++
>  tools/perf/tests/hists_cumulate.c      |  6 ++-
>  tools/perf/tests/hists_filter.c        |  4 +-
>  tools/perf/tests/hists_output.c        |  6 ++-
>  tools/perf/tests/vmlinux-kallsyms.c    | 34 ++++++-------
>  tools/perf/util/comm.c                 | 13 +++--
>  tools/perf/util/dso.c                  | 88 +++++++++++++++++++---------------
>  tools/perf/util/dso.h                  | 13 +++--
>  tools/perf/util/event.c                |  7 ++-
>  tools/perf/util/hist.c                 | 24 ++++------
>  tools/perf/util/hist.h                 |  1 -
>  tools/perf/util/include/linux/rbtree.h | 14 ++++++
>  tools/perf/util/machine.c              |  6 +--
>  tools/perf/util/map.c                  | 31 ++----------
>  tools/perf/util/map.h                  |  6 +--
>  tools/perf/util/parse-events.c         | 18 +++----
>  tools/perf/util/parse-events.h         |  6 +++
>  tools/perf/util/parse-events.y         |  6 ++-
>  tools/perf/util/pmu.c                  |  4 ++
>  tools/perf/util/probe-event.c          | 65 +++++++++++++------------
>  tools/perf/util/probe-event.h          |  3 --
>  tools/perf/util/session.c              |  6 +--
>  tools/perf/util/symbol.c               | 25 +++++-----
>  tools/perf/util/thread.c               |  2 -
>  tools/perf/util/trace-event-parse.c    |  2 +-
>  tools/perf/util/unwind-libunwind.c     | 11 +++--
>  33 files changed, 332 insertions(+), 204 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/25] perf/core improvements and fixes
@ 2015-05-27 15:38 Arnaldo Carvalho de Melo
  2015-05-27 16:43 ` Ingo Molnar
  0 siblings, 1 reply; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-05-27 15:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
	Jiri Olsa, Josef Bacik, kernel-team, Luigi Semenzato,
	Martin Liska, Masami Hiramatsu, Namhyung Kim, Nam T . Nguyen,
	Paul Mackerras, Peter Zijlstra, Richard Weinberger, Simon Que,
	Stephane Eranian, Arnaldo Carvalho de Melo

Hi Ingo,

	Now with the intel PT patches removed except for one, for a problem I
found when trying it on a machine without that feature and that Adrian improved
things to make it clear it wasn't available.

	Ah two patches from Masami, for perf probe, were added.

	Please consider applying,

Regards,

- Arnaldo

The following changes since commit a82d24edfeaf1ed244cf8b969916840c6feb5165:

  perf/x86/intel/pt: Remove redundant variable declaration (2015-05-27 09:17:48 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to dddc7ee32fa13efc66afa71ebd83bce545c8392a:

  perf probe: Fix an error when deleting probes successfully (2015-05-27 12:21:46 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

New features:

- Add option in 'perf sched' to merge like comms to lat output (Josef Bacik)

- Improve 'perf probe' error messages when not finding a
  suitable vmlinux (Masami Hiramatsu)

Infrastructure:

- Use atomic.h for various pre-existing reference counts (Arnaldo Carvalho de Melo)

- Leg work for refcounting 'struct map' (Arnaldo Carvalho de Melo)

- Assign default value for some pointers (Martin Liška)

- Improve setting of gcc debug option (Martin Liška)

- Separate the tests and tools in installation (Nam T. Nguyen)

- Reduce number of arguments of hist_entry_iter__add() (Namhyung Kim)

- DSO data cache fixes (Namhyung Kim)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (5):
      perf tools: Fix function declarations needed by parse-events.y
      perf tools: Fix parse_events_error dereferences
      perf build: Fix libunwind feature detection on 32-bit x86
      perf session: Fix perf_session__peek_event()
      perf tools: Disallow PMU events intel_pt and intel_bts until there is support

Arnaldo Carvalho de Melo (10):
      perf hists: Rename add_hist_entry to hists__findnew_entry
      perf comm: Use atomic.h for refcounting
      perf machine: Do not call map_groups__delete(), drop refcnt instead
      perf tools: Rename maps__next
      perf tools: Remove redundant initialization of thread linkage members
      perf tools: Nuke unused map_groups__flush()
      perf tools: Import rb_erase_init from block/ in the kernel sources
      perf machine: Mark removed threads as such
      perf tools: Leave DSO destruction to the map destruction
      perf tools: Use maps__first()/map__next()

Josef Bacik (1):
      perf sched: Add option to merge like comms to lat output

Martin Liska (1):
      perf tools: Improve setting of gcc debug option

Martin Liška (1):
      perf tools: Assign default value for some pointers

Masami Hiramatsu (2):
      perf probe: Show the error reason comes from invalid DSO
      perf probe: Fix an error when deleting probes successfully

Nam T. Nguyen (1):
      perf tools: Separate the tests and tools in installation

Namhyung Kim (4):
      perf hists: Reducing arguments of hist_entry_iter__add()
      perf tools: Fix dso__data_read_offset() file opening
      perf tools: Get rid of dso__data_fd() from dso__data_size()
      perf tools: Add dso__data_get/put_fd()

 tools/perf/Makefile.perf               |  6 ++-
 tools/perf/arch/common.c               |  2 +-
 tools/perf/builtin-report.c            |  9 ++--
 tools/perf/builtin-sched.c             | 77 +++++++++++++++++++++++++++--
 tools/perf/builtin-top.c               |  7 +--
 tools/perf/config/Makefile             |  4 +-
 tools/perf/config/utilities.mak        | 19 ++++++++
 tools/perf/tests/dso-data.c            | 11 +++++
 tools/perf/tests/hists_cumulate.c      |  6 ++-
 tools/perf/tests/hists_filter.c        |  4 +-
 tools/perf/tests/hists_output.c        |  6 ++-
 tools/perf/tests/vmlinux-kallsyms.c    | 34 ++++++-------
 tools/perf/util/comm.c                 | 13 +++--
 tools/perf/util/dso.c                  | 88 +++++++++++++++++++---------------
 tools/perf/util/dso.h                  | 13 +++--
 tools/perf/util/event.c                |  7 ++-
 tools/perf/util/hist.c                 | 24 ++++------
 tools/perf/util/hist.h                 |  1 -
 tools/perf/util/include/linux/rbtree.h | 14 ++++++
 tools/perf/util/machine.c              |  6 +--
 tools/perf/util/map.c                  | 31 ++----------
 tools/perf/util/map.h                  |  6 +--
 tools/perf/util/parse-events.c         | 18 +++----
 tools/perf/util/parse-events.h         |  6 +++
 tools/perf/util/parse-events.y         |  6 ++-
 tools/perf/util/pmu.c                  |  4 ++
 tools/perf/util/probe-event.c          | 65 +++++++++++++------------
 tools/perf/util/probe-event.h          |  3 --
 tools/perf/util/session.c              |  6 +--
 tools/perf/util/symbol.c               | 25 +++++-----
 tools/perf/util/thread.c               |  2 -
 tools/perf/util/trace-event-parse.c    |  2 +-
 tools/perf/util/unwind-libunwind.c     | 11 +++--
 33 files changed, 332 insertions(+), 204 deletions(-)

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

* Re: [GIT PULL 00/25] perf/core improvements and fixes
  2015-05-05 21:31 Arnaldo Carvalho de Melo
@ 2015-05-06  2:47 ` Ingo Molnar
  0 siblings, 0 replies; 38+ messages in thread
From: Ingo Molnar @ 2015-05-06  2:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Joonsoo Kim, linux-mm, Masami Hiramatsu, Minchan Kim,
	Namhyung Kim, Pekka Enberg, Peter Zijlstra, Stephane Eranian,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider applying, on top of previous requests,
> 
> - Arnaldo
> 
> The following changes since commit 0c160d495b5616e071bb4f873812e8f473128149:
> 
>   perf kmem: Add kmem.default config option (2015-05-04 13:34:48 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-3
> 
> for you to fetch changes up to 3698dab1c849c7e1cd440df4fca24baa1973d53b:
> 
>   perf tools: Move TUI-specific fields out of map_symbol (2015-05-05 18:13:24 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Improve --filter support for 'perf probe', allowing using its arguments
>   on other commands, as --add, --del, etc (Masami Hiramatsu)
> 
> - Show warning when running 'perf kmem stat' on a unsuitable perf.data file,
>   i.e. one with events that are not the ones required for the stat variant
>   used (Namhyung Kim).
> 
> Infrastructure:
> 
> - Auxtrace support patches, paving the way to support Intel PT and BTS (Adrian Hunter)
> 
> - hists browser (top, report) refactorings (Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (9):
>       perf report: Fix placement of itrace option in documentation
>       perf tools: Add AUX area tracing index
>       perf tools: Hit all build ids when AUX area tracing
>       perf tools: Add build option NO_AUXTRACE to exclude AUX area tracing
>       perf auxtrace: Add option to synthesize events for transactions
>       perf tools: Add support for PERF_RECORD_AUX
>       perf tools: Add support for PERF_RECORD_ITRACE_START
>       perf tools: Add AUX area tracing Snapshot Mode
>       perf record: Add AUX area tracing Snapshot Mode support
> 
> Masami Hiramatsu (4):
>       perf probe: Allow to use filter on --del command
>       perf probe: Accept filter argument for --funcs
>       perf probe: Remove redundant cleanup of params.filter
>       perf probe: Cleanup and consolidate command parsers
> 
> Namhyung Kim (12):
>       perf kmem: Show warning when trying to run stat without record
>       perf tools: Move TUI-specific fields into unnamed union
>       perf tools: Move init_have_children field to the unnamed union
>       perf hists browser: Fix possible memory leak
>       perf hists browser: Save hist_browser_timer pointer in hist_browser
>       perf hists browser: Save pstack in the hist_browser
>       perf hists browser: Save perf_session_env in the hist_browser
>       perf hists browser: Split popup menu actions
>       perf hists browser: Split popup menu actions - part 2
>       perf tools: Introduce pstack_peek()
>       perf hists browser: Simplify zooming code using pstack_peek()
>       perf tools: Move TUI-specific fields out of map_symbol
> 
>  tools/perf/Documentation/perf-inject.txt |   9 +-
>  tools/perf/Documentation/perf-probe.txt  |   3 +-
>  tools/perf/Documentation/perf-record.txt |   7 +
>  tools/perf/Documentation/perf-report.txt |  15 +-
>  tools/perf/Documentation/perf-script.txt |   9 +-
>  tools/perf/Makefile.perf                 |   2 +
>  tools/perf/builtin-buildid-list.c        |   9 +
>  tools/perf/builtin-inject.c              |  78 +++-
>  tools/perf/builtin-kmem.c                |  17 +-
>  tools/perf/builtin-probe.c               | 133 +++----
>  tools/perf/builtin-record.c              | 172 ++++++++-
>  tools/perf/config/Makefile               |   5 +
>  tools/perf/perf.h                        |   3 +
>  tools/perf/tests/make                    |   4 +-
>  tools/perf/ui/browsers/hists.c           | 633 +++++++++++++++++++------------
>  tools/perf/util/Build                    |   2 +-
>  tools/perf/util/auxtrace.c               | 305 ++++++++++++++-
>  tools/perf/util/auxtrace.h               | 217 +++++++++++
>  tools/perf/util/callchain.h              |   4 +
>  tools/perf/util/event.c                  |  39 ++
>  tools/perf/util/event.h                  |  24 ++
>  tools/perf/util/header.c                 |  31 +-
>  tools/perf/util/hist.c                   |   2 +-
>  tools/perf/util/machine.c                |  21 +
>  tools/perf/util/machine.h                |   4 +
>  tools/perf/util/parse-options.h          |   4 +
>  tools/perf/util/probe-event.c            | 102 ++---
>  tools/perf/util/probe-event.h            |   2 +-
>  tools/perf/util/pstack.c                 |   7 +
>  tools/perf/util/pstack.h                 |   1 +
>  tools/perf/util/session.c                |  32 ++
>  tools/perf/util/session.h                |   1 +
>  tools/perf/util/sort.h                   |  22 +-
>  tools/perf/util/symbol.h                 |   2 -
>  tools/perf/util/tool.h                   |   2 +
>  35 files changed, 1455 insertions(+), 468 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/25] perf/core improvements and fixes
@ 2015-05-05 21:31 Arnaldo Carvalho de Melo
  2015-05-06  2:47 ` Ingo Molnar
  0 siblings, 1 reply; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-05-05 21:31 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jiri Olsa, Joonsoo Kim,
	linux-mm, Masami Hiramatsu, Minchan Kim, Namhyung Kim,
	Pekka Enberg, Peter Zijlstra, Stephane Eranian,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider applying, on top of previous requests,

- Arnaldo

The following changes since commit 0c160d495b5616e071bb4f873812e8f473128149:

  perf kmem: Add kmem.default config option (2015-05-04 13:34:48 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-3

for you to fetch changes up to 3698dab1c849c7e1cd440df4fca24baa1973d53b:

  perf tools: Move TUI-specific fields out of map_symbol (2015-05-05 18:13:24 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Improve --filter support for 'perf probe', allowing using its arguments
  on other commands, as --add, --del, etc (Masami Hiramatsu)

- Show warning when running 'perf kmem stat' on a unsuitable perf.data file,
  i.e. one with events that are not the ones required for the stat variant
  used (Namhyung Kim).

Infrastructure:

- Auxtrace support patches, paving the way to support Intel PT and BTS (Adrian Hunter)

- hists browser (top, report) refactorings (Namhyung Kim)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (9):
      perf report: Fix placement of itrace option in documentation
      perf tools: Add AUX area tracing index
      perf tools: Hit all build ids when AUX area tracing
      perf tools: Add build option NO_AUXTRACE to exclude AUX area tracing
      perf auxtrace: Add option to synthesize events for transactions
      perf tools: Add support for PERF_RECORD_AUX
      perf tools: Add support for PERF_RECORD_ITRACE_START
      perf tools: Add AUX area tracing Snapshot Mode
      perf record: Add AUX area tracing Snapshot Mode support

Masami Hiramatsu (4):
      perf probe: Allow to use filter on --del command
      perf probe: Accept filter argument for --funcs
      perf probe: Remove redundant cleanup of params.filter
      perf probe: Cleanup and consolidate command parsers

Namhyung Kim (12):
      perf kmem: Show warning when trying to run stat without record
      perf tools: Move TUI-specific fields into unnamed union
      perf tools: Move init_have_children field to the unnamed union
      perf hists browser: Fix possible memory leak
      perf hists browser: Save hist_browser_timer pointer in hist_browser
      perf hists browser: Save pstack in the hist_browser
      perf hists browser: Save perf_session_env in the hist_browser
      perf hists browser: Split popup menu actions
      perf hists browser: Split popup menu actions - part 2
      perf tools: Introduce pstack_peek()
      perf hists browser: Simplify zooming code using pstack_peek()
      perf tools: Move TUI-specific fields out of map_symbol

 tools/perf/Documentation/perf-inject.txt |   9 +-
 tools/perf/Documentation/perf-probe.txt  |   3 +-
 tools/perf/Documentation/perf-record.txt |   7 +
 tools/perf/Documentation/perf-report.txt |  15 +-
 tools/perf/Documentation/perf-script.txt |   9 +-
 tools/perf/Makefile.perf                 |   2 +
 tools/perf/builtin-buildid-list.c        |   9 +
 tools/perf/builtin-inject.c              |  78 +++-
 tools/perf/builtin-kmem.c                |  17 +-
 tools/perf/builtin-probe.c               | 133 +++----
 tools/perf/builtin-record.c              | 172 ++++++++-
 tools/perf/config/Makefile               |   5 +
 tools/perf/perf.h                        |   3 +
 tools/perf/tests/make                    |   4 +-
 tools/perf/ui/browsers/hists.c           | 633 +++++++++++++++++++------------
 tools/perf/util/Build                    |   2 +-
 tools/perf/util/auxtrace.c               | 305 ++++++++++++++-
 tools/perf/util/auxtrace.h               | 217 +++++++++++
 tools/perf/util/callchain.h              |   4 +
 tools/perf/util/event.c                  |  39 ++
 tools/perf/util/event.h                  |  24 ++
 tools/perf/util/header.c                 |  31 +-
 tools/perf/util/hist.c                   |   2 +-
 tools/perf/util/machine.c                |  21 +
 tools/perf/util/machine.h                |   4 +
 tools/perf/util/parse-options.h          |   4 +
 tools/perf/util/probe-event.c            | 102 ++---
 tools/perf/util/probe-event.h            |   2 +-
 tools/perf/util/pstack.c                 |   7 +
 tools/perf/util/pstack.h                 |   1 +
 tools/perf/util/session.c                |  32 ++
 tools/perf/util/session.h                |   1 +
 tools/perf/util/sort.h                   |  22 +-
 tools/perf/util/symbol.h                 |   2 -
 tools/perf/util/tool.h                   |   2 +
 35 files changed, 1455 insertions(+), 468 deletions(-)

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

* [GIT PULL 00/25] perf/core improvements and fixes
@ 2013-11-25 14:17 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-11-25 14:17 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Pekka Enberg, Peter Zijlstra,
	Ramkumar Ramachandra, Stanislav Fomichev, Stephane Eranian,
	Steven Rostedt, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

Hi Ingo,

	Please consider pulling,

	This is based on top of a recent tip/perf/urgent.

- Arnaldo

The following changes since commit e98a6e59dff885eb387163b1a7abe019a44ba90b:

  Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2013-11-20 14:29:46 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 33d7da61e10ad7d43c60d4a5f4adb712361e5131:

  perf script: Print callchains and symbols if they exist (2013-11-22 15:47:41 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

. Make per-cpu mmaps the default in 'perf record', from Adrian Hunter.

. Default -t/--thread 'perf record' option to no inheritance,
  from Adrian Hunter.

. Make 'perf top -g' refer to callchains, for consistency with other tools,
  from David Ahern.

. Skip ignored symbols while printing callchain, from David Ahern.

. Print callchains and symbols if they exist in 'perf script',
  from David Ahern.

. Remove thread summary coloring in 'perf trace', from Pekka Enberg.

. zsh completion support, from Ramkumar Ramachandra.

. 'perf timechart' improvements, including backtrace support,
  from Stanislav Fomichev.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (4):
      perf record: Make per-cpu mmaps the default.
      perf tools: Allow '--inherit' as the negation of '--no-inherit'
      perf tools: Add option macro OPT_BOOLEAN_SET
      perf record: Default -t option to no inheritance

David Ahern (6):
      perf top: Make -g refer to callchains
      perf evsel: Skip ignored symbols while printing callchain
      perf symbols: Move idle syms check from top to generic function
      perf thread: Move comm_list check into function
      perf tools: Export setup_list
      perf script: Print callchains and symbols if they exist

Namhyung Kim (1):
      perf script: Move evname print code to process_event()

Pekka Enberg (1):
      perf trace: Remove thread summary coloring

Ramkumar Ramachandra (5):
      perf completion: Introduce a layer of indirection
      perf completion: Factor out compgen stuff
      perf completion: Factor out call to __ltrim_colon_completions
      perf completion: Introduce zsh support
      perf completion: Rename file to reflect zsh support

Stanislav Fomichev (7):
      perf timechart: Always try to print at least 15 tasks
      perf timechart: Add option to limit number of tasks
      perf timechart: Use proc_num to implement --power-only
      perf timechart: Add support for displaying only tasks related data
      perf timechart: Group figures and add title with details
      perf timechart: Add support for -P and -T in timechart recording
      perf timechart: Add backtrace support

Steven Rostedt (1):
      tools lib traceevent: Use helper trace-seq in print functions like kernel does

 tools/lib/traceevent/event-parse.c                 |   7 +-
 tools/perf/Documentation/perf-record.txt           |  12 +-
 tools/perf/Documentation/perf-timechart.txt        |  26 +-
 tools/perf/Documentation/perf-top.txt              |   5 +-
 tools/perf/Makefile.perf                           |   4 +-
 tools/perf/builtin-record.c                        |  13 +-
 tools/perf/builtin-script.c                        |  35 ++-
 tools/perf/builtin-timechart.c                     | 306 +++++++++++++++++----
 tools/perf/builtin-top.c                           |  29 +-
 tools/perf/builtin-trace.c                         |  13 +-
 tools/perf/{bash_completion => perf-completion.sh} | 100 ++++++-
 tools/perf/perf.h                                  |   1 +
 tools/perf/tests/attr/test-record-no-inherit       |   2 +-
 tools/perf/util/event.c                            |   3 +-
 tools/perf/util/evlist.c                           |   6 +-
 tools/perf/util/evsel.c                            |   5 +-
 tools/perf/util/parse-options.c                    |  21 ++
 tools/perf/util/parse-options.h                    |   8 +
 tools/perf/util/session.c                          |  10 +-
 tools/perf/util/svghelper.c                        |  77 +++++-
 tools/perf/util/svghelper.h                        |  11 +-
 tools/perf/util/symbol.c                           |  32 ++-
 tools/perf/util/symbol.h                           |   4 +
 tools/perf/util/target.c                           |  11 +-
 tools/perf/util/target.h                           |   4 +-
 tools/perf/util/thread.h                           |  12 +
 26 files changed, 603 insertions(+), 154 deletions(-)
 rename tools/perf/{bash_completion => perf-completion.sh} (65%)

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

* Re: [GIT PULL 00/25] perf/core improvements and fixes
  2013-01-31 17:25 Arnaldo Carvalho de Melo
@ 2013-02-01 10:18 ` Ingo Molnar
  0 siblings, 0 replies; 38+ messages in thread
From: Ingo Molnar @ 2013-02-01 10:18 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Andi Kleen, Anton Blanchard, David Ahern,
	Frederic Weisbecker, Jiri Olsa, linuxppc-dev, Mike Galbraith,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
	Peter Zijlstra, Robert Richter, Stephane Eranian,
	Sukadev Bhattiprolu, acme, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 152fefa921535665f95840c08062844ab2f5593e:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-01-31 10:20:14 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 2ac3634a7e1c8eedc961030c87c5c36ebd5bbf8e:
> 
>   perf: Document the ABI of perf sysfs entries (2013-01-31 13:07:51 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> . Make some POWER7 events available in sysfs, equivalent to
>   what was done on x86, from Sukadev Bhattiprolu.
> 
> . Add event group view, from Namyung Kim:
> 
>   To use it, 'perf record' should group events when recording. And then perf
>   report parses the saved group relation from file header and prints them
>   together if --group option is provided.  You can use 'perf evlist' command to
>   see event group information:
> 
>     $ perf record -e '{ref-cycles,cycles}' noploop 1
>     [ perf record: Woken up 2 times to write data ]
>     [ perf record: Captured and wrote 0.385 MB perf.data (~16807 samples) ]
> 
>     $ perf evlist --group
>     {ref-cycles,cycles}
> 
>   With this example, default perf report will show you each event
>   separately like this:
> 
>     $ perf report
>     ...
>     # group: {ref-cycles,cycles}
>     # ========
>     # Samples: 3K of event 'ref-cycles'
>     # Event count (approx.): 3153797218
>     #
>     # Overhead  Command      Shared Object                      Symbol
>     # ........  .......  .................  ..........................
>         99.84%  noploop  noploop            [.] main
>          0.07%  noploop  ld-2.15.so         [.] strcmp
>          0.03%  noploop  [kernel.kallsyms]  [k] timerqueue_del
>          0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
>          0.02%  noploop  [kernel.kallsyms]  [k] account_user_time
>          0.01%  noploop  [kernel.kallsyms]  [k] __alloc_pages_nodemask
>          0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe
> 
>     # Samples: 3K of event 'cycles'
>     # Event count (approx.): 3722310525
>     #
>     # Overhead  Command      Shared Object                     Symbol
>     # ........  .......  .................  .........................
>         99.76%  noploop  noploop            [.] main
>          0.11%  noploop  [kernel.kallsyms]  [k] _raw_spin_lock
>          0.06%  noploop  [kernel.kallsyms]  [k] find_get_page
>          0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
>          0.02%  noploop  [kernel.kallsyms]  [k] rcu_check_callbacks
>          0.02%  noploop  [kernel.kallsyms]  [k] __current_kernel_time
>          0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe
> 
>   In this case the event group information will be shown in the end of
>   header area.  So you can use --group option to enable event group view.
> 
>     $ perf report --group
>     ...
>     # group: {ref-cycles,cycles}
>     # ========
>     # Samples: 7K of event 'anon group { ref-cycles, cycles }'
>     # Event count (approx.): 6876107743
>     #
>     #         Overhead  Command      Shared Object                      Symbol
>     # ................  .......  .................  ..........................
>         99.84%  99.76%  noploop  noploop            [.] main
>          0.07%   0.00%  noploop  ld-2.15.so         [.] strcmp
>          0.03%   0.00%  noploop  [kernel.kallsyms]  [k] timerqueue_del
>          0.03%   0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
>          0.02%   0.00%  noploop  [kernel.kallsyms]  [k] account_user_time
>          0.01%   0.00%  noploop  [kernel.kallsyms]  [k] __alloc_pages_nodemask
>          0.00%   0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe
>          0.00%   0.11%  noploop  [kernel.kallsyms]  [k] _raw_spin_lock
>          0.00%   0.06%  noploop  [kernel.kallsyms]  [k] find_get_page
>          0.00%   0.02%  noploop  [kernel.kallsyms]  [k] rcu_check_callbacks
>          0.00%   0.02%  noploop  [kernel.kallsyms]  [k] __current_kernel_time
> 
>   As you can see the Overhead column now contains both of ref-cycles and
>   cycles and header line shows group information also - 'anon group {
>   ref-cycles, cycles }'.  The output is sorted by period of group leader
>   first.
> 
>   If perf.data file doesn't contain group information, this --group
>   option does nothing.  So if you want enable event group view by
>   default you can set it in ~/.perfconfig file:
> 
>     $ cat ~/.perfconfig
>     [report]
>     group = true
> 
>   It can be overridden with command line if you want:
> 
>     $ perf report --no-group
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf top: Stop using exit()
>       perf top: Delete maps on exit
> 
> Namhyung Kim (18):
>       perf tools: Keep group information
>       perf tests: Add group test conditions
>       perf header: Add HEADER_GROUP_DESC feature
>       perf report: Make another loop for linking group hists
>       perf hists: Resort hist entries using group members for output
>       perf ui/hist: Consolidate hpp helpers
>       perf hists browser: Convert hpp helpers to a function
>       perf gtk/browser: Convert hpp helpers to a function
>       perf ui/hist: Add support for event group view
>       perf hists browser: Move coloring logic to hpp functions
>       perf hists browser: Add suppport for event group view
>       perf gtk/browser: Add support for event group view
>       perf gtk/browser: Trim column header string when event group enabled
>       perf report: Bypass non-leader events when event group is enabled
>       perf report: Show group description when event group is enabled
>       perf report: Add --group option
>       perf report: Add report.group config option
>       perf evlist: Add --group option
> 
> Sukadev Bhattiprolu (5):
>       perf/Power7: Use macros to identify perf events
>       perf: Make EVENT_ATTR global
>       perf/POWER7: Make generic event translations available in sysfs
>       perf/POWER7: Make some POWER7 events available in sysfs
>       perf: Document the ABI of perf sysfs entries
> 
>  .../testing/sysfs-bus-event_source-devices-events  |  62 +++++
>  arch/powerpc/include/asm/perf_event_server.h       |  26 ++
>  arch/powerpc/perf/core-book3s.c                    |  12 +
>  arch/powerpc/perf/power7-pmu.c                     |  80 +++++-
>  arch/x86/kernel/cpu/perf_event.c                   |  13 +-
>  include/linux/perf_event.h                         |  11 +
>  tools/perf/Documentation/perf-evlist.txt           |   4 +
>  tools/perf/Documentation/perf-report.txt           |   3 +
>  tools/perf/builtin-evlist.c                        |   7 +
>  tools/perf/builtin-record.c                        |   3 +
>  tools/perf/builtin-report.c                        |  47 +++-
>  tools/perf/builtin-top.c                           |  62 +++--
>  tools/perf/tests/parse-events.c                    |  28 ++
>  tools/perf/ui/browsers/hists.c                     | 217 ++++++++++++---
>  tools/perf/ui/gtk/hists.c                          | 130 +++++++--
>  tools/perf/ui/hist.c                               | 306 ++++++++++-----------
>  tools/perf/ui/stdio/hist.c                         |   2 +
>  tools/perf/util/evlist.c                           |   7 +-
>  tools/perf/util/evlist.h                           |   1 +
>  tools/perf/util/evsel.c                            |  49 +++-
>  tools/perf/util/evsel.h                            |  16 ++
>  tools/perf/util/header.c                           | 164 +++++++++++
>  tools/perf/util/header.h                           |   2 +
>  tools/perf/util/hist.c                             |  59 +++-
>  tools/perf/util/parse-events.c                     |   1 +
>  tools/perf/util/parse-events.h                     |   1 +
>  tools/perf/util/parse-events.y                     |  10 +
>  tools/perf/util/symbol.h                           |   3 +-
>  28 files changed, 1059 insertions(+), 267 deletions(-)
>  create mode 100644 Documentation/ABI/testing/sysfs-bus-event_source-devices-events

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/25] perf/core improvements and fixes
@ 2013-01-31 17:25 Arnaldo Carvalho de Melo
  2013-02-01 10:18 ` Ingo Molnar
  0 siblings, 1 reply; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-01-31 17:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen,
	Anton Blanchard, David Ahern, Frederic Weisbecker, Jiri Olsa,
	linuxppc-dev, Mike Galbraith, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Pekka Enberg, Peter Zijlstra, Robert Richter,
	Stephane Eranian, Sukadev Bhattiprolu, acme,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 152fefa921535665f95840c08062844ab2f5593e:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-01-31 10:20:14 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 2ac3634a7e1c8eedc961030c87c5c36ebd5bbf8e:

  perf: Document the ABI of perf sysfs entries (2013-01-31 13:07:51 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

. Make some POWER7 events available in sysfs, equivalent to
  what was done on x86, from Sukadev Bhattiprolu.

. Add event group view, from Namyung Kim:

  To use it, 'perf record' should group events when recording. And then perf
  report parses the saved group relation from file header and prints them
  together if --group option is provided.  You can use 'perf evlist' command to
  see event group information:

    $ perf record -e '{ref-cycles,cycles}' noploop 1
    [ perf record: Woken up 2 times to write data ]
    [ perf record: Captured and wrote 0.385 MB perf.data (~16807 samples) ]

    $ perf evlist --group
    {ref-cycles,cycles}

  With this example, default perf report will show you each event
  separately like this:

    $ perf report
    ...
    # group: {ref-cycles,cycles}
    # ========
    # Samples: 3K of event 'ref-cycles'
    # Event count (approx.): 3153797218
    #
    # Overhead  Command      Shared Object                      Symbol
    # ........  .......  .................  ..........................
        99.84%  noploop  noploop            [.] main
         0.07%  noploop  ld-2.15.so         [.] strcmp
         0.03%  noploop  [kernel.kallsyms]  [k] timerqueue_del
         0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
         0.02%  noploop  [kernel.kallsyms]  [k] account_user_time
         0.01%  noploop  [kernel.kallsyms]  [k] __alloc_pages_nodemask
         0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe

    # Samples: 3K of event 'cycles'
    # Event count (approx.): 3722310525
    #
    # Overhead  Command      Shared Object                     Symbol
    # ........  .......  .................  .........................
        99.76%  noploop  noploop            [.] main
         0.11%  noploop  [kernel.kallsyms]  [k] _raw_spin_lock
         0.06%  noploop  [kernel.kallsyms]  [k] find_get_page
         0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
         0.02%  noploop  [kernel.kallsyms]  [k] rcu_check_callbacks
         0.02%  noploop  [kernel.kallsyms]  [k] __current_kernel_time
         0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe

  In this case the event group information will be shown in the end of
  header area.  So you can use --group option to enable event group view.

    $ perf report --group
    ...
    # group: {ref-cycles,cycles}
    # ========
    # Samples: 7K of event 'anon group { ref-cycles, cycles }'
    # Event count (approx.): 6876107743
    #
    #         Overhead  Command      Shared Object                      Symbol
    # ................  .......  .................  ..........................
        99.84%  99.76%  noploop  noploop            [.] main
         0.07%   0.00%  noploop  ld-2.15.so         [.] strcmp
         0.03%   0.00%  noploop  [kernel.kallsyms]  [k] timerqueue_del
         0.03%   0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
         0.02%   0.00%  noploop  [kernel.kallsyms]  [k] account_user_time
         0.01%   0.00%  noploop  [kernel.kallsyms]  [k] __alloc_pages_nodemask
         0.00%   0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe
         0.00%   0.11%  noploop  [kernel.kallsyms]  [k] _raw_spin_lock
         0.00%   0.06%  noploop  [kernel.kallsyms]  [k] find_get_page
         0.00%   0.02%  noploop  [kernel.kallsyms]  [k] rcu_check_callbacks
         0.00%   0.02%  noploop  [kernel.kallsyms]  [k] __current_kernel_time

  As you can see the Overhead column now contains both of ref-cycles and
  cycles and header line shows group information also - 'anon group {
  ref-cycles, cycles }'.  The output is sorted by period of group leader
  first.

  If perf.data file doesn't contain group information, this --group
  option does nothing.  So if you want enable event group view by
  default you can set it in ~/.perfconfig file:

    $ cat ~/.perfconfig
    [report]
    group = true

  It can be overridden with command line if you want:

    $ perf report --no-group

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf top: Stop using exit()
      perf top: Delete maps on exit

Namhyung Kim (18):
      perf tools: Keep group information
      perf tests: Add group test conditions
      perf header: Add HEADER_GROUP_DESC feature
      perf report: Make another loop for linking group hists
      perf hists: Resort hist entries using group members for output
      perf ui/hist: Consolidate hpp helpers
      perf hists browser: Convert hpp helpers to a function
      perf gtk/browser: Convert hpp helpers to a function
      perf ui/hist: Add support for event group view
      perf hists browser: Move coloring logic to hpp functions
      perf hists browser: Add suppport for event group view
      perf gtk/browser: Add support for event group view
      perf gtk/browser: Trim column header string when event group enabled
      perf report: Bypass non-leader events when event group is enabled
      perf report: Show group description when event group is enabled
      perf report: Add --group option
      perf report: Add report.group config option
      perf evlist: Add --group option

Sukadev Bhattiprolu (5):
      perf/Power7: Use macros to identify perf events
      perf: Make EVENT_ATTR global
      perf/POWER7: Make generic event translations available in sysfs
      perf/POWER7: Make some POWER7 events available in sysfs
      perf: Document the ABI of perf sysfs entries

 .../testing/sysfs-bus-event_source-devices-events  |  62 +++++
 arch/powerpc/include/asm/perf_event_server.h       |  26 ++
 arch/powerpc/perf/core-book3s.c                    |  12 +
 arch/powerpc/perf/power7-pmu.c                     |  80 +++++-
 arch/x86/kernel/cpu/perf_event.c                   |  13 +-
 include/linux/perf_event.h                         |  11 +
 tools/perf/Documentation/perf-evlist.txt           |   4 +
 tools/perf/Documentation/perf-report.txt           |   3 +
 tools/perf/builtin-evlist.c                        |   7 +
 tools/perf/builtin-record.c                        |   3 +
 tools/perf/builtin-report.c                        |  47 +++-
 tools/perf/builtin-top.c                           |  62 +++--
 tools/perf/tests/parse-events.c                    |  28 ++
 tools/perf/ui/browsers/hists.c                     | 217 ++++++++++++---
 tools/perf/ui/gtk/hists.c                          | 130 +++++++--
 tools/perf/ui/hist.c                               | 306 ++++++++++-----------
 tools/perf/ui/stdio/hist.c                         |   2 +
 tools/perf/util/evlist.c                           |   7 +-
 tools/perf/util/evlist.h                           |   1 +
 tools/perf/util/evsel.c                            |  49 +++-
 tools/perf/util/evsel.h                            |  16 ++
 tools/perf/util/header.c                           | 164 +++++++++++
 tools/perf/util/header.h                           |   2 +
 tools/perf/util/hist.c                             |  59 +++-
 tools/perf/util/parse-events.c                     |   1 +
 tools/perf/util/parse-events.h                     |   1 +
 tools/perf/util/parse-events.y                     |  10 +
 tools/perf/util/symbol.h                           |   3 +-
 28 files changed, 1059 insertions(+), 267 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-event_source-devices-events

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

* Re: [GIT PULL 00/25] perf/core improvements and fixes
  2012-10-08 22:32 Arnaldo Carvalho de Melo
@ 2012-10-09 13:34 ` Ingo Molnar
  0 siblings, 0 replies; 38+ messages in thread
From: Ingo Molnar @ 2012-10-09 13:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen,
	Bernhard Rosenkraenzer, Corey Ashford, David Ahern, Dong Hao,
	Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt, Wei Yongjun,
	Xiao Guangrong, arnaldo.melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 139c0815903de1a7865fe1d6beac5e995fefdf46:
> 
>   perf hists: Add more helpers for hist entry stat (2012-10-04 13:36:18 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 7747e2f4fb5fb840994613dd1474c17cddb7836b:
> 
>   Documentation: add documentation on compiling for Android (2012-10-08 17:44:39 -0300)
> 
> ----------------------------------------------------------------
> 
> perf/core improvements and fixes
> 
> . Handle PERF_RECORD_EXIT events in sched and annotate.
> 
> . struct machine refactorings to help in top and trace.
> 
> . Add on_exit implementation for systems without one, e.g. Android, from
>   Bernhard Rosenkraenzer.
> 
> . Only process events for vcpus of interest, helps handling large number
>   of events, from David Ahern.
> 
> . Cross compiling fixes for Android, from Irina Tirdea.
> 
> . Add documentation on compiling for Android, from Irina Tirdea.
> 
> . perf diff improvements from Jiri Olsa.
> 
> . Target (task/user/cpu/syswide) handling improvements, from Namhyung Kim.
> 
> . Add support in 'trace' for tracing workload given by command line, from
>   Namhyung Kim.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> 
> Arnaldo Carvalho de Melo (6):
>       perf tools: Have the page size value available for all tools
>       perf machine: Introduce find_thread method
>       perf event: No need to create a thread when handling PERF_RECORD_EXIT
>       perf annotate: Handle PERF_RECORD_EXIT events
>       perf sched: Handle PERF_RECORD_EXIT events
>       perf machine: Carve up event processing specific from perf_tool
> 
> Bernhard Rosenkraenzer (1):
>       perf tools: Add on_exit implementation
> 
> David Ahern (4):
>       perf kvm: Only process events for vcpus of interest
>       perf kvm: Remove typecast in init_kvm_event_record
>       perf kvm: Total count is a u64, print as so
>       perf kvm: Add braces around multi-line statements
> 
> Irina Tirdea (2):
>       perf tools: Update Makefile for Android
>       Documentation: add documentation on compiling for Android
> 
> Jiri Olsa (8):
>       perf diff: Add -b option for perf diff to display paired entries only
>       perf diff: Add ratio computation way to compare hist entries
>       perf diff: Add option to sort entries based on diff computation
>       perf diff: Add weighted diff computation way to compare hist entries
>       perf diff: Add -p option to display period values for hist entries
>       perf diff: Add -F option to display formula for computation
>       perf diff: Include samples without symbol in overall stats
>       perf diff: Display empty space for non paired samples
> 
> Namhyung Kim (3):
>       perf trace: Validate target task/user/cpu argument
>       perf trace: Explicitly enable system-wide mode if no option is given
>       perf trace: Add support for tracing workload given by command line
> 
> Wei Yongjun (1):
>       perf tools: Remove duplicated include from trace-event-python.c
> 
>  tools/perf/Documentation/android.txt               |   75 ++++
>  tools/perf/Documentation/perf-diff.txt             |   60 +++
>  tools/perf/Makefile                                |   33 +-
>  tools/perf/builtin-annotate.c                      |    3 +-
>  tools/perf/builtin-diff.c                          |  405 +++++++++++++++++++-
>  tools/perf/builtin-inject.c                        |    6 +-
>  tools/perf/builtin-kvm.c                           |   35 +-
>  tools/perf/builtin-record.c                        |   32 ++
>  tools/perf/builtin-report.c                        |    4 +-
>  tools/perf/builtin-sched.c                         |    3 +-
>  tools/perf/builtin-script.c                        |    4 +-
>  tools/perf/builtin-test.c                          |    2 -
>  tools/perf/builtin-top.c                           |    3 +-
>  tools/perf/builtin-trace.c                         |   53 ++-
>  tools/perf/config/feature-tests.mak                |   20 +-
>  tools/perf/perf.c                                  |    2 +
>  tools/perf/ui/hist.c                               |  134 ++++++-
>  tools/perf/ui/stdio/hist.c                         |    2 +-
>  tools/perf/util/build-id.c                         |    2 +-
>  tools/perf/util/event.c                            |  215 +----------
>  tools/perf/util/event.h                            |    6 +-
>  tools/perf/util/evlist.c                           |    3 -
>  tools/perf/util/hist.h                             |    8 +
>  tools/perf/util/machine.c                          |  277 +++++++++++++
>  tools/perf/util/machine.h                          |   19 +
>  .../util/scripting-engines/trace-event-python.c    |    1 -
>  tools/perf/util/session.c                          |    4 +-
>  tools/perf/util/sort.h                             |   18 +
>  tools/perf/util/thread.c                           |   41 +-
>  tools/perf/util/thread.h                           |    2 +
>  tools/perf/util/trace-event-read.c                 |    2 -
>  tools/perf/util/util.c                             |    2 +
>  tools/perf/util/util.h                             |    2 +
>  33 files changed, 1173 insertions(+), 305 deletions(-)
>  create mode 100644 tools/perf/Documentation/android.txt
>  create mode 100644 tools/perf/util/machine.c
>  create mode 100644 tools/perf/util/machine.h

Pulled, thanks Arnaldo!

	Ingo

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

* [GIT PULL 00/25] perf/core improvements and fixes
@ 2012-10-08 22:32 Arnaldo Carvalho de Melo
  2012-10-09 13:34 ` Ingo Molnar
  0 siblings, 1 reply; 38+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-10-08 22:32 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo,
	Andi Kleen, Bernhard Rosenkraenzer, Corey Ashford, David Ahern,
	Dong Hao, Frederic Weisbecker, Irina Tirdea, Jiri Olsa,
	Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras,
	Pekka Enberg, Peter Zijlstra, Stephane Eranian, Steven Rostedt,
	Wei Yongjun, Xiao Guangrong, arnaldo.melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 139c0815903de1a7865fe1d6beac5e995fefdf46:

  perf hists: Add more helpers for hist entry stat (2012-10-04 13:36:18 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 7747e2f4fb5fb840994613dd1474c17cddb7836b:

  Documentation: add documentation on compiling for Android (2012-10-08 17:44:39 -0300)

----------------------------------------------------------------

perf/core improvements and fixes

. Handle PERF_RECORD_EXIT events in sched and annotate.

. struct machine refactorings to help in top and trace.

. Add on_exit implementation for systems without one, e.g. Android, from
  Bernhard Rosenkraenzer.

. Only process events for vcpus of interest, helps handling large number
  of events, from David Ahern.

. Cross compiling fixes for Android, from Irina Tirdea.

. Add documentation on compiling for Android, from Irina Tirdea.

. perf diff improvements from Jiri Olsa.

. Target (task/user/cpu/syswide) handling improvements, from Namhyung Kim.

. Add support in 'trace' for tracing workload given by command line, from
  Namhyung Kim.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------

Arnaldo Carvalho de Melo (6):
      perf tools: Have the page size value available for all tools
      perf machine: Introduce find_thread method
      perf event: No need to create a thread when handling PERF_RECORD_EXIT
      perf annotate: Handle PERF_RECORD_EXIT events
      perf sched: Handle PERF_RECORD_EXIT events
      perf machine: Carve up event processing specific from perf_tool

Bernhard Rosenkraenzer (1):
      perf tools: Add on_exit implementation

David Ahern (4):
      perf kvm: Only process events for vcpus of interest
      perf kvm: Remove typecast in init_kvm_event_record
      perf kvm: Total count is a u64, print as so
      perf kvm: Add braces around multi-line statements

Irina Tirdea (2):
      perf tools: Update Makefile for Android
      Documentation: add documentation on compiling for Android

Jiri Olsa (8):
      perf diff: Add -b option for perf diff to display paired entries only
      perf diff: Add ratio computation way to compare hist entries
      perf diff: Add option to sort entries based on diff computation
      perf diff: Add weighted diff computation way to compare hist entries
      perf diff: Add -p option to display period values for hist entries
      perf diff: Add -F option to display formula for computation
      perf diff: Include samples without symbol in overall stats
      perf diff: Display empty space for non paired samples

Namhyung Kim (3):
      perf trace: Validate target task/user/cpu argument
      perf trace: Explicitly enable system-wide mode if no option is given
      perf trace: Add support for tracing workload given by command line

Wei Yongjun (1):
      perf tools: Remove duplicated include from trace-event-python.c

 tools/perf/Documentation/android.txt               |   75 ++++
 tools/perf/Documentation/perf-diff.txt             |   60 +++
 tools/perf/Makefile                                |   33 +-
 tools/perf/builtin-annotate.c                      |    3 +-
 tools/perf/builtin-diff.c                          |  405 +++++++++++++++++++-
 tools/perf/builtin-inject.c                        |    6 +-
 tools/perf/builtin-kvm.c                           |   35 +-
 tools/perf/builtin-record.c                        |   32 ++
 tools/perf/builtin-report.c                        |    4 +-
 tools/perf/builtin-sched.c                         |    3 +-
 tools/perf/builtin-script.c                        |    4 +-
 tools/perf/builtin-test.c                          |    2 -
 tools/perf/builtin-top.c                           |    3 +-
 tools/perf/builtin-trace.c                         |   53 ++-
 tools/perf/config/feature-tests.mak                |   20 +-
 tools/perf/perf.c                                  |    2 +
 tools/perf/ui/hist.c                               |  134 ++++++-
 tools/perf/ui/stdio/hist.c                         |    2 +-
 tools/perf/util/build-id.c                         |    2 +-
 tools/perf/util/event.c                            |  215 +----------
 tools/perf/util/event.h                            |    6 +-
 tools/perf/util/evlist.c                           |    3 -
 tools/perf/util/hist.h                             |    8 +
 tools/perf/util/machine.c                          |  277 +++++++++++++
 tools/perf/util/machine.h                          |   19 +
 .../util/scripting-engines/trace-event-python.c    |    1 -
 tools/perf/util/session.c                          |    4 +-
 tools/perf/util/sort.h                             |   18 +
 tools/perf/util/thread.c                           |   41 +-
 tools/perf/util/thread.h                           |    2 +
 tools/perf/util/trace-event-read.c                 |    2 -
 tools/perf/util/util.c                             |    2 +
 tools/perf/util/util.h                             |    2 +
 33 files changed, 1173 insertions(+), 305 deletions(-)
 create mode 100644 tools/perf/Documentation/android.txt
 create mode 100644 tools/perf/util/machine.c
 create mode 100644 tools/perf/util/machine.h

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

end of thread, other threads:[~2017-06-21 18:13 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 01/25] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 02/25] perf tools: Use kmod_path__parse in decompress_kmodule Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 03/25] perf tools: Use kmod_path__parse in is_kernel_module Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 04/25] perf tools: Remove compressed argument from is_kernel_module Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 05/25] perf tools: Remove is_kmodule_extension function Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 06/25] perf tools: Try to lookup kernel module map before creating one Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 07/25] perf annotate: Allow annotation for decompressed kernel modules Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 08/25] perf tools: Remove (null) value of "Sort order" for perf mem report Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 09/25] perf probe: Fix to get ummapped symbol address on kernel Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 10/25] tools lib traceevent: Factor out allocating and processing args Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 11/25] perf kmem: Print big numbers using thousands' group Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 13/25] perf target: Simplify handling of strerror_r return Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors Arnaldo Carvalho de Melo
2015-03-27 10:32   ` Borislav Petkov
2015-03-27 14:37     ` Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 15/25] tools lib traceevent: Handle NULL comm name Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 16/25] tools lib traceevent: Copy trace_clock and free it Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 17/25] tools lib traceevent: Handle %z in bprint format Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 18/25] tools lib traceevent: Add pevent_data_pid_from_comm() Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 19/25] tools lib traceevent: Make plugin options either string or boolean Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 21/25] tools lib traceevent: Add way to find sub buffer boundary Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 22/25] tools lib traceevent: Free filter tokens in process_filter() Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 23/25] tools lib traceevent: Add support for __print_array() Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 24/25] perf diff: Add kallsyms option Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 25/25] perf tools: Add pid/tid filtering to report and script commands Arnaldo Carvalho de Melo
2015-03-24 16:26 ` [GIT PULL 00/25] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2017-06-21 18:02 Arnaldo Carvalho de Melo
2017-06-21 18:13 ` Ingo Molnar
2015-05-27 15:38 Arnaldo Carvalho de Melo
2015-05-27 16:43 ` Ingo Molnar
2015-05-05 21:31 Arnaldo Carvalho de Melo
2015-05-06  2:47 ` Ingo Molnar
2013-11-25 14:17 Arnaldo Carvalho de Melo
2013-01-31 17:25 Arnaldo Carvalho de Melo
2013-02-01 10:18 ` Ingo Molnar
2012-10-08 22:32 Arnaldo Carvalho de Melo
2012-10-09 13:34 ` Ingo Molnar

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