mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
config: replace cli with direct common_ options
This commit is contained in:
10
README.adoc
10
README.adoc
@@ -846,14 +846,10 @@ It gets annoying to retype `-a aarch64` for every single command, or to remember
|
||||
So simplify that, do:
|
||||
|
||||
....
|
||||
cp cli.example data/cli
|
||||
cp config.example data/config
|
||||
....
|
||||
|
||||
and then edit the `data/cli` file to your needs.
|
||||
|
||||
That file is used to pass extra command line arguments to most of our utilities.
|
||||
|
||||
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.
|
||||
and then edit the `data/config` file to your needs.
|
||||
|
||||
=== Clean the build
|
||||
|
||||
@@ -7342,7 +7338,7 @@ printf '' > data/readfile
|
||||
./run -a "$arch" -g -- -r 1
|
||||
....
|
||||
|
||||
These commands output the approximate number of CPU cycles it took Dhrystone to run.
|
||||
The commands output the approximate number of CPU cycles it took Dhrystone to run.
|
||||
|
||||
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[].
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run all benchmarks for this repo, and save the results to the
|
||||
# benchmark repo, which should be cloned at ../linux-kernel-module-cheat-benchmarks.
|
||||
set -eux
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
|
||||
set -x
|
||||
bench_build=false
|
||||
bench_buildroot_baseline=false
|
||||
bench_gem5_build=false
|
||||
bench_linux_boot=false
|
||||
default_arch=x86_64
|
||||
update_repo=false
|
||||
set -- ${cli_bench_all:-} "$@"
|
||||
while getopts Aa:Bbglu OPT; do
|
||||
case "$OPT" in
|
||||
A)
|
||||
|
||||
2
build
2
build
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_build:-} "$@"
|
||||
mkdir -p "${common_out_dir}"
|
||||
br2_cli_file="${common_out_dir}/br2_cli"
|
||||
rm -f "$br2_cli_file"
|
||||
|
||||
16
cli.example
16
cli.example
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
arch=x86_64
|
||||
gem5=
|
||||
#gem5=-g
|
||||
printf '
|
||||
#BR2_TARGET_ROOTFS_EXT2_SIZE="1024M"
|
||||
' > br2.gitignore
|
||||
cli_bench_all=""
|
||||
cli_build="-a ${arch} -b br2.gitignore -b br2_x11 ${gem5}"
|
||||
cli_run="-a ${arch} ${gem5}"
|
||||
cli_rungdb="-a ${arch} ${gem5}"
|
||||
cli_rungdb_user="-a ${arch} ${gem5}"
|
||||
cli_rungdbserver="-a ${arch} ${gem5}"
|
||||
cli_runtc="-a ${arch}"
|
||||
cli_trace2line="-a ${arch}"
|
||||
cli_trace_boot="-a ${arch}"
|
||||
4
common
4
common
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
common_abspath() (
|
||||
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
|
||||
)
|
||||
@@ -146,7 +148,7 @@ common_qemu_variant=default
|
||||
common_run_id=0
|
||||
common_suffix=
|
||||
|
||||
f="${common_data_dir}/cli"
|
||||
f="${common_data_dir}/config"
|
||||
if [ -f "$f" ]; then
|
||||
. "$f"
|
||||
fi
|
||||
|
||||
3
config.example
Normal file
3
config.example
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
common_arch=aarch64
|
||||
common_gem5=true
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_qemu_trace2txt:-} "$@"
|
||||
while getopts a: OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
|
||||
2
run
2
run
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_run:-} "$@"
|
||||
|
||||
# CLI handling.
|
||||
cpus=1
|
||||
|
||||
2
rungdb
2
rungdb
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_rungdb:-} "$@"
|
||||
after=
|
||||
before=
|
||||
lx_symbols="-ex 'lx-symbols ../kernel_module-1.0/' \\
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_rungdb_user:-} "$@"
|
||||
usage="$0 <exec-relative-path> [<brk-symbol>]"
|
||||
gem5_opt=
|
||||
while getopts a:gh OPT; do
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_rungdbserver:-} "$@"
|
||||
while getopts a:g OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
|
||||
2
runtc
2
runtc
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_runtc:-} "$@"
|
||||
while getopts a:gh OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_trace_boot:-} "$@"
|
||||
while getopts a:g OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
set -- ${cli_trace2line:-} "$@"
|
||||
while getopts a:g OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
|
||||
Reference in New Issue
Block a user