Re: [RFC PATCH 1/3] cgroup: list all subsystem states in debugfs files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for pointing out to drgn scripts in kernel source tree, didn't know about them, I will take a look.

On 11.09.2023 20:55, tj@xxxxxxxxxx wrote:
On Mon, Sep 11, 2023 at 07:55:15AM +0000, Yakunin, Dmitry (Nebius) wrote:
+static void mem_cgroup_css_dump(struct cgroup_subsys_state *css,
+                             struct seq_file *m)
+{
+     struct mem_cgroup *memcg = mem_cgroup_from_css(css);
+
+     seq_printf(m, "mem_id=%u memory=%lu memsw=%lu kmem=%lu tcpmem=%lu shmem=%lu",
+                mem_cgroup_id(memcg),
+                page_counter_read(&memcg->memory),
+                page_counter_read(&memcg->memsw),
+                page_counter_read(&memcg->kmem),
+                page_counter_read(&memcg->tcpmem),
+                memcg_page_state(memcg, NR_SHMEM));
+}
Can you please take a look at drgn (https://github.com/osandov/drgn) and see
whether that satifies your needs? We can easily add drgn scripts under tools
directory too (e.g. iocost already does that).

Thanks.

--
tejun




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux