diff options
author | Alexei Starovoitov <ast@fb.com> | 2017-10-03 07:50:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-05 01:05:05 +0200 |
commit | 39323e788cb672adba8709ca407bd6763aae577d (patch) | |
tree | 717fc5a1b5ce6852fd28d1d5f5270d84db0b6f24 /samples/bpf/cgroup_helpers.c | |
parent | libbpf: introduce bpf_prog_detach2() (diff) | |
download | linux-39323e788cb672adba8709ca407bd6763aae577d.tar.xz linux-39323e788cb672adba8709ca407bd6763aae577d.zip |
samples/bpf: add multi-prog cgroup test case
create 5 cgroups, attach 6 progs and check that progs are executed as:
cgrp1 (MULTI progs A, B) ->
cgrp2 (OVERRIDE prog C) ->
cgrp3 (MULTI prog D) ->
cgrp4 (OVERRIDE prog E) ->
cgrp5 (NONE prog F)
the event in cgrp5 triggers execution of F,D,A,B in that order.
if prog F is detached, the execution is E,D,A,B
if prog F and D are detached, the execution is E,A,B
if prog F, E and D are detached, the execution is C,A,B
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/cgroup_helpers.c')
-rw-r--r-- | samples/bpf/cgroup_helpers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/cgroup_helpers.c b/samples/bpf/cgroup_helpers.c index 9d1be9426401..88bdcf4b1670 100644 --- a/samples/bpf/cgroup_helpers.c +++ b/samples/bpf/cgroup_helpers.c @@ -56,7 +56,7 @@ int setup_cgroup_environment(void) return 1; } - if (mount("none", CGROUP_MOUNT_PATH, "cgroup2", 0, NULL)) { + if (mount("none", CGROUP_MOUNT_PATH, "cgroup2", 0, NULL) && errno != EBUSY) { log_err("mount cgroup2"); return 1; } @@ -163,7 +163,7 @@ int create_and_get_cgroup(char *path) format_cgroup_path(cgroup_path, path); if (mkdir(cgroup_path, 0777) && errno != EEXIST) { - log_err("mkdiring cgroup"); + log_err("mkdiring cgroup %s .. %s", path, cgroup_path); return 0; } |