I don't think the stat subsystem was ever used since tsan
development in 2012. But it adds lots of code and this
effectively dead code needs to be updated if the runtime
code changes, which adds maintanance cost for no benefit.
Normal profiler usually gives enough info and that info
is more trustworthy.
Remove the stats subsystem.
Details
- Reviewers
vitalybuka melver - Commits
- rGadb55d7c3265: tsan: remove the stats subsystem
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Too bad I missed the few hours between the post of the review and the actual commit.
The stats helped a lot in understanding terrific runtime overhead, that we see for certain OpenMP applications doing massively shared reads (like all threads concurrently read the shared vector in a matrix-vector multiplication). I hope to post a patch for review soon to reduce the runtime overhead in such situations.
Interesting. You recompiled tsan runtime with stats enabled? What exactly did you observe in the stats that allowed you to pinpoint the problem?
Is this problem visible in the normal profile (e.g. perf)? Perf should point to this place as well, and it provides stacks and pointer to the user code that triggers this, and it's much more trustable and actionable (shows actual percent of time spent rather than some abstract numbers). In my experience perf is just a better answer for all situations.