From 21a7a1ffa8d45deaa29fcf97436095d8a338960b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Wed, 26 Sep 2018 00:00:00 +0000 Subject: [PATCH] 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. --- README.adoc | 10 +++++----- common.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.adoc b/README.adoc index 4bb067e..4f591ea 100644 --- a/README.adoc +++ b/README.adoc @@ -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 <>: .... -./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. diff --git a/common.py b/common.py index 44ad956..b54ed80 100644 --- a/common.py +++ b/common.py @@ -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')