Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iocost_monitor: fix kernel queue kobj changes

When I use iocost_monitor on nvme0n1, this error shows up:
"Could not find ioc for nvme0n1"

There is no kobj in struct queue in recent kernel, it seems that the commit
2bd85221a625 ("block: untangle request_queue refcounting from sysfs")
move the queue kobj to struct gendisk.

Fix it by using mq_kobj which is at the same level with queue kobj.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Link: https://lore.kernel.org/r/20230804065039.8885-1-chengming.zhou@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Chengming Zhou and committed by
Jens Axboe
2eae9c49 a24c8b51

+1 -1
+1 -1
tools/cgroup/iocost_monitor.py
··· 221 221 for i, ptr in radix_tree_for_each(blkcg_root.blkg_tree.address_of_()): 222 222 blkg = drgn.Object(prog, 'struct blkcg_gq', address=ptr) 223 223 try: 224 - if devname == blkg.q.kobj.parent.name.string_().decode('utf-8'): 224 + if devname == blkg.q.mq_kobj.parent.name.string_().decode('utf-8'): 225 225 q_id = blkg.q.id.value_() 226 226 if blkg.pd[plid]: 227 227 root_iocg = container_of(blkg.pd[plid], 'struct ioc_gq', 'pd')