diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2010-03-17 23:08:26 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2010-03-17 23:08:26 -0400 |
commit | 654979ee0fc8d47bfd1680bc9e4c42ab2da78846 (patch) | |
tree | 1678eb8ecf823d603206a3b3012f0b5876db359a /runtime | |
parent | 5e0ae7b6e3fe6e739b03c3ab4ef675113e38350f (diff) | |
download | systemtap-steved-654979ee0fc8d47bfd1680bc9e4c42ab2da78846.tar.gz systemtap-steved-654979ee0fc8d47bfd1680bc9e4c42ab2da78846.tar.xz systemtap-steved-654979ee0fc8d47bfd1680bc9e4c42ab2da78846.zip |
PR909: filter out offline cpus from perfctr registration loop
* runtime/perf.c (_stp_perf_init): If cpu_is_offline(), don't.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/perf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/perf.c b/runtime/perf.c index 053e0880..12bf220a 100644 --- a/runtime/perf.c +++ b/runtime/perf.c @@ -22,6 +22,7 @@ /** Initialize performance sampling * Call this during probe initialization to set up performance event sampling + * for all online cpus. Returns ERR_PTR on error. * * @param attr description of event to sample * @param callback function to call when perf event overflows @@ -51,6 +52,10 @@ static Perf *_stp_perf_init (struct perf_event_attr *attr, stp_for_each_cpu(cpu) { perfcpu *pd = per_cpu_ptr (pe->pd, cpu); struct perf_event **event = &(pd->event); + if (cpu_is_offline(cpu)) { + *event = NULL; + continue; + } *event = perf_event_create_kernel_counter(attr, cpu, -1, callback); |