diff --git a/fish/.config/fish/functions/pfp.fish b/fish/.config/fish/functions/pfp.fish new file mode 100644 index 0000000..e99ca8b --- /dev/null +++ b/fish/.config/fish/functions/pfp.fish @@ -0,0 +1,6 @@ +function pfp --description 'Select a process to run perf top' + set proc (ps -ef | fzf | awk '{print $2}') + if test -n "$proc" + perf top -p $proc + end +end diff --git a/fish/.config/fish/functions/pft.fish b/fish/.config/fish/functions/pft.fish index c114106..12565de 100644 --- a/fish/.config/fish/functions/pft.fish +++ b/fish/.config/fish/functions/pft.fish @@ -1,6 +1,6 @@ -function pft --description 'Select a process to run perf top' - set proc (ps -ef | fzf | awk '{print $2}') - if test -n "$proc" - perf top -p $proc +function pft --description 'Select a thread to run perf top' + set tid (ps -eLf | fzf | awk '{print $4}') + if test -n "$tid" + perf top -t $tid end end