gem5: automatically add build type to the build path

If you use it, you shall debug it, there is no basic user for gem5, so
longer paths are worth it.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-09-26 00:00:00 +00:00
parent 9f2cd88e48
commit 21a7a1ffa8
2 changed files with 6 additions and 6 deletions

View File

@@ -10699,17 +10699,17 @@ This setup only creates gitignored worktrees of the private repository inside th
The `gem5.debug` has optimizations turned off unlike the default `gem5.opt`, and provides a much better <<debug-the-emulator,debug experience>>:
....
./build-gem5 --arch aarch64 --gem5-build-id debug --gem5-build-type debug
./run --arch aarch64 --debug-vm --gem5 --gem5-build-id debug --gem5-build-type debug
./build-gem5 --arch aarch64 --gem5-build-type debug
./run --arch aarch64 --debug-vm --gem5 --gem5-build-type debug
....
We generate a separate build folder with `--gem5-build-id` just to prevent the `opt` build from getting overwritten, so we can keep both around at the same time.
The build outputs are automatically stored in a different directory from other build types such as `.opt` build, which prevents `.debug` files from overwriting `.opt` ones.
The price to pay however is high: a Linux kernel boot was about 14 times slower than opt at 71e927e63bda6507d5a528f22c78d65099bdf36f between the commands:
The price to pay for debuggability is high however: a Linux kernel boot was about 14 times slower than opt at 71e927e63bda6507d5a528f22c78d65099bdf36f between the commands:
....
./run --arch aarch64 --eval 'm5 exit' --gem5 --linux-build-id v4.16
./run --arch aarch64 --eval 'm5 exit' --gem5 --linux-build-id v4.16 --gem5-build-id debug --gem5-build-type debug
./run --arch aarch64 --eval 'm5 exit' --gem5 --linux-build-id v4.16 --gem5-build-type debug
....
so you will likely only use this when it is unavoidable.

View File

@@ -499,7 +499,7 @@ def setup(parser):
this.qemu_termout_file = os.path.join(this.qemu_run_dir, 'termout.txt')
this.qemu_rrfile = os.path.join(this.qemu_run_dir, 'rrfile')
this.gem5_out_dir = os.path.join(this.out_dir, 'gem5')
this.gem5_build_dir = os.path.join(this.gem5_out_dir, args.gem5_build_id)
this.gem5_build_dir = os.path.join(this.gem5_out_dir, args.gem5_build_id, args.gem5_build_type)
this.gem5_fake_iso = os.path.join(this.gem5_out_dir, 'fake.iso')
this.gem5_m5term = os.path.join(this.gem5_build_dir, 'm5term')
this.gem5_build_build_dir = os.path.join(this.gem5_build_dir, 'build')