History

habanalabs: expand clock throttling information uAPI

In addition to the clock throttling reason, user should be able to obtain also the start time and the duration of the throttling event.

Ofir Bitton committed 5 years ago

Commit 1679c7e1 parent 48f31166 files · +110 −14Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/misc/habanalabs.h+14−2
@@ -473,15 +473,27 @@ struct hl_info_pci_counters { · 472 unmodified lines
473473 __u64 replay_cnt;
474474 };
475475
476−#define HL_CLK_THROTTLE_POWER 0x1
477−#define HL_CLK_THROTTLE_THERMAL 0x2
476+enum hl_clk_throttling_type {
477+ HL_CLK_THROTTLE_TYPE_POWER,
478+ HL_CLK_THROTTLE_TYPE_THERMAL,
479+ HL_CLK_THROTTLE_TYPE_MAX
480+};
481+
482+/* clk_throttling_reason masks */
483+#define HL_CLK_THROTTLE_POWER (1 << HL_CLK_THROTTLE_TYPE_POWER)
484+#define HL_CLK_THROTTLE_THERMAL (1 << HL_CLK_THROTTLE_TYPE_THERMAL)
478485
479486 /**
480487 * struct hl_info_clk_throttle - clock throttling reason
481488 * @clk_throttling_reason: each bit represents a clk throttling reason
489+ * @clk_throttling_timestamp_us: represents CPU timestamp in microseconds of the start-event
490+ * @clk_throttling_duration_ns: the clock throttle time in nanosec
482491 */
483492 struct hl_info_clk_throttle {
484493 __u32 clk_throttling_reason;
494+ __u32 pad;
495+ __u64 clk_throttling_timestamp_us[HL_CLK_THROTTLE_TYPE_MAX];
496+ __u64 clk_throttling_duration_ns[HL_CLK_THROTTLE_TYPE_MAX];
485497 };
486498
487499 /**