diff options
author | Josh Stone <jistone@redhat.com> | 2010-03-18 18:54:18 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-18 18:54:18 -0700 |
commit | 34fe8ec416abfb4355fcb1a9a015de7c9dfc9380 (patch) | |
tree | 8bb3556adc361bf8f4604096fa02374f16061518 /runtime/perf.h | |
parent | 9fab2262961c9cd1ab3efea5d362b8a6a1c0c7c3 (diff) | |
download | systemtap-steved-34fe8ec416abfb4355fcb1a9a015de7c9dfc9380.tar.gz systemtap-steved-34fe8ec416abfb4355fcb1a9a015de7c9dfc9380.tar.xz systemtap-steved-34fe8ec416abfb4355fcb1a9a015de7c9dfc9380.zip |
Create one perf structure to rule them all
* perf.h (stap_perf_probe): Define one structure for all our needs.
* perf.c (_stp_perf_init): Use the new struct, return errors directly.
(_stp_perf_exit): Use the new struct.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls): Use
the stap_perf_probe definition from perf.h now.
(perf_derived_probe_group::emit_module_init): Adapt.
(perf_derived_probe_group::emit_module_exit): Adapt.
Diffstat (limited to 'runtime/perf.h')
-rw-r--r-- | runtime/perf.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/runtime/perf.h b/runtime/perf.h index 19f89fe7..bdc79ade 100644 --- a/runtime/perf.h +++ b/runtime/perf.h @@ -16,22 +16,18 @@ * @brief Header file for performance monitoring hardware support */ -typedef struct { - struct perf_event *event; +struct stap_perf_probe { + struct perf_event_attr attr; + perf_overflow_handler_t callback; const char *pp; - void (*ph) (struct context *); -} perfcpu; + void (*ph) (struct context*); -typedef struct { /* per-cpu data. allocated with _stp_alloc_percpu() */ - perfcpu *pd; -} Perf; + struct perf_event **events; +}; -static Perf *_stp_perf_init (struct perf_event_attr *attr, - perf_overflow_handler_t callback, - const char *pp, - void (*ph) (struct context *) ); +static long _stp_perf_init (struct stap_perf_probe *stp); -static void _stp_perf_del (Perf *pe); +static void _stp_perf_del (struct stap_perf_probe *stp); #endif /* _PERF_H_ */ |