diff options
author | Wang Nan <wangnan0@huawei.com> | 2016-11-26 07:03:29 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-12-05 15:51:42 -0300 |
commit | 8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36 (patch) | |
tree | db08e2b766f375c3037d8dcc39d730c3b58b1dec /tools/perf/util/perf-hooks.h | |
parent | baa1973ebcf6a7bd15522a5b6a35a8fefd6cb232 (diff) | |
download | linux-8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36.tar.gz linux-8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36.tar.bz2 linux-8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36.zip |
perf tools: Pass context to perf hook functions
Pass a pointer to perf hook functions so they receive context
information during setup.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-6-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/perf-hooks.h')
-rw-r--r-- | tools/perf/util/perf-hooks.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/perf-hooks.h b/tools/perf/util/perf-hooks.h index 1d482b26b4b9..838d5797bc1e 100644 --- a/tools/perf/util/perf-hooks.h +++ b/tools/perf/util/perf-hooks.h @@ -5,10 +5,11 @@ extern "C" { #endif -typedef void (*perf_hook_func_t)(void); +typedef void (*perf_hook_func_t)(void *ctx); struct perf_hook_desc { const char * const hook_name; perf_hook_func_t * const p_hook_func; + void *hook_ctx; }; extern void perf_hooks__invoke(const struct perf_hook_desc *); @@ -26,7 +27,8 @@ static inline void perf_hooks__invoke_##name(void) \ extern int perf_hooks__set_hook(const char *hook_name, - perf_hook_func_t hook_func); + perf_hook_func_t hook_func, + void *hook_ctx); extern perf_hook_func_t perf_hooks__get_hook(const char *hook_name); |