Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils: Introduce CHECK and DCHECK debugging features
CHECK is same as assert, but dumps stacktrace before stopped. However, DCHECK is only compiled when DEBUG=1 is on in debug mode build. Otherwise, it's simply ignored and doesn't make any overhead. It would be better if we add more assertion like statements with CHECK and DCHECK. Here is the example output. /home/honggyu/work/uftrace/cmds/report.c:98: add_remaining_fstack: CHECK `root' failed. Stack trace: #0 uftrace() [0x40ffed] #1 uftrace() [0x410542] #2 uftrace() [0x410827] #3 uftrace(command_report+0x374) [0x4118d5] #4 uftrace(main+0x4f7) [0x40c7c5] #5 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f1552007830] #6 uftrace(_start+0x29) [0x40a0d9] Please report this uftrace internal bug to https://github.com/namhyung/uftrace/issues Aborted (core dumped) Signed-off-by: Honggyu Kim <[email protected]>
- Loading branch information