From 1256541c8054e0bfcd730dd066cac2752995240a Mon Sep 17 00:00:00 2001 From: Christoph Weiss Date: Fri, 31 Mar 2023 09:54:18 +0200 Subject: [PATCH] Scripts: Add/Adapt batch scripts acc. refactoring --- scripts/batch_objdump.sh | 134 +++++++++++++++++++++++++++++++++++++ scripts/update_examples.sh | 2 +- 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100755 scripts/batch_objdump.sh diff --git a/scripts/batch_objdump.sh b/scripts/batch_objdump.sh new file mode 100755 index 0000000..bde3752 --- /dev/null +++ b/scripts/batch_objdump.sh @@ -0,0 +1,134 @@ +#!/bin/bash + +function_array=( + acos + asin + atan + atan2 + cos + sin + tan + acosh + atanh + cosh + sinh + tanh + exp + exp2 + expm1 + frexp + ilogb + ldexp + log + log10 + log1p + log2 + logb + modf + scalbn + scalbln + cbrt + fabs + hypot + pow + sqrt + erf + erfc + lgamma + tgamma + ceil + floor + nearbyint + rint + lrint + llrint + round + lround + llround + trunc + fmod + remainder + remquo + copysign + nan + nextafter + fdim + fmax + fmin + fma + + acosf + asinf + atanf + atan2f + cosf + sinf + tanf + acoshf + asinhf + atanhf + coshf + sinhf + tanhf + expf + exp2f + expm1f + frexpf + ilogbf + ldexpf + logf + log10f + log1pf + log2f + logbf + modff + scalbnf + scalblnf + cbrtf + fabsf + hypotf + powf + sqrtf + erff + erfcf + lgammaf + tgammaf + ceilf + floorf + nearbyintf + rintf + lrintf + llrintf + roundf + lroundf + llroundf + truncf + fmodf + remainderf + remquof + copysignf + nanf + nextafterf + fdimf + fmaxf + fminf + fmaf +) + +objdump=../rtems-6-sparc-gr740-smp-4/bin/sparc-rtems6-objdump +application=../examples/gr740/smp/libmcs/b-gr740-qual-only/app.exe +asm_folder=../qualification/asm +pdf_folder=../qualification/pdf +coverage_file=../coverage-tracer/ExecuteTestRun.csv + +mkdir -p $asm_folder +mkdir -p $pdf_folder + +for i in ${function_array[@]} +do + $objdump -d $application | sed -ne '/<'$i'>:/,/^$/p' > $asm_folder/$i.asm + ./asm2cfg -c $coverage_file --preset 'sparc OBJDUMP' $asm_folder/$i.asm +done + +mv *.pdf $pdf_folder/ +rm -f *.gv diff --git a/scripts/update_examples.sh b/scripts/update_examples.sh index d60a970..92fb3dd 100755 --- a/scripts/update_examples.sh +++ b/scripts/update_examples.sh @@ -9,6 +9,6 @@ for asm in examples/*.asm; do if echo $asm | grep -q 'arm.asm'; then flags="$flags --target arm" fi - pdf=$(python3 -m src.asm2cfg $flags -c $asm | awk '/Saved CFG/{print $NF}') + pdf=$(python3 -m ocgraph $flags -c $asm | awk '/Saved CFG/{print $NF}') mv $pdf $(echo $asm | sed 's/\.asm/\.pdf/') done