Re: [PATCH RFC 3/7] perf jevents: Add support for a system events PMU

Jiri Olsa
2020-02-10T12:07:57Z

On Fri, Jan 24, 2020 at 10:35:01PM +0800, John Garry wrote:

SNIP

> + return ret;
> +}
> +
> /*
> * If we fail to locate/process JSON and map files, create a NULL mapping
> * table. This would at least allow perf to build even if we can't find/use
> @@ -887,6 +917,7 @@ static int get_maxfds(void)
> */
> static FILE *eventsfp;
> static char *mapfile;
> +static char *mapfile_sys;
>
> static int is_leaf_dir(const char *fpath)
> {
> @@ -1024,6 +1055,11 @@ static int process_one_file(const char *fpath, const struct stat *sb,
> return 0;
> }
>
> + if (!strcmp(bname, "mapfile_sys.csv")) {
> + mapfile_sys = strdup(fpath);

we could release that in the cleanup code at the end of main
together with 'mapfile', which is also missing

jirka