diff --git a/README.adoc b/README.adoc index 255b97e..262af9f 100644 --- a/README.adoc +++ b/README.adoc @@ -6899,6 +6899,10 @@ Getting everything to work required careful choice of QEMU command line options: * https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144 * https://unix.stackexchange.com/questions/167165/how-to-pass-ctrl-c-to-the-guest-when-running-qemu-with-nographic/436321#436321 +==== QEMU monitor from guest + +Peter Maydell said potentially not possible nicely as of August 2018: https://stackoverflow.com/questions/51747744/how-to-run-a-qemu-monitor-command-from-inside-the-guest/51764110#51764110 + === Debug the emulator When you start hacking QEMU or gem5, it is useful to see what is going on inside the emulator themselves. @@ -8855,6 +8859,9 @@ All benchmarks were run on the <> machine, unless stated otherwise. Run all benchmarks and upload the results: .... +cd .. +git clone https://github.com/cirosantilli/linux-kernel-module-cheat-regression +cd - ./bench-all -A .... @@ -9391,6 +9398,18 @@ This can be used to check the determinism of: * <> * <> +==== Releases + +This is not yet super stable, but one day maybe: + +.... +./do-release +.... + +Source: link:do-release[]. + +This should in particular enable <>. + === About This project is for people who want to learn and modify low level system components: diff --git a/bench-all b/bench-all index ac8652b..8610fdf 100755 --- a/bench-all +++ b/bench-all @@ -1,6 +1,4 @@ #!/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. . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common" set -x bench_build=false @@ -44,7 +42,6 @@ shift "$(($OPTIND - 1))" comment="${1:-}" # Create output directory. -sha="$(git log -1 --format="%H")" benchmark_repo="${common_root_dir}/../linux-kernel-module-cheat-regression" mkdir -p "$benchmark_repo" last_dir="$(ls "$benchmark_repo" | grep -E '^[0-9]' | tail -n 1)" @@ -54,8 +51,7 @@ else seq_id=0 fi seq_id="$(printf '%0.4d' "$seq_id")" -sha="$(git log -1 --format="%H")" -dir_basename="${seq_id}_${sha}" +dir_basename="${seq_id}_${common_sha}" new_dir="${benchmark_repo}/${dir_basename}" mkdir "$new_dir" @@ -64,7 +60,7 @@ if "$bench_build"; then common_suffix=bench common_setup rm -rf "$common_out_arch_dir" - ./build -a "$common_arch" -B 'BR2_CCACHE=n' -s "$suffix" + ./build -a "$common_arch" -B 'BR2_CCACHE=n' -s "$common_suffix" cp "${common_build_dir}/build-time.log" "${new_dir}/build-time-${common_arch}.log" rm -rf "$common_out_arch_dir" fi @@ -90,16 +86,15 @@ if "$bench_gem5_build"; then arches='x86_64 arm' for common_arch in $arches; do common_setup - cd "${common_root_dir}/gem5/gem5" + cd "${common_gem5_src_dir}" git clean -xdf - cd "${common_root_dir}/gem5" results_file="${common_gem5_out_dir}/bench-build.txt" gem5_outdir="${common_out_dir}/bench_build" rm -fr "$results_file" "${gem5_outdir}" # TODO understand better: --foreground required otherwise we cannot # kill the build with Ctrl+C if something goes wrong, can be minimized to: # bash -c "eval 'timeout 5 sleep 3'" - common_bench_cmd "timeout --foreground 900 ./build -a '$common_arch' -o '${gem5_outdir}'" "$results_file" + common_bench_cmd "timeout --foreground 900 ../build -a '$common_arch' -o '${gem5_outdir}'" "$results_file" cp "$results_file" "${new_dir}/gem5-bench-build-${common_arch}.txt" cd "${common_root_dir}/gem5/gem5" git clean -xdf diff --git a/build b/build index c7a2f3c..95156d4 100755 --- a/build +++ b/build @@ -18,7 +18,7 @@ kernel_config_fragments= post_script_args= qemu_sdl='--enable-sdl --with-sdlabi=2.0' v=0 -while getopts 'a:B:b:C:c:fGgj:hIiK:kL:lM:p:Q:qSst::v' OPT; do +while getopts 'a:B:b:C:c:fGgj:hIiK:kL:lM:p:Q:qSs:t:v' OPT; do case "$OPT" in a) common_arch="$OPTARG" diff --git a/common b/common index bb0cc61..052ee3d 100644 --- a/common +++ b/common @@ -48,7 +48,7 @@ common_setup() { common_buildroot_dir="${common_root_dir}/buildroot" common_arch_dir="$common_arch" if [ -n "$common_suffix" ]; then - common_arch_dir="${arch_dir}-${common_suffix}" + common_arch_dir="${common_arch_dir}-${common_suffix}" fi common_out_arch_dir="${common_out_dir}/${common_arch_dir}" common_buildroot_out_dir="${common_out_arch_dir}/buildroot" @@ -146,6 +146,7 @@ common_gem5_worktree= common_linux_variant=default common_qemu_variant=default common_run_id=0 +common_sha="$(git log -1 --format="%H")" common_suffix= f="${common_data_dir}/config" diff --git a/do-release b/do-release new file mode 100755 index 0000000..8bb6308 --- /dev/null +++ b/do-release @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common" +common_setup +./build-all +./zip-img +tag="sha-${common_sha}" +upload_basename="images-${common_sha}.zip" +git tag "$tag" +git push --tags +#curl "https://api.github.com/repos/cirosantilli/linux-kernel-module-cheat/releases/tags/${tag}/assets?access_token=$(cat data/access_token)&tag_name=${upload_basename}" \ +# --header 'Content-Type: application/zip' \ +# --upload-file "${common_out_dir}/${upload_basename}" \ +# -H 'Accept: application/vnd.github.v3+json' \ +# -X POST \ +#; +./bench-all -u diff --git a/run b/run index c7825f0..12a3b17 100755 --- a/run +++ b/run @@ -364,7 +364,6 @@ ${qemu_common} \ -append '${root} ${extra_append}' \\ -cpu cortex-a57 \\ ${virtio_gpu_pci} \ --kernel '${common_images_dir}/Image' \\ ${extra_flags} \ " ;; @@ -380,7 +379,6 @@ ${qemu_common} \ -M malta \\ -append '${root} ${extra_append}' \\ -cpu I6400 \\ --kernel '${common_vmlinux}' \\ ${extra_flags} \ " ;; diff --git a/zip-img b/zip-img index a4bb013..86f8358 100755 --- a/zip-img +++ b/zip-img @@ -1,9 +1,10 @@ #!/usr/bin/env bash -set -eu -outfile="out/out.zip" +. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common" +common_setup +outfile="${common_out_dir}/lkmc-${common_sha}.zip" rm -f "$outfile" for arch in x86_64 arm aarch64; do - img_dir="out/${arch}/buildroot/images" - rm -f "${img_dir}/rootfs.ext2" - zip -r "$outfile" "${img_dir}" + common_setup + rm -f "${common_images_dir}/rootfs.ext2" + zip -r "$outfile" "$common_images_dir" done