Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10962478ybl; Fri, 27 Dec 2019 05:23:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxPVb5yj1mFb1f70YttRumJFmAMNK9MKYjkrout9X1aNScuaZaBe8Vaz4+EO6p5EXTd1ldU X-Received: by 2002:a05:6830:1e16:: with SMTP id s22mr45159674otr.340.1577453012389; Fri, 27 Dec 2019 05:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577453012; cv=none; d=google.com; s=arc-20160816; b=zQeOyBHoy0RlfGB8GuC94MDxHcpjisaHxIkTB8LmUNMvWbBsxwtwTb2oUCJ/zyEcWk wI8U9nbcNTTuZ/q6JbxiRsFzod7U7dWptq5rQZcBvGKB8tA514Ch7wtyiGbYY6xhdhSG +3V/krKJ3tyO7IIOxGAGZAIt3PPhbRmB07gCIeRoCg85x9ME2u0QssNPWmI5qJyxag8Q Uhg8PTlsR0V20szy0SHNsIAlbPmtFSG40d5Quro6lKgV/DsQwCy+aD/nacRavdE6doIS sMm5roHdNDKj58QkcRMU587fO4YgR+LbQuqLfCo+20XkQYK4jirWgxjHVtcUUhpnCdeg a0+Q== 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=WbWpVEqeCSiVGZpfka0N2mlBN53wfaVG9l1MxeloCNE=; b=Eh6+7QJW+PJXTnm4NVy4R4QRQxz5ZOjomP3UUOK77/FuCAduJCeHvFx++ImMiy4gEg YErdLVs584vwyYNUtzYwqSbC9Uix3DDtZRbIXC57UuCfCtKvnOb2b3GwVMy4TZxblTPd +9M+iHPEKh82HeRjqxbr18YwTP7DEYomgUdepbXC0BKfI41KMEYsCPPOCk126mT+y0xY Es2ODBtpFjk2sZIYdYnSgu19DslM1qb9hMwvIQWb5LVY4xdbQh7xrazlwwiLEIGUI+Ko gwZt9EN6phdWsgwDfWZdxgHECiCCTPNjLEmXL430Fo4tQwrZangf2QFBgmRkD/OP8IOo RHbg== 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 u125si16739122oif.130.2019.12.27.05.23.07; Fri, 27 Dec 2019 05:23:32 -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 S1726602AbfL0NVt (ORCPT + 99 others); Fri, 27 Dec 2019 08:21:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:40682 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbfL0NVt (ORCPT ); Fri, 27 Dec 2019 08:21:49 -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 6B559B206; Fri, 27 Dec 2019 13:21:47 +0000 (UTC) From: mrostecki@opensuse.org 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 11:53:46 +0100 Message-Id: <20191227105346.867-3-mrostecki@opensuse.org> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191227105346.867-1-mrostecki@opensuse.org> References: <20191227105346.867-1-mrostecki@opensuse.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Rostecki 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