In addition to the clock throttling reason, user should be able to obtain also the start time and the duration of the throttling event.
Showing the changes to include/uapi (1 of 6 files). Show all
Unified · Split
| @@ -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 0x1 | 476 | enum hl_clk_throttling_type { |
| 477 | #define HL_CLK_THROTTLE_THERMAL 0x2 | 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) | ||
| 478 | 485 | ||
| 479 | /** | 486 | /** |
| 480 | * struct hl_info_clk_throttle - clock throttling reason | 487 | * struct hl_info_clk_throttle - clock throttling reason |
| 481 | * @clk_throttling_reason: each bit represents a clk throttling reason | 488 | * @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 | */ |
| 483 | struct hl_info_clk_throttle { | 492 | struct 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 | /** |