+ fclose(file);
+ pr_debug("gets failed for file %s\n", path);
+ free(buf);
+ return NULL;
+ }
+ fclose(file);
+
+ /* Remove any whitespace, this could be from ACPI HID */
+ s = strlen(buf);
+ for (i = 0; i < s; i++) {
+ if (buf[i] == ' ') {
+ buf[i] = 0;
+ break;
+ };
+ }
+
+ return buf;
+}
+
+static char *perf_pmu__getsysid(void)
+{
+ char *sysid;
+ static bool printed;
+
+ sysid = getenv("PERF_SYSID");
+ if (sysid)
+ sysid = strdup(sysid);
+
+ if (!sysid)
+ sysid = get_sysid_str();
+ if (!sysid)
+ return NULL;
+
+ if (!printed) {
+ pr_debug("Using SYSID %s\n", sysid);
+ printed = true;
+ }
+ return sysid;
+}
this part is getting complicated and AFAIK we have no tests for it
if you could think of any tests that'd be great.. Perhaps we could
load 'our' json test files and check appropriate events/aliasses
via in pmu object.. or via parse_events interface.. those test aliases
would have to be part of perf, but we have tests compiled in anyway