.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* Copyright (c) 2017 Facebook |
---|
2 | | - * |
---|
3 | | - * This program is free software; you can redistribute it and/or |
---|
4 | | - * modify it under the terms of version 2 of the GNU General Public |
---|
5 | | - * License as published by the Free Software Foundation. |
---|
6 | 3 | */ |
---|
7 | 4 | |
---|
8 | 5 | #include <stdio.h> |
---|
.. | .. |
---|
36 | 33 | goto out; |
---|
37 | 34 | } |
---|
38 | 35 | |
---|
39 | | - if (setup_cgroup_environment()) { |
---|
40 | | - printf("Failed to load DEV_CGROUP program\n"); |
---|
41 | | - goto err; |
---|
42 | | - } |
---|
43 | | - |
---|
44 | | - /* Create a cgroup, get fd, and join it */ |
---|
45 | | - cgroup_fd = create_and_get_cgroup(TEST_CGROUP); |
---|
46 | | - if (!cgroup_fd) { |
---|
| 36 | + cgroup_fd = cgroup_setup_and_join(TEST_CGROUP); |
---|
| 37 | + if (cgroup_fd < 0) { |
---|
47 | 38 | printf("Failed to create test cgroup\n"); |
---|
48 | | - goto err; |
---|
49 | | - } |
---|
50 | | - |
---|
51 | | - if (join_cgroup(TEST_CGROUP)) { |
---|
52 | | - printf("Failed to join cgroup\n"); |
---|
53 | | - goto err; |
---|
| 39 | + goto out; |
---|
54 | 40 | } |
---|
55 | 41 | |
---|
56 | 42 | /* Attach bpf program */ |
---|