From: Jakub Kicinski Subject: Re: [PATCH iproute2 2/5] bpf: move bpf_elf_map fixup notification under verbose Date: Tue, 17 Jul 2018 17:24:52 -0700 Message-ID: <20180717172452.14db9c14@cakuba.lan> References: <20180717233122.29390-1-daniel@iogearbox.net> <20180717233122.29390-3-daniel@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dsahern@gmail.com, alexei.starovoitov@gmail.com, netdev@vger.kernel.org To: Daniel Borkmann Return-path: Received: from mail-qt0-f172.google.com ([209.85.216.172]:35516 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730180AbeGRBAD (ORCPT ); Tue, 17 Jul 2018 21:00:03 -0400 Received: by mail-qt0-f172.google.com with SMTP id a5-v6so2611218qtp.2 for ; Tue, 17 Jul 2018 17:24:57 -0700 (PDT) In-Reply-To: <20180717233122.29390-3-daniel@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 18 Jul 2018 01:31:19 +0200, Daniel Borkmann wrote: > No need to spam the user with this if it can be fixed gracefully > anyway. Therefore, move it under verbose option. > > Signed-off-by: Daniel Borkmann > --- > lib/bpf.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/bpf.c b/lib/bpf.c > index 4e26c0d..42093db 100644 > --- a/lib/bpf.c > +++ b/lib/bpf.c > @@ -1893,9 +1893,9 @@ static int bpf_fetch_maps_end(struct bpf_elf_ctx *ctx) > } > > memcpy(ctx->maps, fixup, sizeof(fixup)); > - > - printf("Note: %zu bytes struct bpf_elf_map fixup performed due to size mismatch!\n", > - sizeof(struct bpf_elf_map) - ctx->map_len); > + if (ctx->verbose) > + printf("%zu bytes struct bpf_elf_map fixup performed due to size mismatch!\n", > + sizeof(struct bpf_elf_map) - ctx->map_len); Glad to see that :) FWIW you seem to use fprintf(stderr, ) in the btf patch for information messages, I think that's a good approach. Separating "results" from "info/error" messages. Helps JSON too. Probably doesn't matter much for this message.