[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170721192557.4371-1-andi@firstfloor.org>
Date: Fri, 21 Jul 2017 12:25:57 -0700
From: Andi Kleen <andi@...stfloor.org>
To: acme@...nel.org
Cc: jolsa@...nel.org, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>, sukadev@...ux.vnet.ibm.com
Subject: [PATCH] perf, tools: Make build fail on JSON parse error
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.
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