habanalabs: add uapi to retrieve device utilization
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 28 Aug 2019 14:32:04 +0000 (17:32 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 5 Sep 2019 11:55:27 +0000 (14:55 +0300)
commit75b3cb2bb080372d043e8f0c0aeae8f52461136b
tree48d38cc87865d9f654c305ac8db16f41a33f21ee
parent413cf576fd50297429e967b050d63067c997645c
habanalabs: add uapi to retrieve device utilization

Users and sysadmins usually want to know what is the device utilization as
a level 0 indication if they are efficiently using the device.

Add a new opcode to the INFO IOCTL that will return the device utilization
over the last period of 100-1000ms. The return value is 0-100,
representing as percentage the total utilization rate.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Omer Shpigelman <oshpigelman@habana.ai>
drivers/misc/habanalabs/command_submission.c
drivers/misc/habanalabs/device.c
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/habanalabs_ioctl.c
drivers/misc/habanalabs/hw_queue.c
drivers/misc/habanalabs/include/goya/goya.h
include/uapi/misc/habanalabs.h