Skip to content

Commit 40b5c5a

Browse files
committed
time all builds and run
1 parent 435436f commit 40b5c5a

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

README.adoc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,24 @@ To get a terminal, either open a new shell and run:
353353
./gem5-shell
354354
....
355355

356-
or if you are inside tmux, which I highly recommend, just run gem5 with:
356+
The only way to exit the shell is to kill the gem5 on the previous shell
357+
358+
If you are inside tmux, which I highly recommend, just run gem5 with:
357359

358360
....
359361
./run --gem5 --tmux
360362
....
361363

362-
This will open up a split terminal by default so that you can see both the gem5 stdout and the terminal. See also: <<tmux-gem5>>
364+
This will open up a split terminal by default so that you can see both the gem5 stdout and the terminal. See also: <<tmux-gem5>>.
365+
366+
At the end of boot, it might not be very clear that you have the shell since some <<printk>> messages may appear in front of the prompt like this:
367+
368+
....
369+
# <6>[ 1.215329] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x1cd486fa865, max_idle_ns: 440795259574 ns
370+
<6>[ 1.215351] clocksource: Switched to clocksource tsc
371+
....
372+
373+
but if you look closely, the `PS1` prompt marker `#` is there already, just hit enter and a clear prompt line will appear.
363374

364375
If you forgot to open the shell and gem5 exit, you can inspect the terminal output post-mortem at:
365376

build-gem5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import os
66
import pathlib
77
import shutil
88
import subprocess
9+
import time
910

1011
import common
1112

@@ -23,6 +24,7 @@ disks_dir = os.path.join(common.gem5_system_dir, 'disks')
2324
if args.clean:
2425
common.rmrf(common.gem5_build_dir)
2526
else:
27+
start_time = time.time()
2628
os.makedirs(binaries_dir, exist_ok=True)
2729
os.makedirs(disks_dir, exist_ok=True)
2830
if not os.path.exists(os.path.join(common.gem5_src_dir, '.git')):
@@ -81,3 +83,5 @@ else:
8183
term_src_dir = os.path.join(common.gem5_src_dir, 'util/term')
8284
subprocess.check_call(['make', '-C', term_src_dir])
8385
shutil.copy2(os.path.join(term_src_dir, 'm5term'), common.gem5_m5term)
86+
end_time = time.time()
87+
common.print_time(end_time - start_time)

build-qemu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import multiprocessing
44
import os
55
import subprocess
6+
import time
67

78
import common
89

@@ -18,6 +19,7 @@ args = common.setup(parser)
1819
if args.clean:
1920
common.rmrf(common.qemu_build_dir)
2021
else:
22+
start_time = time.time()
2123
os.makedirs(common.qemu_build_dir, exist_ok=True)
2224
subprocess.check_call(
2325
[
@@ -37,5 +39,8 @@ else:
3739
# TODO factor with build.
3840
'-j', str(multiprocessing.cpu_count()),
3941
],
40-
cwd=common.qemu_build_dir
42+
cwd=common.qemu_build_dir,
43+
extra_env={'PATH': '/usr/lib/ccache:' + os.environ['PATH']},
4144
)
45+
end_time = time.time()
46+
common.print_time(end_time - start_time)

run

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python3
22

33
import os
4+
import re
45
import shlex
56
import subprocess
67
import sys
7-
import re
8+
import time
89

910
import common
1011

@@ -463,4 +464,8 @@ Run QEMU with VNC instead of the default SDL. Connect to it with:
463464
if __name__ == '__main__':
464465
parser = get_argparse()
465466
args = common.setup(parser)
466-
sys.exit(main(args))
467+
start_time = time.time()
468+
exit_status = main(args)
469+
end_time = time.time()
470+
common.print_time(end_time - start_time)
471+
sys.exit(exit_status)

0 commit comments

Comments
 (0)