Kernel: Track KCOVInstance via Process instead of HashMap

While this clutters Process.cpp a tiny bit, I feel that it's worth it:
- 2x speed on the kcov_loop benchmark. Likely more during fuzzing.
- Overall code complexity is going down with this change.
- By reducing the code reachable from __sanitizer_cov_trace_pc code,
  we can now instrument more code.
This commit is contained in:
Space Meyer
2024-04-08 02:49:15 +02:00
committed by Andrew Kaster
parent 83020a48a8
commit a721e4d507
8 changed files with 92 additions and 117 deletions

View File

@@ -14,7 +14,6 @@
#include <Kernel/Arch/SmapDisabler.h>
#include <Kernel/Arch/TrapFrame.h>
#include <Kernel/Debug.h>
#include <Kernel/Devices/KCOVDevice.h>
#include <Kernel/FileSystem/OpenFileDescription.h>
#include <Kernel/Interrupts/InterruptDisabler.h>
#include <Kernel/KSyms.h>
@@ -441,9 +440,6 @@ void Thread::exit(void* exit_value)
space->deallocate_region(*region);
});
}
#ifdef ENABLE_KERNEL_COVERAGE_COLLECTION
KCOVDevice::free_thread();
#endif
die_if_needed();
}