Re: [PATCH 1/2] perf jevents: Tidy error handling

2020-10-22 Thread John Garry
On 21/10/2020 14:37, kajoljain wrote: May be we can use similar checks: if( verbose)    pr_info("%s: Error walking file tree %s%s\n", prog, ldirname,err_string_ext); if(rc > 0)     empty_map = 1; else    ret = 1; Not that it matters much, this logic is slightly different for verbose set an

Re: [PATCH 1/2] perf jevents: Tidy error handling

2020-10-21 Thread kajoljain
On 10/20/20 2:05 PM, John Garry wrote: > On 20/10/2020 09:14, kajoljain wrote: >> >> >> On 10/20/20 11:13 AM, Namhyung Kim wrote: >>> Hello, >>> >>> On Tue, Oct 20, 2020 at 12:42 AM John Garry wrote: There is much duplication in the error handling for directory traversing for pro

Re: [PATCH 1/2] perf jevents: Tidy error handling

2020-10-20 Thread John Garry
On 20/10/2020 09:14, kajoljain wrote: On 10/20/20 11:13 AM, Namhyung Kim wrote: Hello, On Tue, Oct 20, 2020 at 12:42 AM John Garry wrote: There is much duplication in the error handling for directory traversing for processing JSONs. Factor out the common code to tidy a bit. Signed-off-by

Re: [PATCH 1/2] perf jevents: Tidy error handling

2020-10-20 Thread kajoljain
On 10/20/20 11:13 AM, Namhyung Kim wrote: > Hello, > > On Tue, Oct 20, 2020 at 12:42 AM John Garry wrote: >> >> There is much duplication in the error handling for directory traversing >> for processing JSONs. >> >> Factor out the common code to tidy a bit. >> >> Signed-off-by: John Garry >>

Re: [PATCH 1/2] perf jevents: Tidy error handling

2020-10-19 Thread Namhyung Kim
Hello, On Tue, Oct 20, 2020 at 12:42 AM John Garry wrote: > > There is much duplication in the error handling for directory traversing > for processing JSONs. > > Factor out the common code to tidy a bit. > > Signed-off-by: John Garry > --- [SNIP] > -empty_map: > +err_processing_std_arch_event_d

[PATCH 1/2] perf jevents: Tidy error handling

2020-10-19 Thread John Garry
There is much duplication in the error handling for directory traversing for processing JSONs. Factor out the common code to tidy a bit. Signed-off-by: John Garry --- tools/perf/pmu-events/jevents.c | 81 ++--- 1 file changed, 33 insertions(+), 48 deletions(-) diff