[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170722003159.GA15787@us.ibm.com>
Date: Fri, 21 Jul 2017 17:31:59 -0700
From: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] perf, tools: Make build fail on JSON parse error
Andi Kleen [andi@...stfloor.org] wrote:
> From: Andi Kleen <ak@...ux.intel.com>
>
> Today, when a JSON file fails parsing the build continues,
> but there are no json files built in, which is difficult to debug later.
> Make the build stop on a parse error instead.
I see the problem and we were being defensive to not break the build
on architectures that don't yet have the PMU event lists. It will be
good to check build on an architecture other than x86/powerpc.
Also, following comments may no longer be applicable?
diff --git a/tools/perf/pmu-events/README b/tools/perf/pmu-events/README
index 1408ade0d773..c2ee3e4417fe 100644
--- a/tools/perf/pmu-events/README
+++ b/tools/perf/pmu-events/README
@@ -85,10 +85,6 @@ users to specify events by their name:
where 'pm_1plus_ppc_cmpl' is a Power8 PMU event.
-In case of errors when processing files in the tools/perf/pmu-events/arch
-directory, 'jevents' tries to create an empty mapping file to allow the perf
-build to succeed even if the PMU event aliases cannot be used.
-
However some errors in processing may cause the perf build to fail.
Mapfile format
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index baa073f38334..f6fb0eebf488 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -826,10 +826,6 @@ static int process_one_file(const char *fpath, const struct stat *sb,
* PMU event tables (see struct pmu_events_map).
*
* Write out the PMU events tables and the mapping table to pmu-event.c.
- *
- * If unable to process the JSON or arch files, create an empty mapping
- * table so we can continue to build/use perf even if we cannot use the
- * PMU event aliases.
*/
int main(int argc, char *argv[])
{
>
> Cc: sukadev@...ux.vnet.ibm.com
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> ---
> tools/perf/pmu-events/jevents.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> index 70cbd5bc4819..58b42508c333 100644
> --- a/tools/perf/pmu-events/jevents.c
> +++ b/tools/perf/pmu-events/jevents.c
> @@ -890,6 +890,9 @@ int main(int argc, char *argv[])
> if (rc && verbose) {
> pr_info("%s: Error walking file tree %s\n", prog, ldirname);
> goto empty_map;
> + } else if (rc < 0) {
> + /* Make build fail */
> + return 1;
> } else if (rc) {
> goto empty_map;
> }
> @@ -904,7 +907,8 @@ int main(int argc, char *argv[])
>
> if (process_mapfile(eventsfp, mapfile)) {
> pr_info("%s: Error processing mapfile %s\n", prog, mapfile);
> - goto empty_map;
> + /* Make build fail */
> + return 1;
> }
>
> return 0;
> --
> 2.9.4
Powered by blists - more mailing lists