[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200210120759.GG1907700@krava>
Date: Mon, 10 Feb 2020 13:07:59 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: John Garry <john.garry@...wei.com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
namhyung@...nel.org, will@...nel.org, ak@...ux.intel.com,
linuxarm@...wei.com, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, suzuki.poulose@....com,
james.clark@....com, zhangshaokun@...ilicon.com,
robin.murphy@....com
Subject: Re: [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
Powered by blists - more mailing lists