All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] perf tools: Allow vmlinux to fallback to kallsyms on NO_LIBELF=1
@ 2014-11-07  5:20 Namhyung Kim
  2014-11-07  5:20 ` [PATCH 2/3] perf symbol: Implement a very simple ELF symbol parser Namhyung Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 28+ messages in thread
From: Namhyung Kim @ 2014-11-07  5:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
	Namhyung Kim, LKML, Jiri Olsa, Adrian Hunter, David Ahern

When libelf is not used, perf cannot not show symbol names since it
doesn't access the ELF symbol table.  But kernel is different as it
can fallback to kallsyms.

It worked w/o libelf, but recent change to use vmlinux for kernel
symbols break it.

With this change, it now can show kernel symbols again:

  # Overhead  Command  Shared Object      Symbol
  # ........  .......  .................  ........................
  #
      34.51%  swapper  [kernel.kallsyms]  [k] intel_idle
      12.54%  perf     [kernel.kallsyms]  [k] generic_exec_single
      10.11%  swapper  [kernel.kallsyms]  [k] int_sqrt
       9.83%  swapper  [kernel.kallsyms]  [k] hrtimer_interrupt
       7.25%  emacs    [kernel.kallsyms]  [k] __switch_to
       7.06%  sleep    [kernel.kallsyms]  [k] find_next_iomem_res
       7.02%  swapper  [kernel.kallsyms]  [k] run_timer_softirq
       2.55%  swapper  [kernel.kallsyms]  [k] _raw_spin_unlock_irq
       1.90%  swapper  [kernel.kallsyms]  [k] lapic_next_deadline
       1.75%  swapper  [kernel.kallsyms]  [k] native_sched_clock
       1.49%  swapper  [kernel.kallsyms]  [k] __schedule
       1.20%  swapper  [kernel.kallsyms]  [k] read_tsc
       1.10%  sleep    [kernel.kallsyms]  [k] current_kernel_time
       0.99%  swapper  [kernel.kallsyms]  [k] pick_next_task_rt
       0.36%  swapper  [kernel.kallsyms]  [k] group_sched_in
       0.24%  swapper  [kernel.kallsyms]  [k] x86_pmu_commit_txn
       0.06%  swapper  [kernel.kallsyms]  [k] intel_pmu_enable_all
       0.03%  perf     [kernel.kallsyms]  [k] intel_pmu_enable_all

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/symbol-minimal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index c9541fea9514..226cf41ed7e6 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -335,6 +335,9 @@ int dso__load_sym(struct dso *dso, struct map *map __maybe_unused,
 	unsigned char *build_id[BUILD_ID_SIZE];
 	int ret;
 
+	if (dso->kernel)
+		return 0;  /* always use kallsyms */
+
 	ret = fd__is_64_bit(ss->fd);
 	if (ret >= 0)
 		dso->is_64_bit = ret;
-- 
2.1.2


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

end of thread, other threads:[~2014-11-20  7:38 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07  5:20 [PATCH 1/3] perf tools: Allow vmlinux to fallback to kallsyms on NO_LIBELF=1 Namhyung Kim
2014-11-07  5:20 ` [PATCH 2/3] perf symbol: Implement a very simple ELF symbol parser Namhyung Kim
2014-11-07 15:26   ` Arnaldo Carvalho de Melo
2014-11-10  6:36     ` Namhyung Kim
2014-11-10 12:09       ` Arnaldo Carvalho de Melo
2014-11-17  2:31         ` Namhyung Kim
2014-11-07  5:20 ` [PATCH 3/3] perf tools: Clean up libelf feature support code Namhyung Kim
2014-11-20  7:36   ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-11-07  8:27 ` [PATCH 1/3] perf tools: Allow vmlinux to fallback to kallsyms on NO_LIBELF=1 Peter Zijlstra
2014-11-07 14:57   ` Namhyung Kim
2014-11-07 17:37     ` Peter Zijlstra
2014-11-10  6:33       ` Namhyung Kim
2014-11-10 12:11         ` Peter Zijlstra
2014-11-11  4:24           ` Namhyung Kim
2014-11-11 10:27             ` Peter Zijlstra
2014-11-11 13:03               ` Arnaldo Carvalho de Melo
2014-11-11 14:02                 ` Arnaldo Carvalho de Melo
2014-11-11 17:19                   ` Peter Zijlstra
2014-11-20  7:37                 ` [tip:perf/core] perf symbols: Fallback to kallsyms when using the minimal 'ELF' loader tip-bot for Arnaldo Carvalho de Melo
2014-11-11 13:02             ` [PATCH 1/3] perf tools: Allow vmlinux to fallback to kallsyms on NO_LIBELF=1 Arnaldo Carvalho de Melo
2014-11-17  1:55               ` Namhyung Kim
2014-11-07 15:21 ` David Ahern
2014-11-10  7:40   ` Namhyung Kim
2014-11-10 14:20     ` David Ahern
2014-11-07 15:29 ` Arnaldo Carvalho de Melo
2014-11-10  6:53   ` Namhyung Kim
2014-11-10 12:11     ` Arnaldo Carvalho de Melo
2014-11-17  2:04       ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.