From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Randy Dunlap <rdunlap@xenotime.net>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Oleg Nesterov <oleg@redhat.com>, Mark Wielaard <mjw@redhat.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
LKML <linux-kernel@vger.kernel.org>,
Naren A Devaiah <naren.devaiah@in.ibm.com>,
Jim Keniston <jkenisto@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
"Frank Ch. Eigler" <fche@redhat.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCHv10 2.6.35-rc6-tip 12/14] perf: Add third parameter to symbol_filter_t.
Date: Tue, 27 Jul 2010 16:41:19 +0530 [thread overview]
Message-ID: <20100727111119.24690.74064.sendpatchset@localhost6.localdomain6> (raw)
In-Reply-To: <20100727110855.24690.26901.sendpatchset@localhost6.localdomain6>
GElf_Sym for a symbol is needed to filter out based on binding,
type, value. This will be needed to list only global binding
functions when listing functions from perf probe.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
tools/perf/builtin-test.c | 4 +++-
tools/perf/builtin-top.c | 6 +++++-
tools/perf/util/map.h | 4 +++-
tools/perf/util/symbol.c | 10 +++++-----
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 035b9fa..31fb9e3 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -11,10 +11,12 @@
#include "util/session.h"
#include "util/symbol.h"
#include "util/thread.h"
+#include <gelf.h>
static long page_size;
-static int vmlinux_matches_kallsyms_filter(struct map *map __used, struct symbol *sym)
+static int vmlinux_matches_kallsyms_filter(struct map *map __used,
+ struct symbol *sym, GElf_Sym *gsym __used)
{
bool *visited = symbol__priv(sym);
*visited = true;
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index b513e40..56989e8 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -54,6 +54,7 @@
#include <linux/unistd.h>
#include <linux/types.h>
+#include <gelf.h>
static int *fd[MAX_NR_CPUS][MAX_COUNTERS];
@@ -932,7 +933,10 @@ static const char *skip_symbols[] = {
NULL
};
-static int symbol_filter(struct map *map, struct symbol *sym)
+#define __unused __attribute__((unused))
+
+static int symbol_filter(struct map *map, struct symbol *sym,
+ GElf_Sym *gsym __unused)
{
struct sym_entry *syme;
const char *name = sym->name;
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index f391345..1fcde24 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdbool.h>
#include "types.h"
+#include <gelf.h>
enum map_type {
MAP__FUNCTION = 0,
@@ -100,7 +101,8 @@ u64 map__objdump_2ip(struct map *map, u64 addr);
struct symbol;
-typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym);
+typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym,
+ GElf_Sym *gsym);
void map__init(struct map *self, enum map_type type,
u64 start, u64 end, u64 pgoff, struct dso *dso);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 410e824..38ad5c9 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -574,7 +574,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map,
++kernel_range;
}
- if (filter && filter(curr_map, pos)) {
+ if (filter && filter(curr_map, pos, NULL)) {
discard_symbol: rb_erase(&pos->rb_node, root);
symbol__delete(pos);
} else {
@@ -653,7 +653,7 @@ static int dso__load_perf_map(struct dso *self, struct map *map,
if (sym == NULL)
goto out_delete_line;
- if (filter && filter(map, sym))
+ if (filter && filter(map, sym, NULL))
symbol__delete(sym);
else {
symbols__insert(&self->symbols[map->type], sym);
@@ -864,7 +864,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, struct map *map,
if (!f)
goto out_elf_end;
- if (filter && filter(map, f))
+ if (filter && filter(map, f, &sym))
symbol__delete(f);
else {
symbols__insert(&self->symbols[map->type], f);
@@ -886,7 +886,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, struct map *map,
if (!f)
goto out_elf_end;
- if (filter && filter(map, f))
+ if (filter && filter(map, f, &sym))
symbol__delete(f);
else {
symbols__insert(&self->symbols[map->type], f);
@@ -1122,7 +1122,7 @@ new_symbol:
if (!f)
goto out_elf_end;
- if (filter && filter(curr_map, f))
+ if (filter && filter(curr_map, f, &sym))
symbol__delete(f);
else {
symbols__insert(&curr_dso->symbols[curr_map->type], f);
next prev parent reply other threads:[~2010-07-27 11:13 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-27 11:08 [PATCHv10 2.6.35-rc6-tip 0/14] Uprobes Patches Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 1/14] mm: Move replace_page() / write_protect_page() to mm/memory.c Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 2/14] uprobes: Breakpoint insertion/removal in user space applications Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 3/14] uprobes: Slot allocation for Execution out of line(XOL) Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 4/14] uprobes: x86 specific functions for user space breakpointing Srikar Dronamraju
2010-07-27 11:09 ` [PATCHv10 2.6.35-rc6-tip 5/14] uprobes: Uprobes (un)registration and exception handling Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 6/14] uprobes: X86 support for Uprobes Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 7/14] uprobes: Uprobes Documentation Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 8/14] trace: Extract out common code for kprobes/uprobes traceevents Srikar Dronamraju
2010-07-27 13:22 ` Masami Hiramatsu
2010-07-27 14:03 ` Srikar Dronamraju
2010-07-28 7:56 ` Masami Hiramatsu
2010-07-29 14:16 ` Srikar Dronamraju
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 9/14] trace: uprobes trace_event interface Srikar Dronamraju
2010-07-29 5:04 ` Masami Hiramatsu
2010-08-02 2:20 ` Frederic Weisbecker
2010-08-02 3:45 ` Masami Hiramatsu
2010-08-02 6:46 ` Srikar Dronamraju
2010-08-02 7:58 ` Frederic Weisbecker
2010-08-02 7:46 ` Frederic Weisbecker
2010-08-02 7:56 ` Ingo Molnar
2010-08-02 8:00 ` Christoph Hellwig
2010-08-02 9:29 ` Masami Hiramatsu
2010-08-02 9:36 ` Christoph Hellwig
2010-07-29 5:04 ` Masami Hiramatsu
2010-07-29 5:20 ` Srikar Dronamraju
2010-07-29 14:15 ` Srikar Dronamraju
2010-08-02 2:28 ` Frederic Weisbecker
2010-07-27 11:10 ` [PATCHv10 2.6.35-rc6-tip 10/14] perf: rename common fields/functions from kprobe to probe Srikar Dronamraju
2010-07-29 11:51 ` Masami Hiramatsu
2010-07-29 14:13 ` Srikar Dronamraju
2010-07-29 19:42 ` Arnaldo Carvalho de Melo
2010-08-02 7:53 ` [tip:perf/core] perf probe: Rename " tip-bot for Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 11/14] perf: perf interface for uprobes Srikar Dronamraju
2010-07-29 12:01 ` Masami Hiramatsu
2010-07-29 14:11 ` Srikar Dronamraju
2010-07-30 19:19 ` Arnaldo Carvalho de Melo
2010-07-31 2:57 ` Srikar Dronamraju
2010-07-31 19:30 ` Arnaldo Carvalho de Melo
2010-08-02 1:51 ` Masami Hiramatsu
2010-08-02 12:27 ` Srikar Dronamraju
2010-08-02 14:56 ` Arnaldo Carvalho de Melo
2010-08-02 12:38 ` [PATCH] perf: expose event__process function Srikar Dronamraju
2010-08-05 8:01 ` [tip:perf/core] " tip-bot for Srikar Dronamraju
2010-08-02 12:41 ` [PATCHv10 2.6.35-rc6-tip 11/14] perf: perf interface for uprobes Srikar Dronamraju
2010-07-27 11:11 ` Srikar Dronamraju [this message]
2010-08-05 15:19 ` [PATCHv10 2.6.35-rc6-tip 12/14] perf: Add third parameter to symbol_filter_t Arnaldo Carvalho de Melo
2010-08-05 15:20 ` Arnaldo Carvalho de Melo
2010-08-05 15:23 ` Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 13/14] [RFC] perf: Show Potential probe points Srikar Dronamraju
2010-07-27 11:11 ` [PATCHv10 2.6.35-rc6-tip 14/14] [RFC] perf: show functions in a file without using pid Srikar Dronamraju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100727111119.24690.74064.sendpatchset@localhost6.localdomain6 \
--to=srikar@linux.vnet.ibm.com \
--cc=acme@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=fche@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=jkenisto@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@elte.hu \
--cc=mjw@redhat.com \
--cc=naren.devaiah@in.ibm.com \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rdunlap@xenotime.net \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox