Currently, we only print how threads involved in data race are created from their parent threads.
Add a runtime flag 'print_full_thread_history' to print thread creation stacks for the threads involved in the data race and their ancestors up to the main thread.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-format: please reformat the code
Please also fix clang-format warnings.
compiler-rt/lib/tsan/rtl/tsan_flags.inc | ||
---|---|---|
84 | Asan has print_full_thread_history flag, use the same name. | |
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp | ||
837 | Can't this be done in 1 loop and w/o worklist? | |
compiler-rt/test/tsan/report_full_thread_create_stack.cpp | ||
41 ↗ | (On Diff #416902) | Please add actual thread numbers. They must be stable, right. |
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp | ||
---|---|---|
830 | Humm... It looks like it's doing a different thing now as compared to the previous version (add one vs all parents). What is the intended behavior? If the current version is wrong, please extend the test to catch it. Tid tid = rep_desc->threads[i]->parent_tid; while (tid != tid == kMainTid && tid != kInvalidTid) { rep.AddThread(tid); tid = ctx->thread_registry.GetThreadLocked(tid)->parent; } |
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp | ||
---|---|---|
830 | emm, I think the code of this version does the same thing as the previous version? |
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp | ||
---|---|---|
830 | Sorry, I misunderstand, I will update patch. |
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp | ||
---|---|---|
830 | You are right. The code is fine as is, no need to change. |
Thanks for your review. I don't have commit accesss, Can you commit this for me? Thanks!
Asan has print_full_thread_history flag, use the same name.