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