linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/9] perf/core fixes and improvements
@ 2012-01-31  1:24 Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 1/9] perf evsel: Fix spelling typo Arnaldo Carvalho de Melo
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Akihiro Nagai,
	David Ahern, Frederic Weisbecker, Hitoshi Mitake,
	Masami Hiramatsu, Masanari Iida, Mike Galbraith, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	yrl.pp-manager.tt, arnaldo.melo

The following changes since commit efb3040d481a1594592b1defb4526c406c7a4751:

  jump_label: Add some documentation (2012-01-27 12:14:46 +0100)

are available in the git repository at:

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

for you to fetch changes up to cfeb1d90a1b1db96383b48888cb7a5f10ca12e12:

  perf python: Use attr.watermark in twatch.py (2012-01-30 18:38:23 -0200)

----------------------------------------------------------------
perf/core fixes and improvements.

----------------------------------------------------------------
Akihiro Nagai (4):
      perf script: Unify the expressions indicating "unknown"
      perf script: Print branch_from and branch_to of BTS events
      perf script: Add the offset field specifier
      perf script: Add option resolving vmlinux path

Arnaldo Carvalho de Melo (1):
      perf python: Use attr.watermark in twatch.py

Masanari Iida (1):
      perf evsel: Fix spelling typo

Namhyung Kim (2):
      perf lock: Document lock info subcommand
      perf tools: Remove unnecessary ctype.h inclusion

Stephane Eranian (1):
      perf top: Fix number of samples displayed

 tools/perf/Documentation/perf-lock.txt             |   20 ++++-
 tools/perf/Documentation/perf-script.txt           |    5 +-
 tools/perf/bench/mem-memcpy.c                      |    1 -
 tools/perf/bench/mem-memset.c                      |    1 -
 tools/perf/builtin-lock.c                          |    4 +-
 tools/perf/builtin-script.c                        |   80 ++++++++++++++++----
 tools/perf/builtin-top.c                           |   13 +++-
 tools/perf/python/twatch.py                        |    2 +-
 tools/perf/util/evsel.c                            |    2 +-
 tools/perf/util/map.c                              |   15 ++++
 tools/perf/util/map.h                              |    1 +
 tools/perf/util/probe-finder.c                     |    1 -
 .../util/scripting-engines/trace-event-python.c    |    1 -
 tools/perf/util/session.c                          |   39 ++++------
 tools/perf/util/session.h                          |    2 +-
 tools/perf/util/symbol.c                           |   22 ++++++
 tools/perf/util/symbol.h                           |    4 +
 tools/perf/util/trace-event-parse.c                |    1 -
 tools/perf/util/trace-event-read.c                 |    1 -
 tools/perf/util/trace-event-scripting.c            |    1 -
 tools/perf/util/ui/browsers/map.c                  |    2 +-
 21 files changed, 159 insertions(+), 59 deletions(-)

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

* [PATCH 1/9] perf evsel: Fix spelling typo
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 2/9] perf script: Unify the expressions indicating "unknown" Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masanari Iida, Peter Zijlstra, trivial,
	Arnaldo Carvalho de Melo

From: Masanari Iida <standby24x7@gmail.com>

Correct spelling "unsuported" to "unsupported" in
tools/peft/util/evsel.c

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: standby24x7@gmail.com
Cc: trivial@kernel.org
Link: http://lkml.kernel.org/r/1327500312-9520-1-git-send-email-standby24x7@gmail.com
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 667f3b7..dcfefab 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -535,7 +535,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
 	}
 
 	if (type & PERF_SAMPLE_READ) {
-		fprintf(stderr, "PERF_SAMPLE_READ is unsuported for now\n");
+		fprintf(stderr, "PERF_SAMPLE_READ is unsupported for now\n");
 		return -1;
 	}
 
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 2/9] perf script: Unify the expressions indicating "unknown"
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 1/9] perf evsel: Fix spelling typo Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 3/9] perf script: Print branch_from and branch_to of BTS events Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Akihiro Nagai, David Ahern, Frederic Weisbecker,
	Masami Hiramatsu, Paul Mackerras, Peter Zijlstra,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>

The perf script command uses various expressions to indicate "unknown".

It is unfriendly for user scripts to parse it. So, this patch unifies
the expressions to "[unknown]".

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20120130044257.2384.62905.stgit@linux3
Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c |   20 ++++++--------------
 tools/perf/util/map.c       |   12 ++++++++++++
 tools/perf/util/map.h       |    1 +
 tools/perf/util/session.c   |   35 ++++++++++-------------------------
 tools/perf/util/symbol.c    |   12 ++++++++++++
 tools/perf/util/symbol.h    |    1 +
 6 files changed, 42 insertions(+), 39 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index bb68ddf..add13ec 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -300,7 +300,7 @@ static void print_sample_start(struct perf_sample *sample,
 		} else
 			evname = __event_name(attr->type, attr->config);
 
-		printf("%s: ", evname ? evname : "(unknown)");
+		printf("%s: ", evname ? evname : "[unknown]");
 	}
 }
 
@@ -323,7 +323,6 @@ static void print_sample_addr(union perf_event *event,
 {
 	struct addr_location al;
 	u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
-	const char *symname, *dsoname;
 
 	printf("%16" PRIx64, sample->addr);
 
@@ -343,21 +342,14 @@ static void print_sample_addr(union perf_event *event,
 		al.sym = map__find_symbol(al.map, al.addr, NULL);
 
 	if (PRINT_FIELD(SYM)) {
-		if (al.sym && al.sym->name)
-			symname = al.sym->name;
-		else
-			symname = "";
-
-		printf(" %16s", symname);
+		printf(" ");
+		symbol__fprintf_symname(al.sym, stdout);
 	}
 
 	if (PRINT_FIELD(DSO)) {
-		if (al.map && al.map->dso && al.map->dso->name)
-			dsoname = al.map->dso->name;
-		else
-			dsoname = "";
-
-		printf(" (%s)", dsoname);
+		printf(" (");
+		map__fprintf_dsoname(al.map, stdout);
+		printf(")");
 	}
 }
 
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 316aa0a..1107960 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -212,6 +212,18 @@ size_t map__fprintf(struct map *self, FILE *fp)
 		       self->start, self->end, self->pgoff, self->dso->name);
 }
 
