lkml.org 
[lkml]   [2020]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] perf jevents: Tidy error handling
Hello,

On Tue, Oct 20, 2020 at 12:42 AM John Garry <john.garry@huawei.com> 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 <john.garry@huawei.com>
> ---
[SNIP]
> -empty_map:
> +err_processing_std_arch_event_dir:
> + err_string_ext = " for std arch event";
> +err_processing_dir:
> + if (verbose || rc > 0) {
> + pr_info("%s: Error walking file tree %s%s\n", prog, ldirname,
> + err_string_ext);

This was printed only if verbose is set but now changed.

Thanks
Namhyung


> + empty_map = 1;
> + } else {
> + ret = 1;
> + }
> +err_close_eventsfp:
> fclose(eventsfp);
> - create_empty_mapping(output_file);
> + if (empty_map)
> + create_empty_mapping(output_file);
> +err_out:
> free_arch_std_events();
> -out_free_mapfile:
> free(mapfile);
> return ret;
> }
> --
> 2.26.2
>

\
 
 \ /
  Last update: 2020-10-20 07:43    [W:0.072 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site