Skip to content

Commit

Permalink
Avoid failing in syscall_mix for traces without syscall markers (#6440)
Browse files Browse the repository at this point in the history
Removes the check for trace file type that fails for older traces that
do not have the syscall marker. It is better to simply report zero
counts than to fail with a fatal error.
  • Loading branch information
abhinav92003 authored Nov 16, 2023
1 parent 56c6b0f commit e32b2c1
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions clients/drcachesim/tools/syscall_mix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,14 @@ bool
syscall_mix_t::parallel_shard_memref(void *shard_data, const memref_t &memref)
{
shard_data_t *shard = reinterpret_cast<shard_data_t *>(shard_data);
if (memref.marker.type != TRACE_TYPE_MARKER)
if (memref.marker.type != TRACE_TYPE_MARKER ||
memref.marker.marker_type != TRACE_MARKER_TYPE_SYSCALL)
return true;
switch (memref.marker.marker_type) {
case TRACE_MARKER_TYPE_FILETYPE:
if (!TESTANY(OFFLINE_FILE_TYPE_SYSCALL_NUMBERS, memref.marker.marker_value)) {
shard->error = "Trace does not have TRACE_MARKER_TYPE_SYSCALL markers.";
return false;
}
break;
case TRACE_MARKER_TYPE_SYSCALL: {
int syscall_num = static_cast<int>(memref.marker.marker_value);
int syscall_num = static_cast<int>(memref.marker.marker_value);
#ifdef X64
assert(static_cast<uintptr_t>(syscall_num) == memref.marker.marker_value);
assert(static_cast<uintptr_t>(syscall_num) == memref.marker.marker_value);
#endif
++shard->syscall_counts[syscall_num];
break;
}
default: break;
}
++shard->syscall_counts[syscall_num];
return true;
}

Expand Down

0 comments on commit e32b2c1

Please sign in to comment.