AMD_LOG_LEVEL / AMD_LOG_LEVEL_FILE environment variables provide a powerful way to sneak peek into the execution of ROCm based programs.
One currently undocumented feature of AMD_LOG_LEVEL is that levels starting from 4 augment the log with the caller process' and thread' identifiers, which are super handy to untangle multithreaded or even multiprocess mess that a real world software produces. This script splits a single log file obtained with a such level into a set of log files each corresponding to a unique pid/tid combination found in the log, which makes analysing the log much easier.
A useful thing to note here, that experience tells that a parser of related AMD_LOG_MASK variable at least in ROCm 6.3.4 don't handle hexadecimal values properly, so if you customize the mask - make sure to specify it a decimals.