Browse Source

Fix perf cmd and add time for mac (#20)

pull/26/head
RJ Rybarczyk 4 years ago
committed by GitHub
parent
commit
fc7f699298
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      justfile

14
justfile

@ -41,8 +41,14 @@ publish:
# Profiling
time CMD:
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
time /usr/bin/time -f "\n%E (hr:min:sec): Real time\n%S (sec): Total number of CPU-seconds used by the system on behalf of the process (in kernel mode)\n%U (sec): Total number of CPU-seconds that the process used directly (in user mode)\n%M kB: Max resident set size of the process during its lifetime\n%W: Number of times the process was swapped out of memory\n%P: Percentage of CPU that this job got." {{CMD}}
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
time /usr/bin/time -f "\n%E (hr:min:sec): Real time\n%S (sec): Total number of CPU-seconds used by the system on behalf of the process (in kernel mode)\n%U (sec): Total number of CPU-seconds that the process used directly (in user mode)\n%M kB: Max resident set size of the process during its lifetime\n%W: Number of times the process was swapped out of memory\n%P: Percentage of CPU that this job got." {{CMD}}
# sync - force completion of pending disk writes (flush cache)
# purge - force disk cache to be purged (flushed and emptied)
time-mac CMD:
sync && sudo purge
gtime -f "\n%E (hr:min:sec): Real time\n%S (sec): Total number of CPU-seconds used by the system on behalf of the process (in kernel mode)\n%U (sec): Total number of CPU-seconds that the process used directly (in user mode)\n%M kB: Max resident set size of the process during its lifetime\n%W: Number of times the process was swapped out of memory\n%P: Percentage of CPU that this job got." {{CMD}}
# Generate flamegraphs
# ex cmd: $ cargo-flamegraph flamegraph download -d dmp -n 1,2,3,14,17,18 -> $ just flmg "download -d dmp -n 1,2,3,14,17,18"
@ -51,5 +57,5 @@ flmg CMD:
cargo-flamegraph flamegraph {{CMD}}
# View perf.data file generated by flamegraph (--no-children flag is useful to sort by each individual stack call instead of by the accumulated callchain of children to parent)
perf PATH-TO-PERF:
perf report -i {{PATH-TO-PERF}}
perf PATH-TO-PERF:
perf report -i {{PATH-TO-PERF}}

Loading…
Cancel
Save