summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-01-07 19:59:40 -0200
committerIngo Molnar <mingo@elte.hu>2010-01-13 10:09:16 +0100
commitcf5531148ff34938840d6da775c0a4ace442d573 (patch)
tree5a5536361634fa8683a11f0c6e4431390d109a0d
parenta89e5abe3efcc7facc666d3985769278937f86b0 (diff)
downloadop-kernel-dev-cf5531148ff34938840d6da775c0a4ace442d573.zip
op-kernel-dev-cf5531148ff34938840d6da775c0a4ace442d573.tar.gz
perf tools: Create typedef for common event synthesizing callback
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1262901583-8074-3-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--tools/perf/util/event.c16
-rw-r--r--tools/perf/util/event.h12
2 files changed, 10 insertions, 18 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 1a31feb..bfb3d87 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -8,8 +8,7 @@
#include "thread.h"
static pid_t event__synthesize_comm(pid_t pid, int full,
- int (*process)(event_t *event,
- struct perf_session *session),
+ event__handler_t process,
struct perf_session *session)
{
event_t ev;
@@ -91,8 +90,7 @@ out_failure:
}
static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
- int (*process)(event_t *event,
- struct perf_session *session),
+ event__handler_t process,
struct perf_session *session)
{
char filename[PATH_MAX];
@@ -156,9 +154,7 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
return 0;
}
-int event__synthesize_thread(pid_t pid,
- int (*process)(event_t *event,
- struct perf_session *session),
+int event__synthesize_thread(pid_t pid, event__handler_t process,
struct perf_session *session)
{
pid_t tgid = event__synthesize_comm(pid, 1, process, session);
@@ -167,8 +163,7 @@ int event__synthesize_thread(pid_t pid,
return event__synthesize_mmap_events(pid, tgid, process, session);
}
-void event__synthesize_threads(int (*process)(event_t *event,
- struct perf_session *session),
+void event__synthesize_threads(event__handler_t process,
struct perf_session *session)
{
DIR *proc;
@@ -205,8 +200,7 @@ static int find_symbol_cb(void *arg, const char *name, char type, u64 start)
return 1;
}
-int event__synthesize_kernel_mmap(int (*process)(event_t *event,
- struct perf_session *session),
+int event__synthesize_kernel_mmap(event__handler_t process,
struct perf_session *session,
const char *symbol_name)
{
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 61fc0dc..80356da 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -103,15 +103,13 @@ void event__print_totals(void);
struct perf_session;
-int event__synthesize_thread(pid_t pid,
- int (*process)(event_t *event,
- struct perf_session *session),
+typedef int (*event__handler_t)(event_t *event, struct perf_session *session);
+
+int event__synthesize_thread(pid_t pid, event__handler_t process,
struct perf_session *session);
-void event__synthesize_threads(int (*process)(event_t *event,
- struct perf_session *session),
+void event__synthesize_threads(event__handler_t process,
struct perf_session *session);
-int event__synthesize_kernel_mmap(int (*process)(event_t *event,
- struct perf_session *session),
+int event__synthesize_kernel_mmap(event__handler_t process,
struct perf_session *session,
const char *symbol_name);
OpenPOWER on IntegriCloud