Home
last modified time | relevance | path

Searched refs:cgroup (Results 1 – 25 of 159) sorted by relevance

1234567

/tools/testing/selftests/cgroup/
A Dtest_freezer.c143 if (!cgroup) in test_cgfreezer_simple()
167 if (cgroup) in test_cgfreezer_simple()
198 cgroup[1] = cg_name(cgroup[0], "B"); in test_cgfreezer_tree()
202 cgroup[2] = cg_name(cgroup[1], "C"); in test_cgfreezer_tree()
206 cgroup[3] = cg_name(cgroup[1], "D"); in test_cgfreezer_tree()
210 cgroup[4] = cg_name(cgroup[0], "E"); in test_cgfreezer_tree()
214 cgroup[5] = cg_name(cgroup[4], "F"); in test_cgfreezer_tree()
218 cgroup[6] = cg_name(cgroup[5], "G"); in test_cgfreezer_tree()
222 cgroup[7] = cg_name(cgroup[6], "H"); in test_cgfreezer_tree()
226 cgroup[8] = cg_name(cgroup[0], "I"); in test_cgfreezer_tree()
[all …]
A Dtest_kill.c64 if (!cgroup) in test_cgkill_simple()
92 if (cgroup) in test_cgkill_simple()
124 cgroup[1] = cg_name(cgroup[0], "B"); in test_cgkill_tree()
128 cgroup[2] = cg_name(cgroup[1], "C"); in test_cgkill_tree()
132 cgroup[3] = cg_name(cgroup[1], "D"); in test_cgkill_tree()
136 cgroup[4] = cg_name(cgroup[0], "E"); in test_cgkill_tree()
140 cgroup[5] = cg_name(cgroup[4], "F"); in test_cgkill_tree()
144 cgroup[6] = cg_name(cgroup[5], "G"); in test_cgkill_tree()
148 cgroup[7] = cg_name(cgroup[6], "H"); in test_cgkill_tree()
152 cgroup[8] = cg_name(cgroup[0], "I"); in test_cgkill_tree()
[all …]
/tools/testing/selftests/cgroup/lib/include/
A Dcgroup_util.h36 extern int cg_create(const char *cgroup);
37 extern int cg_destroy(const char *cgroup);
51 extern int cg_run(const char *cgroup,
52 int (*fn)(const char *cgroup, void *arg),
54 extern int cg_enter(const char *cgroup, int pid);
55 extern int cg_enter_current(const char *cgroup);
57 extern int cg_run_nowait(const char *cgroup,
58 int (*fn)(const char *cgroup, void *arg),
61 extern int cg_killall(const char *cgroup);
69 extern int cg_prepare_for_wait(const char *cgroup);
[all …]
/tools/perf/util/
A Dcgroup.h12 struct cgroup { struct
23 struct cgroup *cgroup__get(struct cgroup *cgroup); argument
24 void cgroup__put(struct cgroup *cgroup);
29 struct cgroup *cgroup__new(const char *name, bool do_open);
30 struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
33 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
37 struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id,
39 struct cgroup *cgroup__find(struct perf_env *env, uint64_t id);
40 struct cgroup *__cgroup__find(struct rb_root *root, uint64_t id);
45 int read_cgroup_id(struct cgroup *cgrp);
[all …]
A Dcgroup.c119 struct cgroup *cgroup = zalloc(sizeof(*cgroup)); in cgroup__new() local
125 if (!cgroup->name) in cgroup__new()
133 cgroup->fd = -1; in cgroup__new()
137 return cgroup; in cgroup__new()
142 free(cgroup); in cgroup__new()
148 struct cgroup *cgroup = evlist__find_cgroup(evlist, name); in evlist__findnew_cgroup() local
179 static void cgroup__delete(struct cgroup *cgroup) in cgroup__delete() argument
182 close(cgroup->fd); in cgroup__delete()
184 free(cgroup); in cgroup__delete()
194 struct cgroup *cgroup__get(struct cgroup *cgroup) in cgroup__get() argument
[all …]
/tools/testing/selftests/bpf/progs/
A Dcgrp_kfunc_failure.c35 struct cgroup *acquired; in BPF_PROG()
54 struct cgroup *acquired; in BPF_PROG()
70 struct cgroup *acquired, *stack_cgrp = (struct cgroup *)&path; in BPF_PROG()
84 struct cgroup *acquired; in BPF_PROG()
98 struct cgroup *acquired; in BPF_PROG()
112 struct cgroup *acquired; in BPF_PROG()
126 struct cgroup *acquired; in BPF_PROG()
140 struct cgroup *kptr; in BPF_PROG()
160 struct cgroup *kptr; in BPF_PROG()
197 struct cgroup *acquired = (struct cgroup *)&path; in BPF_PROG()
[all …]
A Dcgrp_kfunc_common.h13 struct cgroup __kptr * cgrp;
23 struct cgroup *bpf_cgroup_acquire(struct cgroup *p) __ksym;
24 void bpf_cgroup_release(struct cgroup *p) __ksym;
25 struct cgroup *bpf_cgroup_ancestor(struct cgroup *cgrp, int level) __ksym;
26 struct cgroup *bpf_cgroup_from_id(u64 cgid) __ksym;
30 static inline struct __cgrps_kfunc_map_value *cgrps_kfunc_map_value_lookup(struct cgroup *cgrp) in cgrps_kfunc_map_value_lookup()
42 static inline int cgrps_kfunc_map_insert(struct cgroup *cgrp) in cgrps_kfunc_map_insert()
46 struct cgroup *acquired, *old; in cgrps_kfunc_map_insert()
A Dcgroup_read_xattr.c15 static __always_inline void read_xattr(struct cgroup *cgroup) in read_xattr() argument
29 struct cgroup *cgrp; in BPF_PROG()
45 struct cgroup *cgrp; in BPF_PROG()
62 struct cgroup *cgrp; in BPF_PROG()
69 read_xattr(css->cgroup); in BPF_PROG()
81 struct cgroup *cgrp; in BPF_PROG()
88 read_xattr(css->cgroup); in BPF_PROG()
100 struct cgroup *cgrp; in BPF_PROG()
108 read_xattr(css->cgroup); in BPF_PROG()
121 struct cgroup *cgrp, *ancestor; in BPF_PROG()
[all …]
A Diters_css_task.c13 struct cgroup *bpf_cgroup_acquire(struct cgroup *p) __ksym;
14 struct cgroup *bpf_cgroup_from_id(u64 cgid) __ksym;
15 void bpf_cgroup_release(struct cgroup *p) __ksym;
28 struct cgroup *cgrp; in BPF_PROG()
50 static inline u64 cgroup_id(struct cgroup *cgrp) in cgroup_id()
59 struct cgroup *cgrp = ctx->cgroup; in cgroup_id_printer()
89 struct cgroup *cgrp = bpf_cgroup_from_id(cgrp_id); in BPF_PROG()
A Dcgrp_kfunc_success.c33 int BPF_PROG(test_cgrp_acquire_release_argument, struct cgroup *cgrp, const char *path) in BPF_PROG()
35 struct cgroup *acquired; in BPF_PROG()
50 int BPF_PROG(test_cgrp_acquire_leave_in_map, struct cgroup *cgrp, const char *path) in BPF_PROG()
65 int BPF_PROG(test_cgrp_xchg_release, struct cgroup *cgrp, const char *path) in BPF_PROG()
67 struct cgroup *kptr, *cg; in BPF_PROG()
108 int BPF_PROG(test_cgrp_get_release, struct cgroup *cgrp, const char *path) in BPF_PROG()
110 struct cgroup *kptr; in BPF_PROG()
139 int BPF_PROG(test_cgrp_get_ancestors, struct cgroup *cgrp, const char *path) in BPF_PROG()
141 struct cgroup *self, *ancestor1, *invalid; in BPF_PROG()
184 int BPF_PROG(test_cgrp_from_id, struct cgroup *cgrp, const char *path) in BPF_PROG()
[all …]
A Dcgrp_ls_sleepable.c22 struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id) __ksym;
23 void bpf_cgroup_release(struct cgroup *cgrp) __ksym;
30 struct cgroup *cgrp = ctx->cgroup; in cgroup_iter()
43 static void __no_rcu_lock(struct cgroup *cgrp) in __no_rcu_lock()
60 struct cgroup *cgrp; in cgrp1_no_rcu_lock()
94 struct cgroup *cgrp; in yes_rcu_lock()
A Dtest_cgroup1_hierarchy.c13 struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id) __ksym;
14 struct cgroup *bpf_cgroup_ancestor(struct cgroup *cgrp, int level) __ksym;
15 void bpf_cgroup_release(struct cgroup *cgrp) __ksym;
19 struct cgroup *cgrp, *ancestor; in bpf_link_create_verify()
A Dcgrp_ls_recursion.c27 struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id) __ksym;
28 void bpf_cgroup_release(struct cgroup *cgrp) __ksym;
30 static void __on_update(struct cgroup *cgrp) in __on_update()
47 struct cgroup *cgrp; in BPF_PROG()
63 static void __on_enter(struct pt_regs *regs, long id, struct cgroup *cgrp) in __on_enter()
80 struct cgroup *cgrp; in BPF_PROG()
A Dtest_task_under_cgroup.c10 struct cgroup *bpf_cgroup_from_id(u64 cgid) __ksym;
11 long bpf_task_under_cgroup(struct task_struct *task, struct cgroup *ancestor) __ksym;
12 void bpf_cgroup_release(struct cgroup *p) __ksym;
23 struct cgroup *cgrp = NULL; in BPF_PROG()
54 struct cgroup *cgrp = NULL; in BPF_PROG()
A Diters_css.c18 struct cgroup *bpf_cgroup_from_id(u64 cgid) __ksym;
19 void bpf_cgroup_release(struct cgroup *p) __ksym;
28 struct cgroup *root_cgrp, *leaf_cgrp, *cur_cgrp; in iter_css_for_each()
51 cur_cgrp = pos->cgroup; in iter_css_for_each()
57 cur_cgrp = pos->cgroup; in iter_css_for_each()
A Dcgrp_ls_tp_btf.c33 struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id) __ksym;
34 void bpf_cgroup_release(struct cgroup *cgrp) __ksym;
36 static void __on_enter(struct pt_regs *regs, long id, struct cgroup *cgrp) in __on_enter()
70 struct cgroup *cgrp; in BPF_PROG()
90 static void __on_exit(struct pt_regs *regs, long id, struct cgroup *cgrp) in __on_exit()
108 struct cgroup *cgrp; in BPF_PROG()
A Dstruct_ops_kptr_return_fail__invalid_scalar.c8 struct cgroup *bpf_cgroup_acquire(struct cgroup *p) __ksym;
17 struct task_struct *task, struct cgroup *cgrp) in BPF_PROG()
A Dstruct_ops_kptr_return_fail__nonzero_offset.c8 struct cgroup *bpf_cgroup_acquire(struct cgroup *p) __ksym;
17 struct task_struct *task, struct cgroup *cgrp) in BPF_PROG()
/tools/testing/selftests/cgroup/lib/
A Dcgroup_util.c273 int cg_create(const char *cgroup) in cg_create() argument
275 return mkdir(cgroup, 0755); in cg_create()
303 int cg_killall(const char *cgroup) in cg_killall() argument
335 if (!cgroup) in cg_destroy()
338 ret = rmdir(cgroup); in cg_destroy()
340 cg_killall(cgroup); in cg_destroy()
369 int cg_run(const char *cgroup, in cg_run() argument
384 exit(fn(cgroup, arg)); in cg_run()
402 .cgroup = cgroup_fd, in clone_into_cgroup()
481 exit(fn(cgroup, arg)); in clone_into_cgroup_run_nowait()
[all …]
/tools/bpf/bpftool/Documentation/
A Dbpftool-cgroup.rst4 bpftool-cgroup
17 **bpftool** [*OPTIONS*] **cgroup** *COMMAND*
31 | **bpftool** **cgroup help**
62 bpftool cgroup tree [*CGROUP_ROOT*] [effective]
79 bpf program, the program in this cgroup yields to sub-cgroup program;
80 **multi** if a sub-cgroup installs some bpf program, that cgroup program
141 | **# mkdir /sys/fs/cgroup/test.slice**
143 | **# bpftool cgroup attach /sys/fs/cgroup/test.slice/ device id 1 allow_multi**
145 **# bpftool cgroup list /sys/fs/cgroup/test.slice/**
153 | **# bpftool cgroup detach /sys/fs/cgroup/test.slice/ device id 1**
[all …]
/tools/perf/tests/shell/
A Dstat_bpf_counters_cgrp.sh15 if ! perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1; then
18 perf --no-pager stat -a --bpf-counters --for-each-cgroup / true || true
28 if [ -d /sys/fs/cgroup/system.slice ] && [ -d /sys/fs/cgroup/user.slice ]; then
34 find_cgroups_self_cgrp=$(grep perf_event /proc/self/cgroup | cut -d: -f3)
37 find_cgroups_self_cgrp=$(grep ^0: /proc/self/cgroup | cut -d: -f3)
51 …check_system_wide_counted_output=$(perf stat -a --bpf-counters --for-each-cgroup ${test_cgroups} -…
/tools/testing/selftests/mm/
A Dwrite_hugetlb_memory.sh9 cgroup=$4
16 echo "Putting task in cgroup '$cgroup'"
17 echo $$ > ${cgroup_path:-/dev/cgroup/memory}/"$cgroup"/cgroup.procs
A Dhugetlb_reparenting_test.sh30 echo "+hugetlb +memory" >$CGROUP_ROOT/cgroup.subtree_control
32 CGROUP_ROOT=$(mount -t cgroup | grep ",hugetlb" | awk '{print $3}')
34 CGROUP_ROOT=/dev/cgroup/memory
35 mount -t cgroup memory,hugetlb $CGROUP_ROOT
123 echo "+hugetlb +memory" >$CGROUP_ROOT/a/cgroup.subtree_control
141 local cgroup="$1"
146 echo $$ >$CGROUP_ROOT/$cgroup/cgroup.procs
148 echo 0 >$CGROUP_ROOT/$cgroup/cpuset.mems
149 echo 0 >$CGROUP_ROOT/$cgroup/cpuset.cpus
150 echo $$ >"$CGROUP_ROOT/$cgroup/tasks"
[all …]
A Dcharge_reserved_hugetlb.sh36 echo "+hugetlb" >$cgroup_path/cgroup.subtree_control
41 mount -t cgroup memory,hugetlb $cgroup_path
49 echo $$ >$cgroup_path/cgroup.procs
100 echo writing cgroup limit: "$cgroup_limit"
116 local cgroup="$1"
127 local cgroup="$1"
140 local cgroup="$1"
153 local cgroup="$1"
254 local cgroup="$1"
258 wait_for_hugetlb_memory_to_get_depleted $cgroup
[all …]
/tools/testing/selftests/sched_ext/
A Dmaximal.bpf.c100 s32 BPF_STRUCT_OPS(maximal_cgroup_init, struct cgroup *cgrp, in BPF_STRUCT_OPS()
106 void BPF_STRUCT_OPS(maximal_cgroup_exit, struct cgroup *cgrp) in BPF_STRUCT_OPS()
110 struct cgroup *from, struct cgroup *to) in BPF_STRUCT_OPS()
116 struct cgroup *from, struct cgroup *to) in BPF_STRUCT_OPS()
120 struct cgroup *from, struct cgroup *to) in BPF_STRUCT_OPS()
123 void BPF_STRUCT_OPS(maximal_cgroup_set_weight, struct cgroup *cgrp, u32 weight) in BPF_STRUCT_OPS()
126 void BPF_STRUCT_OPS(maximal_cgroup_set_bandwidth, struct cgroup *cgrp, in BPF_STRUCT_OPS()

Completed in 34 milliseconds

1234567