lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 8 Jul 2014 19:13:12 -0700
From:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	jolsa@...hat.com, linux-kernel@...r.kernel.org,
	namhyung@...nel.org, acme@...radead.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 4/9] perf, tools: Automatically look for event file name
 for cpu v3

Andi Kleen [andi@...stfloor.org] wrote:

| +static const char *json_default_name(void)
| +{
| +	char *cache;
| +	char *idstr = get_cpu_str();
| +	char *res = NULL;
| +	char *home = NULL;
| +	char *emap;
| +
| +	emap = getenv("EVENTMAP");
| +	if (emap) {
| +		if (access(emap, R_OK) == 0)
| +			return emap;
| +		if (asprintf(&idstr, "%s-core", emap) < 0)
| +			return NULL;
| +	}

Hi Andi,

Couple of questions/comments about EVENTMAP and the "core" suffix.

Is EVENTMAP a new environment variable ? If specific to PERF, should
we prefix it with "PERF_" to avoid collision?

Would all/many architectures need this "-core" suffix or is that Intel
specific ?

Is the intent that architectures that don't need this should simply
never set EVENTMAP variable ?

| +
| +	cache = getenv("XDG_CACHE_HOME");
| +	if (!cache) {
| +		home = getenv("HOME");
| +		if (!home || asprintf(&cache, "%s/.cache", home) < 0)
| +			goto out;
| +	}

As with XDG_CACHE_HOME in perf-download.txt, can you please add a note
about usage of EVENTMAP in the man page.

| +	if (cache && idstr)
| +		res = mkpath("%s/pmu-events/%s.json",
| +			     cache,
| +			     idstr);
| +	if (home)
| +		free(cache);
| +out:
| +	free(idstr);
| +	return res;
| +}
| +

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