+size_t map__fprintf_dsoname(struct map *map, FILE *fp)
+{
+	const char *dsoname;
+
+	if (map && map->dso && map->dso->name)
+		dsoname = map->dso->name;
+	else
+		dsoname = "[unknown]";
+
+	return fprintf(fp, "%s", dsoname);
+}
+
 /*
  * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN.
  * map->dso->adjust_symbols==1 for ET_EXEC-like cases.
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index 2b8017f..b100c20 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -118,6 +118,7 @@ void map__delete(struct map *self);
 struct map *map__clone(struct map *self);
 int map__overlap(struct map *l, struct map *r);
 size_t map__fprintf(struct map *self, FILE *fp);
+size_t map__fprintf_dsoname(struct map *map, FILE *fp);
 
 int map__load(struct map *self, symbol_filter_t filter);
 struct symbol *map__find_symbol(struct map *self,
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index b5ca255..e5334a9 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1296,7 +1296,6 @@ void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
 			  int print_sym, int print_dso)
 {
 	struct addr_location al;
-	const char *symname, *dsoname;
 	struct callchain_cursor *cursor = &evsel->hists.callchain_cursor;
 	struct callchain_cursor_node *node;
 
@@ -1324,20 +1323,13 @@ void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
 
 			printf("\t%16" PRIx64, node->ip);
 			if (print_sym) {
-				if (node->sym && node->sym->name)
-					symname = node->sym->name;
-				else
-					symname = "";
-
-				printf(" %s", symname);
+				printf(" ");
+				symbol__fprintf_symname(node->sym, stdout);
 			}
 			if (print_dso) {
-				if (node->map && node->map->dso && node->map->dso->name)
-					dsoname = node->map->dso->name;
-				else
-					dsoname = "";
-
-				printf(" (%s)", dsoname);
+				printf(" (");
+				map__fprintf_dsoname(al.map, stdout);
+				printf(")");
 			}
 			printf("\n");
 
@@ -1347,21 +1339,14 @@ void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
 	} else {
 		printf("%16" PRIx64, sample->ip);
 		if (print_sym) {
-			if (al.sym && al.sym->name)
-				symname = al.sym->name;
-			else
-				symname = "";
-
-			printf(" %s", symname);
+			printf(" ");
+			symbol__fprintf_symname(al.sym, stdout);
 		}
 
 		if (print_dso) {
-			if (al.map && al.map->dso && al.map->dso->name)
-				dsoname = al.map->dso->name;
-			else
-				dsoname = "";
-
-			printf(" (%s)", dsoname);
+			printf(" (");
+			map__fprintf_dsoname(al.map, stdout);
+			printf(")");
 		}
 	}
 }
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 0975438..b580fa8 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -263,6 +263,18 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
 		       sym->name);
 }
 
+size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp)
+{
+	const char *symname;
+
+	if (sym && sym->name)
+		symname = sym->name;
+	else
+		symname = "[unknown]";
+
+	return fprintf(fp, "%s", symname);
+}
+
 void dso__set_long_name(struct dso *dso, char *name)
 {
 	if (name == NULL)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 123c2e1..d349c7a 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -241,6 +241,7 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
 
 int symbol__init(void);
 void symbol__exit(void);
+size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);
 bool symbol_type__is_a(char symbol_type, enum map_type map_type);
 
 size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 3/9] perf script: Print branch_from and branch_to of BTS events
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 1/9] perf evsel: Fix spelling typo Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 2/9] perf script: Unify the expressions indicating "unknown" Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 4/9] perf script: Add the offset field specifier Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Akihiro Nagai, David Ahern, Frederic Weisbecker,
	Masami Hiramatsu, Paul Mackerras, Peter Zijlstra,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>

BTS records branch_from_addr and branch_to_addr in IP and ADDR field in perf_sample.
This patch enables to print them in following format,

<from_addr> <from_symbol> (<from_dso>) => <to_addr> <to_symbol> (<to_dso>)

Sample:
 ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e016b0    _start (/lib64/ld-2.14.so)
 ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e016b0    _start (/lib64/ld-2.14.so)
       3f03e016b3     _start (/lib64/ld-2.14.so) => 3f03e04b80 _dl_start (/lib64/ld-2.14.so)
 ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e04b80 _dl_start (/lib64/ld-2.14.so)
 ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e04ba6 _dl_start (/lib64/ld-2.14.so)
 ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e04bad _dl_start (/lib64/ld-2.14.so)
       3f03e04bfb  _dl_start (/lib64/ld-2.14.so) => 3f03e04c1d _dl_start (/lib64/ld-2.14.so)
[snip]

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20120130044309.2384.44252.stgit@linux3
Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index add13ec..414d49a 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -304,6 +304,13 @@ static void print_sample_start(struct perf_sample *sample,
 	}
 }
 
+static bool is_bts_event(struct perf_event_attr *attr)
+{
+	return ((attr->type == PERF_TYPE_HARDWARE) &&
+		(attr->config & PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
+		(attr->sample_period == 1));
+}
+
 static bool sample_addr_correlates_sym(struct perf_event_attr *attr)
 {
 	if ((attr->type == PERF_TYPE_SOFTWARE) &&
@@ -312,6 +319,9 @@ static bool sample_addr_correlates_sym(struct perf_event_attr *attr)
 	     (attr->config == PERF_COUNT_SW_PAGE_FAULTS_MAJ)))
 		return true;
 
+	if (is_bts_event(attr))
+		return true;
+
 	return false;
 }
 
@@ -353,6 +363,33 @@ static void print_sample_addr(union perf_event *event,
 	}
 }
 
+static void print_sample_bts(union perf_event *event,
+			     struct perf_sample *sample,
+			     struct perf_evsel *evsel,
+			     struct machine *machine,
+			     struct thread *thread)
+{
+	struct perf_event_attr *attr = &evsel->attr;
+
+	/* print branch_from information */
+	if (PRINT_FIELD(IP)) {
+		if (!symbol_conf.use_callchain)
+			printf(" ");
+		else
+			printf("\n");
+		perf_event__print_ip(event, sample, machine, evsel,
+				     PRINT_FIELD(SYM), PRINT_FIELD(DSO));
+	}
+
+	printf(" => ");
+
+	/* print branch_to information */
+	if (PRINT_FIELD(ADDR))
+		print_sample_addr(event, sample, machine, thread, attr);
+
+	printf("\n");
+}
+
 static void process_event(union perf_event *event __unused,
 			  struct perf_sample *sample,
 			  struct perf_evsel *evsel,
@@ -366,6 +403,11 @@ static void process_event(union perf_event *event __unused,
 
 	print_sample_start(sample, thread, attr);
 
+	if (is_bts_event(attr)) {
+		print_sample_bts(event, sample, evsel, machine, thread);
+		return;
+	}
+
 	if (PRINT_FIELD(TRACE))
 		print_trace_event(sample->cpu, sample->raw_data,
 				  sample->raw_size);
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 4/9] perf script: Add the offset field specifier
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 3/9] perf script: Print branch_from and branch_to of BTS events Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 5/9] perf script: Add option resolving vmlinux path Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Akihiro Nagai, David Ahern, Frederic Weisbecker,
	Masami Hiramatsu, Paul Mackerras, Peter Zijlstra,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>

