Last active
October 15, 2015 11:08
-
-
Save rmohr/23b7ae12ac0b8d0201a5 to your computer and use it in GitHub Desktop.
Use pyudev to monitor cpu hotplug events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyudev | |
context = pyudev.Context() | |
monitor = pyudev.Monitor.from_netlink(context) | |
monitor.filter_by(subsystem='cpu') | |
for action, device in monitor: | |
print('CPU %s went %s ' % (device.sys_path, action)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment