Skip to content

Commit b1bd456

Browse files
committed
config: replace cli with direct common_ options
1 parent 1cb056a commit b1bd456

File tree

14 files changed

+10
-45
lines changed

14 files changed

+10
-45
lines changed

README.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -846,14 +846,10 @@ It gets annoying to retype `-a aarch64` for every single command, or to remember
846846
So simplify that, do:
847847

848848
....
849-
cp cli.example data/cli
849+
cp config.example data/config
850850
....
851851

852-
and then edit the `data/cli` file to your needs.
853-
854-
That file is used to pass extra command line arguments to most of our utilities.
855-
856-
Of course, you could get by with the shell history, or your own aliases, but we've felt that it was worth introducing a common mechanism for that.
852+
and then edit the `data/config` file to your needs.
857853

858854
=== Clean the build
859855

@@ -7342,7 +7338,7 @@ printf '' > data/readfile
73427338
./run -a "$arch" -g -- -r 1
73437339
....
73447340

7345-
These commands output the approximate number of CPU cycles it took Dhrystone to run.
7341+
The commands output the approximate number of CPU cycles it took Dhrystone to run.
73467342

73477343
For more serious tests, you will likely want to automate logging the commands ran and results to files, a good example is: link:gem5-bench-cache[].
73487344

bench-all

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/usr/bin/env bash
22
# Run all benchmarks for this repo, and save the results to the
33
# benchmark repo, which should be cloned at ../linux-kernel-module-cheat-benchmarks.
4-
set -eux
54
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
6-
5+
set -x
76
bench_build=false
87
bench_buildroot_baseline=false
98
bench_gem5_build=false
109
bench_linux_boot=false
1110
default_arch=x86_64
1211
update_repo=false
13-
set -- ${cli_bench_all:-} "$@"
1412
while getopts Aa:Bbglu OPT; do
1513
case "$OPT" in
1614
A)

build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
set -eu
32
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
4-
set -- ${cli_build:-} "$@"
53
mkdir -p "${common_out_dir}"
64
br2_cli_file="${common_out_dir}/br2_cli"
75
rm -f "$br2_cli_file"

cli.example

Lines changed: 0 additions & 16 deletions
This file was deleted.

common

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -eu
4+
35
common_abspath() (
46
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
57
)
@@ -146,7 +148,7 @@ common_qemu_variant=default
146148
common_run_id=0
147149
common_suffix=
148150

149-
f="${common_data_dir}/cli"
151+
f="${common_data_dir}/config"
150152
if [ -f "$f" ]; then
151153
. "$f"
152154
fi

config.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
common_arch=aarch64
3+
common_gem5=true

qemu-trace2txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
set -eu
32
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
4-
set -- ${cli_qemu_trace2txt:-} "$@"
53
while getopts a: OPT; do
64
case "$OPT" in
75
a)

run

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
set -eu
32
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
4-
set -- ${cli_run:-} "$@"
53

64
# CLI handling.
75
cpus=1

rungdb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
set -eu
32
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
4-
set -- ${cli_rungdb:-} "$@"
53
after=
64
before=
75
lx_symbols="-ex 'lx-symbols ../kernel_module-1.0/' \\

rungdb-user

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
set -eu
32
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
4-
set -- ${cli_rungdb_user:-} "$@"
53
usage="$0 <exec-relative-path> [<brk-symbol>]"
64
gem5_opt=
75
while getopts a:gh OPT; do

0 commit comments

Comments
 (0)