/linux-master/include/linux/ |
H A D | cgroup_api.h | 1 #include <linux/cgroup.h>
|
H A D | psi.h | 9 #include <linux/cgroup-defs.h> 10 #include <linux/cgroup.h> 35 static inline struct psi_group *cgroup_psi(struct cgroup *cgrp) 40 int psi_cgroup_alloc(struct cgroup *cgrp); 41 void psi_cgroup_free(struct cgroup *cgrp); 54 static inline int psi_cgroup_alloc(struct cgroup *cgrp) 58 static inline void psi_cgroup_free(struct cgroup *cgrp)
|
H A D | cgroup.h | 5 * cgroup interface 28 #include <linux/cgroup-defs.h> 100 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgroup, 102 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup, 107 struct cgroup *cgroup_get_from_path(const char *path); 108 struct cgroup *cgroup_get_from_fd(int fd); 109 struct cgroup *cgroup_v1v2_get_from_fd(int fd); 112 int cgroup_transfer_tasks(struct cgroup *t [all...] |
/linux-master/tools/testing/selftests/cgroup/ |
H A D | test_freezer.c | 25 * Check if the cgroup is frozen by looking at the cgroup.events::frozen value. 27 static int cg_check_frozen(const char *cgroup, bool frozen) argument 30 if (cg_read_strstr(cgroup, "cgroup.events", "frozen 1") != 0) { 31 debug("Cgroup %s isn't frozen\n", cgroup); 36 * Check the cgroup.events::frozen value. 38 if (cg_read_strstr(cgroup, "cgroup.events", "frozen 0") != 0) { 39 debug("Cgroup %s is frozen\n", cgroup); 50 cg_freeze_nowait(const char *cgroup, bool freeze) argument 59 cg_enter_and_wait_for_frozen(const char *cgroup, int pid, bool frozen) argument 93 cg_freeze_wait(const char *cgroup, bool freeze) argument 121 child_fn(const char *cgroup, void *arg) argument 139 char *cgroup = NULL; local 190 char *cgroup[10] = {0}; local 340 forkbomb_fn(const char *cgroup, void *arg) argument 363 char *cgroup = NULL; local 511 char *cgroup[2] = {0}; local 586 char *cgroup = NULL; local 668 char *cgroup = NULL; local 712 char *cgroup = NULL; local 763 vfork_fn(const char *cgroup, void *arg) argument 781 char *cgroup = NULL; local [all...] |
H A D | cgroup_util.h | 27 extern char *cg_control(const char *cgroup, const char *control); 28 extern int cg_create(const char *cgroup); 29 extern int cg_destroy(const char *cgroup); 30 extern int cg_read(const char *cgroup, const char *control, 32 extern int cg_read_strcmp(const char *cgroup, const char *control, 34 extern int cg_read_strstr(const char *cgroup, const char *control, 36 extern long cg_read_long(const char *cgroup, const char *control); 37 long cg_read_key_long(const char *cgroup, const char *control, const char *key); 38 extern long cg_read_lc(const char *cgroup, const char *control); 39 extern int cg_write(const char *cgroup, cons [all...] |
H A D | test_kill.c | 17 * Kill the given cgroup and wait for the inotify signal. 19 * Then check that the cgroup is in the desired state. 21 static int cg_kill_wait(const char *cgroup) argument 25 fd = cg_prepare_for_wait(cgroup); 29 ret = cg_write(cgroup, "cgroup.kill", "1"); 46 static int child_fn(const char *cgroup, void *arg) argument 60 char *cgroup = NULL; local 63 cgroup = cg_name(root, "cg_test_simple"); 64 if (!cgroup) 116 char *cgroup[10] = {0}; local 204 forkbomb_fn(const char *cgroup, void *arg) argument 225 char *cgroup = NULL; local [all...] |
H A D | cgroup_util.c | 75 char *cg_control(const char *cgroup, const char *control) argument 77 size_t len = strlen(cgroup) + strlen(control) + 2; 80 snprintf(ret, len, "%s/%s", cgroup, control); 86 int cg_read(const char *cgroup, const char *control, char *buf, size_t len) argument 91 snprintf(path, sizeof(path), "%s/%s", cgroup, control); 97 int cg_read_strcmp(const char *cgroup, const char *control, argument 114 if (cg_read(cgroup, control, buf, size)) { 124 int cg_read_strstr(const char *cgroup, const char *control, const char *needle) argument 128 if (cg_read(cgroup, control, buf, sizeof(buf))) 134 long cg_read_long(const char *cgroup, cons argument 144 cg_read_key_long(const char *cgroup, const char *control, const char *key) argument 159 cg_read_lc(const char *cgroup, const char *control) argument 176 cg_write(const char *cgroup, const char *control, char *buf) argument 186 cg_write_numeric(const char *cgroup, const char *control, long value) argument 227 cg_create(const char *cgroup) argument 232 cg_wait_for_proc_count(const char *cgroup, int count) argument 257 cg_killall(const char *cgroup) argument 285 cg_destroy(const char *cgroup) argument 305 cg_enter(const char *cgroup, int pid) argument 313 cg_enter_current(const char *cgroup) argument 318 cg_enter_current_thread(const char *cgroup) argument 323 cg_run(const char *cgroup, int (*fn)(const char *cgroup, void *arg), void *arg) argument 421 clone_into_cgroup_run_nowait(const char *cgroup, int (*fn)(const char *cgroup, void *arg), void *arg) argument 440 cg_run_nowait(const char *cgroup, int (*fn)(const char *cgroup, void *arg), void *arg) argument 495 alloc_anon(const char *cgroup, void *arg) argument 582 clone_into_cgroup_run_wait(const char *cgroup) argument 607 __prepare_for_wait(const char *cgroup, const char *filename) argument 624 cg_prepare_for_wait(const char *cgroup) argument 629 memcg_prepare_for_wait(const char *cgroup) argument [all...] |
/linux-master/tools/testing/selftests/mm/ |
H A D | write_hugetlb_memory.sh | 9 cgroup=$4 16 echo "Putting task in cgroup '$cgroup'" 17 echo $$ > ${cgroup_path:-/dev/cgroup/memory}/"$cgroup"/cgroup.procs
|
/linux-master/tools/perf/util/ |
H A D | cgroup.h | 12 struct cgroup { struct 23 struct cgroup *cgroup__get(struct cgroup *cgroup); 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); 34 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup); [all...] |
H A D | cgroup.c | 4 #include "cgroup.h" 23 /* used to match cgroup name with patterns */ 45 fprintf(stderr, "no access to cgroup %s\n", path); 66 int read_cgroup_id(struct cgroup *cgrp) 101 static struct cgroup *evlist__find_cgroup(struct evlist *evlist, const char *str) 117 struct cgroup *cgroup__new(const char *name, bool do_open) 119 struct cgroup *cgroup = zalloc(sizeof(*cgroup)); local 121 if (cgroup ! 148 struct cgroup *cgroup = evlist__find_cgroup(evlist, name); local 179 cgroup__delete(struct cgroup *cgroup) argument 194 cgroup__get(struct cgroup *cgroup) argument 201 evsel__set_default_cgroup(struct evsel *evsel, struct cgroup *cgroup) argument 207 evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup) argument [all...] |
/linux-master/tools/testing/selftests/bpf/progs/ |
H A D | cgrp_kfunc_failure.c | 16 * TP_PROTO(struct cgroup *cgrp, const char *path), 20 static struct __cgrps_kfunc_map_value *insert_lookup_cgrp(struct cgroup *cgrp) 33 int BPF_PROG(cgrp_kfunc_acquire_untrusted, struct cgroup *cgrp, const char *path) 35 struct cgroup *acquired; 52 int BPF_PROG(cgrp_kfunc_acquire_no_null_check, struct cgroup *cgrp, const char *path) 54 struct cgroup *acquired; 67 __failure __msg("arg#0 pointer type STRUCT cgroup must point") 68 int BPF_PROG(cgrp_kfunc_acquire_fp, struct cgroup *cgrp, const char *path) 70 struct cgroup *acquired, *stack_cgrp = (struct cgroup *) [all...] |
H A D | cgrp_kfunc_common.h | 13 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) 42 static inline int cgrps_kfunc_map_insert(struct cgroup *cgrp) 46 struct cgroup *acquire [all...] |
H A D | iters_css_task.c | 13 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; 50 static inline u64 cgroup_id(struct cgroup *cgrp) 55 SEC("?iter/cgroup") 59 struct cgroup *cgrp = ctx->cgroup; 89 struct cgroup *cgr [all...] |
H A D | cgroup_iter.c | 12 static inline u64 cgroup_id(struct cgroup *cgrp) 17 SEC("iter/cgroup") 21 struct cgroup *cgrp = ctx->cgroup;
|
H A D | cgrp_kfunc_success.c | 17 * TP_PROTO(struct cgroup *cgrp, const char *path), 33 int BPF_PROG(test_cgrp_acquire_release_argument, struct cgroup *cgrp, const char *path) 35 struct cgroup *acquired; 50 int BPF_PROG(test_cgrp_acquire_leave_in_map, struct cgroup *cgrp, const char *path) 65 int BPF_PROG(test_cgrp_xchg_release, struct cgroup *cgrp, const char *path) 67 struct cgroup *kptr, *cg; 108 int BPF_PROG(test_cgrp_get_release, struct cgroup *cgrp, const char *path) 110 struct cgroup *kptr; 139 int BPF_PROG(test_cgrp_get_ancestors, struct cgroup *cgrp, const char *path) 141 struct cgroup *sel [all...] |
H A D | cgrp_ls_sleepable.c | 23 struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id) __ksym; 24 void bpf_cgroup_release(struct cgroup *cgrp) __ksym; 28 SEC("?iter.s/cgroup") 31 struct cgroup *cgrp = ctx->cgroup; 44 static void __no_rcu_lock(struct cgroup *cgrp) 61 struct cgroup *cgrp; 95 struct cgroup *cgrp;
|
H A D | iters_css.c | 18 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; 51 cur_cgrp = pos->cgroup; 57 cur_cgrp = pos->cgroup;
|
H A D | test_task_under_cgroup.c | 10 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; 54 struct cgroup *cgrp = NULL; 65 /* 1 is the root cgroup */
|
H A D | test_cgroup1_hierarchy.c | 13 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;
|
H A D | cgrp_ls_recursion.c | 27 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) 47 struct cgroup *cgrp; 63 static void __on_enter(struct pt_regs *regs, long id, struct cgroup *cgrp) 80 struct cgroup *cgrp;
|
/linux-master/kernel/bpf/ |
H A D | bpf_cgrp_storage.c | 41 struct cgroup *cg = owner; 46 void bpf_cgrp_storage_free(struct cgroup *cgroup) argument 51 local_storage = rcu_dereference(cgroup->bpf_cgrp_storage); 64 cgroup_storage_lookup(struct cgroup *cgroup, struct bpf_map *map, bool cacheit_lockit) argument 69 cgroup_storage = rcu_dereference_check(cgroup->bpf_cgrp_storage, 81 struct cgroup *cgroup; local 85 cgroup 100 struct cgroup *cgroup; local 116 cgroup_storage_delete(struct cgroup *cgroup, struct bpf_map *map) argument 130 struct cgroup *cgroup; local [all...] |
H A D | cgroup_iter.c | 5 #include <linux/cgroup.h> 9 #include "../cgroup/cgroup-internal.h" /* cgroup_mutex and cgroup_is_dead */ 11 /* cgroup_iter provides four modes of traversal to the cgroup hierarchy. 13 * 1. Walk the descendants of a cgroup in pre-order. 14 * 2. Walk the descendants of a cgroup in post-order. 15 * 3. Walk the ancestors of a cgroup. 16 * 4. Show the given cgroup only. 19 * post-order. For walking ancestors, the iter walks up from a cgroup to 26 * the first element. The prog may also be passed a NULL cgroup, [all...] |
/linux-master/tools/perf/tests/shell/ |
H A D | stat_bpf_counters_cgrp.sh | 2 # perf stat --bpf-counters --for-each-cgroup test 12 # skip if --bpf-counters --for-each-cgroup is not supported 15 if ! perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1; then 17 echo "Skipping: --bpf-counters --for-each-cgroup not supported" 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) 36 # cgroup v2 doesn't specify perf_event 37 find_cgroups_self_cgrp=$(grep ^0: /proc/self/cgroup | cu [all...] |
/linux-master/kernel/cgroup/ |
H A D | Makefile | 2 obj-y := cgroup.o rstat.o namespace.o cgroup-v1.o freezer.o
|
/linux-master/include/trace/events/ |
H A D | cgroup.h | 3 #define TRACE_SYSTEM cgroup 8 #include <linux/cgroup.h> 54 DECLARE_EVENT_CLASS(cgroup, 56 TP_PROTO(struct cgroup *cgrp, const char *path), 78 DEFINE_EVENT(cgroup, cgroup_mkdir, 80 TP_PROTO(struct cgroup *cgrp, const char *path), 85 DEFINE_EVENT(cgroup, cgroup_rmdir, 87 TP_PROTO(struct cgroup *cgrp, const char *path), 92 DEFINE_EVENT(cgroup, cgroup_release, 94 TP_PROTO(struct cgroup *cgr [all...] |