From: Tom Hromatka Date: Mon, 31 Jan 2022 16:30:56 +0000 (-0700) Subject: abstraction-map: Add (currently) unmappable cpu.stat X-Git-Tag: v3.0~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ad52442fed71d7b53ad3c9583a8bf3f31b850a1;p=thirdparty%2Flibcgroup.git abstraction-map: Add (currently) unmappable cpu.stat 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 Reviewed-by: Kamalesh Babulal --- diff --git a/src/abstraction-map.c b/src/abstraction-map.c index 5e1c2c02..5c432146 100644 --- a/src/abstraction-map.c +++ b/src/abstraction-map.c @@ -32,9 +32,11 @@ #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,