Add the offset field specifier 'symoff' to show the offset from
the symbols in the output of perf-script. We can get the more
detailed address information.

Output sample:
ffffffff81467612 irq_return+0x0 => 301ec016b0 _start+0x0
ffffffff81467612 irq_return+0x0 => 301ec016b0 _start+0x0
      301ec016b3 _start+0x3     => 301ec04b70 _dl_start+0x0
ffffffff81467612 irq_return+0x0 => 301ec04b70 _dl_start+0x0
ffffffff81467612 irq_return+0x0 => 301ec04b96 _dl_start+0x26
ffffffff81467612 irq_return+0x0 => 301ec04b9d _dl_start+0x2d
      301ec04beb _dl_start+0x7b => 301ec04c0d _dl_start+0x9d
      301ec04c11 _dl_start+0xa1 => 301ec04bf0 _dl_start+0x80
[snip]

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20120130044314.2384.67094.stgit@linux3
Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-script.txt |    2 +-
 tools/perf/builtin-script.c              |   23 +++++++++++++++++++----
 tools/perf/util/session.c                |    8 ++++++--
 tools/perf/util/session.h                |    2 +-
 tools/perf/util/symbol.c                 |   24 +++++++++++++++++-------
 tools/perf/util/symbol.h                 |    2 ++
 6 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 2f6cef4..228c7bb 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -115,7 +115,7 @@ OPTIONS
 -f::
 --fields::
         Comma separated list of fields to print. Options are:
-        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr.
+        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff.
         Field list can be prepended with the type, trace, sw or hw,
         to indicate to which event type the field list applies.
         e.g., -f sw:comm,tid,time,ip,sym  and -f trace:time,cpu,trace
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 414d49a..752d401 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -40,6 +40,7 @@ enum perf_output_field {
 	PERF_OUTPUT_SYM             = 1U << 8,
 	PERF_OUTPUT_DSO             = 1U << 9,
 	PERF_OUTPUT_ADDR            = 1U << 10,
+	PERF_OUTPUT_SYMOFFSET       = 1U << 11,
 };
 
 struct output_option {
@@ -57,6 +58,7 @@ struct output_option {
 	{.str = "sym",   .field = PERF_OUTPUT_SYM},
 	{.str = "dso",   .field = PERF_OUTPUT_DSO},
 	{.str = "addr",  .field = PERF_OUTPUT_ADDR},
+	{.str = "symoff", .field = PERF_OUTPUT_SYMOFFSET},
 };
 
 /* default set to maintain compatibility with current format */
@@ -193,6 +195,11 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
 		       "to symbols.\n");
 		return -EINVAL;
 	}
