-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[RUNTIME] Add libbacktrace for backtraces with line numbers #7153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
0a172a9
[RUNTIME] Add libbacktrace for backtraces with line numbers
tkonolige 27b9d39
Fix _Pragma issue on windows build
rkimball 3db736f
allow libbacktrace patch
tkonolige e546407
add apache headers
tkonolige 9e39bb5
lint fix
tkonolige 926b9b7
handle early cmake versions
tkonolige c69df46
Move logging into runtime namespace. Add detail namespace for logging…
tkonolige ef74ccd
push CHECK_OP comparisons into functions to handle early versions of …
tkonolige 6f8505e
make object files depend on libbacktrace
tkonolige a79c364
Make tvm::Error a subclass of dmlc::Error
tkonolige 939a3d9
allow custom logging for non-standard backends
tkonolige 6cd5457
forgot a not... whoops
tkonolige 0b54636
allow user to override logging with TVM_LOG_CUSTOMIZE
tkonolige 8d6b00c
ios_rpc builds
tkonolige 3896ed5
formatting
tkonolige 05c2984
fix android build
tkonolige c80610c
fix emcc
tkonolige 4abe902
fix cmake
tkonolige 5aa2e85
fix vitis_ai
tkonolige d4dd7d8
fix error message format. fix clang warnings
tkonolige 2105e3f
fixes for older cmake
tkonolige 0a83a2f
apply patch after update
tkonolige 7d9e3b5
missing logging header
tkonolige 34eed0b
set defines for cython
tkonolige ce3942a
specify debug build for testing
tkonolige c51ebfa
disable builtin patch step
tkonolige 0323a73
more robust patching
tkonolige 36640ea
more dmlc logging defines
tkonolige 56584b9
address comments
tkonolige e7fb965
move backtrace definition to source file
tkonolige cc9f6c1
namespace windows backtrace correctly?
tkonolige cd04cb9
fix warnings on windows
tkonolige b53137f
Fix building on windows
rkimball d63e6bb
Fix unresolved symbol for function Backtrace on Windows. Apply style.
rkimball 59fd4c3
pass dmlc flag to standalone crt
tkonolige b408ed4
forgot private
tkonolige 5255c3d
switch to TVM_DLL
tkonolige a5589a4
more dll stuff
tkonolige 76b0165
revert to windows-only approach
tkonolige 6155a11
fix vta_fsim defines
tkonolige ef2c9f8
adding more -D...
tkonolige 3a63b2c
vta flags
tkonolige b52f8f2
clean up added includes
tkonolige a5f9f49
bad rebase
tkonolige 614a4e3
apparently include directories is needed on all targets
tkonolige 8b2e098
fix flag for standalone crt
tkonolige 935d941
remove unnessesary flags?
tkonolige ad0cf23
correctly depend on libbacktrace
tkonolige 54ecb7a
fix overcommit in test
tkonolige 54e69d2
revert layer change
tkonolige 3e6edf8
use float16 for vgg test
tkonolige 9634240
delete vgg ir printing test. it takes too much memory
tkonolige 8ab5d59
only add flags for CXX
tkonolige a734de3
bump stack size on CI
tkonolige 4c9f849
remove bad todo
tkonolige 1799137
switch relay test to tvm so it stops running out of memory
tkonolige c5b9b12
fix workload
tkonolige 7c68da1
Accidentally droped dmlc dep
tkonolige ccbe212
different ulimit change
tkonolige 481461b
finally fix stack overflow
tkonolige f73b7e7
one global backtrace object
tkonolige 2bc5dd1
rename
tkonolige 3ef265f
formatting
tkonolige 70e8d61
formatting
tkonolige 1cd3306
move defines into header for jni
tkonolige 0999ce1
switch to submodule
tkonolige 4711201
Trigger CI
tkonolige File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dmlc-core
updated
19 files
| +4 −3 | .github/workflows/githubci.yml | |
| +6 −1 | CMakeLists.txt | |
| +1 −5 | Makefile | |
| +1 −1 | README.md | |
| +0 −5 | appveyor.yml | |
| +1 −1 | doc/Doxyfile | |
| +2 −2 | doc/parameter.md | |
| +25 −4 | include/dmlc/base.h | |
| +56 −50 | include/dmlc/logging.h | |
| +1 −0 | include/dmlc/omp.h | |
| +5 −33 | include/dmlc/parameter.h | |
| +0 −3 | make/config.mk | |
| +14 −15 | scripts/s390x/Dockerfile | |
| +2 −2 | scripts/test_script.sh | |
| +17 −6 | src/io/hdfs_filesys.cc | |
| +41 −2 | test/unittest/unittest_logging.cc | |
| +0 −11 | test/unittest/unittest_logging_throw.cc | |
| +4 −11 | test/unittest/unittest_param.cc | |
| +6 −8 | test/unittest/unittest_thread_group.cc |
Submodule libbacktrace
added at
08f7c7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,17 +25,13 @@ | |
|
|
||
| #include <fstream> | ||
|
|
||
| /* Enable custom logging - this will cause TVM to pass every log message | ||
| * through CustomLogMessage instead of LogMessage. By enabling this, we must | ||
| * implement dmlc::CustomLogMessage::Log. We use this to pass TVM log | ||
| * messages to Android logcat. | ||
| #define DMLC_USE_LOGGING_LIBRARY <tvm/runtime/logging.h> | ||
| #define TVM_BACKTRACE_DISABLED 1 | ||
| /* Enable custom logging - this will cause TVM to use a custom implementation | ||
| * of tvm::runtime::detail::LogMessage. We use this to pass TVM log messages to | ||
| * Android logcat. | ||
| */ | ||
| #define DMLC_LOG_CUSTOMIZE 1 | ||
|
|
||
| /* Ensure that fatal errors are passed to the logger before throwing | ||
| * in LogMessageFatal | ||
| */ | ||
| #define DMLC_LOG_BEFORE_THROW 1 | ||
| #define TVM_LOG_CUSTOMIZE 1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CC @yzhliu for the android part |
||
|
|
||
| #include "../src/runtime/c_runtime_api.cc" | ||
| #include "../src/runtime/cpu_device_api.cc" | ||
|
|
@@ -72,8 +68,20 @@ | |
|
|
||
| #include <android/log.h> | ||
|
|
||
| void dmlc::CustomLogMessage::Log(const std::string& msg) { | ||
| // This is called for every message logged by TVM. | ||
| // We pass the message to logcat. | ||
| __android_log_write(ANDROID_LOG_DEBUG, "TVM_RUNTIME", msg.c_str()); | ||
| } | ||
| namespace tvm { | ||
| namespace runtime { | ||
| namespace detail { | ||
| // Override logging mechanism | ||
| void LogFatalImpl(const std::string& file, int lineno, const std::string& message) { | ||
| std::string m = file + ":" + std::to_string(lineno) + ": " + message; | ||
| __android_log_write(ANDROID_LOG_DEBUG, "TVM_RUNTIME", m.c_str()); | ||
| throw InternalError(file, lineno, message); | ||
| } | ||
| void LogMessageImpl(const std::string& file, int lineno, const std::string& message) { | ||
| std::string m = file + ":" + std::to_string(lineno) + ": " + message; | ||
| __android_log_write(ANDROID_LOG_DEBUG, "TVM_RUNTIME", m.c_str()); | ||
| } | ||
|
|
||
| } // namespace detail | ||
| } // namespace runtime | ||
| } // namespace tvm | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to define these on the external project for libbacktrace and then when you target_link_libraries to it you will get all of the PUBLIC compile definitions and include directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging libraries are part of TVM, so I think the define should go there.