aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-09-05 18:24:18 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-09-05 18:24:18 +0300
commitcd3dbd539598580c30c75bf8a0af716deb8f3186 (patch)
tree0051d5cc3948b4058b220f3045dbaf9c6759b766 /meta-linaro
parent3be0939f67e8c8242ff4318b6772d19a0067ed50 (diff)
downloadmeta-linaro-cd3dbd539598580c30c75bf8a0af716deb8f3186.tar.gz
Add calibrator recipe
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'meta-linaro')
-rw-r--r--meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb25
-rw-r--r--meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch95
2 files changed, 120 insertions, 0 deletions
diff --git a/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb b/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb
new file mode 100644
index 00000000..0b85a540
--- /dev/null
+++ b/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Cache-Memory and TLB calibration tool"
+DESCRIPTION = "The Calibrator is a small C program that is supposed to \
+analyze a computers (cache-) memory system and extract the following \
+parameters: \
+number of cache levels, main memory access latency, number of TLB levels."
+HOMEPAGE = "http://homepages.cwi.nl/~manegold/Calibrator/"
+SECTION = "console/tools"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://calibrator.c;endline=39;md5=102be98d5b443582cffa8eb4ee776af8"
+PR = "r0"
+
+SRC_URI = "http://homepages.cwi.nl/~manegold/Calibrator/src/calibrator.c \
+ file://fix_conflicting_types_for_round.patch"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ ${CC} ${CFLAGS} calibrator.c -o calibrator -lm
+}
+
+do_install() {
+ install -D -p -m0755 calibrator ${D}${bindir}/calibrator
+}
+
+COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
diff --git a/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch b/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch
new file mode 100644
index 00000000..b7e7a649
--- /dev/null
+++ b/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch
@@ -0,0 +1,95 @@
+Description: rename round() to rnd() to fix conflicting types for 'round' error
+Author: Fathi Boudra <fathi.boudra@linaro.org>
+
+---
+ calibrator.c | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
+
+--- a/calibrator.c
++++ b/calibrator.c
+@@ -128,7 +128,7 @@ void ErrXit(char *format, ...) {
+ exit(1);
+ }
+
+-lng round(dbl x)
++lng rnd(dbl x)
+ {
+ return (lng)(x + 0.5);
+ }
+@@ -890,16 +890,16 @@ void plotCache(cacheInfo *cache, lng **r
+ fprintf(fp, ")\n");
+ fprintf(fp, "set y2tics");
+ for (l = 0, s = " ("; l <= cache->levels; l++, s = ", ") {
+- if (!delay) fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(cache->latency1[l] - delay)), NSperIt(cache->latency1[l] - delay));
+- else fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(cache->latency2[l] - delay)), NSperIt(cache->latency2[l] - delay));
++ if (!delay) fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(cache->latency1[l] - delay)), NSperIt(cache->latency1[l] - delay));
++ else fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(cache->latency2[l] - delay)), NSperIt(cache->latency2[l] - delay));
+ }
+ for (y = 1; y <= yh; y *= 10) {
+ fprintf(fp, "%s'%1.3g' %ld", s, (dbl)(y * MHz) / 1000.0, y);
+ }
+ fprintf(fp, ")\n");
+ for (l = 0; l <= cache->levels; l++) {
+- if (!delay) z = (dbl)round(CYperIt(cache->latency1[l] - delay)) * 1000.0 / (dbl)MHz;
+- else z = (dbl)round(CYperIt(cache->latency2[l] - delay)) * 1000.0 / (dbl)MHz;
++ if (!delay) z = (dbl)rnd(CYperIt(cache->latency1[l] - delay)) * 1000.0 / (dbl)MHz;
++ else z = (dbl)rnd(CYperIt(cache->latency2[l] - delay)) * 1000.0 / (dbl)MHz;
+ fprintf(fp, "set label %ld '(%1.3g) ' at %f,%f right\n", l + 1, z, xl, z);
+ fprintf(fp, "set arrow %ld from %f,%f to %f,%f nohead lt 0\n", l + 1, xl, z, xh, z);
+ }
+@@ -986,16 +986,16 @@ void plotTLB(TLBinfo *TLB, lng **result,
+ fprintf(fp, "%s'<L1>' %ld)\n", s, TLB->mincachelines);
+ fprintf(fp, "set y2tics");
+ for (l = 0, s = " ("; l <= TLB->levels; l++, s = ", ") {
+- if (!delay) fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(TLB->latency1[l] - delay)), NSperIt(TLB->latency1[l] - delay));
+- else fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(TLB->latency2[l] - delay)), NSperIt(TLB->latency2[l] - delay));
++ if (!delay) fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(TLB->latency1[l] - delay)), NSperIt(TLB->latency1[l] - delay));
++ else fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(TLB->latency2[l] - delay)), NSperIt(TLB->latency2[l] - delay));
+ }
+ for (y = 1; y <= yh; y *= 10) {
+ fprintf(fp, "%s'%1.3g' %ld", s, (dbl)(y * MHz) / 1000.0, y);
+ }
+ fprintf(fp, ")\n");
+ for (l = 0; l <= TLB->levels; l++) {
+- if (!delay) z = (dbl)round(CYperIt(TLB->latency1[l] - delay)) * 1000.0 / (dbl)MHz;
+- else z = (dbl)round(CYperIt(TLB->latency2[l] - delay)) * 1000.0 / (dbl)MHz;
++ if (!delay) z = (dbl)rnd(CYperIt(TLB->latency1[l] - delay)) * 1000.0 / (dbl)MHz;
++ else z = (dbl)rnd(CYperIt(TLB->latency2[l] - delay)) * 1000.0 / (dbl)MHz;
+ fprintf(fp, "set label %ld '(%1.3g) ' at %f,%f right\n", l + 1, z, xl, z);
+ fprintf(fp, "set arrow %ld from %f,%f to %f,%f nohead lt 0\n", l + 1, xl, z, xh, z);
+ }
+@@ -1023,9 +1023,9 @@ void printCPU(cacheInfo *cache, lng MHz,
+ FILE *fp = stdout;
+
+ fprintf(fp, "CPU loop + L1 access: ");
+- fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[0]), round(CYperIt(cache->latency1[0])));
++ fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[0]), rnd(CYperIt(cache->latency1[0])));
+ fprintf(fp, " ( delay: ");
+- fprintf(fp, " %6.2f ns = %3ld cy )\n", NSperIt(delay), round(CYperIt(delay)));
++ fprintf(fp, " %6.2f ns = %3ld cy )\n", NSperIt(delay), rnd(CYperIt(delay)));
+ fprintf(fp, "\n");
+ fflush(fp);
+ }
+@@ -1047,8 +1047,8 @@ void printCache(cacheInfo *cache, lng MH
+ fprintf(fp, " %3ld KB ", cache->size[l] / 1024);
+ }
+ fprintf(fp, " %3ld bytes ", cache->linesize[l + 1]);
+- fprintf(fp, " %6.2f ns = %3ld cy " , NSperIt(cache->latency2[l + 1] - cache->latency2[l]), round(CYperIt(cache->latency2[l + 1] - cache->latency2[l])));
+- fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[l + 1] - cache->latency1[l]), round(CYperIt(cache->latency1[l + 1] - cache->latency1[l])));
++ fprintf(fp, " %6.2f ns = %3ld cy " , NSperIt(cache->latency2[l + 1] - cache->latency2[l]), rnd(CYperIt(cache->latency2[l + 1] - cache->latency2[l])));
++ fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[l + 1] - cache->latency1[l]), rnd(CYperIt(cache->latency1[l + 1] - cache->latency1[l])));
+ }
+ fprintf(fp, "\n");
+ fflush(fp);
+@@ -1075,9 +1075,9 @@ void printTLB(TLBinfo *TLB, lng MHz)
+ } else {
+ fprintf(fp, " %3ld KB ", TLB->pagesize[l + 1] / 1024);
+ }
+- fprintf(fp, " %6.2f ns = %3ld cy ", NSperIt(TLB->latency2[l + 1] - TLB->latency2[l]), round(CYperIt(TLB->latency2[l + 1] - TLB->latency2[l])));
++ fprintf(fp, " %6.2f ns = %3ld cy ", NSperIt(TLB->latency2[l + 1] - TLB->latency2[l]), rnd(CYperIt(TLB->latency2[l + 1] - TLB->latency2[l])));
+ /*
+- fprintf(fp, " %6.2f ns = %3ld cy" , NSperIt(TLB->latency1[l + 1] - TLB->latency1[l]), round(CYperIt(TLB->latency1[l + 1] - TLB->latency1[l])));
++ fprintf(fp, " %6.2f ns = %3ld cy" , NSperIt(TLB->latency1[l + 1] - TLB->latency1[l]), rnd(CYperIt(TLB->latency1[l + 1] - TLB->latency1[l])));
+ */
+ fprintf(fp, "\n");
+ }