Commit ee2ce6fd authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf jevents: Provide path to JSON file on error

If a JSONDecoderError or similar is raised then it is useful to know the
path. Print this and then raise the exception agan.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.garry@huawei.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20220812230949.683239-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f793ae18
...@@ -225,7 +225,12 @@ class JsonEvent: ...@@ -225,7 +225,12 @@ class JsonEvent:
def read_json_events(path: str) -> Sequence[JsonEvent]: def read_json_events(path: str) -> Sequence[JsonEvent]:
"""Read json events from the specified file.""" """Read json events from the specified file."""
return json.load(open(path), object_hook=lambda d: JsonEvent(d))
try:
return json.load(open(path), object_hook=lambda d: JsonEvent(d))
except BaseException as err:
print(f"Exception processing {path}")
raise
def preprocess_arch_std_files(archpath: str) -> None: def preprocess_arch_std_files(archpath: str) -> None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment