* [PATCH tip 3/3] perf tools: Fallback to cplus_demangle when bfd_demangle is not available
@ 2009-08-11 19:22 Arnaldo Carvalho de Melo
2009-08-11 20:04 ` [PATCH tip 1/1] perf tools: Make dso__new handle deleted DSOs Arnaldo Carvalho de Melo
0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-08-11 19:22 UTC (permalink / raw)
To: Ingo Molnar
Cc: H. Peter Anvin, Peter Zijlstra, Mike Galbraith,
Frédéric Weisbecker, Thomas Gleixner,
Luis Claudio R. Gonçalves, Linux Kernel Mailing List
In old binutils we can't access bfd_demangle, use cplus_demangle just
like oprofile.
Cc: Luis Claudio R. Gonçalves <lclaudio@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile | 29 ++++++++++++++++++-----------
tools/perf/util/symbol.c | 15 ---------------
tools/perf/util/symbol.h | 24 ++++++++++++++++++++++++
3 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index de7beac..3ab09e5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -384,22 +384,29 @@ endif
ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE
else
-
has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd > /dev/null 2>&1 && echo y")
- has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty > /dev/null 2>&1 && echo y")
-
- has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
-
ifeq ($(has_bfd),y)
EXTLIBS += -lbfd
- else ifeq ($(has_bfd_iberty),y)
- EXTLIBS += -lbfd -liberty
- else ifeq ($(has_bfd_iberty_z),y)
- EXTLIBS += -lbfd -liberty -lz
else
- msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling)
- BASIC_CFLAGS += -DNO_DEMANGLE
+ has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty > /dev/null 2>&1 && echo y")
+ ifeq ($(has_bfd_iberty),y)
+ EXTLIBS += -lbfd -liberty
+ else
+ has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
+ ifeq ($(has_bfd_iberty_z),y)
+ EXTLIBS += -lbfd -liberty -lz
+ else
+ has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -liberty > /dev/null 2>&1 && echo y")
+ ifeq ($(has_cplus_demangle),y)
+ EXTLIBS += -liberty
+ BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+ else
+ msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling)
+ BASIC_CFLAGS += -DNO_DEMANGLE
+ endif
+ endif
+ endif
endif
endif
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index f1dcede..2473fd4 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -7,23 +7,8 @@
#include <gelf.h>
#include <elf.h>
-#ifndef NO_DEMANGLE
-#include <bfd.h>
-#else
-static inline
-char *bfd_demangle(void __used *v, const char __used *c, int __used i)
-{
- return NULL;
-}
-#endif
-
const char *sym_hist_filter;
-#ifndef DMGL_PARAMS
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-#endif
-
enum dso_origin {
DSO__ORIG_KERNEL = 0,
DSO__ORIG_JAVA_JIT,
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 1e003ec..b53bf01 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -7,6 +7,30 @@
#include <linux/rbtree.h>
#include "module.h"
+#ifdef HAVE_CPLUS_DEMANGLE
+extern char *cplus_demangle(const char *, int);
+
+static inline char *bfd_demangle(void __used *v, const char *c, int i)
+{
+ return cplus_demangle(c, i);
+}
+#else
+#ifdef NO_DEMANGLE
+static inline char *bfd_demangle(void __used *v, const char __used *c,
+ int __used i)
+{
+ return NULL;
+}
+#else
+#include <bfd.h>
+#endif
+#endif
+
+#ifndef DMGL_PARAMS
+#define DMGL_PARAMS (1 << 0) /* Include function args */
+#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
+#endif
+
struct symbol {
struct rb_node rb_node;
u64 start;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH tip 1/1] perf tools: Make dso__new handle deleted DSOs
2009-08-11 19:22 [PATCH tip 3/3] perf tools: Fallback to cplus_demangle when bfd_demangle is not available Arnaldo Carvalho de Melo
@ 2009-08-11 20:04 ` Arnaldo Carvalho de Melo
2009-08-12 17:44 ` [PATCH tip 1/1] perf list: use the pager Arnaldo Carvalho de Melo
0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-08-11 20:04 UTC (permalink / raw)
To: Ingo Molnar
Cc: H. Peter Anvin, Peter Zijlstra, Mike Galbraith,
Frédéric Weisbecker, Thomas Gleixner,
Luis Claudio R. Gonçalves, Clark Williams,
Linux Kernel Mailing List
It is better than showing the map addr, this way at least we know that we can't
get the symtabs because the DSO was deleted (system update) while an app still
used such DSO.
Yeah, don't do that, but if you do, you'll figure it out quicker this
way.
[acme@doppio linux-2.6-tip]$ perf report | head -15
# Samples: 3796
#
# Overhead Command Shared Object Symbol
# ........ ....... ................................................................... ......
#
23.55% pidgin /lib64/libglib-2.0.so.0.2000.4.#prelink#.Pd98lu (deleted) [.] 0x00000000038844
21.55% pidgin /lib64/libpthread-2.10.1.so.#prelink#.AFwK8Q (deleted) [.] 0x0000000000a42d
10.85% pidgin [kernel] [.] vread_hpet
7.85% pidgin /lib64/libgobject-2.0.so.0.2000.4.#prelink#.o1vpU7 (deleted) [.] 0x00000000014de8
3.35% pidgin /lib64/libc-2.10.1.so (deleted) [.] 0x0000000007a875
3.19% pidgin /lib64/libdbus-1.so.3.4.0.#prelink#.6mwgZP (deleted) [.] 0x0000000001d254
3.06% pidgin /usr/lib64/libgtk-x11-2.0.so.0.1600.5.#prelink#.511hAl (deleted) [.] 0x000000002334e7
2.90% pidgin /usr/lib64/libgdk-x11-2.0.so.0.1600.5.#prelink#.5qlMo1 (deleted) [.] 0x00000000037b2d
1.84% pidgin [kernel] [k] do_sys_poll
1.45% pidgin /usr/lib64/libX11.so.6.2.0.#prelink#.iR59Rx (deleted) [.] 0x0000000004c751
[acme@doppio linux-2.6-tip]$
Cc: Luis Claudio R. Gonçalves <lclaudio@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 2473fd4..5c0f42e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -801,6 +801,8 @@ more:
}
out:
free(name);
+ if (ret < 0 && strstr(self->name, " (deleted)") != NULL)
+ return 0;
return ret;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH tip 1/1] perf list: use the pager
2009-08-11 20:04 ` [PATCH tip 1/1] perf tools: Make dso__new handle deleted DSOs Arnaldo Carvalho de Melo
@ 2009-08-12 17:44 ` Arnaldo Carvalho de Melo
2009-08-12 18:42 ` Frederic Weisbecker
2009-08-13 7:28 ` [tip:perfcounters/urgent] perf list: Fix large list output by using " tip-bot for Arnaldo Carvalho de Melo
0 siblings, 2 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-08-12 17:44 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Peter Zijlstra, Linux Kernel Mailing List
When /sys/kernel/debug is mounted the list is imense, so use the pager
like the other tools.
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index f990fa8..d88c696 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -10,11 +10,12 @@
#include "perf.h"
-#include "util/parse-options.h"
#include "util/parse-events.h"
+#include "util/cache.h"
int cmd_list(int argc __used, const char **argv __used, const char *prefix __used)
{
+ setup_pager();
print_events();
return 0;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH tip 1/1] perf list: use the pager
2009-08-12 17:44 ` [PATCH tip 1/1] perf list: use the pager Arnaldo Carvalho de Melo
@ 2009-08-12 18:42 ` Frederic Weisbecker
2009-08-13 7:28 ` [tip:perfcounters/urgent] perf list: Fix large list output by using " tip-bot for Arnaldo Carvalho de Melo
1 sibling, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2009-08-12 18:42 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Ingo Molnar, Peter Zijlstra, Linux Kernel Mailing List
On Wed, Aug 12, 2009 at 02:44:59PM -0300, Arnaldo Carvalho de Melo wrote:
> When /sys/kernel/debug is mounted the list is imense, so use the pager
> like the other tools.
>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Ah, the integration of syscalls tracepoints made the list huge
and I tried to figure out a way to set something like that.
I didn't know it was so simple :-)
>
> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> index f990fa8..d88c696 100644
> --- a/tools/perf/builtin-list.c
> +++ b/tools/perf/builtin-list.c
> @@ -10,11 +10,12 @@
>
> #include "perf.h"
>
> -#include "util/parse-options.h"
> #include "util/parse-events.h"
> +#include "util/cache.h"
>
> int cmd_list(int argc __used, const char **argv __used, const char *prefix __used)
> {
> + setup_pager();
> print_events();
> return 0;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:perfcounters/urgent] perf list: Fix large list output by using the pager
2009-08-12 17:44 ` [PATCH tip 1/1] perf list: use the pager Arnaldo Carvalho de Melo
2009-08-12 18:42 ` Frederic Weisbecker
@ 2009-08-13 7:28 ` tip-bot for Arnaldo Carvalho de Melo
1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2009-08-13 7:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, acme, hpa, mingo, fweisbec, peterz, tglx, mingo
Commit-ID: 8f7a0dc51674ad0dd06155291b0aed60d655943c
Gitweb: http://git.kernel.org/tip/8f7a0dc51674ad0dd06155291b0aed60d655943c
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Wed, 12 Aug 2009 14:44:59 -0300
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 13 Aug 2009 09:05:48 +0200
perf list: Fix large list output by using the pager
When /sys/kernel/debug is mounted the list can be imense, so
use the pager like the other tools.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20090812174459.GB3495@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/builtin-list.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index f990fa8..d88c696 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -10,11 +10,12 @@
#include "perf.h"
-#include "util/parse-options.h"
#include "util/parse-events.h"
+#include "util/cache.h"
int cmd_list(int argc __used, const char **argv __used, const char *prefix __used)
{
+ setup_pager();
print_events();
return 0;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-13 7:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 19:22 [PATCH tip 3/3] perf tools: Fallback to cplus_demangle when bfd_demangle is not available Arnaldo Carvalho de Melo
2009-08-11 20:04 ` [PATCH tip 1/1] perf tools: Make dso__new handle deleted DSOs Arnaldo Carvalho de Melo
2009-08-12 17:44 ` [PATCH tip 1/1] perf list: use the pager Arnaldo Carvalho de Melo
2009-08-12 18:42 ` Frederic Weisbecker
2009-08-13 7:28 ` [tip:perfcounters/urgent] perf list: Fix large list output by using " tip-bot for 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).