cgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated field

This effectively renames cg_is_empty_recursive() to cg_is_empty().
Note that all existing code calls the former and not the latter,
hence with cgv1 support being dropped it's trivial to consult
cgroup.events directly for populated state everywhere.

Additionally, use more generic cg_get_keyed_attribute() helper
rather than cg_read_event().
This commit is contained in:
Mike Yuan
2025-05-26 22:59:48 +02:00
parent 879952a853
commit c3f900770d
8 changed files with 16 additions and 75 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ int show_cgroup_by_path(
if (!k)
return -ENOMEM;
if (!(flags & OUTPUT_SHOW_ALL) && cg_is_empty_recursive(NULL, k) > 0)
if (!(flags & OUTPUT_SHOW_ALL) && cg_is_empty(NULL, k) > 0)
continue;
if (!shown_pids) {