This is an archive of the discontinued LLVM Phabricator instance.

tsan: Support calling ThreadCreate()/ThreadStart()/ThreadFinish() for non-current thread
AbandonedPublic

Authored by yuri on Nov 22 2018, 9:50 AM.

Details

Reviewers
dvyukov
blastrock
Summary

Currently it is not possible to call any of ThreadCreate()/ThreadStart()/ThreadFinish() with thr argument that is not current thread because of HACKY_CALL() implementation. This removes this limitation by calling TraceSwitch() directly on corresponding code paths.

Only generated code for ThreadContext::OnCreated()/ThreadContext::OnStarted()/ThreadContext::OnFinished() has changed (they became few bytes shorter). There is no any changes in performance-critical functions.

Diff Detail

Event Timeline

yuri created this revision.Nov 22 2018, 9:50 AM
Herald added subscribers: Restricted Project, llvm-commits, kubamracek. · View Herald TranscriptNov 22 2018, 9:50 AM
yuri added a comment.Nov 22 2018, 9:58 AM

I have working implemented of fibers (coroutines) support for thread sanitizer.
Taking in the account that fibers are supported by address sanitizer, support in thread sanitizer may be useful as well.

This is a first patch of the changeset. Please advise, what is the preferred process of reviewing in such cases: submit patches one-by-one or submit the entire changeset?

I have working implemented of fibers (coroutines) support for thread sanitizer.
Taking in the account that fibers are supported by address sanitizer, support in thread sanitizer may be useful as well.

This is a first patch of the changeset. Please advise, what is the preferred process of reviewing in such cases: submit patches one-by-one or submit the entire changeset?

Hi Yuri,

Fibers support sounds great.
Regardless of how we proceed with submitting patches, I would like to see the whole change first. Otherwise it's hard to see reasoning behind individual changes and understand if it's right approach or not.
Please upload whole change into a separate review.

Thanks

yuri added a comment.Nov 26 2018, 2:09 AM

Fibers support sounds great.
Regardless of how we proceed with submitting patches, I would like to see the whole change first. Otherwise it's hard to see reasoning behind individual changes and understand if it's right approach or not.
Please upload whole change into a separate review.

Hi Dmitry,
I have uploaded full code in https://reviews.llvm.org/D54889

Fibers support sounds great.
Regardless of how we proceed with submitting patches, I would like to see the whole change first. Otherwise it's hard to see reasoning behind individual changes and understand if it's right approach or not.
Please upload whole change into a separate review.

Hi Dmitry,
I have uploaded full code in https://reviews.llvm.org/D54889

Thanks. Just to let you know, I am travelling this whole week, don't know yet when I will be able to look at this.

yuri planned changes to this revision.Dec 11 2018, 4:59 AM

Problem solved differently in D54889

yuri abandoned this revision.Dec 11 2018, 5:01 AM