mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
gem5 readfile use file, not stdin, or else sh does not work to start interaction
This commit is contained in:
@@ -11528,7 +11528,7 @@ So we can do it like:
|
|||||||
....
|
....
|
||||||
# Boot, checkpoint and exit.
|
# Boot, checkpoint and exit.
|
||||||
printf 'echo "setup run";m5 exit' > "$(./getvar gem5_readfile_file)"
|
printf 'echo "setup run";m5 exit' > "$(./getvar gem5_readfile_file)"
|
||||||
./run --emulator gem5 --eval 'm5 checkpoint;m5 readfile | sh'
|
./run --emulator gem5 --eval 'm5 checkpoint;m5 readfile > /tmp/gem5.sh && sh /tmp/gem5.sh'
|
||||||
|
|
||||||
# Restore and run the first benchmark.
|
# Restore and run the first benchmark.
|
||||||
printf 'echo "first benchmark";m5 exit' > "$(./getvar gem5_readfile_file)"
|
printf 'echo "first benchmark";m5 exit' > "$(./getvar gem5_readfile_file)"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# https://cirosantilli.com/linux-kernel-module-cheat#gem5-restore-new-script
|
# https://cirosantilli.com/linux-kernel-module-cheat#gem5-restore-new-script
|
||||||
m5 checkpoint
|
m5 checkpoint
|
||||||
|
tmp="$(mktemp)"
|
||||||
|
m5 readfile > "$tmp"
|
||||||
m5 resetstats
|
m5 resetstats
|
||||||
m5 readfile | sh
|
sh "$tmp"
|
||||||
m5 exit
|
m5 exit
|
||||||
|
|||||||
Reference in New Issue
Block a user