-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prover-client exec timing analysis scripts.
- Loading branch information
1 parent
866a5f7
commit 82434a2
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
NODE_NO_WARNINGS=1 strace -f -tt -T \ | ||
-e trace=execve \ | ||
-o /dev/stderr \ | ||
-s 4096 \ | ||
node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit \ | ||
src/test/bb_prover_full_rollup.test.ts \ | ||
2> >(./process_trace.sh) \ | ||
1>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
awk ' | ||
/execve/ && /aztec-packages/ { | ||
# Extract the PID, timestamp, and command | ||
pid = $1 | ||
match($0, /execve\([^,]+, \[(.+?)\]/, cmd) | ||
command[pid] = cmd[1] | ||
sub("/mnt/user-data/charlie/aztec-repos/aztec-packages/", "", command[pid]) | ||
sub(".* ", "", $2) # Remove the date from timestamp | ||
start_time[pid] = $2 | ||
} | ||
/\+\+\+ exited/ { | ||
# Extract the PID and timestamp from the exit line | ||
pid = $1 | ||
if (pid in start_time) { | ||
sub(".* ", "", $2) # Remove the date from timestamp | ||
end_time = $2 | ||
# Calculate the wall-clock time | ||
split(start_time[pid], start, ":") | ||
split(end_time, end, ":") | ||
wall_clock = (end[1] * 3600 + end[2] * 60 + end[3]) - (start[1] * 3600 + start[2] * 60 + start[3]) | ||
if (wall_clock < 0) wall_clock += 86400 # Handle timestamp wrapping across midnight | ||
# Print in the desired format: [timestamp] [wall-clock-time] [command] | ||
printf "[%s] [%.3f] [%s]\n", start_time[pid], wall_clock, command[pid] | ||
delete command[pid] | ||
delete start_time[pid] | ||
} | ||
} | ||
' $1 | ||
|