Conditionally include backtraces in ROCPROFSYS_THROW based on verbosity (#272)

* Conditionally include backtraces in ROCPROFSYS_THROW based on verbosity

Modify ROCPROFSYS_THROW to only include backtraces when:
  debug mode is enabled, OR
  verbose level is >= 2, OR
  running in CI environment

* Fix formatting errors
Bu işleme şunda yer alıyor:
Sajina PK
2025-07-07 14:14:02 -04:00
işlemeyi yapan: GitHub
ebeveyn 4e5029221b
işleme b0ff07b4fe
3 değiştirilmiş dosya ile 16 ekleme ve 2 silme
+9 -2
Dosyayı Görüntüle
@@ -377,14 +377,21 @@ as_hex<void*>(void*, size_t);
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
char _msg_buffer[ROCPROFSYS_DEBUG_BUFFER_LEN]; \
bool _print_backtrace = ::rocprofsys::get_debug() || \
::rocprofsys::get_verbose() >= 2 || \
::rocprofsys::get_is_continuous_integration(); \
snprintf(_msg_buffer, ROCPROFSYS_DEBUG_BUFFER_LEN, \
"[rocprof-sys][%i][%li][%s]%s", ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, \
ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
auto len = strlen(_msg_buffer); \
snprintf(_msg_buffer + len, ROCPROFSYS_DEBUG_BUFFER_LEN - len, __VA_ARGS__); \
throw ::rocprofsys::exception<TYPE>( \
::tim::log::string(::tim::log::color::fatal(), _msg_buffer)); \
if(!_print_backtrace) \
throw ::rocprofsys::exception<TYPE>( \
::tim::log::string(::tim::log::color::fatal(), _msg_buffer), false); \
else \
throw ::rocprofsys::exception<TYPE>( \
::tim::log::string(::tim::log::color::fatal(), _msg_buffer)); \
}
#define ROCPROFSYS_CONDITIONAL_BASIC_THROW_E(COND, TYPE, ...) \