diff --git a/examples/c/main.c b/examples/c/main.c index 90040dc..4eb5f10 100644 --- a/examples/c/main.c +++ b/examples/c/main.c @@ -22,6 +22,6 @@ void main() { func1(); func1(); func1(); - rftrace_dump_full_uftrace(events, "tracedir", "test", true); + rftrace_dump_full_uftrace(events, "tracedir", "test"); } \ No newline at end of file diff --git a/examples/hermitc/main.c b/examples/hermitc/main.c index 3230bc1..ab522fb 100644 --- a/examples/hermitc/main.c +++ b/examples/hermitc/main.c @@ -22,7 +22,7 @@ void main() { func1(); func1(); func1(); - rftrace_dump_full_uftrace(events, "/tracedir", "example", false); + rftrace_dump_full_uftrace(events, "/tracedir", "example"); } diff --git a/examples/hermitrust/src/main.rs b/examples/hermitrust/src/main.rs index 7726035..a14d500 100755 --- a/examples/hermitrust/src/main.rs +++ b/examples/hermitrust/src/main.rs @@ -22,7 +22,7 @@ fn main() { .expect("Time went backwards"); println!("Duration: {:?}", duration); - rftrace::dump_full_uftrace(events, "/tracedir", "test", false).expect(""); + rftrace::dump_full_uftrace(events, "/tracedir", "test").expect(""); } fn test1() { diff --git a/examples/rust/src/main.rs b/examples/rust/src/main.rs index 41daf62..0cdba6b 100755 --- a/examples/rust/src/main.rs +++ b/examples/rust/src/main.rs @@ -6,7 +6,7 @@ fn main() { rftrace::enable(); println!("Hello, world!"); test1(); - rftrace::dump_full_uftrace(events, "tracedir", "test", true).expect(""); + rftrace::dump_full_uftrace(events, "tracedir", "test").expect(""); } fn test1() { diff --git a/rftrace-frontend-ffi/rftrace_frontend_ffi.h b/rftrace-frontend-ffi/rftrace_frontend_ffi.h index 2313b9c..e1b81a1 100644 --- a/rftrace-frontend-ffi/rftrace_frontend_ffi.h +++ b/rftrace-frontend-ffi/rftrace_frontend_ffi.h @@ -19,8 +19,7 @@ void rftrace_disable(void); int64_t rftrace_dump_full_uftrace(Events *events, const char *out_dir, - const char *binary_name, - uint64_t linux_mode); + const char *binary_name); int64_t rftrace_dump_trace(Events *events, const char *outfile); diff --git a/rftrace-frontend-ffi/src/lib.rs b/rftrace-frontend-ffi/src/lib.rs index bd8cde8..fa593d0 100644 --- a/rftrace-frontend-ffi/src/lib.rs +++ b/rftrace-frontend-ffi/src/lib.rs @@ -31,13 +31,11 @@ pub unsafe extern "C" fn rftrace_dump_full_uftrace( events: *mut Events, out_dir: *const c_char, binary_name: *const c_char, - linux_mode: u64, ) -> i64 { let out_dir = CStr::from_ptr(out_dir).to_string_lossy().into_owned(); let binary_name = CStr::from_ptr(binary_name).to_string_lossy().into_owned(); - let linux = linux_mode != 0; - if rftrace_frontend::dump_full_uftrace(&mut *events, &out_dir, &binary_name, linux).is_err() { + if rftrace_frontend::dump_full_uftrace(&mut *events, &out_dir, &binary_name).is_err() { return -1; } 0 diff --git a/rftrace-frontend/src/frontend.rs b/rftrace-frontend/src/frontend.rs index f95ba57..47a15b7 100644 --- a/rftrace-frontend/src/frontend.rs +++ b/rftrace-frontend/src/frontend.rs @@ -74,14 +74,8 @@ pub fn init(max_event_count: usize, overwriting: bool) -> &'static mut Events { /// * `events` - Events buffer to write, returned by `init()` /// * `out_dir` - folder into which the resulting trace is dumped. Has to exist. /// * `binary_name` - only relevant for this symbol file. Generated metadata instructs uftrace where to look for it. -/// * `linux` - if true, don't fake the memory map, copy it from /proc/self/maps. /// -pub fn dump_full_uftrace( - events: &mut Events, - out_dir: &str, - binary_name: &str, - linux: bool, -) -> io::Result<()> { +pub fn dump_full_uftrace(events: &mut Events, out_dir: &str, binary_name: &str) -> io::Result<()> { // arbitrary values for pid and sid let pid = 42; let sid = "00"; @@ -171,7 +165,7 @@ pub fn dump_full_uftrace( let mapfilename = format!("{}/sid-{}.map", out_dir, sid); let mut mapfile = File::create(mapfilename)?; - if linux { + if cfg!(target_os = "linux") { // see uftrace's record_proc_maps(..) // TODO: implement section-merging println!( @@ -194,7 +188,7 @@ pub fn dump_full_uftrace( )?; } - if linux { + if cfg!(target_os = "linux") { println!( "\nYou should generate symbols with `nm -n $BINARY > {}/$BINARY.sym`", out_dir