77 lines
2.9 KiB
Diff
77 lines
2.9 KiB
Diff
|
|
From 85a5823c87f8b0e5d5b2172aa5e4564f50fbc011 Mon Sep 17 00:00:00 2001
|
||
|
|
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
|
||
|
|
Date: Fri, 21 Apr 2023 09:51:16 +0800
|
||
|
|
Subject: [PATCH 12/15] add memory info from runtime
|
||
|
|
|
||
|
|
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
|
||
|
|
---
|
||
|
|
src/json/schema/container/info.json | 2 +-
|
||
|
|
src/json/schema/shim/client/runtime-stats.json | 9 +++++++++
|
||
|
|
src/lcrcontainer.h | 2 --
|
||
|
|
src/lcrcontainer_execute.c | 3 +++
|
||
|
|
4 files changed, 13 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/src/json/schema/container/info.json b/src/json/schema/container/info.json
|
||
|
|
index 1db0ccf..19107a1 100644
|
||
|
|
--- a/src/json/schema/container/info.json
|
||
|
|
+++ b/src/json/schema/container/info.json
|
||
|
|
@@ -20,7 +20,7 @@
|
||
|
|
"avaliable_bytes": {
|
||
|
|
"type": "uint64"
|
||
|
|
},
|
||
|
|
- "usage_bytes": {
|
||
|
|
+ "workingset_bytes": {
|
||
|
|
"type": "uint64"
|
||
|
|
},
|
||
|
|
"rss_bytes": {
|
||
|
|
diff --git a/src/json/schema/shim/client/runtime-stats.json b/src/json/schema/shim/client/runtime-stats.json
|
||
|
|
index ae77e9d..6fdc579 100644
|
||
|
|
--- a/src/json/schema/shim/client/runtime-stats.json
|
||
|
|
+++ b/src/json/schema/shim/client/runtime-stats.json
|
||
|
|
@@ -52,6 +52,15 @@
|
||
|
|
"properties": {
|
||
|
|
"total_inactive_file": {
|
||
|
|
"$ref": "../../defs.json#/definitions/uint64"
|
||
|
|
+ },
|
||
|
|
+ "rss": {
|
||
|
|
+ "$ref": "../../defs.json#/definitions/uint64"
|
||
|
|
+ },
|
||
|
|
+ "pgfault": {
|
||
|
|
+ "$ref": "../../defs.json#/definitions/uint64"
|
||
|
|
+ },
|
||
|
|
+ "pgmajfault": {
|
||
|
|
+ "$ref": "../../defs.json#/definitions/uint64"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
diff --git a/src/lcrcontainer.h b/src/lcrcontainer.h
|
||
|
|
index a222ac9..edfc869 100644
|
||
|
|
--- a/src/lcrcontainer.h
|
||
|
|
+++ b/src/lcrcontainer.h
|
||
|
|
@@ -90,8 +90,6 @@ struct lcr_container_state {
|
||
|
|
/* Memory usage */
|
||
|
|
uint64_t mem_used;
|
||
|
|
uint64_t mem_limit;
|
||
|
|
- uint64_t avaliable_bytes;
|
||
|
|
- uint64_t usage_bytes;
|
||
|
|
uint64_t rss_bytes;
|
||
|
|
uint64_t page_faults;
|
||
|
|
uint64_t major_page_faults;
|
||
|
|
diff --git a/src/lcrcontainer_execute.c b/src/lcrcontainer_execute.c
|
||
|
|
index ff4685b..4d72050 100644
|
||
|
|
--- a/src/lcrcontainer_execute.c
|
||
|
|
+++ b/src/lcrcontainer_execute.c
|
||
|
|
@@ -789,6 +789,9 @@ void do_lcr_state(struct lxc_container *c, struct lcr_container_state *lcs)
|
||
|
|
lcs->mem_limit = lxc_metrics.mem_limit;
|
||
|
|
lcs->kmem_used = lxc_metrics.kmem_used;
|
||
|
|
lcs->kmem_limit = lxc_metrics.kmem_limit;
|
||
|
|
+ lcs->rss_bytes = lxc_metrics.rss_bytes;
|
||
|
|
+ lcs->page_faults = lxc_metrics.page_faults;
|
||
|
|
+ lcs->major_page_faults = lxc_metrics.major_page_faults;
|
||
|
|
|
||
|
|
lcs->cache = lxc_metrics.cache;
|
||
|
|
lcs->cache_total = lxc_metrics.cache_total;
|
||
|
|
--
|
||
|
|
2.25.1
|
||
|
|
|