@@ -233,6 +233,83 @@ CheckPVTMDistributionOnRK3588() {
233
233
done | grep -v ' | |' | grep -v ' | 0/0 |' | sed ' s/,/./g' | sort -t ' |' -k 3 -n
234
234
} # CheckPVTMDistributionOnRK3588
235
235
236
+ PlotOPPTables () {
237
+ PNGWidth=900
238
+
239
+ for OPPTable in * .dat ; do
240
+ # for OPPTable in bcm2712-30cc5f37-Raspberry_Pi_5B.dat; do
241
+ case " ${OPPTable##*/ } " in
242
+ rk* )
243
+ SoCName=" Rockchip RK$( cut -c3-6 <<< " ${OPPTable##*/}" ) "
244
+ OSInfo=" (Kernel $( cut -f2 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) )"
245
+ DeviceName=" $( cut -f3 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) "
246
+ ;;
247
+ sun* )
248
+ SoCName=" Allwinner $( cut -f2 -d' -' <<< " ${OPPTable##*/}" | tr ' [:lower:]' ' [:upper:]' ) "
249
+ OSInfo=" (Kernel $( cut -f3 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) )"
250
+ DeviceName=" $( cut -f4 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) "
251
+ ;;
252
+ amlogic* )
253
+ SoCName=" Amlogic $( cut -f2 -d' -' <<< " ${OPPTable##*/}" | tr ' [:lower:]' ' [:upper:]' ) "
254
+ OSInfo=" (Kernel $( cut -f3 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) )"
255
+ DeviceName=" $( cut -f4 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) "
256
+ ;;
257
+ bcm* )
258
+ SoCName=" BroadCom $( cut -f1 -d' -' <<< " ${OPPTable##*/}" | tr ' [:lower:]' ' [:upper:]' ) "
259
+ OSInfo=" (ThreadX $( cut -f2 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) )"
260
+ DeviceName=" $( cut -f3 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) "
261
+ ;;
262
+ * )
263
+ SoCName=" $( cut -f1 -d' -' <<< " ${OPPTable##*/}" | tr ' [:lower:]' ' [:upper:]' | sed -e ' s/IMX8/NXP i.MX8/' -e ' s/EXYNOS5/Exynos 5422/' ) "
264
+ OSInfo=" (Kernel $( cut -f2 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) )"
265
+ DeviceName=" $( cut -f3 -d' -' <<< " ${OPPTable##*/}" | tr ' _' ' ' ) "
266
+ ;;
267
+ esac
268
+ case " ${OPPTable##*/ } " in
269
+ * -big.dat)
270
+ CoreInfo=" , big cores"
271
+ ;;
272
+ * -little.dat)
273
+ CoreInfo=" , little cores"
274
+ ;;
275
+ * )
276
+ CoreInfo=" "
277
+ ;;
278
+ esac
279
+
280
+ GraphTitle=" $( sed ' s/\.dat//' <<< " ${SoCName} / ${DeviceName}${CoreInfo}${OSInfo}" ) "
281
+ echo ${GraphTitle}
282
+ PNGName=" $( basename " ${OPPTable##*/ } " .dat) .png"
283
+ CpufreqDat=" $( mktemp /tmp/${0##*/ } .XXXXXX) "
284
+ echo -e " 0\t0" > " ${CpufreqDat} "
285
+ cut -f1 -d' .' < " ${OPPTable} " | awk -F" " ' {print $1"\t"$3}' >> " ${CpufreqDat} "
286
+ HighestVoltage=$( tail -n1 " ${CpufreqDat} " | cut -f2)
287
+ LowestVoltage=$( head -n1 " ${CpufreqDat} " | cut -f2)
288
+ YRange1=$(( LowestVoltage - 100 ))
289
+ YRange2=$(( HighestVoltage + 100 ))
290
+ HighestMHz=$( tail -n1 " ${CpufreqDat} " | cut -f1)
291
+ LowestMHz=$( head -n2 " ${CpufreqDat} " | tail -n1 | cut -f1)
292
+ XRange1=$(( LowestMHz - 50 ))
293
+ XRange2=$(( HighestMHz + 50 ))
294
+
295
+ cat << - EOF | gnuplot
296
+ set title '${GraphTitle} '
297
+ set ylabel 'Supply voltage in mV'
298
+ set ytics nomirror
299
+ set yrange [${YRange1} :${YRange2} ]
300
+ set xrange [${XRange1} :${XRange2} ]
301
+ set xlabel 'CPU clockspeed in MHz'
302
+ set datafile sep '\t'
303
+ set key top left autotitle columnheader
304
+ set grid
305
+ set terminal png size ${PNGWidth}
306
+ set output '${PNGName} '
307
+ plot '${CpufreqDat} ' with linespoints title 'DVFS OPP'
308
+ EOF
309
+ rm " ${CpufreqDat} "
310
+ done
311
+ } # PlotOPPTables
312
+
236
313
# CPUUtilization7ZIP >7-zip-cpu-utilisation.md
237
314
# CheckRAID6PerfAndAlgo >raid6-perf-and-algo.md
238
315
# CheckRK3588sbc-bench-results
0 commit comments