1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-06-23 01:28:32 +02:00
dotfiles/functions/tracing.zsh

Failed to ignore revisions in .git-blame-ignore-revs.

19 lines
342 B
Bash
Raw Normal View History

2023-09-15 00:33:46 +02:00
#!/bin/zsh
function start_tracing {
zmodload zsh/zprof
zmodload zsh/datetime
setopt PROMPT_SUBST
PS4+='+$EPOCHREALTIME %N:%i> '
logfile=$(mktemp zsh_profile.XXXXXXXX)
echo "logging to $logfile"
exec 3>&2 2>$logfile
setopt XTRACE
}
function stop_tracing {
unsetopt XTRACE
exec 2>&3 3>&-
zprof | tee zprof_out.log | vimscratch -
}