Skip to content

Commit

Permalink
test...
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Aug 20, 2024
1 parent c5b62dd commit ccd19dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ unsafe fn trace_from_process_id(
log.Context = addr_of_mut!(context).cast();

unsafe extern "system" fn event_record_callback(record: *mut EVENT_RECORD) {
eprintln!("RECORD!");
let provider_guid_data1 = (*record).EventHeader.ProviderId.data1;
let event_opcode = (*record).EventHeader.EventDescriptor.Opcode;
let context = &mut *(*record).UserContext.cast::<TraceContext>();
Expand Down Expand Up @@ -443,7 +444,7 @@ unsafe fn trace_from_process_id(
let entry = context.stack_counts_hashmap.entry(stack);
*entry.or_insert(0) += 1;

const DEBUG_OUTPUT_EVENTS: bool = false;
const DEBUG_OUTPUT_EVENTS: bool = true;
if DEBUG_OUTPUT_EVENTS {
#[repr(C)]
#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ use std::process::Command;
fn test_basic() {
let mut cmd = Command::new("ping");
cmd.arg("localhost");
let result = blondie::trace_command(cmd, false).unwrap();
let result = blondie::trace_command(cmd, true).unwrap();
assert!(0 < result.iter_callstacks().count());
}

0 comments on commit ccd19dc

Please sign in to comment.