tools/cgroup/slabinfo.py: updated to work on current kernel
authorVasily Averin <vvs@virtuozzo.com>
Fri, 23 Apr 2021 21:29:03 +0000 (14:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 23 Apr 2021 21:42:40 +0000 (14:42 -0700)
commit1974c45dd7745e999b9387be3d8fdcb27a5b1721
tree9fd770404f008e3d275b5ae4e0533846c03cacc0
parented98b0159fa92a22a2838bd92522b8c8d964556b
tools/cgroup/slabinfo.py: updated to work on current kernel

slabinfo.py script does not work with actual kernel version.

First, it was unable to recognise SLUB susbsytem, and when I specified
it manually it failed again with

  AttributeError: 'struct page' has no member 'obj_cgroups'

.. and then again with

  File "tools/cgroup/memcg_slabinfo.py", line 221, in main
    memcg.kmem_caches.address_of_(),
  AttributeError: 'struct mem_cgroup' has no member 'kmem_caches'

Link: https://lkml.kernel.org/r/cec1a75e-43b4-3d64-2084-d9f98fda037f@virtuozzo.com
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Tested-by: Roman Gushchin <guro@fb.com>
Acked-by: Roman Gushchin <guro@fb.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/cgroup/memcg_slabinfo.py