+	if (PRINT_FIELD(SYMOFFSET) && !PRINT_FIELD(SYM)) {
+		pr_err("Display of offsets requested but symbol is not"
+		       "selected.\n");
+		return -EINVAL;
+	}
 	if (PRINT_FIELD(DSO) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) {
 		pr_err("Display of DSO requested but neither sample IP nor "
 			   "sample address\nis selected. Hence, no addresses to convert "
@@ -353,7 +360,10 @@ static void print_sample_addr(union perf_event *event,
 
 	if (PRINT_FIELD(SYM)) {
 		printf(" ");
-		symbol__fprintf_symname(al.sym, stdout);
+		if (PRINT_FIELD(SYMOFFSET))
+			symbol__fprintf_symname_offs(al.sym, &al, stdout);
+		else
+			symbol__fprintf_symname(al.sym, stdout);
 	}
 
 	if (PRINT_FIELD(DSO)) {
@@ -378,7 +388,8 @@ static void print_sample_bts(union perf_event *event,
 		else
 			printf("\n");
 		perf_event__print_ip(event, sample, machine, evsel,
-				     PRINT_FIELD(SYM), PRINT_FIELD(DSO));
+				     PRINT_FIELD(SYM), PRINT_FIELD(DSO),
+				     PRINT_FIELD(SYMOFFSET));
 	}
 
 	printf(" => ");
@@ -421,7 +432,8 @@ static void process_event(union perf_event *event __unused,
 		else
 			printf("\n");
 		perf_event__print_ip(event, sample, machine, evsel,
-				     PRINT_FIELD(SYM), PRINT_FIELD(DSO));
+				     PRINT_FIELD(SYM), PRINT_FIELD(DSO),
+				     PRINT_FIELD(SYMOFFSET));
 	}
 
 	printf("\n");
@@ -1131,7 +1143,10 @@ static const struct option options[] = {
 	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
 		    "Look for files with symbols relative to this directory"),
 	OPT_CALLBACK('f', "fields", NULL, "str",
-		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr",
+		     "comma separated output fields prepend with 'type:'. "
+		     "Valid types: hw,sw,trace,raw. "
+		     "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
+		     "addr,symoff",
 		     parse_output_fields),
 	OPT_BOOLEAN('a', "all-cpus", &system_wide,
 		     "system-wide collection from all CPUs"),
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e5334a9..552c1c5 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1293,7 +1293,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
 
 void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
 			  struct machine *machine, struct perf_evsel *evsel,
-			  int print_sym, int print_dso)
+			  int print_sym, int print_dso, int print_symoffset)
 {
 	struct addr_location al;
 	struct callchain_cursor *cursor = &evsel->hists.callchain_cursor;
@@ -1340,7 +1340,11 @@ void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
 		printf("%16" PRIx64, sample->ip);
 		if (print_sym) {
 			printf(" ");
-			symbol__fprintf_symname(al.sym, stdout);
+			if (print_symoffset)
+				symbol__fprintf_symname_offs(al.sym, &al,
+							     stdout);
+			else
+				symbol__fprintf_symname(al.sym, stdout);
 		}
 
 		if (print_dso) {
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 37bc383..c8d9017 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -147,7 +147,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
 
 void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
 			  struct machine *machine, struct perf_evsel *evsel,
-			  int print_sym, int print_dso);
+			  int print_sym, int print_dso, int print_symoffset);
 
 int perf_session__cpu_bitmap(struct perf_session *session,
 			     const char *cpu_list, unsigned long *cpu_bitmap);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b580fa8..fc6e12f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -263,16 +263,26 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
 		       sym->name);
 }
 
-size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp)
+size_t symbol__fprintf_symname_offs(const struct symbol *sym,
+				    const struct addr_location *al, FILE *fp)
 {
-	const char *symname;
+	unsigned long offset;
+	size_t length;
 
-	if (sym && sym->name)
-		symname = sym->name;
-	else
-		symname = "[unknown]";
+	if (sym && sym->name) {
+		length = fprintf(fp, "%s", sym->name);
+		if (al) {
+			offset = al->addr - sym->start;
+			length += fprintf(fp, "+0x%lx", offset);
+		}
+		return length;
+	} else
+		return fprintf(fp, "[unknown]");
+}
 
-	return fprintf(fp, "%s", symname);
+size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp)
+{
+	return symbol__fprintf_symname_offs(sym, NULL, fp);
 }
 
 void dso__set_long_name(struct dso *dso, char *name)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index d349c7a..ba909c9 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -241,6 +241,8 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
 
 int symbol__init(void);
 void symbol__exit(void);
+size_t symbol__fprintf_symname_offs(const struct symbol *sym,
+				    const struct addr_location *al, FILE *fp);
 size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);
 bool symbol_type__is_a(char symbol_type, enum map_type map_type);
 
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 5/9] perf script: Add option resolving vmlinux path
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 4/9] perf script: Add the offset field specifier Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 6/9] perf top: Fix number of samples displayed Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Akihiro Nagai, David Ahern, Frederic Weisbecker,
	Masami Hiramatsu, Paul Mackerras, Peter Zijlstra,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>

Add the option get the path of [kernel.kallsyms].
Specify '--show-kernel-path' option to use this function.
This patch enables other applications to use this output easily.

Without --show-kernel-path  option

ffffffff81467612 irq_return ([kernel.kallsyms])
ffffffff81467612 irq_return ([kernel.kallsyms])
    7f24fc02a6b3 _start (/lib64/ld-2.14.so)
[snip]

With --show-kernel-path option

ffffffff81467612 irq_return (/lib/modules/3.2.0+/build/vmlinux)
ffffffff81467612 irq_return (/lib/modules/3.2.0+/build/vmlinux)
    7f24fc02a6b3 _start (/lib64/ld-2.14.so)
[snip]

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20120130044320.2384.73322.stgit@linux3
Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-script.txt |    3 +++
 tools/perf/builtin-script.c              |    3 +++
 tools/perf/util/map.c                    |    9 ++++++---
 tools/perf/util/symbol.h                 |    1 +
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 228c7bb..e9cbfcd 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -200,6 +200,9 @@ OPTIONS
 	It currently includes: cpu and numa topology of the host system.
 	It can only be used with the perf script report mode.
 
+--show-kernel-path::
+	Try to resolve the path of [kernel.kallsyms]
+
 SEE ALSO
 --------
 linkperf:perf-record[1], linkperf:perf-script-perl[1],
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 752d401..d4ce733 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1155,6 +1155,9 @@ static const struct option options[] = {
 		   "only display events for these comms"),
 	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,
+		    "Show the path of [kernel.kallsyms]"),
+
 	OPT_END()
 };
 
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 1107960..dea6d1c 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -216,9 +216,12 @@ size_t map__fprintf_dsoname(struct map *map, FILE *fp)
 {
 	const char *dsoname;
 
-	if (map && map->dso && map->dso->name)
-		dsoname = map->dso->name;
-	else
+	if (map && map->dso && (map->dso->name || map->dso->long_name)) {
+		if (symbol_conf.show_kernel_path && map->dso->long_name)
+			dsoname = map->dso->long_name;
+		else if (map->dso->name)
+			dsoname = map->dso->name;
+	} else
 		dsoname = "[unknown]";
 
 	return fprintf(fp, "%s", dsoname);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ba909c9..2a683d4 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -70,6 +70,7 @@ struct symbol_conf {
 	unsigned short	priv_size;
 	unsigned short	nr_events;
 	bool		try_vmlinux_path,
+			show_kernel_path,
 			use_modules,
 			sort_by_name,
 			show_nr_samples,
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 6/9] perf top: Fix number of samples displayed
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 5/9] perf script: Add option resolving vmlinux path Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 7/9] perf lock: Document lock info subcommand Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Stephane Eranian, David Ahern, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Stephane Eranian <eranian@google.com>

In recent versions of perf top, pressing the 'e' key to change the
number of displayed samples had no effect.

The number of samples was still dictated by the size of the terminal
(stdio mode). That was quite annoying because typically only the first
dozen samples really matter.

This patch fixes this.

Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120130105037.GA5160@quad
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-top.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index e8b033c..d869b21 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -88,8 +88,6 @@ void get_term_dimensions(struct winsize *ws)
 
 static void perf_top__update_print_entries(struct perf_top *top)
 {
-	top->print_entries = top->winsize.ws_row;
-
 	if (top->print_entries > 9)
 		top->print_entries -= 9;
 }
@@ -99,6 +97,13 @@ static void perf_top__sig_winch(int sig __used, siginfo_t *info __used, void *ar
 	struct perf_top *top = arg;
 
 	get_term_dimensions(&top->winsize);
+	if (!top->print_entries
+	    || (top->print_entries+4) > top->winsize.ws_row) {
+		top->print_entries = top->winsize.ws_row;
+	} else {
+		top->print_entries += 4;
+		top->winsize.ws_row = top->print_entries;
+	}
 	perf_top__update_print_entries(top);
 }
 
@@ -452,8 +457,10 @@ static void perf_top__handle_keypress(struct perf_top *top, int c)
 				};
 				perf_top__sig_winch(SIGWINCH, NULL, top);
 				sigaction(SIGWINCH, &act, NULL);
-			} else
+			} else {
+				perf_top__sig_winch(SIGWINCH, NULL, top);
 				signal(SIGWINCH, SIG_DFL);
+			}
 			break;
 		case 'E':
 			if (top->evlist->nr_entries > 1) {
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 7/9] perf lock: Document lock info subcommand
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 6/9] perf top: Fix number of samples displayed Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 8/9] perf tools: Remove unnecessary ctype.h inclusion Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Hitoshi Mitake, Paul Mackerras,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@gmail.com>

The commit 26242d859c9be ("perf lock: Add "info" subcommand for dumping
misc information") added the subcommand but missed documentation. Add
it. Also update stale 'trace' subcommand to 'script'.

Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1327827356-8786-5-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-lock.txt |   20 +++++++++++++++++---
 tools/perf/builtin-lock.c              |    4 ++--
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt
index d6b2a4f..c7f5f55 100644
--- a/tools/perf/Documentation/perf-lock.txt
+++ b/tools/perf/Documentation/perf-lock.txt
@@ -8,7 +8,7 @@ perf-lock - Analyze lock events
 SYNOPSIS
 --------
 [verse]
-'perf lock' {record|report|trace}
+'perf lock' {record|report|script|info}
 
 DESCRIPTION
 -----------
@@ -20,10 +20,13 @@ and statistics with this 'perf lock' command.
   produces the file "perf.data" which contains tracing
   results of lock events.
 
-  'perf lock trace' shows raw lock events.
-
   'perf lock report' reports statistical data.
 
+  'perf lock script' shows raw lock events.
+
+  'perf lock info' shows metadata like threads or addresses
+  of lock instances.
+
 COMMON OPTIONS
 --------------
 
@@ -47,6 +50,17 @@ REPORT OPTIONS
         Sorting key. Possible values: acquired (default), contended,
         wait_total, wait_max, wait_min.
 
+INFO OPTIONS
+------------
+
+-t::
+--threads::
+	dump thread list in perf.data
+
+-m::
+--map::
+	dump map of lock instances (address:name table)
+
 SEE ALSO
 --------
 linkperf:perf[1]
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 2296c39..12c8148 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -922,12 +922,12 @@ static const struct option info_options[] = {
 	OPT_BOOLEAN('t', "threads", &info_threads,
 		    "dump thread list in perf.data"),
 	OPT_BOOLEAN('m', "map", &info_map,
-		    "map of lock instances (name:address table)"),
+		    "map of lock instances (address:name table)"),
 	OPT_END()
 };
 
 static const char * const lock_usage[] = {
-	"perf lock [<options>] {record|trace|report}",
+	"perf lock [<options>] {record|report|script|info}",
 	NULL
 };
 
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 8/9] perf tools: Remove unnecessary ctype.h inclusion
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 7/9] perf lock: Document lock info subcommand Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31  1:24 ` [PATCH 9/9] perf python: Use attr.watermark in twatch.py Arnaldo Carvalho de Melo
  2012-01-31 12:06 ` [GIT PULL 0/9] perf/core fixes and improvements Ingo Molnar
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@gmail.com>

There are unnecessary #include <ctype.h> out there, and they might cause
a nasty build failure in some environment. As we already have most of
ctype macros in util.h, just get rid of them.

A few of exceptions are util/symbol.c which needs isupper() macro util.h
doesn't provide and perl scripting support code which includes ctype.h
internally.

Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1327827356-8786-4-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/bench/mem-memcpy.c                      |    1 -
 tools/perf/bench/mem-memset.c                      |    1 -
 tools/perf/util/probe-finder.c                     |    1 -
 .../util/scripting-engines/trace-event-python.c    |    1 -
 tools/perf/util/trace-event-parse.c                |    1 -
 tools/perf/util/trace-event-read.c                 |    1 -
 tools/perf/util/trace-event-scripting.c            |    1 -
 tools/perf/util/ui/browsers/map.c                  |    2 +-
 8 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 6ad2b1c..7155722 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -5,7 +5,6 @@
  *
  * Written by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
  */
-#include <ctype.h>
 
 #include "../perf.h"
 #include "../util/util.h"
