From 8b7e37acce8f50d2f58d201e919796968529d505 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Thu, 14 May 2020 09:30:24 +0900 Subject: [PATCH] Update 'perf timechart' completion --- src/_perf | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/_perf b/src/_perf index da03724..162c0c1 100644 --- a/src/_perf +++ b/src/_perf @@ -524,15 +524,23 @@ _perf() { && ret=0 ;; (timechart) - # TODO Complete 'record' command _arguments \ '(-i --input)'{-i,--input=}'[input file name]: :_files' \ '(-o --output)'{-o,--output=}'[output file name]: :_files' \ '(-w --width)'{-w,--width=}'[select the width of the SVG file]:width' \ '(-P --power-only)'{-P,--power-only}'[only output the CPU power section of the diagram]' \ + '(-T --task-only)'{-T,--task-only}'[do not output processor state transitions]' \ '(-p --process)'{-p,--process}'[select the processes to display, by name or PID]:process' \ + '(-f --force)'{-f,--force}'[do not complain, do it]' \ '--symfs=[look for files with symbols relative to this directory]: :_files -/' \ + '(-n --proc-num)'{-n,--proc-num=}'[print task info for at least given number of tasks]:number:' \ + '(-t --topology)'{-t,--topology}'[sort CPUs acording to topology]' \ + '--highlight=[highlight tasks using different color]:nsecs_or_task:' \ + '--io-skip-eagain[do not draw EAGAIN IO events]' \ + '--io-min-times=[draw small events as if they lasted min-time]:nsecs:' \ + '--io-merge-dist=[merge events that are merge-dist nanoseconds apart]:nsecs:' \ '1:command:((record))' \ + '*:: :->timechart_args' \ && ret=0 ;; (top) @@ -675,6 +683,18 @@ _perf() { ;; esac ;; + (timechart_args) + if [[ $words[1] == "record" ]]; then + _arguments \ + '(-P --power-only)'{-P,--power-only}'[record only power-related events]' \ + '(-T --tasks-only)'{-T,--tasks-only}'[record only tasks-related events]' \ + '(-I --io-only)'{-I,--io-only}'[record only io-related events]' \ + '(-g --callchain)'{-g,--callchain}'[do call-graph recording]' \ + '1:command:_command_names -e' \ + '*::args:_normal' \ + && ret=0 + fi + ;; esac }