From d1fa95daa9fde4b7a2d836d8a8a72d116407bb5a Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Fri, 19 Apr 2024 18:02:19 +0530 Subject: [PATCH] fish: functions: Add a different variant for perf top on a thread --- fish/.config/fish/functions/pfp.fish | 6 ++++++ fish/.config/fish/functions/pft.fish | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 fish/.config/fish/functions/pfp.fish 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