perf jevents: Tidy error handling
John Garry authored

There is much duplication in the error handling for directory transvering
for prcessing JSONs.

Factor out the common code to tidy a bit.
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-By: Kajol Jain<kjain@linux.ibm.com>
Link: https://lore.kernel.org/r/1603364547-197086-2-git-send-email-john.garry@huawei.com

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
fa1b41a7