From patchwork Fri Mar 23 10:41:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Olsa X-Patchwork-Id: 889875 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4070Tg0f1Nz9ryr for ; Fri, 23 Mar 2018 21:41:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756361AbeCWKlo (ORCPT ); Fri, 23 Mar 2018 06:41:44 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756308AbeCWKle (ORCPT ); Fri, 23 Mar 2018 06:41:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1458F818AAE8; Fri, 23 Mar 2018 10:41:34 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5B77111DD15; Fri, 23 Mar 2018 10:41:32 +0000 (UTC) From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann Cc: lkml , netdev@vger.kernel.org, Quentin Monnet Subject: [PATCH 2/2] bpftool: Adjust to new print_bpf_insn interface Date: Fri, 23 Mar 2018 11:41:29 +0100 Message-Id: <20180323104129.14989-3-jolsa@kernel.org> In-Reply-To: <20180323104129.14989-1-jolsa@kernel.org> References: <20180323104129.14989-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 10:41:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 10:41:34 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@kernel.org' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Change bpftool to skip the removed struct bpf_verifier_env argument in print_bpf_insn. It was passed as NULL anyway. No functional change intended. Signed-off-by: Jiri Olsa --- tools/bpf/bpftool/xlated_dumper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/bpf/bpftool/xlated_dumper.c b/tools/bpf/bpftool/xlated_dumper.c index 20da835e9e38..7a3173b76c16 100644 --- a/tools/bpf/bpftool/xlated_dumper.c +++ b/tools/bpf/bpftool/xlated_dumper.c @@ -114,7 +114,7 @@ static struct kernel_sym *kernel_syms_search(struct dump_data *dd, sizeof(*dd->sym_mapping), kernel_syms_cmp) : NULL; } -static void print_insn(struct bpf_verifier_env *env, const char *fmt, ...) +static void print_insn(void *private_data, const char *fmt, ...) { va_list args; @@ -124,7 +124,7 @@ static void print_insn(struct bpf_verifier_env *env, const char *fmt, ...) } static void -print_insn_for_graph(struct bpf_verifier_env *env, const char *fmt, ...) +print_insn_for_graph(void *private_data, const char *fmt, ...) { char buf[64], *p; va_list args; @@ -154,7 +154,7 @@ print_insn_for_graph(struct bpf_verifier_env *env, const char *fmt, ...) printf("%s", buf); } -static void print_insn_json(struct bpf_verifier_env *env, const char *fmt, ...) +static void print_insn_json(void *private_data, const char *fmt, ...) { unsigned int l = strlen(fmt); char chomped_fmt[l]; @@ -248,7 +248,7 @@ void dump_xlated_json(struct dump_data *dd, void *buf, unsigned int len, jsonw_start_object(json_wtr); jsonw_name(json_wtr, "disasm"); - print_bpf_insn(&cbs, NULL, insn + i, true); + print_bpf_insn(&cbs, insn + i, true); if (opcodes) { jsonw_name(json_wtr, "opcodes"); @@ -302,7 +302,7 @@ void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len, double_insn = insn[i].code == (BPF_LD | BPF_IMM | BPF_DW); printf("% 4d: ", i); - print_bpf_insn(&cbs, NULL, insn + i, true); + print_bpf_insn(&cbs, insn + i, true); if (opcodes) { printf(" "); @@ -331,7 +331,7 @@ void dump_xlated_for_graph(struct dump_data *dd, void *buf_start, void *buf_end, for (; cur <= insn_end; cur++) { printf("% 4d: ", (int)(cur - insn_start + start_idx)); - print_bpf_insn(&cbs, NULL, cur, true); + print_bpf_insn(&cbs, cur, true); if (cur != insn_end) printf(" | "); }