On Fri, 12 Apr 2019 12:03:21 +0900, Benjamin Poirier wrote: > diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c > index e96903078991..71840faaeab5 100644 > --- a/tools/bpf/bpftool/map.c > +++ b/tools/bpf/bpftool/map.c > @@ -261,20 +261,19 @@ static void print_entry_json(struct bpf_map_info *info, unsigned char *key, > } > > static void print_entry_error(struct bpf_map_info *info, unsigned char *key, > - const char *value) > + const char *value, bool single_line) > { > - int value_size = strlen(value); > - bool single_line, break_names; > + bool break_names; I'd rather you kept the strlen() and 16 char limitation logic. > - break_names = info->key_size > 16 || value_size > 16; > - single_line = info->key_size + value_size <= 24 && !break_names; > + break_names = info->key_size > 16; > + single_line = single_line && !break_names; > > printf("key:%c", break_names ? '\n' : ' '); > fprint_hex(stdout, key, info->key_size, " "); > > printf(single_line ? " " : "\n"); > > - printf("value:%c%s", break_names ? '\n' : ' ', value); > + printf("value:%c%s", single_line ? ' ' : '\n', value); > > printf("\n"); > }