+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ ERROR("turbostat plugin: unable to open: '%s': %s", path, strerror(errno));
+ return -1;
+ }
+
+ if (fgets(buf, sizeof(buf), fp) == NULL) {
+ ERROR("turbostat plugin: unable to read: '%s': %s", path, strerror(errno));
+ fclose(fp);
+ return -1;
+ }
+ fclose(fp);
+
+ /* We only care about the first integer in the range */
+ c = strchr(buf, '-');
+ if (c != NULL)
+ *c = '\0';
+ c = strchr(buf, ',');
+ if (c != NULL)
+ *c = '\0';
+ strstripnewline(buf);
+
+ if (parse_value(buf, &v, DS_TYPE_DERIVE) != 0) {