struct stat sb;
int ret;
+ if (stat("/dev/cpu/0/msr", &sb)) {
+ ERROR("Turbostat plugin: Initialization failed: /dev/cpu/0/msr"
+ " does not exist while the CPU supports MSR. You may be "
+ "missing the corresponding kernel module, please try '# "
+ "modprobe msr'");
+ return -1;
+ }
+
if (getuid() != 0) {
ERROR("Turbostat plugin: Initialization failed: this plugin "
"requires collectd to run as root in order to read "
DO_OR_GOTO_ERR(probe_cpu());
- if (stat("/dev/cpu/0/msr", &sb)) {
- ERROR("Turbostat plugin: Initialization failed: /dev/cpu/0/msr"
- " does not exist while the CPU supports MSR. You may be "
- "missing the corresponding kernel module, please try '# "
- "modprobe msr'");
- return -1;
- }
-
DO_OR_GOTO_ERR(setup_all_buffers());
plugin_register_read(PLUGIN_NAME, turbostat_read);