]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/cgsnapshot: limit the controller to search to user lists
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 21 Dec 2022 15:46:26 +0000 (21:16 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 6 Jan 2023 15:28:47 +0000 (08:28 -0700)
commit99135e0f6afd203458e32c66e33956a764dc8968
tree304cb08e85d3e3522cf878406f1009594194aad8
parent52f20c4567ea45157112ad765b94f072cf62183f
tools/cgsnapshot: limit the controller to search to user lists

is_ctlr_on_list(), returns on the first match of the list of controllers
the user has passed on the command line, this might serve as an
optimization but as a side effect we search through the whole list of
controllers, those the user has not asked for. Let's reset the list of
controllers to controllers available on wanted_consts array (list of
controllers required by the user) and controllers array (list of
available controllers).

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/cgsnapshot.c