Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10905368ybl; Fri, 27 Dec 2019 04:22:51 -0800 (PST) X-Google-Smtp-Source: APXvYqz6ALHtIfgXk6uXOxPdSmzrVgjkQ1uphSIQMdvwIq19D26FemIcCcpKvJt0oxJCFEmhkV9Q X-Received: by 2002:a9d:6211:: with SMTP id g17mr51677532otj.168.1577449371701; Fri, 27 Dec 2019 04:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577449371; cv=none; d=google.com; s=arc-20160816; b=DyIWXei1DRF7xOFnk2WxesH+fg0hFhM+JWC0f4ZvqbClG9bYnDB0t/hqFc2JegZ0BG Adr6AmGGKe89yvwEruBmU2VgmejrvB8SCOyRO9g5h0JcOdlhDe4dlXE8hDXseqmGl3Gg 6JZWit4Rov/ueThYIUir6GOYUULV+22eI2FFe4JFqBW3iVzgGbApmwEsXw05qAyr7MSo E0ytMSBxLbI/zRojbzHdSz1hXVuycqhNIvOPu2fgYxpNu120s6hA+DAUNuQPGuzrOh9n 77fdwNegE6VTwnBvxqe4yFEyFstC5fIFcqWw+9RecwOQzjsBNjJ9aVdfO3zkl8CEoujL RfvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=tlPIEf45y6g9XsgMadnv4im2DWeMdXYtr7dYRmDrN48=; b=lcrtixaTvYI1qaOg9iEnuMwxAfhk/9ped28Y+g0ATfCphENygfY/SmJXqv3sxNO3K+ 0LazwyepycBy6uWdcJsoGjEY3zmdQ02cFaZ4iZEYVhblexBifaIgRRXvbWzCcljf/3nU WC4pAaxIStaEHI1mTfpPxOn9TfQiTQwSUEVuyRzd682xEp3NQqmLUOULz+7LWjWiMCsa Ugr7EIEL8BwSn9qpjWh+MqOLtQ9v83BSq0gakQpy6UUwIYM3J9YmoAkLHSxc9S9wL0bS QcTRdsttBYw1hY2e8CEpcjE6CKVX5QL2uiKvx2/gE3BxYPz5Gfo+ldmZM2oNL2K8m5U/ aeQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si17790866otr.25.2019.12.27.04.22.39; Fri, 27 Dec 2019 04:22:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727044AbfL0MVu (ORCPT + 99 others); Fri, 27 Dec 2019 07:21:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:38818 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfL0MVu (ORCPT ); Fri, 27 Dec 2019 07:21:50 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 557FAB276; Fri, 27 Dec 2019 12:21:48 +0000 (UTC) From: Michal Rostecki To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Rostecki Subject: [PATCH bpf-next 2/2] bpftool: Add misc secion and probe for large INSN limit Date: Fri, 27 Dec 2019 12:06:05 +0100 Message-Id: <20191227110605.1757-3-mrostecki@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191227110605.1757-1-mrostecki@suse.de> References: <20191227110605.1757-1-mrostecki@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a new probe section (misc) for probes not related to concrete map types, program types, functions or kernel configuration. Introduce a probe for large INSN limit as the first one in that section. Signed-off-by: Michal Rostecki --- tools/bpf/bpftool/feature.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c index 03bdc5b3ac49..4a7359b9a427 100644 --- a/tools/bpf/bpftool/feature.c +++ b/tools/bpf/bpftool/feature.c @@ -572,6 +572,18 @@ probe_helpers_for_progtype(enum bpf_prog_type prog_type, bool supported_type, printf("\n"); } +static void +probe_large_insn_limit(const char *define_prefix, __u32 ifindex) +{ + bool res; + + res = bpf_probe_large_insn_limit(ifindex); + print_bool_feature("have_large_insn_limit", + "Large complexity limit and maximum program size (1M)", + "HAVE_LARGE_INSN_LIMIT", + res, define_prefix); +} + static int do_probe(int argc, char **argv) { enum probe_component target = COMPONENT_UNSPEC; @@ -724,6 +736,12 @@ static int do_probe(int argc, char **argv) probe_helpers_for_progtype(i, supported_types[i], define_prefix, ifindex); + print_end_then_start_section("misc", + "Scanning miscellaneous eBPF features...", + "/*** eBPF misc features ***/", + define_prefix); + probe_large_insn_limit(define_prefix, ifindex); + exit_close_json: if (json_output) { /* End current "section" of probes */ -- 2.16.4