diff --git a/tools/perf/bench/mem-memset.c b/tools/perf/bench/mem-memset.c
index 59d4933..e907918 100644
--- a/tools/perf/bench/mem-memset.c
+++ b/tools/perf/bench/mem-memset.c
@@ -5,7 +5,6 @@
  *
  * Trivial clone of mem-memcpy.c.
  */
-#include <ctype.h>
 
 #include "../perf.h"
 #include "../util/util.h"
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 5d73262..67dc4ae 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -30,7 +30,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
-#include <ctype.h>
 #include <dwarf-regs.h>
 
 #include <linux/bitops.h>
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 0b2a487..c2623c6 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -24,7 +24,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 #include <errno.h>
 
 #include "../../perf.h"
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 1a8d4dc..e0a4f65 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -25,7 +25,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 #include <errno.h>
 
 #include "../perf.h"
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index f55cc3a..b9592e0 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -33,7 +33,6 @@
 #include <pthread.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <ctype.h>
 #include <errno.h>
 
 #include "../perf.h"
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index a3fdf55..18ae6c1 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -22,7 +22,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 #include <errno.h>
 
 #include "../perf.h"
diff --git a/tools/perf/util/ui/browsers/map.c b/tools/perf/util/ui/browsers/map.c
index 6905bcc..eca6575 100644
--- a/tools/perf/util/ui/browsers/map.c
+++ b/tools/perf/util/ui/browsers/map.c
@@ -3,9 +3,9 @@
 #include <newt.h>
 #include <inttypes.h>
 #include <sys/ttydefaults.h>
-#include <ctype.h>
 #include <string.h>
 #include <linux/bitops.h>
+#include "../../util.h"
 #include "../../debug.h"
 #include "../../symbol.h"
 #include "../browser.h"
-- 
1.7.9.rc2.1.g69204


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

* [PATCH 9/9] perf python: Use attr.watermark in twatch.py
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 8/9] perf tools: Remove unnecessary ctype.h inclusion Arnaldo Carvalho de Melo
@ 2012-01-31  1:24 ` Arnaldo Carvalho de Melo
  2012-01-31 12:06 ` [GIT PULL 0/9] perf/core fixes and improvements Ingo Molnar
  9 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-31  1:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian

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

We want to be woken up for every PERF_RECORD_ event, attr.wakeup_events
is only for PERF_RECORD_SAMPLE, so also use attr.watermark = 1 to fix
that.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-v3lnpwgrr8mllcr3ntduuqvc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/python/twatch.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/python/twatch.py b/tools/perf/python/twatch.py
index df638c4..b11cca5 100755
--- a/tools/perf/python/twatch.py
+++ b/tools/perf/python/twatch.py
@@ -19,7 +19,7 @@ def main():
 	cpus = perf.cpu_map()
 	threads = perf.thread_map()
 	evsel = perf.evsel(task = 1, comm = 1, mmap = 0,
-			   wakeup_events = 1, sample_period = 1,
+			   wakeup_events = 1, watermark = 1,
 			   sample_id_all = 1,
 			   sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU | perf.SAMPLE_TID)
 	evsel.open(cpus = cpus, threads = threads);
-- 
1.7.9.rc2.1.g69204


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

* Re: [GIT PULL 0/9] perf/core fixes and improvements
  2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2012-01-31  1:24 ` [PATCH 9/9] perf python: Use attr.watermark in twatch.py Arnaldo Carvalho de Melo
@ 2012-01-31 12:06 ` Ingo Molnar
  9 siblings, 0 replies; 16+ messages in thread
From: Ingo Molnar @ 2012-01-31 12:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Akihiro Nagai, David Ahern, Frederic Weisbecker,
	Hitoshi Mitake, Masami Hiramatsu, Masanari Iida, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	yrl.pp-manager.tt, arnaldo.melo


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

