Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693939

[PATCH] perf, tools: Make build fail on JSON parse error

From Andi Kleen <andi@firstfloor.org>
Newsgroups linux.kernel
Subject [PATCH] perf, tools: Make build fail on JSON parse error
Date 2017-07-21 21:30 +0200
Message-ID <u5LMC-ou-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] perf, tools: Make build fail on JSON parse error Andi Kleen <andi@firstfloor.org> - 2017-07-21 21:30 +0200
  Re: [PATCH] perf, tools: Make build fail on JSON parse error Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2017-07-22 02:40 +0200
    Re: [PATCH] perf, tools: Make build fail on JSON parse error Jiri Olsa <jolsa@redhat.com> - 2017-07-24 16:20 +0200
      Re: [PATCH] perf, tools: Make build fail on JSON parse error Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-24 19:50 +0200
        Re: [PATCH] perf, tools: Make build fail on JSON parse error Andi Kleen <andi@firstfloor.org> - 2017-07-24 19:50 +0200
          Re: [PATCH] perf, tools: Make build fail on JSON parse error Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> - 2017-07-24 21:10 +0200

csiph-web