[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200511110137.GC2986380@krava>
Date: Mon, 11 May 2020 13:01:37 +0200
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,
qiangqing.zhang@....com, irogers@...gle.com, robin.murphy@....com,
zhangshaokun@...ilicon.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH RFC v3 02/12] perf jevents: Add support for system events
tables
On Thu, May 07, 2020 at 07:57:41PM +0800, John Garry wrote:
SNIP
> + &sys_event_tables);
> + }
> +
> print_events_table_prefix(eventsfp, tblname);
> return 0;
> }
> @@ -1180,7 +1253,6 @@ int main(int argc, char *argv[])
> } else if (rc < 0) {
> /* Make build fail */
> fclose(eventsfp);
> - free_arch_std_events();
> ret = 1;
> goto out_free_mapfile;
> } else if (rc) {
> @@ -1206,27 +1278,31 @@ int main(int argc, char *argv[])
> if (close_table)
> print_events_table_suffix(eventsfp);
>
> - if (!mapfile) {
> - pr_info("%s: No CPU->JSON mapping?\n", prog);
> - goto empty_map;
> + if (mapfile) {
> + if (process_mapfile(eventsfp, mapfile)) {
> + pr_err("%s: Error processing mapfile %s\n", prog,
> + mapfile);
> + /* Make build fail */
> + fclose(eventsfp);
> + ret = 1;
> + }
> + } else {
> + pr_err("%s: No CPU->JSON mapping?\n", prog);
shouldn't we jump to empty_map in here? there still needs to be a
mapfile, right?
jirka
> }
>
> - if (process_mapfile(eventsfp, mapfile)) {
> - pr_info("%s: Error processing mapfile %s\n", prog, mapfile);
> - /* Make build fail */
> + if (process_system_event_tables(eventsfp)) {
> fclose(eventsfp);
> - free_arch_std_events();
> ret = 1;
> }
>
> -
> goto out_free_mapfile;
>
> empty_map:
> fclose(eventsfp);
> create_empty_mapping(output_file);
> - free_arch_std_events();
> out_free_mapfile:
> + free_arch_std_events();
> + free_sys_event_tables();
> free(mapfile);
> return ret;
> }
SNIP
Powered by blists - more mailing lists