From 654979ee0fc8d47bfd1680bc9e4c42ab2da78846 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 17 Mar 2010 23:08:26 -0400 Subject: PR909: filter out offline cpus from perfctr registration loop * runtime/perf.c (_stp_perf_init): If cpu_is_offline(), don't. --- runtime/perf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/perf.c') 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); -- cgit