diff options
author | Will Cohen <wcohen@redhat.com> | 2010-02-17 10:30:15 -0500 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-17 11:50:34 -0700 |
commit | 5d8efa6b59a399815e065d4f29ed64d01bdb6182 (patch) | |
tree | 7f70b243a56c9a88b0f339d3b0beae0630c26178 /runtime/perf.h | |
parent | 6ccb243c59eff3ac89072b112414c50d6ef6cf3b (diff) | |
download | systemtap-steved-5d8efa6b59a399815e065d4f29ed64d01bdb6182.tar.gz systemtap-steved-5d8efa6b59a399815e065d4f29ed64d01bdb6182.tar.xz systemtap-steved-5d8efa6b59a399815e065d4f29ed64d01bdb6182.zip |
PR909: Runtime for Performance Event Sampling
Implements a very simple sampling runtime to using the performance
events kernel API. An perf event attribute describing the setup and a
function to handle the counter overflows are passed into
_stp_perf_init(). This function sets up the event on each processor.
If successfully initialized, a pointer data structure is
returned. When the sampling is no longer needed _stp_perf_del() is
called to shutdown the sampling.
* runtime/perf.h: Add declarations for data structures and functions
* runtime/perf.c: Remove old perfmon runtime runtime.
Add _stp_perf_init() and _stp_perf_del() functions.
Diffstat (limited to 'runtime/perf.h')
-rw-r--r-- | runtime/perf.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/perf.h b/runtime/perf.h index 6a87bff0..32383665 100644 --- a/runtime/perf.h +++ b/runtime/perf.h @@ -1,6 +1,7 @@ /* -*- linux-c -*- * Perf Header File * Copyright (C) 2006 Red Hat Inc. + * Copyright (C) 2010 Red Hat Inc. * * This file is part of systemtap, and is free software. You can * redistribute it and/or modify it under the terms of the GNU General @@ -15,13 +16,17 @@ * @brief Header file for performance monitoring hardware support */ -static int _stp_perfmon_setup(void **desc, - struct pfarg_ctx *context, - struct pfarg_pmc pmc[], int pmc_count, - struct pfarg_pmd pmd[], int pmd_count); +struct _Perf { + /* per-cpu data. allocated with _stp_alloc_percpu() */ + struct perf_event **pd; + perf_overflow_handler_t callback; +}; -static int _stp_perfmon_shutdown(void *desc); +typedef struct _Perf *Perf; -static int64_t _stp_perfmon_read(void *desc, int counter); +static Perf _stp_perf_init (struct perf_event_attr *attr, + perf_overflow_handler_t callback); + +static void _stp_perf_del (Perf pe); #endif /* _PERF_H_ */ |