File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1351,6 +1351,11 @@ def main_normal():
1351
1351
# Create build directory.
1352
1352
shell .makedirs (invocation .workspace .build_root )
1353
1353
1354
+ # Create .build_script_log.
1355
+ build_script_log = os .path .join (invocation .workspace .build_root ,
1356
+ ".build_script_log" )
1357
+ open (build_script_log , 'w' ).close ()
1358
+
1354
1359
# Build ninja if required, which will update the toolchain.
1355
1360
if args .build_ninja :
1356
1361
invocation .build_ninja ()
Original file line number Diff line number Diff line change @@ -257,6 +257,16 @@ for component in ${components[@]} ; do
257
257
)
258
258
done
259
259
260
+ function log_event() {
261
+ build_script_log_path=${BUILD_DIR} /.build_script_log
262
+ event_type=$1
263
+ event_command=$2
264
+ evnet_duration=$3
265
+
266
+ build_event=" {\" event\" :\" ${event_type} \" , \" command\" :\" ${event_command} \" , \" duration\" :\" ${evnet_duration} \" }"
267
+ echo " ${build_event} " >> ${build_script_log_path}
268
+ }
269
+
260
270
# Centralized access point for traced command invocation.
261
271
# Every operation that might mutates file system should be called via
262
272
# these functions.
@@ -265,10 +275,14 @@ function call() {
265
275
if [[ ${DRY_RUN} ]] || [[ " ${VERBOSE_BUILD} " ]]; then
266
276
echo " ${PS4} " $( quoted_print " $@ " )
267
277
fi
278
+
279
+ SECONDS=0
268
280
if [[ ! ${DRY_RUN} ]]; then
281
+ log_event " start" " $( quoted_print " $@ " ) " " ${SECONDS} "
269
282
{ set -x; } 2> /dev/null
270
283
" $@ "
271
284
{ set +x; } 2> /dev/null
285
+ log_event " finish" " $( quoted_print " $@ " ) " " ${SECONDS} "
272
286
fi
273
287
}
274
288
You can’t perform that action at this time.
0 commit comments