Re: Performance counter API review was [patch] Performance Counters for Linux, v3

Nathan Lynch
2009-02-04T02:33:16Z

Paul Mackerras wrote:
>
> By the way, how does userspace get to know about cpus being added or
> removed? Is there a better way than continually reading
> /sys/devices/system/cpu/online?

The kernel generates uevents for cpu online and offline operations;
you can see them with udevmonitor. Not sure how you get those events
to an arbitrary application, though. Alternatively you can set an
inotify watch on e.g. /sys/devices/system/cpu/cpu1/online (at least it
seems to work here).