diff --git a/0019-metrics-add-total_inactive_file-metric-for-memory.patch b/0019-metrics-add-total_inactive_file-metric-for-memory.patch new file mode 100644 index 0000000000000000000000000000000000000000..737afccd907f521c29fcc71329c4ab1baa645b7b --- /dev/null +++ b/0019-metrics-add-total_inactive_file-metric-for-memory.patch @@ -0,0 +1,39 @@ +From 15da6e1f057c70eee476730138788fd73de1b208 Mon Sep 17 00:00:00 2001 +From: Li Feng +Date: Thu, 28 Jan 2021 16:05:18 +0800 +Subject: [PATCH 19/19] metrics: add total_inactive_file metric for memory + +Signed-off-by: Li Feng +--- + src/lxc/lxccontainer.c | 1 + + src/lxc/lxccontainer.h | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c +index 9202b73ff..06552ce5c 100644 +--- a/src/lxc/lxccontainer.c ++++ b/src/lxc/lxccontainer.c +@@ -5919,6 +5919,7 @@ static bool do_lxcapi_get_container_metrics(struct lxc_container *c, struct lxc + + metrics->cache = metrics_match_get_ull(c, cgroup_ops, "memory.stat", "cache", 1); + metrics->cache_total = metrics_match_get_ull(c, cgroup_ops, "memory.stat", "total_cache", 1); ++ metrics->inactive_file_total = metrics_match_get_ull(c, cgroup_ops, "memory.stat", "total_inactive_file", 1); + + return true; + } +diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h +index e30bf6161..9abbd09ed 100644 +--- a/src/lxc/lxccontainer.h ++++ b/src/lxc/lxccontainer.h +@@ -69,6 +69,8 @@ struct lxc_container_metrics { + /* Cache usage */ + uint64_t cache; + uint64_t cache_total; ++ /* total inactive file */ ++ uint64_t inactive_file_total; + }; + + /*! +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 52e1867d2812163504ba805f91ef66348cf4058c..45a55a704571a86bd8682d39dcecb6c3a32dba9c 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2021012001 +%global _release 2021012801 Name: lxc Version: 4.0.3 @@ -26,6 +26,7 @@ Patch0015: 0015-Streaming-IO-solution-optimization-and-enhancement.patch Patch0016: 0016-avoid-using-void-pointers-in-caclulation.patch Patch0017: 0017-fix-compilation-errors-without-libcap.patch Patch0018: 0018-IO-fix-io-data-miss-when-exec-with-pipes.patch +Patch0019: 0019-metrics-add-total_inactive_file-metric-for-memory.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -197,6 +198,12 @@ make check %{_mandir}/*/man7/%{name}* %changelog +* Thu Jan 28 2021 lifeng - 4.0.3-2021012801 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: add inactive file total metrics + * Wed Jan 21 2021 lifeng - 4.0.3-2021012001 - Type:enhancement - ID:NA diff --git a/series.conf b/series.conf index fcd7814d0f55c8a0976139662456376030406c46..065ae00d7bfd37a466bbf4ebbeeb8f9d05d9fc93 100644 --- a/series.conf +++ b/series.conf @@ -16,3 +16,4 @@ 0016-avoid-using-void-pointers-in-caclulation.patch 0017-fix-compilation-errors-without-libcap.patch 0018-IO-fix-io-data-miss-when-exec-with-pipes.patch +0019-metrics-add-total_inactive_file-metric-for-memory.patch