]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
abstraction-map: Add (currently) unmappable cpu.stat
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 31 Jan 2022 16:30:56 +0000 (09:30 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 3 Feb 2022 21:42:38 +0000 (14:42 -0700)
Add an unmappable mapping for the cpu.stat setting.  While
the filename, cpu.stat, maps perfectly from v1 <-> v2, the
contents do not.  At this time, let's set this as unmappable
and revisit it when we've thought through the best way to
map the contents.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/abstraction-map.c

index 5e1c2c02526ac5ce2dccf80484dbb5d8a41fa55d..5c43214605fd6fe31ee7059cd06ca669ffb5a78a 100644 (file)
 #include "abstraction-map.h"
 
 const struct cgroup_abstraction_map cgroup_v1_to_v2_map[] = {
+       /* cpu controller */
        {cgroup_convert_int, "cpu.shares", (void *)1024, "cpu.weight", (void *)100},
        {cgroup_convert_cpu_quota_to_max, "cpu.cfs_quota_us", NULL, "cpu.max", NULL},
        {cgroup_convert_cpu_period_to_max, "cpu.cfs_period_us", NULL, "cpu.max", NULL},
+       {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL},
 
        /* cpuset controller */
        {cgroup_convert_name_only, "cpuset.effective_cpus", NULL,
@@ -50,9 +52,11 @@ const int cgroup_v1_to_v2_map_sz = sizeof(cgroup_v1_to_v2_map) /
                                   sizeof(cgroup_v1_to_v2_map[0]);
 
 const struct cgroup_abstraction_map cgroup_v2_to_v1_map[] = {
+       /* cpu controller */
        {cgroup_convert_int, "cpu.weight", (void *)100, "cpu.shares", (void *)1024},
        {cgroup_convert_cpu_max_to_quota, "cpu.max", NULL, "cpu.cfs_quota_us", NULL},
        {cgroup_convert_cpu_max_to_period, "cpu.max", NULL, "cpu.cfs_period_us", NULL},
+       {cgroup_convert_unmappable, "cpu.stat", NULL, "cpu.stat", NULL},
 
        /* cpuset controller */
        {cgroup_convert_name_only, "cpuset.cpus.effective", NULL,