#!/bin/bash # # Copyright (c) 2011, Intel Corporation. # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # DESCRIPTION # This script runs BB_CMD (typically building core-image-sato) for all # combincations of BB_RANGE and PM_RANGE values. It saves off all the console # logs, the buildstats directories, and creates a bb-pm-runtime.dat file which # can be used to postprocess the results with a plotting tool, spreadsheet, etc. # Before running this script, it is recommended that you pre-download all the # necessary sources by performing the BB_CMD once manually. It is also a good # idea to disable cron to avoid runtime variations caused by things like the # locate process. Be sure to sanitize the dat file prior to post-processing as # it may contain error messages or bad runs that should be removed. # # AUTHORS # Darren Hart # # The following ranges are appropriate for a 4 core system with 8 logical units BB_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16" PM_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16" DATADIR="bb-matrix-$$" BB_CMD="bitbake core-image-minimal" RUNTIME_LOG="$DATADIR/bb-matrix.dat" # See TIME(1) for a description of the time format parameters # The following all report 0: W K r s t w TIME_STR="%e %S %U %P %c %w %R %F %M %x" # Prepare the DATADIR mkdir $DATADIR if [ $? -ne 0 ]; then echo "Failed to create $DATADIR." exit 1 fi # Add a simple header echo "BB PM $TIME_STR" > $RUNTIME_LOG for BB in $BB_RANGE; do for PM in $PM_RANGE; do RUNDIR="$DATADIR/$BB-$PM-build" mkdir $RUNDIR BB_LOG=$RUNDIR/$BB-$PM-bitbake.log date echo "BB=$BB PM=$PM Logging to $BB_LOG" # Export the variables under test and run the bitbake command export BB_NUMBER_THREADS=$(echo $BB | sed 's/^0*//') export PARALLEL_MAKE="-j $(echo $PM | sed 's/^0*//')" /usr/bin/time -f "$BB $PM $TIME_STR" -a -o $RUNTIME_LOG $BB_CMD &> $BB_LOG echo " $(tail -n1 $RUNTIME_LOG)" echo -n " Cleaning up..." mv tmp/buildstats $RUNDIR/$BB-$PM-buildstats rm -f pseudodone &> /dev/null rm -rf tmp &> /dev/null rm -rf sstate-cache &> /dev/null rm -rf tmp-eglibc &> /dev/null echo "done" done done 541ee48da3bdb5f88508fe871acf38'>main.cpp
blob: eac6aeb17d3e9cda9e9ee92625772f63dbdad31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369