Lines Matching full:part
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
80 TracePart* part = nullptr; in TracePartAlloc() local
87 part = ctx->trace_part_recycle.PopFront(); in TracePartAlloc()
88 DPrintf("#%d: TracePartAlloc: part=%p\n", thr->tid, part); in TracePartAlloc()
89 if (part && part->trace) { in TracePartAlloc()
90 Trace* trace1 = part->trace; in TracePartAlloc()
92 part->trace = nullptr; in TracePartAlloc()
94 CHECK_EQ(part, part1); in TracePartAlloc()
107 if (!part) in TracePartAlloc()
112 if (!part) in TracePartAlloc()
113 part = new (MmapOrDie(sizeof(*part), "TracePart")) TracePart(); in TracePartAlloc()
114 return part; in TracePartAlloc()
117 static void TracePartFree(TracePart* part) SANITIZER_REQUIRES(ctx->slot_mtx) { in TracePartFree() argument
118 DCHECK(part->trace); in TracePartFree()
119 part->trace = nullptr; in TracePartFree()
120 ctx->trace_part_recycle.PushFront(part); in TracePartFree()
125 while (auto* part = ctx->trace_part_recycle.PopFront()) { in TraceResetForTesting() local
126 if (auto trace = part->trace) in TraceResetForTesting()
127 CHECK_EQ(trace->parts.PopFront(), part); in TraceResetForTesting()
128 UnmapOrDie(part, sizeof(*part)); in TraceResetForTesting()
155 auto part = parts->Front(); in DoResetImpl() local
156 local = local || part == trace->local_head; in DoResetImpl()
158 CHECK(!ctx->trace_part_recycle.Queued(part)); in DoResetImpl()
160 ctx->trace_part_recycle.Remove(part); in DoResetImpl()
162 // The thread is running and this is the last/current part. in DoResetImpl()
163 // Set the trace position to the end of the current part in DoResetImpl()
165 // to a new slot and allocate a new trace part. in DoResetImpl()
168 // within this part, because switching parts is protected by in DoResetImpl()
172 reinterpret_cast<uptr>(&part->events[TracePart::kSize])); in DoResetImpl()
175 parts->Remove(part); in DoResetImpl()
176 TracePartFree(part); in DoResetImpl()
325 TracePart* part = nullptr; in SlotDetachImpl() local
334 part = parts->PopFront(); in SlotDetachImpl()
339 if (part) { in SlotDetachImpl()
341 TracePartFree(part); in SlotDetachImpl()
913 auto *part = trace->parts.Back(); in TraceSkipGap() local
915 trace, trace->parts.Front(), part, pos); in TraceSkipGap()
916 if (!part) in TraceSkipGap()
918 // We can get here when we still have space in the current trace part. in TraceSkipGap()
920 // the part. Check if we are indeed at the end of the current part or not, in TraceSkipGap()
922 Event* end = &part->events[TracePart::kSize]; in TraceSkipGap()
923 DCHECK_GE(pos, &part->events[0]); in TraceSkipGap()
946 TracePart* part = thr->tctx->trace.parts.Back(); in TraceSwitchPart() local
947 if (part) { in TraceSwitchPart()
949 reinterpret_cast<uptr>(&part->events[0])); in TraceSwitchPart()
960 TracePart* part = TracePartAlloc(thr); in TraceSwitchPartImpl() local
961 part->trace = trace; in TraceSwitchPartImpl()
970 trace->local_head = part; in TraceSwitchPartImpl()
975 trace->parts.PushBack(part); in TraceSwitchPartImpl()
977 reinterpret_cast<uptr>(&part->events[0])); in TraceSwitchPartImpl()
979 // Make this part self-sufficient by restoring the current stack in TraceSwitchPartImpl()
983 // Pathologically large stacks may not fit into the part. in TraceSwitchPartImpl()
986 // Check that kMaxFrames won't consume the whole part. in TraceSwitchPartImpl()
1004 // filled the trace part exactly up to the TracePart::kAlignment gap in TraceSwitchPartImpl()