driazati commented on a change in pull request #9872:
URL: https://github.com/apache/tvm/pull/9872#discussion_r790076169
##########
File path: src/runtime/logging.cc
##########
@@ -120,7 +130,22 @@ int BacktraceFullCallback(void* data, uintptr_t pc, const
char* filename, int li
std::string Backtrace() {
BacktraceInfo bt;
- bt.max_size = 500;
+
+ // Limit backtrace length based on TVM_BACKTRACE_LIMIT env variable
+ auto user_limit_s = getenv("TVM_BACKTRACE_LIMIT");
+ const auto default_limit = 500;
+
+ if (user_limit_s == nullptr) {
+ bt.max_size = default_limit;
+ } else {
+ // Parse out the user-set backtrace limit
+ try {
+ bt.max_size = std::stoi(user_limit_s);
+ } catch (const std::invalid_argument& e) {
+ bt.max_size = default_limit;
+ }
+ }
+
Review comment:
moved into #10025
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]