Merge pull request #4523 from Stypox/data-race-tracing
Add tracing to data race functions
This commit is contained in:
commit
70fe61fa07
1 changed files with 6 additions and 0 deletions
|
|
@ -1394,6 +1394,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
GlobalDataRaceHandler::Genmc(genmc_ctx) =>
|
||||
genmc_ctx.memory_load(machine, ptr.addr(), range.size)?,
|
||||
GlobalDataRaceHandler::Vclocks(_data_race) => {
|
||||
let _trace = enter_trace_span!(data_race::before_memory_read);
|
||||
let AllocDataRaceHandler::Vclocks(data_race, weak_memory) = &alloc_extra.data_race
|
||||
else {
|
||||
unreachable!();
|
||||
|
|
@ -1429,6 +1430,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
genmc_ctx.memory_store(machine, ptr.addr(), range.size)?;
|
||||
}
|
||||
GlobalDataRaceHandler::Vclocks(_global_state) => {
|
||||
let _trace = enter_trace_span!(data_race::before_memory_write);
|
||||
let AllocDataRaceHandler::Vclocks(data_race, weak_memory) =
|
||||
&mut alloc_extra.data_race
|
||||
else {
|
||||
|
|
@ -1465,6 +1467,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
GlobalDataRaceHandler::Genmc(genmc_ctx) =>
|
||||
genmc_ctx.handle_dealloc(machine, ptr.addr(), size, align, kind)?,
|
||||
GlobalDataRaceHandler::Vclocks(_global_state) => {
|
||||
let _trace = enter_trace_span!(data_race::before_memory_deallocation);
|
||||
let data_race = alloc_extra.data_race.as_vclocks_mut().unwrap();
|
||||
data_race.write(
|
||||
alloc_id,
|
||||
|
|
@ -1675,6 +1678,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
local: mir::Local,
|
||||
) -> InterpResult<'tcx> {
|
||||
if let Some(data_race) = &frame.extra.data_race {
|
||||
let _trace = enter_trace_span!(data_race::after_local_read);
|
||||
data_race.local_read(local, &ecx.machine);
|
||||
}
|
||||
interp_ok(())
|
||||
|
|
@ -1686,6 +1690,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
storage_live: bool,
|
||||
) -> InterpResult<'tcx> {
|
||||
if let Some(data_race) = &ecx.frame().extra.data_race {
|
||||
let _trace = enter_trace_span!(data_race::after_local_write);
|
||||
data_race.local_write(local, storage_live, &ecx.machine);
|
||||
}
|
||||
interp_ok(())
|
||||
|
|
@ -1708,6 +1713,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
if let Some(data_race) =
|
||||
&machine.threads.active_thread_stack().last().unwrap().extra.data_race
|
||||
{
|
||||
let _trace = enter_trace_span!(data_race::after_local_moved_to_memory);
|
||||
data_race.local_moved_to_memory(
|
||||
local,
|
||||
alloc_info.data_race.as_vclocks_mut().unwrap(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue