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.
81 TracePart* part = nullptr;
88 part = ctx->trace_part_recycle.PopFront();
89 DPrintf("#%d: TracePartAlloc: part=%p\n", thr->tid, part);
90 if (part && part->trace) {
91 Trace* trace1 = part->trace;
93 part->trace = nullptr;
95 CHECK_EQ(part, part1);
108 if (!part)
113 if (!part)
114 part = new (MmapOrDie(sizeof(*part), "TracePart")) TracePart();
115 return part;
118 static void TracePartFree(TracePart* part) SANITIZER_REQUIRES(ctx->slot_mtx) {
119 DCHECK(part->trace);
120 part->trace = nullptr;
121 ctx->trace_part_recycle.PushFront(part);
126 while (auto* part = ctx->trace_part_recycle.PopFront()) {
127 if (auto trace = part->trace)
128 CHECK_EQ(trace->parts.PopFront(), part);
129 UnmapOrDie(part, sizeof(*part));
156 auto part = parts->Front();
157 local = local || part == trace->local_head;
159 CHECK(!ctx->trace_part_recycle.Queued(part));
161 ctx->trace_part_recycle.Remove(part);
163 // The thread is running and this is the last/current part.
164 // Set the trace position to the end of the current part
166 // to a new slot and allocate a new trace part.
169 // within this part, because switching parts is protected by
173 reinterpret_cast<uptr>(&part->events[TracePart::kSize]));
176 parts->Remove(part);
177 TracePartFree(part);
326 TracePart* part = nullptr;
335 part = parts->PopFront();
340 if (part) {
342 TracePartFree(part);
917 auto *part = trace->parts.Back();
919 trace, trace->parts.Front(), part, pos);
920 if (!part)
922 // We can get here when we still have space in the current trace part.
924 // the part. Check if we are indeed at the end of the current part or not,
926 Event* end = &part->events[TracePart::kSize];
927 DCHECK_GE(pos, &part->events[0]);
950 TracePart* part = thr->tctx->trace.parts.Back();
951 if (part) {
953 reinterpret_cast<uptr>(&part->events[0]));
964 TracePart* part = TracePartAlloc(thr);
965 part->trace = trace;
974 trace->local_head = part;
979 trace->parts.PushBack(part);
981 reinterpret_cast<uptr>(&part->events[0]));
983 // Make this part self-sufficient by restoring the current stack
987 // Pathologically large stacks may not fit into the part.
990 // Check that kMaxFrames won't consume the whole part.
1008 // filled the trace part exactly up to the TracePart::kAlignment gap