Lines Matching refs:SID

43 // Segment ID (SID)      is in range [1, kMaxSID-1]
228 class SID: public ID {
230 explicit SID(T id) : ID(id) {}
231 SID() : ID(0) {}
267 explicit SSID(SID sid) : ID(sid.raw()) {}
276 SID GetSingleton() const {
278 return SID(raw());
401 static uint32_t combine2(SSID a, SID b) {
1707 static bool ProfileSeg(SID sid) {
1721 static INLINE uintptr_t *embedded_stack_trace(SID sid) {
1731 static void ensure_space_for_stack_trace(SID sid) {
1748 static string StackTraceString(SID sid) {
1755 static INLINE void AllocateFreshSegments(size_t n, SID *fresh_sids) {
1763 SID sid = reusable_sids_->back();
1771 Printf("Segment: reused SID %d\n", sid.raw());
1786 if (ProfileSeg(SID(n_segments_))) {
1787 Printf("Segment: allocated SID %d\n", n_segments_);
1790 SID sid = fresh_sids[i] = SID(n_segments_);
1799 static INLINE void SetupFreshSid(SID sid, TID tid, VTS *vts,
1818 static INLINE SID AddNewSegment(TID tid, VTS *vts,
1821 SID sid;
1827 static bool Alive(SID sid) {
1832 static void AssertLive(SID sid, int line) {
1848 static INLINE Segment *Get(SID sid) {
1856 static INLINE void RecycleOneFreshSid(SID sid) {
1862 Printf("Segment: recycled SID %d\n", sid.raw());
1866 static bool RecycleOneSid(SID sid) {
1881 static void INLINE Ref(SID sid, const char *where) {
1891 static INLINE intptr_t UnrefNoRecycle(SID sid, const char *where) {
1900 static void INLINE Unref(SID sid, const char *where) {
1913 static string ToString(SID sid) {
1919 static string ToStringTidOnly(SID sid) {
1925 static string ToStringWithLocks(SID sid) {
1934 static bool INLINE HappensBeforeOrSameThread(SID a, SID b) {
1940 static bool INLINE HappensBefore(SID a, SID b) {
1967 Segment *seg = GetInternal(SID(i));
2003 reusable_sids_ = new vector<SID>;
2010 static INLINE Segment *GetInternal(SID sid) {
2040 static vector<SID> *reusable_sids_;
2047 vector<SID> *Segment::reusable_sids_;
2052 static NOINLINE SSID AddSegmentToSS(SSID old_ssid, SID new_sid);
2053 static NOINLINE SSID RemoveSegmentFromSS(SSID old_ssid, SID sid_to_remove);
2055 static INLINE SSID AddSegmentToTupleSS(SSID ssid, SID new_sid);
2056 static INLINE SSID RemoveSegmentFromTupleSS(SSID old_ssid, SID sid_to_remove);
2114 SID sid = this->GetSID(i);
2203 return "{" + Segment::ToStringTidOnly(SID(ssid.raw())) + "}";
2240 SID GetSID(int32_t i) const {
2246 void SetSID(int32_t i, SID sid) {
2252 static SID GetSID(SSID ssid, int32_t i, int line) {
2260 SID sid = Get(ssid)->GetSID(i);
2266 static bool INLINE Contains(SSID ssid, SID seg) {
2275 SID sid = ss->GetSID(i);
2304 // sids_ are filled with zeroes due to SID default CTOR.
2323 DCHECK(sizeof(int32_t) == sizeof(SID));
2336 res_ss->sids_[i] = SID(0);
2350 SID sid = ss->GetSID(i);
2380 static INLINE SSID DoubletonSSID(SID sid1, SID sid2) {
2388 static SegmentSet *AddSegmentToTupleSS(SegmentSet *ss, SID new_sid) {
2394 static SegmentSet *Doubleton(SID sid1, SID sid2) {
2405 SID sid1 = ss1->sids_[i],
2419 SID sid1 = ss1->sids_[i],
2511 typedef PairCache<SSID, SID, SSID, 1009, 1> SsidSidToSidCache;
2517 SID sids_[kMaxSegmentSetSize];
2531 SSID SegmentSet::RemoveSegmentFromSS(SSID old_ssid, SID sid_to_remove) {
2542 SID sid = old_ssid.GetSingleton();
2562 SSID SegmentSet::AddSegmentToSS(SSID old_ssid, SID new_sid) {
2573 SID old_sid(old_ssid.raw());
2585 // The new segment is in the same thread - just replace the SID.
2591 // happens before the new one - just replace the SID.
2613 SID old_sid(old_ssid.raw());
2633 SSID SegmentSet::RemoveSegmentFromTupleSS(SSID ssid, SID sid_to_remove) {
2641 SID * tmp_sids = tmp.sids_;
2642 CHECK(sizeof(int32_t) == sizeof(SID));
2645 SID sid = ss->GetSID(i);
2666 SSID SegmentSet::AddSegmentToTupleSS(SSID ssid, SID new_sid) {
2677 SID tmp_sids[kMaxSegmentSetSize + 1];
2678 CHECK(sizeof(int32_t) == sizeof(SID));
2680 // traverse all SID in current ss. tids are ordered.
2682 SID sid = ss->GetSID(i);
2737 SID sid = tmp_sids[i];
2773 SID sid1 = GetSID(i);
2778 SID sid2 = GetSID(j);
2807 SID sid = GetSID(ssid, i, __LINE__);
2818 SID sid = GetSID(i);
2831 SID sid1 = Segment::AddNewSegment(TID(0), VTS::Parse("[0:2;]"), ls, ls);
2832 SID sid2 = Segment::AddNewSegment(TID(1), VTS::Parse("[0:1; 1:1]"), ls, ls);
2833 SID sid3 = Segment::AddNewSegment(TID(2), VTS::Parse("[0:1; 2:1]"), ls, ls);
2834 SID sid4 = Segment::AddNewSegment(TID(3), VTS::Parse("[0:1; 3:1]"), ls, ls);
2835 SID sid5 = Segment::AddNewSegment(TID(4), VTS::Parse("[0:3; 2:2; 3:2;]"),
2837 SID sid6 = Segment::AddNewSegment(TID(4), VTS::Parse("[0:3; 1:2; 2:2; 3:2;]"),
3498 set <SID> all_sids;
3502 SID sid = SegmentSet::GetSID(*it, i, __LINE__);
3508 if (Segment::ProfileSeg(SID(i)) && all_sids.count(SID(i)) == 0) {
3509 // Printf("Segment SID %d: missing in storage; ref=%d\n", i,
3510 // Segment::Get(SID(i))->ref_count());
3815 SID last_access_sid;
3966 void Push(SID sid) {
3976 INLINE SID Search(CallStack *curr_stack,
3977 SID curr_sid, /*OUT*/ bool *needs_refill) {
3981 deque<SID>::iterator it = queue_.begin();
3983 SID sid = *it;
4015 return SID();
4021 SID sid = queue_.back();
4027 deque<SID> queue_;
4395 SID sid() const {
4676 SID new_sid = Segment::AddNewSegment(tid(), new_vts,
4678 SID old_sid = sid();
4696 SID old_sid = sid();
4728 GetSomeFreshSids(); // fill the thread-local SID cache.
4740 SID match = recent_segments_cache_.Search(call_stack_, sid(),
4759 SID fresh_sid = fresh_sids_.back();
5097 thr->sid_ = SID(); // Reset the old SID so we don't try to read its VTS.
5136 // When creating a new segment on SBLOCK_ENTER, we need to get a fresh SID
5141 INLINE void AddDeadSid(SID sid, const char *where) {
5155 SID sid = dead_sids_[i];
5193 SID sid_; // Current segment ID.
5221 vector<SID> dead_sids_;
5222 vector<SID> fresh_sids_;
5433 SID sid;
5772 void PrintConcurrentSegmentSet(SSID ssid, TID tid, SID sid,
5775 set<SID>* concurrent_sids) {
5780 SID concurrent_sid = SegmentSet::GetSID(ssid, s, __LINE__);
5831 string RaceInfoString(uintptr_t pc, set<SID>& concurrent_sids) {
5836 for (set<SID>::iterator it = concurrent_sids.begin();
5856 SID sid = race->last_access_sid;
5900 set<SID> concurrent_sids;
6904 SID w1_sid = SegmentSet::GetSID(wr_ssid, w1, __LINE__);
6921 SID r_sid = SegmentSet::GetSID(rd_ssid, r, __LINE__);
6944 SID cur_sid = thr->sid();
7009 SID cur_sid = thr->sid();
7014 SID wr_sid = wr_ssid.GetSingleton();
7047 SID rd_sid = rd_ssid.GetSingleton();
7078 SID wr_sid = wr_ssid.GetSingleton();
7193 SID sid = ssid.GetSingleton();