lkml.org 
[lkml]   [2017]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf, tools: Make build fail on JSON parse error
Date
From: Andi Kleen <ak@linux.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@linux.vnet.ibm.com
Signed-off-by: Andi Kleen <ak@linux.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
\
 
 \ /
  Last update: 2017-07-21 21:26    [W:0.053 / U:2.032 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site