-
Notifications
You must be signed in to change notification settings - Fork 13
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
Reduce analysis cost after detected race #16
Comments
Good thoughts! Yes this would be a faster alternative to the current race reduction angle. Two things concern me a bit, none of which is fundamental to the proposal but important regardless for archer at this stage.
Maybe we can learn about the well-knwon reduction criteria using the current work and then use that lessons to do high speed reduction like you proposed here (once that problem is understood) Dong |
@jprotze , trying to understand your proposal here. Is it that you're suggesting that we analyse the log rather than tsan analysing memory accesses for portions of code where it's earmarked as racy region? I'd once worked on a project(LLVM pass) which generated a trace report of a multi threaded code. One of the issues that I faced at that time were that, because of race conditions, the trace report was distorted only to be handled afterwards. But isn't doing all this and then analysing this a significant cost? I understand that it'll be faster but how significant will the gains be? Hope I've understood the proposal correctly and I'm asking the right questions. Thank you, |
@SumedhArani: I think the main distinction is on-the-fly duplicate detection vs. post mortem detection. As I mentioned above, I think this optimization can be done later once we understand what constitutes "duplicates" using your technique. |
Ohh! When you mentioned current work, I thought you ( @dongahn ) were referring to the work being done in the research field regarding reduction. |
No, that's your topic now :-) |
@dongahn @jprotze I think I solved the problem of overriding the weak symbol of @SumedhArani created a new static library redefining
I already modified the Compiling in this way tsan calls our
So, what @SumedhArani did was correct, we just needed the right flag for compiling, now that we found the solution he can actually integrate the race reduction on archer! :) Also looking at the there are utility functions such as:
Maybe we can use those to extract the information we need for the reduction from the pointer @SumedhArani as I said previously I created a new branch called
Let me know if all this makes sense, we can talk on Slack if further clarification is needed. |
@simoatze: out of curiosity, was __tsan_on_report already a weak symbol? Or does this need to bring in our own locally modified TSan runtime library? It seems this is are various hooks into "on events" If this is these hooks, it seems we can indeed have good mileage! I think the reduction features can be incorporated as an Archer option. ARCHER_OPTIONS="group_by=pc" This can be read by Archer init function which can also set and modify relevant TSAN options such as log_path. It seems it is okay to generate both TSan report and Archer summary report together though. Maybe, we first report ==== ARCHER SUMMARY ==== Original TSAN Report In any case group_by can later be extended to cover other aggregation criteria. |
@dongahn: __tsan_on_report is already weak on tsan, but seems that weak symbols don't work in the same way with static library, that's why we need this workaround. |
Your approach seems great to me! Thank you for looking into this. I know you are super busy. |
Afaik, weak symbol just avoids that you get linker error for duplicate implementation when linking static libraries. |
But linking libarcher before tsan would break our fallback implementation of tsan annotations in libarcher. |
That's what I know too and I tried to change the order, it didn't work. |
I'm not sure, but I think, the posts of last 24h were on #11 ? @SumedhArani My intention in this issue was to binary patch
would become
|
I know the discussions on this thread have digressed and should have rather been on #13 Your intent for this issue was to not do logging rather than that of on the fly reduction. Right? If I'm getting you correct, you've demonstrated above that instead of sending it to tsan reporting routine, we should rather have a "nop" at runtime and rather log it. Correct @jprotze ? Thanks! |
@jprotze I see, how would you do that? With dyninst? |
Well... I don't understand. If there is a hook for "on report", why do we need to do a binary patch? What is the current library linking order and what order is not working and for what case again? |
Identifying duplicates in data race reports is quite expensive regarding time.
It should be possible to reduce this cost by applying only logging, but no analysis for memory accesses, that were identified as racy code.
The idea would be:
This will reduce analysis cost to detect duplicates and reduce output about races between other threads.
A potential issue of this approach is, that TSan potentially will not report races that this memory access has with other code regions. That means, more iterations of fixing code and running TSan might be needed.
The text was updated successfully, but these errors were encountered: