diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-02-21 07:08:28 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-02-21 07:08:28 +0000 |
commit | d6437c9d70f030ce4074a450534bfda48e731a1f (patch) | |
tree | 5eb8dd25dc014ab4f9998b0ba43fec7da3da805a | |
parent | 6187de0c04b6a3c3ca604bbe43507bd70e0f396c (diff) |
perfdatadir2csv.sh: Add --num-dsos and --num-symbols options
Change-Id: I70503f37ee9dc793233f0e5a7b39c778d131e84f
-rwxr-xr-x | perfdatadir2csv.sh | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/perfdatadir2csv.sh b/perfdatadir2csv.sh index b03974c..3372395 100755 --- a/perfdatadir2csv.sh +++ b/perfdatadir2csv.sh @@ -5,17 +5,22 @@ set -e perf_dirs=() event="cycles" format="sample,overhead" -num_entries="10" +declare -A num_entries +num_entries[total]="10" +num_entries[dso]=${num_entries[total]} +num_entries[symbol]=${num_entries[total]} add_time=false verbose="" -OPTS="`getopt -l dir:,event:,format:,num:,time,verbose -o d:,e:,f:,n:,t,v -- "$@"`" +OPTS="`getopt -l dir:,event:,format:,num:,num-dsos:,num-symbols:,time,verbose -o d:,e:,f:,n:,t,v -- "$@"`" while test $# -gt 0; do case $1 in --dir|-d) perf_dirs=("${perf_dirs[@]}" "$(cd $2; pwd)"); shift ;; --event|-e) event="$2"; shift ;; --format|-f) format="$2"; shift ;; - --num|-n) num_entries="$2"; shift ;; + --num|-n) num_entries[total]="$2"; shift ;; + --num-dsos) num_entries[dso]="$2"; shift ;; + --num-symbols) num_entries[symbol]="$2"; shift ;; --time|-t) add_time=true ;; --verbose|-v) verbose="set -x" ;; *) echo "ERROR: Unknown option $1"; exit 1 ;; @@ -73,7 +78,8 @@ BEGIN { found_samples=0; found_command=0 } /^#/ { if (found_command) { exit } } /^$/ { next } { if (found_command) { print \$0 } } -" - done | head -n $num_entries | sed -e "s/^/$(basename $data .data),/" +" \ + | head -n ${num_entries[$report_field]} + done | head -n ${num_entries[total]} | sed -e "s/^/$(basename $data .data),/" done done |