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
473 __u64 replay_cnt;473 __u64 replay_cnt;
474};474};
475 475
476#define HL_CLK_THROTTLE_POWER 0x1476enum hl_clk_throttling_type {
477#define HL_CLK_THROTTLE_THERMAL 0x2477 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)
478 485
479/**486/**
480 * struct hl_info_clk_throttle - clock throttling reason487 * struct hl_info_clk_throttle - clock throttling reason
481 * @clk_throttling_reason: each bit represents a clk throttling reason488 * @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
482 */491 */
483struct hl_info_clk_throttle {492struct hl_info_clk_throttle {
484 __u32 clk_throttling_reason;493 __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];
485};497};
486 498
487/**499/**