lxcfs/0012-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch
vegbir 6ad912e044 update to 4.0.11
(cherry picked from commit 333138af7dd63430c46198dcb24abdcf5cc43b98)
2021-12-17 10:03:03 +08:00

43 lines
1.5 KiB
Diff

From a0d132e43d22153908e392b8274570bacd9cb6ce Mon Sep 17 00:00:00 2001
From: yangjiaqi <yangjiaqi16@huawei.com>
Date: Thu, 25 Nov 2021 16:10:39 +0800
Subject: [PATCH 12/17] lxcfs-proc_diskstats_read-func-obtain-data-from-blki
---
src/cgroups/cgfsng.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/cgroups/cgfsng.c b/src/cgroups/cgfsng.c
index 781923c..e50c87d 100644
--- a/src/cgroups/cgfsng.c
+++ b/src/cgroups/cgfsng.c
@@ -751,7 +751,11 @@ static int cgfsng_get_io(struct cgroup_ops *ops, const char *cgroup,
static int cgfsng_get_io_service_bytes(struct cgroup_ops *ops,
const char *cgroup, char **value)
{
- return cgfsng_get_io(ops, cgroup, "blkio.io_service_bytes_recursive", value);
+ int ret;
+ ret = cgfsng_get_io(ops, cgroup, "blkio.throttle.io_service_bytes_recursive", value);
+ if (ret < 0)
+ return cgfsng_get_io(ops, cgroup, "blkio.throttle.io_service_bytes", value);
+ return ret;
}
static int cgfsng_get_io_service_time(struct cgroup_ops *ops,
@@ -763,7 +767,11 @@ static int cgfsng_get_io_service_time(struct cgroup_ops *ops,
static int cgfsng_get_io_serviced(struct cgroup_ops *ops, const char *cgroup,
char **value)
{
- return cgfsng_get_io(ops, cgroup, "blkio.io_serviced_recursive", value);
+ int ret;
+ ret = cgfsng_get_io(ops, cgroup, "blkio.throttle.io_serviced_recursive", value);
+ if (ret < 0)
+ return cgfsng_get_io(ops, cgroup, "blkio.throttle.io_serviced", value);
+ return ret;
}
static int cgfsng_get_io_merged(struct cgroup_ops *ops, const char *cgroup,
--
2.27.0