1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-21 11:01:31 +01:00

zsh: functions: cleanup tracing functions

This commit is contained in:
bretello 2024-04-05 15:10:01 +02:00
parent faf318c3d0
commit 3db7721edb
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -3,9 +3,10 @@
function start_tracing {
zmodload zsh/zprof
zmodload zsh/datetime
setopt PROMPT_SUBST
PS4+='+$EPOCHREALTIME %N:%i> '
logfile=$(mktemp zsh_profile.XXXXXXXX)
logfile=$(mktemp --tmpdir zsh_profile.XXXXXXXX)
echo "logging to $logfile"
exec 3>&2 2>$logfile
setopt XTRACE
@ -14,5 +15,8 @@ function start_tracing {
function stop_tracing {
unsetopt XTRACE
exec 2>&3 3>&-
zprof | tee zprof_out.log | vimscratch -
zprof | tee zprof_out.log | vim -c "set buftype=nofile" -
zmodload -u zsh/zprof
zmodload -u zsh/datetime
}