blob: 01e199dcf0ec3b80f6393f72face18bb6c25d0b2 [file] [log] [blame]
Justin Bognerf8d79192014-03-21 17:24:48 +00001//=-- InstrProfReader.cpp - Instrumented profiling reader -------------------=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file contains support for reading profiling data for clang's
11// instrumentation based PGO and coverage.
12//
13//===----------------------------------------------------------------------===//
14
15#include "llvm/ProfileData/InstrProfReader.h"
Justin Bognerb7aa2632014-04-18 21:48:40 +000016#include "InstrProfIndexed.h"
Chandler Carruthd9903882015-01-14 11:23:27 +000017#include "llvm/ProfileData/InstrProf.h"
Justin Bognerf8d79192014-03-21 17:24:48 +000018#include <cassert>
19
20using namespace llvm;
21
Diego Novillofcd55602014-11-03 00:51:45 +000022static ErrorOr<std::unique_ptr<MemoryBuffer>>
23setupMemoryBuffer(std::string Path) {
Rafael Espindolaadf21f22014-07-06 17:43:13 +000024 ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
25 MemoryBuffer::getFileOrSTDIN(Path);
26 if (std::error_code EC = BufferOrErr.getError())
Justin Bognerf8d79192014-03-21 17:24:48 +000027 return EC;
Justin Bogner2b6c5372015-02-18 01:58:17 +000028 return std::move(BufferOrErr.get());
Justin Bognerb7aa2632014-04-18 21:48:40 +000029}
30
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +000031static std::error_code initializeReader(InstrProfReader &Reader) {
Justin Bognerb7aa2632014-04-18 21:48:40 +000032 return Reader.readHeader();
33}
34
Diego Novillofcd55602014-11-03 00:51:45 +000035ErrorOr<std::unique_ptr<InstrProfReader>>
36InstrProfReader::create(std::string Path) {
Justin Bognerb7aa2632014-04-18 21:48:40 +000037 // Set up the buffer to read.
Diego Novillofcd55602014-11-03 00:51:45 +000038 auto BufferOrError = setupMemoryBuffer(Path);
39 if (std::error_code EC = BufferOrError.getError())
Justin Bognerb7aa2632014-04-18 21:48:40 +000040 return EC;
Justin Bogner2b6c5372015-02-18 01:58:17 +000041 return InstrProfReader::create(std::move(BufferOrError.get()));
42}
Justin Bognerf8d79192014-03-21 17:24:48 +000043
Justin Bogner2b6c5372015-02-18 01:58:17 +000044ErrorOr<std::unique_ptr<InstrProfReader>>
45InstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
46 // Sanity check the buffer.
47 if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max())
48 return instrprof_error::too_large;
49
Diego Novillofcd55602014-11-03 00:51:45 +000050 std::unique_ptr<InstrProfReader> Result;
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +000051 // Create the reader.
Justin Bognerb7aa2632014-04-18 21:48:40 +000052 if (IndexedInstrProfReader::hasFormat(*Buffer))
53 Result.reset(new IndexedInstrProfReader(std::move(Buffer)));
54 else if (RawInstrProfReader64::hasFormat(*Buffer))
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +000055 Result.reset(new RawInstrProfReader64(std::move(Buffer)));
56 else if (RawInstrProfReader32::hasFormat(*Buffer))
57 Result.reset(new RawInstrProfReader32(std::move(Buffer)));
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +000058 else
Duncan P. N. Exon Smith4c5b7cb2014-03-21 20:42:34 +000059 Result.reset(new TextInstrProfReader(std::move(Buffer)));
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +000060
Justin Bognerb7aa2632014-04-18 21:48:40 +000061 // Initialize the reader and return the result.
Diego Novillofcd55602014-11-03 00:51:45 +000062 if (std::error_code EC = initializeReader(*Result))
63 return EC;
64
65 return std::move(Result);
Justin Bognerb7aa2632014-04-18 21:48:40 +000066}
67
Justin Bognerab89ed72015-02-16 21:28:58 +000068ErrorOr<std::unique_ptr<IndexedInstrProfReader>>
69IndexedInstrProfReader::create(std::string Path) {
Justin Bognerb7aa2632014-04-18 21:48:40 +000070 // Set up the buffer to read.
Diego Novillofcd55602014-11-03 00:51:45 +000071 auto BufferOrError = setupMemoryBuffer(Path);
72 if (std::error_code EC = BufferOrError.getError())
Justin Bognerb7aa2632014-04-18 21:48:40 +000073 return EC;
Justin Bogner2b6c5372015-02-18 01:58:17 +000074 return IndexedInstrProfReader::create(std::move(BufferOrError.get()));
75}
Justin Bognerb7aa2632014-04-18 21:48:40 +000076
Justin Bogner2b6c5372015-02-18 01:58:17 +000077
78ErrorOr<std::unique_ptr<IndexedInstrProfReader>>
79IndexedInstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
80 // Sanity check the buffer.
81 if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max())
82 return instrprof_error::too_large;
Justin Bognerab89ed72015-02-16 21:28:58 +000083
Justin Bognerb7aa2632014-04-18 21:48:40 +000084 // Create the reader.
85 if (!IndexedInstrProfReader::hasFormat(*Buffer))
86 return instrprof_error::bad_magic;
Justin Bogner2b6c5372015-02-18 01:58:17 +000087 auto Result = llvm::make_unique<IndexedInstrProfReader>(std::move(Buffer));
Justin Bognerb7aa2632014-04-18 21:48:40 +000088
89 // Initialize the reader and return the result.
Justin Bognerab89ed72015-02-16 21:28:58 +000090 if (std::error_code EC = initializeReader(*Result))
91 return EC;
92
93 return std::move(Result);
Justin Bognerf8d79192014-03-21 17:24:48 +000094}
95
96void InstrProfIterator::Increment() {
97 if (Reader->readNextRecord(Record))
98 *this = InstrProfIterator();
99}
100
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000101std::error_code TextInstrProfReader::readNextRecord(InstrProfRecord &Record) {
Justin Bognercf36a362014-07-29 22:29:23 +0000102 // Skip empty lines and comments.
103 while (!Line.is_at_end() && (Line->empty() || Line->startswith("#")))
Justin Bognerf8d79192014-03-21 17:24:48 +0000104 ++Line;
105 // If we hit EOF while looking for a name, we're done.
106 if (Line.is_at_end())
107 return error(instrprof_error::eof);
108
109 // Read the function name.
110 Record.Name = *Line++;
111
112 // Read the function hash.
113 if (Line.is_at_end())
114 return error(instrprof_error::truncated);
115 if ((Line++)->getAsInteger(10, Record.Hash))
116 return error(instrprof_error::malformed);
117
118 // Read the number of counters.
119 uint64_t NumCounters;
120 if (Line.is_at_end())
121 return error(instrprof_error::truncated);
122 if ((Line++)->getAsInteger(10, NumCounters))
123 return error(instrprof_error::malformed);
Justin Bognerb59d7c72014-04-25 02:45:33 +0000124 if (NumCounters == 0)
125 return error(instrprof_error::malformed);
Justin Bognerf8d79192014-03-21 17:24:48 +0000126
127 // Read each counter and fill our internal storage with the values.
128 Counts.clear();
129 Counts.reserve(NumCounters);
130 for (uint64_t I = 0; I < NumCounters; ++I) {
131 if (Line.is_at_end())
132 return error(instrprof_error::truncated);
133 uint64_t Count;
134 if ((Line++)->getAsInteger(10, Count))
135 return error(instrprof_error::malformed);
136 Counts.push_back(Count);
137 }
138 // Give the record a reference to our internal counter storage.
139 Record.Counts = Counts;
140
141 return success();
142}
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000143
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000144template <class IntPtrT>
145static uint64_t getRawMagic();
146
147template <>
148uint64_t getRawMagic<uint64_t>() {
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +0000149 return
Duncan P. N. Exon Smith745a2bf2014-03-21 20:42:37 +0000150 uint64_t(255) << 56 |
151 uint64_t('l') << 48 |
152 uint64_t('p') << 40 |
153 uint64_t('r') << 32 |
154 uint64_t('o') << 24 |
155 uint64_t('f') << 16 |
156 uint64_t('r') << 8 |
157 uint64_t(129);
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +0000158}
159
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000160template <>
161uint64_t getRawMagic<uint32_t>() {
162 return
163 uint64_t(255) << 56 |
164 uint64_t('l') << 48 |
165 uint64_t('p') << 40 |
166 uint64_t('r') << 32 |
167 uint64_t('o') << 24 |
168 uint64_t('f') << 16 |
169 uint64_t('R') << 8 |
170 uint64_t(129);
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +0000171}
172
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000173template <class IntPtrT>
174bool RawInstrProfReader<IntPtrT>::hasFormat(const MemoryBuffer &DataBuffer) {
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000175 if (DataBuffer.getBufferSize() < sizeof(uint64_t))
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000176 return false;
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000177 uint64_t Magic =
178 *reinterpret_cast<const uint64_t *>(DataBuffer.getBufferStart());
179 return getRawMagic<IntPtrT>() == Magic ||
Artyom Skrobovef5e8672014-06-14 11:36:01 +0000180 sys::getSwappedBytes(getRawMagic<IntPtrT>()) == Magic;
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000181}
182
183template <class IntPtrT>
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000184std::error_code RawInstrProfReader<IntPtrT>::readHeader() {
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +0000185 if (!hasFormat(*DataBuffer))
186 return error(instrprof_error::bad_magic);
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000187 if (DataBuffer->getBufferSize() < sizeof(RawHeader))
Duncan P. N. Exon Smith531bb482014-03-21 20:42:28 +0000188 return error(instrprof_error::bad_header);
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000189 auto *Header =
190 reinterpret_cast<const RawHeader *>(DataBuffer->getBufferStart());
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000191 ShouldSwapBytes = Header->Magic != getRawMagic<IntPtrT>();
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000192 return readHeader(*Header);
193}
194
Justin Bognera119f322014-05-16 00:38:00 +0000195template <class IntPtrT>
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000196std::error_code
197RawInstrProfReader<IntPtrT>::readNextHeader(const char *CurrentPos) {
Justin Bognera119f322014-05-16 00:38:00 +0000198 const char *End = DataBuffer->getBufferEnd();
199 // Skip zero padding between profiles.
200 while (CurrentPos != End && *CurrentPos == 0)
201 ++CurrentPos;
202 // If there's nothing left, we're done.
203 if (CurrentPos == End)
204 return instrprof_error::eof;
205 // If there isn't enough space for another header, this is probably just
206 // garbage at the end of the file.
207 if (CurrentPos + sizeof(RawHeader) > End)
208 return instrprof_error::malformed;
Justin Bogner54b11282014-09-12 21:22:55 +0000209 // The writer ensures each profile is padded to start at an aligned address.
210 if (reinterpret_cast<size_t>(CurrentPos) % alignOf<uint64_t>())
211 return instrprof_error::malformed;
Justin Bognera119f322014-05-16 00:38:00 +0000212 // The magic should have the same byte order as in the previous header.
213 uint64_t Magic = *reinterpret_cast<const uint64_t *>(CurrentPos);
214 if (Magic != swap(getRawMagic<IntPtrT>()))
215 return instrprof_error::bad_magic;
216
217 // There's another profile to read, so we need to process the header.
218 auto *Header = reinterpret_cast<const RawHeader *>(CurrentPos);
219 return readHeader(*Header);
220}
221
Duncan P. N. Exon Smith09a67f42014-03-21 20:42:31 +0000222static uint64_t getRawVersion() {
223 return 1;
224}
225
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000226template <class IntPtrT>
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000227std::error_code
228RawInstrProfReader<IntPtrT>::readHeader(const RawHeader &Header) {
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000229 if (swap(Header.Version) != getRawVersion())
230 return error(instrprof_error::unsupported_version);
231
232 CountersDelta = swap(Header.CountersDelta);
233 NamesDelta = swap(Header.NamesDelta);
234 auto DataSize = swap(Header.DataSize);
235 auto CountersSize = swap(Header.CountersSize);
236 auto NamesSize = swap(Header.NamesSize);
237
238 ptrdiff_t DataOffset = sizeof(RawHeader);
239 ptrdiff_t CountersOffset = DataOffset + sizeof(ProfileData) * DataSize;
240 ptrdiff_t NamesOffset = CountersOffset + sizeof(uint64_t) * CountersSize;
Justin Bognera119f322014-05-16 00:38:00 +0000241 size_t ProfileSize = NamesOffset + sizeof(char) * NamesSize;
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000242
Justin Bognera119f322014-05-16 00:38:00 +0000243 auto *Start = reinterpret_cast<const char *>(&Header);
244 if (Start + ProfileSize > DataBuffer->getBufferEnd())
Duncan P. N. Exon Smith531bb482014-03-21 20:42:28 +0000245 return error(instrprof_error::bad_header);
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000246
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000247 Data = reinterpret_cast<const ProfileData *>(Start + DataOffset);
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000248 DataEnd = Data + DataSize;
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000249 CountersStart = reinterpret_cast<const uint64_t *>(Start + CountersOffset);
250 NamesStart = Start + NamesOffset;
Justin Bognera119f322014-05-16 00:38:00 +0000251 ProfileEnd = Start + ProfileSize;
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000252
253 return success();
254}
255
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000256template <class IntPtrT>
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000257std::error_code
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000258RawInstrProfReader<IntPtrT>::readNextRecord(InstrProfRecord &Record) {
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000259 if (Data == DataEnd)
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000260 if (std::error_code EC = readNextHeader(ProfileEnd))
Justin Bognera119f322014-05-16 00:38:00 +0000261 return EC;
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000262
263 // Get the raw data.
264 StringRef RawName(getName(Data->NamePtr), swap(Data->NameSize));
Justin Bognerb59d7c72014-04-25 02:45:33 +0000265 uint32_t NumCounters = swap(Data->NumCounters);
266 if (NumCounters == 0)
267 return error(instrprof_error::malformed);
268 auto RawCounts = makeArrayRef(getCounter(Data->CounterPtr), NumCounters);
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000269
270 // Check bounds.
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000271 auto *NamesStartAsCounter = reinterpret_cast<const uint64_t *>(NamesStart);
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000272 if (RawName.data() < NamesStart ||
273 RawName.data() + RawName.size() > DataBuffer->getBufferEnd() ||
274 RawCounts.data() < CountersStart ||
Duncan P. N. Exon Smithd7d83472014-03-24 00:47:18 +0000275 RawCounts.data() + RawCounts.size() > NamesStartAsCounter)
Duncan P. N. Exon Smith24b4b652014-03-21 18:26:05 +0000276 return error(instrprof_error::malformed);
277
278 // Store the data in Record, byte-swapping as necessary.
279 Record.Hash = swap(Data->FuncHash);
280 Record.Name = RawName;
281 if (ShouldSwapBytes) {
282 Counts.clear();
283 Counts.reserve(RawCounts.size());
284 for (uint64_t Count : RawCounts)
285 Counts.push_back(swap(Count));
286 Record.Counts = Counts;
287 } else
288 Record.Counts = RawCounts;
289
290 // Iterate.
291 ++Data;
292 return success();
293}
Duncan P. N. Exon Smith46803612014-03-23 03:38:12 +0000294
295namespace llvm {
296template class RawInstrProfReader<uint32_t>;
297template class RawInstrProfReader<uint64_t>;
298}
Justin Bognerb7aa2632014-04-18 21:48:40 +0000299
Justin Bognerb5d368e2014-04-18 22:00:22 +0000300InstrProfLookupTrait::hash_value_type
301InstrProfLookupTrait::ComputeHash(StringRef K) {
302 return IndexedInstrProf::ComputeHash(HashType, K);
303}
304
Justin Bognerb7aa2632014-04-18 21:48:40 +0000305bool IndexedInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
306 if (DataBuffer.getBufferSize() < 8)
307 return false;
308 using namespace support;
309 uint64_t Magic =
310 endian::read<uint64_t, little, aligned>(DataBuffer.getBufferStart());
311 return Magic == IndexedInstrProf::Magic;
312}
313
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000314std::error_code IndexedInstrProfReader::readHeader() {
Aaron Ballmana7c9ed52014-05-01 17:16:24 +0000315 const unsigned char *Start =
316 (const unsigned char *)DataBuffer->getBufferStart();
Justin Bognerb7aa2632014-04-18 21:48:40 +0000317 const unsigned char *Cur = Start;
Aaron Ballmana7c9ed52014-05-01 17:16:24 +0000318 if ((const unsigned char *)DataBuffer->getBufferEnd() - Cur < 24)
Justin Bognerb7aa2632014-04-18 21:48:40 +0000319 return error(instrprof_error::truncated);
320
321 using namespace support;
322
323 // Check the magic number.
324 uint64_t Magic = endian::readNext<uint64_t, little, unaligned>(Cur);
325 if (Magic != IndexedInstrProf::Magic)
326 return error(instrprof_error::bad_magic);
327
328 // Read the version.
Justin Bogner821d7472014-08-01 22:50:07 +0000329 FormatVersion = endian::readNext<uint64_t, little, unaligned>(Cur);
330 if (FormatVersion > IndexedInstrProf::Version)
Justin Bognerb7aa2632014-04-18 21:48:40 +0000331 return error(instrprof_error::unsupported_version);
332
333 // Read the maximal function count.
334 MaxFunctionCount = endian::readNext<uint64_t, little, unaligned>(Cur);
335
336 // Read the hash type and start offset.
337 IndexedInstrProf::HashT HashType = static_cast<IndexedInstrProf::HashT>(
338 endian::readNext<uint64_t, little, unaligned>(Cur));
339 if (HashType > IndexedInstrProf::HashT::Last)
340 return error(instrprof_error::unsupported_hash_type);
341 uint64_t HashOffset = endian::readNext<uint64_t, little, unaligned>(Cur);
342
343 // The rest of the file is an on disk hash table.
344 Index.reset(InstrProfReaderIndex::Create(Start + HashOffset, Cur, Start,
345 InstrProfLookupTrait(HashType)));
346 // Set up our iterator for readNextRecord.
347 RecordIterator = Index->data_begin();
348
349 return success();
350}
351
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000352std::error_code IndexedInstrProfReader::getFunctionCounts(
Justin Bogner821d7472014-08-01 22:50:07 +0000353 StringRef FuncName, uint64_t FuncHash, std::vector<uint64_t> &Counts) {
354 auto Iter = Index->find(FuncName);
Justin Bognerb7aa2632014-04-18 21:48:40 +0000355 if (Iter == Index->end())
356 return error(instrprof_error::unknown_function);
357
Justin Bogner821d7472014-08-01 22:50:07 +0000358 // Found it. Look for counters with the right hash.
359 ArrayRef<uint64_t> Data = (*Iter).Data;
360 uint64_t NumCounts;
361 for (uint64_t I = 0, E = Data.size(); I != E; I += NumCounts) {
362 // The function hash comes first.
363 uint64_t FoundHash = Data[I++];
364 // In v1, we have at least one count. Later, we have the number of counts.
365 if (I == E)
366 return error(instrprof_error::malformed);
367 NumCounts = FormatVersion == 1 ? E - I : Data[I++];
368 // If we have more counts than data, this is bogus.
369 if (I + NumCounts > E)
370 return error(instrprof_error::malformed);
371 // Check for a match and fill the vector if there is one.
372 if (FoundHash == FuncHash) {
373 Counts = Data.slice(I, NumCounts);
374 return success();
375 }
376 }
377 return error(instrprof_error::hash_mismatch);
Justin Bognerb7aa2632014-04-18 21:48:40 +0000378}
379
Rafael Espindoladb4ed0b2014-06-13 02:24:39 +0000380std::error_code
381IndexedInstrProfReader::readNextRecord(InstrProfRecord &Record) {
Justin Bognerb7aa2632014-04-18 21:48:40 +0000382 // Are we out of records?
383 if (RecordIterator == Index->data_end())
384 return error(instrprof_error::eof);
385
Justin Bogner821d7472014-08-01 22:50:07 +0000386 // Record the current function name.
387 Record.Name = (*RecordIterator).Name;
388
389 ArrayRef<uint64_t> Data = (*RecordIterator).Data;
390 // Valid data starts with a hash and either a count or the number of counts.
391 if (CurrentOffset + 1 > Data.size())
Justin Bognerb7aa2632014-04-18 21:48:40 +0000392 return error(instrprof_error::malformed);
Justin Bogner821d7472014-08-01 22:50:07 +0000393 // First we have a function hash.
394 Record.Hash = Data[CurrentOffset++];
395 // In version 1 we knew the number of counters implicitly, but in newer
396 // versions we store the number of counters next.
397 uint64_t NumCounts =
398 FormatVersion == 1 ? Data.size() - CurrentOffset : Data[CurrentOffset++];
399 if (CurrentOffset + NumCounts > Data.size())
400 return error(instrprof_error::malformed);
401 // And finally the counts themselves.
402 Record.Counts = Data.slice(CurrentOffset, NumCounts);
403
404 // If we've exhausted this function's data, increment the record.
405 CurrentOffset += NumCounts;
406 if (CurrentOffset == Data.size()) {
407 ++RecordIterator;
408 CurrentOffset = 0;
409 }
410
Justin Bognerb7aa2632014-04-18 21:48:40 +0000411 return success();
412}