lkml.org 
[lkml]   [2020]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 5/7] perf pmu: Support matching by sysid
On Fri, Jan 24, 2020 at 10:35:03PM +0800, John Garry wrote:

SNIP

> + 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

thanks,
jirka

\
 
 \ /
  Last update: 2020-02-10 13:09    [W:0.197 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site