Introduce RSMI_DEBUG_INFINITE_LOOP

The environment variable RSMI_DEBUG_INFINITE_LOOP is introduced
to facilitate debugging RSMI in user applications. When this
env. variable is non-zero, an infinite loop will be entered in
rsmi_init(). At this point, a debugger can be attached and RSMI
can be debugger. This only applies to debug builds.

Change-Id: I23f6dd730fc965764295070de053314a1cc5b6aa
This commit is contained in:
Chris Freehill
2020-12-21 16:16:43 -06:00
parent 7b5f220f76
commit 68095b50e7
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -143,6 +143,13 @@ struct rsmi_func_id_iter_handle {
};
struct RocmSMI_env_vars {
// If RSMI_DEBUG_INFINITE_LOOP is non-zero, rsmi_init() will go into
// an infinite loop in debug builds. For release builds, this is
// ignored. This is useful for debugging RSMI applications with
// gdb. After attaching with gdb, the inf. loop can be exited and
// RSMI can be debugged.
uint32_t debug_inf_loop;
// Bitfield that is AND'd with various RSMI_DEBUG_* bits to determine
// which debugging information should be turned on. Env. variable
// RSMI_DEBUG_BITFIELD is used to set all the debug info bits.