Skip to content

Commit

Permalink
Suppress divergence warnings during 'rr dump'
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed May 4, 2016
1 parent 70108d5 commit c1fcfce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/DumpCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ static void dump_events_matching(TraceReader& trace, const DumpFlags& flags,
while (true) {
TraceReader::MappedData data;
bool found;
KernelMapping km = trace.read_mapped_region(&data, &found);
KernelMapping km =
trace.read_mapped_region(&data, &found, TraceReader::DONT_VALIDATE);
if (!found) {
break;
}
Expand Down Expand Up @@ -223,7 +224,8 @@ static void dump_events_matching(TraceReader& trace, const DumpFlags& flags,
}
while (true) {
TraceReader::MappedData data;
KernelMapping km = trace.read_mapped_region(&data);
KernelMapping km = trace.read_mapped_region(&data, nullptr,
TraceReader::DONT_VALIDATE);
if (km.size() == 0) {
break;
}
Expand Down
5 changes: 3 additions & 2 deletions src/TraceStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ TraceWriter::RecordInTrace TraceWriter::write_mapped_region(
: DONT_RECORD_IN_TRACE;
}

KernelMapping TraceReader::read_mapped_region(MappedData* data, bool* found) {
KernelMapping TraceReader::read_mapped_region(MappedData* data, bool* found,
ValidateSourceFile validate) {
if (found) {
*found = false;
}
Expand Down Expand Up @@ -435,7 +436,7 @@ KernelMapping TraceReader::read_mapped_region(MappedData* data, bool* found) {
if (backing_file_name[0] != '/') {
backing_file_name = dir() + "/" + backing_file_name;
}
if (!is_clone) {
if (!is_clone && validate == VALIDATE) {
struct stat backing_stat;
if (stat(backing_file_name.c_str(), &backing_stat)) {
FATAL() << "Failed to stat " << backing_file_name
Expand Down
4 changes: 3 additions & 1 deletion src/TraceStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ class TraceReader : public TraceStream {
* If |found| is non-null, set *found to indicate whether a descriptor
* was found for the current event.
*/
KernelMapping read_mapped_region(MappedData* data, bool* found = nullptr);
enum ValidateSourceFile { VALIDATE, DONT_VALIDATE };
KernelMapping read_mapped_region(MappedData* data, bool* found = nullptr,
ValidateSourceFile validate = VALIDATE);

/**
* Peek at the next mapping. Returns an empty region if there isn't one for
Expand Down

0 comments on commit c1fcfce

Please sign in to comment.