Add config option to disable pt tracing

This commit is contained in:
David Venhoff 2025-09-10 15:33:58 +02:00
parent af1cecbd98
commit b2a71111ab
3 changed files with 25 additions and 4 deletions

View File

@ -249,7 +249,10 @@ pub struct RuntimeConfig {
aux_buffer_size: usize,
/* The path to which nyx logs will be written to from QEMU-Nyx (requires debug mode in QEMU-Nyx) */
nyx_debug_log_path: Option<String>
nyx_debug_log_path: Option<String>,
/* Whether pt tracing will be enabled. */
pt_enabled: bool,
}
impl RuntimeConfig{
@ -261,7 +264,8 @@ impl RuntimeConfig{
debug_mode: false,
worker_id: 0,
aux_buffer_size: DEFAULT_AUX_BUFFER_SIZE,
nyx_debug_log_path: None
nyx_debug_log_path: None,
pt_enabled: true,
}
}
@ -333,7 +337,14 @@ impl RuntimeConfig{
pub fn nyx_debug_log_path(&self) -> Option<&str> {
self.nyx_debug_log_path.as_deref()
}
pub fn set_pt_enabled(&mut self, enabled: bool) {
self.pt_enabled = enabled;
}
pub fn pt_enabled(&self) -> bool {
self.pt_enabled
}
}
#[derive(Clone, Debug)]

View File

@ -108,6 +108,7 @@ impl QemuParams {
fuzzer_config.runtime.aux_buffer_size()
);
nyx_ops += &format!(",dump_pt_trace={}", true);
nyx_ops += &format!(",global_pt_enable={}", fuzzer_config.runtime.pt_enabled());
let mut i = 0;
for filter in fuzzer_config.fuzz.ipt_filters {

View File

@ -99,7 +99,8 @@ impl NyxConfig {
println!(" - input_buffer_size -> {}", self.input_buffer_size());
println!(" - input_buffer_write_protection -> {}", self.input_buffer_write_protection());
println!(" - hprintf_fd -> {}", self.hprintf_fd());
println!(" - process_role: -> {:?}", self.process_role());
println!(" - process_role: -> {:?}", self.process_role());
println!(" - pt_enabled: -> {}", self.pt_enabled());
}
@ -249,6 +250,14 @@ impl NyxConfig {
self.config.runtime.nyx_debug_log_path()
}
pub fn set_pt_enabled(&mut self, enabled: bool) {
self.config.runtime.set_pt_enabled(enabled);
}
pub fn pt_enabled(&self) -> bool {
self.config.runtime.pt_enabled()
}
pub fn dict(&self) -> Vec<Vec<u8>> {
self.config.fuzz.dict.clone()
}