Netdev List
 help / color / mirror / Atom feed
From: Chen Rong <chenr.fnst@cn.fujitsu.com>
To: unlisted-recipients:; (no To-header on input)
Cc: <chenr.fnst@cn.fujitsu.com>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Shuah Khan <shuah@kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>
Subject: [PATCH] selftests/bpf: remove the DEBUG macro for test_dev_cgroup
Date: Wed, 20 Dec 2017 11:15:44 +0800	[thread overview]
Message-ID: <20171220031544.13350-1-chenr.fnst@cn.fujitsu.com> (raw)

The test may fail if not enable DEBUG macro in dev_cgroup.c
  # ./test_dev_cgroup
  libbpf: load bpf program failed: Operation not permitted
  libbpf: failed to load program 'cgroup/dev'
  libbpf: failed to load object './dev_cgroup.o'
  Failed to load DEV_CGROUP program

Removing the DEBUG macro makes the test always pass.

Signed-off-by: Chen Rong <chenr.fnst@cn.fujitsu.com>
---
 tools/testing/selftests/bpf/dev_cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/dev_cgroup.c b/tools/testing/selftests/bpf/dev_cgroup.c
index ce41a34..a167c6d 100644
--- a/tools/testing/selftests/bpf/dev_cgroup.c
+++ b/tools/testing/selftests/bpf/dev_cgroup.c
@@ -13,7 +13,6 @@ SEC("cgroup/dev")
 int bpf_prog1(struct bpf_cgroup_dev_ctx *ctx)
 {
 	short type = ctx->access_type & 0xFFFF;
-#ifdef DEBUG
 	short access = ctx->access_type >> 16;
 	char fmt[] = "  %d:%d    \n";
 
@@ -39,7 +38,6 @@ int bpf_prog1(struct bpf_cgroup_dev_ctx *ctx)
 		fmt[10] = 'm';
 
 	bpf_trace_printk(fmt, sizeof(fmt), ctx->major, ctx->minor);
-#endif
 
 	/* Allow access to /dev/zero and /dev/random.
 	 * Forbid everything else.
-- 
2.5.0

                 reply	other threads:[~2017-12-20  3:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171220031544.13350-1-chenr.fnst@cn.fujitsu.com \
    --to=chenr.fnst@cn.fujitsu.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox