diff options
Diffstat (limited to 'meta-linaro/recipes-extra/calibrator')
-rw-r--r-- | meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb | 27 | ||||
-rw-r--r-- | meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch | 95 |
2 files changed, 122 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 0000000..7911e0f --- /dev/null +++ b/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb | |||
@@ -0,0 +1,27 @@ | |||
1 | SUMMARY = "Cache-Memory and TLB calibration tool" | ||
2 | DESCRIPTION = "The Calibrator is a small C program that is supposed to \ | ||
3 | analyze a computers (cache-) memory system and extract the following \ | ||
4 | parameters: \ | ||
5 | number of cache levels, main memory access latency, number of TLB levels." | ||
6 | HOMEPAGE = "http://homepages.cwi.nl/~manegold/Calibrator/" | ||
7 | SECTION = "console/tools" | ||
8 | LICENSE = "BSD" | ||
9 | LIC_FILES_CHKSUM = "file://calibrator.c;endline=39;md5=102be98d5b443582cffa8eb4ee776af8" | ||
10 | PR = "r0" | ||
11 | |||
12 | SRC_URI = "http://homepages.cwi.nl/~manegold/Calibrator/src/calibrator.c \ | ||
13 | file://fix_conflicting_types_for_round.patch" | ||
14 | SRC_URI[md5sum] = "5355f07ab1103e6d2948e08936d1ff54" | ||
15 | SRC_URI[sha256sum] = "2018ed8fa733155d44ceb1c0066c5cf8df7771cdf7cfca0a07b8dd9bebd9c221" | ||
16 | |||
17 | S = "${WORKDIR}" | ||
18 | |||
19 | do_compile() { | ||
20 | ${CC} ${CFLAGS} calibrator.c -o calibrator -lm | ||
21 | } | ||
22 | |||
23 | do_install() { | ||
24 | install -D -p -m0755 calibrator ${D}${bindir}/calibrator | ||
25 | } | ||
26 | |||
27 | 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 0000000..b7e7a64 --- /dev/null +++ b/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch | |||
@@ -0,0 +1,95 @@ | |||
1 | Description: rename round() to rnd() to fix conflicting types for 'round' error | ||
2 | Author: Fathi Boudra <fathi.boudra@linaro.org> | ||
3 | |||
4 | --- | ||
5 | calibrator.c | 30 +++++++++++++++--------------- | ||
6 | 1 file changed, 15 insertions(+), 15 deletions(-) | ||
7 | |||
8 | --- a/calibrator.c | ||
9 | +++ b/calibrator.c | ||
10 | @@ -128,7 +128,7 @@ void ErrXit(char *format, ...) { | ||
11 | exit(1); | ||
12 | } | ||
13 | |||
14 | -lng round(dbl x) | ||
15 | +lng rnd(dbl x) | ||
16 | { | ||
17 | return (lng)(x + 0.5); | ||
18 | } | ||
19 | @@ -890,16 +890,16 @@ void plotCache(cacheInfo *cache, lng **r | ||
20 | fprintf(fp, ")\n"); | ||
21 | fprintf(fp, "set y2tics"); | ||
22 | for (l = 0, s = " ("; l <= cache->levels; l++, s = ", ") { | ||
23 | - if (!delay) fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(cache->latency1[l] - delay)), NSperIt(cache->latency1[l] - delay)); | ||
24 | - else fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(cache->latency2[l] - delay)), NSperIt(cache->latency2[l] - delay)); | ||
25 | + if (!delay) fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(cache->latency1[l] - delay)), NSperIt(cache->latency1[l] - delay)); | ||
26 | + else fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(cache->latency2[l] - delay)), NSperIt(cache->latency2[l] - delay)); | ||
27 | } | ||
28 | for (y = 1; y <= yh; y *= 10) { | ||
29 | fprintf(fp, "%s'%1.3g' %ld", s, (dbl)(y * MHz) / 1000.0, y); | ||
30 | } | ||
31 | fprintf(fp, ")\n"); | ||
32 | for (l = 0; l <= cache->levels; l++) { | ||
33 | - if (!delay) z = (dbl)round(CYperIt(cache->latency1[l] - delay)) * 1000.0 / (dbl)MHz; | ||
34 | - else z = (dbl)round(CYperIt(cache->latency2[l] - delay)) * 1000.0 / (dbl)MHz; | ||
35 | + if (!delay) z = (dbl)rnd(CYperIt(cache->latency1[l] - delay)) * 1000.0 / (dbl)MHz; | ||
36 | + else z = (dbl)rnd(CYperIt(cache->latency2[l] - delay)) * 1000.0 / (dbl)MHz; | ||
37 | fprintf(fp, "set label %ld '(%1.3g) ' at %f,%f right\n", l + 1, z, xl, z); | ||
38 | fprintf(fp, "set arrow %ld from %f,%f to %f,%f nohead lt 0\n", l + 1, xl, z, xh, z); | ||
39 | } | ||
40 | @@ -986,16 +986,16 @@ void plotTLB(TLBinfo *TLB, lng **result, | ||
41 | fprintf(fp, "%s'<L1>' %ld)\n", s, TLB->mincachelines); | ||
42 | fprintf(fp, "set y2tics"); | ||
43 | for (l = 0, s = " ("; l <= TLB->levels; l++, s = ", ") { | ||
44 | - if (!delay) fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(TLB->latency1[l] - delay)), NSperIt(TLB->latency1[l] - delay)); | ||
45 | - else fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(TLB->latency2[l] - delay)), NSperIt(TLB->latency2[l] - delay)); | ||
46 | + if (!delay) fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(TLB->latency1[l] - delay)), NSperIt(TLB->latency1[l] - delay)); | ||
47 | + else fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(TLB->latency2[l] - delay)), NSperIt(TLB->latency2[l] - delay)); | ||
48 | } | ||
49 | for (y = 1; y <= yh; y *= 10) { | ||
50 | fprintf(fp, "%s'%1.3g' %ld", s, (dbl)(y * MHz) / 1000.0, y); | ||
51 | } | ||
52 | fprintf(fp, ")\n"); | ||
53 | for (l = 0; l <= TLB->levels; l++) { | ||
54 | - if (!delay) z = (dbl)round(CYperIt(TLB->latency1[l] - delay)) * 1000.0 / (dbl)MHz; | ||
55 | - else z = (dbl)round(CYperIt(TLB->latency2[l] - delay)) * 1000.0 / (dbl)MHz; | ||
56 | + if (!delay) z = (dbl)rnd(CYperIt(TLB->latency1[l] - delay)) * 1000.0 / (dbl)MHz; | ||
57 | + else z = (dbl)rnd(CYperIt(TLB->latency2[l] - delay)) * 1000.0 / (dbl)MHz; | ||
58 | fprintf(fp, "set label %ld '(%1.3g) ' at %f,%f right\n", l + 1, z, xl, z); | ||
59 | fprintf(fp, "set arrow %ld from %f,%f to %f,%f nohead lt 0\n", l + 1, xl, z, xh, z); | ||
60 | } | ||
61 | @@ -1023,9 +1023,9 @@ void printCPU(cacheInfo *cache, lng MHz, | ||
62 | FILE *fp = stdout; | ||
63 | |||
64 | fprintf(fp, "CPU loop + L1 access: "); | ||
65 | - fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[0]), round(CYperIt(cache->latency1[0]))); | ||
66 | + fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[0]), rnd(CYperIt(cache->latency1[0]))); | ||
67 | fprintf(fp, " ( delay: "); | ||
68 | - fprintf(fp, " %6.2f ns = %3ld cy )\n", NSperIt(delay), round(CYperIt(delay))); | ||
69 | + fprintf(fp, " %6.2f ns = %3ld cy )\n", NSperIt(delay), rnd(CYperIt(delay))); | ||
70 | fprintf(fp, "\n"); | ||
71 | fflush(fp); | ||
72 | } | ||
73 | @@ -1047,8 +1047,8 @@ void printCache(cacheInfo *cache, lng MH | ||
74 | fprintf(fp, " %3ld KB ", cache->size[l] / 1024); | ||
75 | } | ||
76 | fprintf(fp, " %3ld bytes ", cache->linesize[l + 1]); | ||
77 | - fprintf(fp, " %6.2f ns = %3ld cy " , NSperIt(cache->latency2[l + 1] - cache->latency2[l]), round(CYperIt(cache->latency2[l + 1] - cache->latency2[l]))); | ||
78 | - 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]))); | ||
79 | + fprintf(fp, " %6.2f ns = %3ld cy " , NSperIt(cache->latency2[l + 1] - cache->latency2[l]), rnd(CYperIt(cache->latency2[l + 1] - cache->latency2[l]))); | ||
80 | + 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]))); | ||
81 | } | ||
82 | fprintf(fp, "\n"); | ||
83 | fflush(fp); | ||
84 | @@ -1075,9 +1075,9 @@ void printTLB(TLBinfo *TLB, lng MHz) | ||
85 | } else { | ||
86 | fprintf(fp, " %3ld KB ", TLB->pagesize[l + 1] / 1024); | ||
87 | } | ||
88 | - fprintf(fp, " %6.2f ns = %3ld cy ", NSperIt(TLB->latency2[l + 1] - TLB->latency2[l]), round(CYperIt(TLB->latency2[l + 1] - TLB->latency2[l]))); | ||
89 | + fprintf(fp, " %6.2f ns = %3ld cy ", NSperIt(TLB->latency2[l + 1] - TLB->latency2[l]), rnd(CYperIt(TLB->latency2[l + 1] - TLB->latency2[l]))); | ||
90 | /* | ||
91 | - fprintf(fp, " %6.2f ns = %3ld cy" , NSperIt(TLB->latency1[l + 1] - TLB->latency1[l]), round(CYperIt(TLB->latency1[l + 1] - TLB->latency1[l]))); | ||
92 | + fprintf(fp, " %6.2f ns = %3ld cy" , NSperIt(TLB->latency1[l + 1] - TLB->latency1[l]), rnd(CYperIt(TLB->latency1[l + 1] - TLB->latency1[l]))); | ||
93 | */ | ||
94 | fprintf(fp, "\n"); | ||
95 | } | ||