Andi Kleen [a...@firstfloor.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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/