> The following changes since commit efb3040d481a1594592b1defb4526c406c7a4751:
> 
>   jump_label: Add some documentation (2012-01-27 12:14:46 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf-core-for-mingo
> 
> for you to fetch changes up to cfeb1d90a1b1db96383b48888cb7a5f10ca12e12:
> 
>   perf python: Use attr.watermark in twatch.py (2012-01-30 18:38:23 -0200)
> 
> ----------------------------------------------------------------
> perf/core fixes and improvements.
> 
> ----------------------------------------------------------------
> Akihiro Nagai (4):
>       perf script: Unify the expressions indicating "unknown"
>       perf script: Print branch_from and branch_to of BTS events
>       perf script: Add the offset field specifier
>       perf script: Add option resolving vmlinux path
> 
> Arnaldo Carvalho de Melo (1):
>       perf python: Use attr.watermark in twatch.py
> 
> Masanari Iida (1):
>       perf evsel: Fix spelling typo
> 
> Namhyung Kim (2):
>       perf lock: Document lock info subcommand
>       perf tools: Remove unnecessary ctype.h inclusion
> 
> Stephane Eranian (1):
>       perf top: Fix number of samples displayed
> 
>  tools/perf/Documentation/perf-lock.txt             |   20 ++++-
>  tools/perf/Documentation/perf-script.txt           |    5 +-
>  tools/perf/bench/mem-memcpy.c                      |    1 -
>  tools/perf/bench/mem-memset.c                      |    1 -
>  tools/perf/builtin-lock.c                          |    4 +-
>  tools/perf/builtin-script.c                        |   80 ++++++++++++++++----
>  tools/perf/builtin-top.c                           |   13 +++-
>  tools/perf/python/twatch.py                        |    2 +-
>  tools/perf/util/evsel.c                            |    2 +-
>  tools/perf/util/map.c                              |   15 ++++
>  tools/perf/util/map.h                              |    1 +
>  tools/perf/util/probe-finder.c                     |    1 -
>  .../util/scripting-engines/trace-event-python.c    |    1 -
>  tools/perf/util/session.c                          |   39 ++++------
>  tools/perf/util/session.h                          |    2 +-
>  tools/perf/util/symbol.c                           |   22 ++++++
>  tools/perf/util/symbol.h                           |    4 +
>  tools/perf/util/trace-event-parse.c                |    1 -
>  tools/perf/util/trace-event-read.c                 |    1 -
>  tools/perf/util/trace-event-scripting.c            |    1 -
>  tools/perf/util/ui/browsers/map.c                  |    2 +-
>  21 files changed, 159 insertions(+), 59 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

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

* Re: [GIT PULL 0/9] perf/core fixes and improvements
  2012-01-08 15:42 Arnaldo Carvalho de Melo
@ 2012-01-08 16:02 ` Ingo Molnar
  0 siblings, 0 replies; 16+ messages in thread
From: Ingo Molnar @ 2012-01-08 16:02 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Joerg Roedel, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, arnaldo.melo


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

> Hi Ingo,
> 
>         Please consider pulling.
> 
> Regards,
> 
> - Arnaldo
> 
> The following changes since commit b9f616bbf4a917398aa09db89efbdf9a204e80dc:
> 
>   Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-01-08 12:36:18 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core
> 
> for you to fetch changes up to 172d1b0b73256551f100fc00c69e356d047103f5:
> 
>   perf tools: Fix compile error on x86_64 Ubuntu (2012-01-08 13:34:55 -0200)
> 
> ----------------------------------------------------------------
> Namhyung Kim (9):
>       perf script: Add missing closedir() calls
>       perf test: Change type of '-v' option to INCR
>       perf top: Add error message for EMFILE
>       perf kmem: Add missing closedir() calls
>       perf kmem: Fix a memory leak
>       perf annotate: Fix usage string
>       perf annotate: Get rid of field_sep check
>       perf report: Fix --stdio output alignment when --showcpuutilization used
>       perf tools: Fix compile error on x86_64 Ubuntu
> 
>  tools/perf/builtin-annotate.c      |    7 +------
>  tools/perf/builtin-kmem.c          |    3 +++
>  tools/perf/builtin-script.c        |    4 ++++
>  tools/perf/builtin-test.c          |    2 +-
>  tools/perf/builtin-top.c           |    4 ++++
>  tools/perf/util/hist.c             |   34 ++++++++++++++++++----------------
>  tools/perf/util/trace-event-info.c |    1 -
>  7 files changed, 31 insertions(+), 24 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

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

* [GIT PULL 0/9] perf/core fixes and improvements
@ 2012-01-08 15:42 Arnaldo Carvalho de Melo
  2012-01-08 16:02 ` Ingo Molnar
  0 siblings, 1 reply; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-01-08 15:42 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Joerg Roedel,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, arnaldo.melo

Hi Ingo,

        Please consider pulling.

Regards,

- Arnaldo

The following changes since commit b9f616bbf4a917398aa09db89efbdf9a204e80dc:

  Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-01-08 12:36:18 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core

for you to fetch changes up to 172d1b0b73256551f100fc00c69e356d047103f5:

  perf tools: Fix compile error on x86_64 Ubuntu (2012-01-08 13:34:55 -0200)

----------------------------------------------------------------
Namhyung Kim (9):
      perf script: Add missing closedir() calls
      perf test: Change type of '-v' option to INCR
      perf top: Add error message for EMFILE
      perf kmem: Add missing closedir() calls
      perf kmem: Fix a memory leak
      perf annotate: Fix usage string
      perf annotate: Get rid of field_sep check
      perf report: Fix --stdio output alignment when --showcpuutilization used
      perf tools: Fix compile error on x86_64 Ubuntu

 tools/perf/builtin-annotate.c      |    7 +------
 tools/perf/builtin-kmem.c          |    3 +++
 tools/perf/builtin-script.c        |    4 ++++
 tools/perf/builtin-test.c          |    2 +-
 tools/perf/builtin-top.c           |    4 ++++
 tools/perf/util/hist.c             |   34 ++++++++++++++++++----------------
 tools/perf/util/trace-event-info.c |    1 -
 7 files changed, 31 insertions(+), 24 deletions(-)

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

* Re: [GIT PULL 0/9] perf/core fixes and improvements
  2011-06-02 20:56 Arnaldo Carvalho de Melo
@ 2011-06-03 15:05 ` Ingo Molnar
  0 siblings, 0 replies; 16+ messages in thread
From: Ingo Molnar @ 2011-06-03 15:05 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David Ahern, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Thomas Gleixner, Tom Zanussi, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (3):
>   perf evlist: Remove dependency on debug routines
>   perf python: Use exception to propagate errors
>   perf evlist: Don't die if sample_{id_all|type} is invalid
> 
> David Ahern (4):
>   perf stat: clarify unsupported events from uncounted events
>   perf script: "sym" field really means show IP data
>   perf script: Make printing of dso a separate field option
>   perf script: Add printing of sample address
> 
> Frederic Weisbecker (2):
>   perf python: Fix argument name list of read_on_cpu()
>   perf python: Cleanup useless double NULL termination in method arg names
> 
>  tools/perf/Documentation/perf-script.txt |   12 ++--
>  tools/perf/builtin-script.c              |  108 +++++++++++++++++++++++++++---
>  tools/perf/builtin-stat.c                |    9 ++-
>  tools/perf/builtin-test.c                |    2 +-
>  tools/perf/util/event.c                  |   16 -----
>  tools/perf/util/event.h                  |    2 -
>  tools/perf/util/evlist.c                 |   68 +++++++++++--------
>  tools/perf/util/evlist.h                 |    6 +-
>  tools/perf/util/evsel.c                  |   17 +++++
>  tools/perf/util/evsel.h                  |    8 ++
>  tools/perf/util/python.c                 |   29 ++++----
>  tools/perf/util/session.c                |   73 ++++++++++++++-------
>  tools/perf/util/session.h                |    5 +-
>  13 files changed, 245 insertions(+), 110 deletions(-)

Pulled, thanks a lot Arnaldo!

Mind cherry-picking the fixes into perf/urgent?

Thanks,

	Ingo

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

* [GIT PULL 0/9] perf/core fixes and improvements
@ 2011-06-02 20:56 Arnaldo Carvalho de Melo
  2011-06-03 15:05 ` Ingo Molnar
  0 siblings, 1 reply; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-06-02 20:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Thomas Gleixner, Tom Zanussi,
	Arnaldo Carvalho de Melo

Hi Ingo,

        Please consider pulling from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (3):
  perf evlist: Remove dependency on debug routines
  perf python: Use exception to propagate errors
  perf evlist: Don't die if sample_{id_all|type} is invalid

David Ahern (4):
  perf stat: clarify unsupported events from uncounted events
  perf script: "sym" field really means show IP data
  perf script: Make printing of dso a separate field option
  perf script: Add printing of sample address

Frederic Weisbecker (2):
  perf python: Fix argument name list of read_on_cpu()
  perf python: Cleanup useless double NULL termination in method arg names

 tools/perf/Documentation/perf-script.txt |   12 ++--
 tools/perf/builtin-script.c              |  108 +++++++++++++++++++++++++++---
 tools/perf/builtin-stat.c                |    9 ++-
 tools/perf/builtin-test.c                |    2 +-
 tools/perf/util/event.c                  |   16 -----
 tools/perf/util/event.h                  |    2 -
 tools/perf/util/evlist.c                 |   68 +++++++++++--------
 tools/perf/util/evlist.h                 |    6 +-
 tools/perf/util/evsel.c                  |   17 +++++
 tools/perf/util/evsel.h                  |    8 ++
 tools/perf/util/python.c                 |   29 ++++----
 tools/perf/util/session.c                |   73 ++++++++++++++-------
 tools/perf/util/session.h                |    5 +-
 13 files changed, 245 insertions(+), 110 deletions(-)


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

* [GIT PULL 0/9] perf/core fixes and improvements
@ 2010-08-10 20:15 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-08-10 20:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Dave Martin,
	Frederic Weisbecker, Mike Galbraith, Peter Zijlstra,
	Stephane Eranian

Hi Ingo,

        Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (8):
  perf ui: Shorten ui_browser member names
  perf ui: Move ui_helpline routines to separate file in util/ui/
  perf ui: Move ui_progress routines to separate file in util/ui/
  perf ui: Move annotate browser to util/ui/browsers/
  perf ui: Move map browser to util/ui/browsers/
  perf ui: Move hists browser to util/ui/browsers/
  perf ui: Complete the breakdown of util/newt.c
  perf annotate: Sort by hottest lines in the TUI

Dave Martin (1):
  perf symbols: Ignore mapping symbols on ARM

 tools/perf/Makefile                    |   25 +-
 tools/perf/builtin-annotate.c          |    2 +-
 tools/perf/util/debug.c                |    2 +-
 tools/perf/util/debug.h                |    9 +-
 tools/perf/util/hist.c                 |   13 +-
 tools/perf/util/hist.h                 |    3 +-
 tools/perf/util/newt.c                 | 1487 --------------------------------
 tools/perf/util/pstack.h               |    2 +
 tools/perf/util/symbol.c               |   10 +
 tools/perf/util/ui/browser.c           |   57 +-
 tools/perf/util/ui/browser.h           |    7 +-
 tools/perf/util/ui/browsers/annotate.c |  191 ++++
 tools/perf/util/ui/browsers/hists.c    |  946 ++++++++++++++++++++
 tools/perf/util/ui/browsers/map.c      |  163 ++++
 tools/perf/util/ui/browsers/map.h      |    6 +
 tools/perf/util/ui/helpline.c          |   69 ++
 tools/perf/util/ui/helpline.h          |   10 +
 tools/perf/util/ui/libslang.h          |   27 +
 tools/perf/util/ui/progress.c          |   60 ++
 tools/perf/util/ui/progress.h          |   11 +
 tools/perf/util/ui/setup.c             |   42 +
 tools/perf/util/ui/util.c              |  114 +++
 tools/perf/util/ui/util.h              |   10 +
 23 files changed, 1729 insertions(+), 1537 deletions(-)
 delete mode 100644 tools/perf/util/newt.c
 create mode 100644 tools/perf/util/ui/browsers/annotate.c
 create mode 100644 tools/perf/util/ui/browsers/hists.c
 create mode 100644 tools/perf/util/ui/browsers/map.c
 create mode 100644 tools/perf/util/ui/browsers/map.h
 create mode 100644 tools/perf/util/ui/helpline.c
 create mode 100644 tools/perf/util/ui/helpline.h
 create mode 100644 tools/perf/util/ui/libslang.h
 create mode 100644 tools/perf/util/ui/progress.c
 create mode 100644 tools/perf/util/ui/progress.h
 create mode 100644 tools/perf/util/ui/setup.c
 create mode 100644 tools/perf/util/ui/util.c
 create mode 100644 tools/perf/util/ui/util.h


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

end of thread, other threads:[~2012-01-31 12:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31  1:24 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 1/9] perf evsel: Fix spelling typo Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 2/9] perf script: Unify the expressions indicating "unknown" Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 3/9] perf script: Print branch_from and branch_to of BTS events Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 4/9] perf script: Add the offset field specifier Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 5/9] perf script: Add option resolving vmlinux path Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 6/9] perf top: Fix number of samples displayed Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 7/9] perf lock: Document lock info subcommand Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 8/9] perf tools: Remove unnecessary ctype.h inclusion Arnaldo Carvalho de Melo
2012-01-31  1:24 ` [PATCH 9/9] perf python: Use attr.watermark in twatch.py Arnaldo Carvalho de Melo
2012-01-31 12:06 ` [GIT PULL 0/9] perf/core fixes and improvements Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2012-01-08 15:42 Arnaldo Carvalho de Melo
2012-01-08 16:02 ` Ingo Molnar
2011-06-02 20:56 Arnaldo Carvalho de Melo
2011-06-03 15:05 ` Ingo Molnar
2010-08-10 20:15 Arnaldo Carvalho de Melo

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