From c33f332921bb4b7a309c824d78e4205fb6c38bb2 Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Wed, 21 Sep 2011 17:52:40 +0200 Subject: [PATCH] Added simple scripts for creating charts out of measured data. --- Makefile | 10 ++++++++++ samq_plot.txt | 29 +++++++++++++++++++++++++++++ single_arch_multiple_qdiscs.sh | 30 ++++++++++++++++++++++++++++++ single_qdisc_multiple_archs.sh | 28 ++++++++++++++++++++++++++++ sqma_plot.txt | 27 +++++++++++++++++++++++++++ 5 files changed, 124 insertions(+) create mode 100644 Makefile create mode 100644 samq_plot.txt create mode 100755 single_arch_multiple_qdiscs.sh create mode 100755 single_qdisc_multiple_archs.sh create mode 100644 sqma_plot.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6942398 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +charts: + ./single_qdisc_multiple_archs.sh + ./single_arch_multiple_qdiscs.sh + +clean: + rm sqma/*.pdf + rm sqma/*.eps + rm samq/*.pdf + rm samq/*.eps + diff --git a/samq_plot.txt b/samq_plot.txt new file mode 100644 index 0000000..62992e4 --- /dev/null +++ b/samq_plot.txt @@ -0,0 +1,29 @@ +set terminal postscript color eps enhanced size 15cm,7cm lw 1 "Times-Roman" 10 +set log y +set xrange [ 1 : 5000 ] +#set yrange [ 0.25 : 1000 ] +set xlabel "N-th sample" +set ylabel "Time spent in can\\_send() function[us]" + +set style data lines +set style line 1 linetype 1 linecolor rgb "black" linewidth 1 pointtype 1 +set style line 2 linetype 1 linecolor rgb "yellow" linewidth 1 pointtype 1 +set style line 3 linetype 1 linecolor rgb "blue" linewidth 1 pointtype 1 +set style line 4 linetype 1 linecolor rgb "red" linewidth 1 pointtype 1 +set style line 5 linetype 1 linecolor rgb "green" linewidth 1 pointtype 1 +set style line 6 linetype 1 linecolor rgb "cyan" linewidth 1 pointtype 1 +set style line 7 linetype 1 linecolor rgb "cyan" linewidth 1 pointtype 1 + + +#set style data points +#set style data dots +#set pointsize 1 +plot \ + "ftrace_sff_pfifo1_plot.dat" ls 1 title "Default pfifo qdisc; fixed CAN ID", \ + "ftrace_sff_pfifo2_plot.dat" ls 2 title "Default pfifo qdisc; incrementing CAN ID", \ + "ftrace_sff_prio1_plot.dat" ls 3 title "Prio qdisc; every frame is classified into the first class", \ + "ftrace_sff_prio1b_plot.dat" ls 4 title "Prio qdisc; most of the traffic goes into default (last) class", \ + "ftrace_sff_prio2_plot.dat" ls 5 title "Prio qdisc; 5 classes, each has filter with 128 rules", \ + "ftrace_sff_htb1_plot.dat" ls 6 title "Simple HTB qdisc; fixed CAN ID", \ + "ftrace_sff_htb2_plot.dat" ls 7 title "Simple HTB qdisc; incrementing CAN ID" + diff --git a/single_arch_multiple_qdiscs.sh b/single_arch_multiple_qdiscs.sh new file mode 100755 index 0000000..111a22c --- /dev/null +++ b/single_arch_multiple_qdiscs.sh @@ -0,0 +1,30 @@ +#!/bin/bash +DIRS=(test1 test2 test3 test4 test5) +TESTS=(ftrace_sff_pfifo1 ftrace_sff_prio1 ftrace_sff_htb1 \ + ftrace_sff_pfifo2 ftrace_sff_prio2 ftrace_sff_htb2 \ + ftrace_sff_prio1b) + +if [ ! -d "samq" ]; then + mkdir "samq" +fi + +for A in "sff_array" "sff_bitmap" +do + for X in ${DIRS[@]:0} + do + for Y in ${TESTS[@]:0} + do + cat "${X}/${A}/${Y}.txt" | \ + tail -n +5 | cut -c 7- | cut -d" " -f 1 | \ + cat -n > ${Y}_plot.dat + done + + echo -n "." + gnuplot < samq_plot.txt > samq/plot_${A}_${X}.eps + epstopdf samq/plot_${A}_${X}.eps + done +done + +rm *_plot.dat +echo +exit 0; diff --git a/single_qdisc_multiple_archs.sh b/single_qdisc_multiple_archs.sh new file mode 100755 index 0000000..7b97a9a --- /dev/null +++ b/single_qdisc_multiple_archs.sh @@ -0,0 +1,28 @@ +#!/bin/bash +DIRS=(test1 test2 test3 test4 test5) +TESTS=( $(ls test1/sff_array/) ) + +if [ ! -d "sqma" ]; then + mkdir "sqma" +fi + +for A in "sff_array" "sff_bitmap" +do + for X in ${TESTS[@]:0} + do + for Y in ${DIRS[@]:0} + do + cat "${Y}/${A}/${X}" | \ + tail -n +5 | cut -c 7- | cut -d" " -f 1 | \ + cat -n > ${Y}_plot.dat + done + + echo -n "." + gnuplot < sqma_plot.txt > sqma/plot_${A}_${X}.eps + epstopdf sqma/plot_${A}_${X}.eps + done +done + +rm *_plot.dat +echo +exit 0; diff --git a/sqma_plot.txt b/sqma_plot.txt new file mode 100644 index 0000000..201a317 --- /dev/null +++ b/sqma_plot.txt @@ -0,0 +1,27 @@ +set terminal postscript color eps enhanced size 15cm,7cm lw 1 "Times-Roman" 10 +set log y +set xrange [ 1 : 5000 ] +set yrange [ 0.25 : 1000 ] +set xlabel "N-th sample" +set ylabel "Time spent in can\\_send() function[us]" + +set style data lines +set style line 1 linetype 1 linecolor rgb "black" linewidth 1 pointtype 1 +set style line 2 linetype 1 linecolor rgb "yellow" linewidth 1 pointtype 1 +set style line 3 linetype 1 linecolor rgb "blue" linewidth 1 pointtype 1 +set style line 4 linetype 1 linecolor rgb "red" linewidth 1 pointtype 1 +set style line 5 linetype 1 linecolor rgb "green" linewidth 1 pointtype 1 +set style line 6 linetype 1 linecolor rgb "cyan" linewidth 1 pointtype 1 +set style line 7 linetype 1 linecolor rgb "cyan" linewidth 1 pointtype 1 + + +#set style data points +#set style data dots +#set pointsize 1 +plot \ + "test2_plot.dat" ls 1 title "P4 PC; g = 0", \ + "test1_plot.dat" ls 2 title "P4 PC; g = 1", \ + "test3_plot.dat" ls 3 title "MPC5200 PPC; g = 0", \ + "test4_plot.dat" ls 4 title "MPC5200 PPC; g = 1", \ + "test5_plot.dat" ls 5 title "MPC5200 PPC; g = 2" + -- 2.39.2