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:
parent
faf318c3d0
commit
3db7721edb
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user