mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
OK, direct the annoying traces to the output folder
Otherwise it was getting messy to distinguish between trace-events and trace-<pid> in the .gitignore. Now only the latest trace will be kept, with a fixed name.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,7 +9,6 @@ gitignore*
|
|||||||
# Specific files.
|
# Specific files.
|
||||||
/9p
|
/9p
|
||||||
/README.html
|
/README.html
|
||||||
/trace-[0-9]*
|
|
||||||
|
|
||||||
# GEM5
|
# GEM5
|
||||||
/m5out
|
/m5out
|
||||||
|
|||||||
7
run
7
run
@@ -25,7 +25,8 @@ initramfs=false
|
|||||||
memory=256M
|
memory=256M
|
||||||
nographic=true
|
nographic=true
|
||||||
root=''
|
root=''
|
||||||
while getopts a:c:DdE:e:f:G:ghIiKkm:x OPT; do
|
trace_enable=''
|
||||||
|
while getopts a:c:DdE:e:f:G:ghIiKkm:T:x OPT; do
|
||||||
case "$OPT" in
|
case "$OPT" in
|
||||||
a)
|
a)
|
||||||
arch="$OPTARG"
|
arch="$OPTARG"
|
||||||
@@ -78,6 +79,9 @@ while getopts a:c:DdE:e:f:G:ghIiKkm:x OPT; do
|
|||||||
m)
|
m)
|
||||||
memory="$OPTARG"
|
memory="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
T)
|
||||||
|
trace_enable="$OPTARG"
|
||||||
|
;;
|
||||||
x)
|
x)
|
||||||
nographic=false
|
nographic=false
|
||||||
;;
|
;;
|
||||||
@@ -169,6 +173,7 @@ ${debug_vm} \
|
|||||||
-monitor telnet::45454,server,nowait \
|
-monitor telnet::45454,server,nowait \
|
||||||
-netdev user,hostfwd=tcp::45455-:45455,hostfwd=tcp::45456-:22,id=net0 \
|
-netdev user,hostfwd=tcp::45455-:45455,hostfwd=tcp::45456-:22,id=net0 \
|
||||||
-smp ${cpus} \
|
-smp ${cpus} \
|
||||||
|
-trace enable=${trace_enable},file='${lkmc_out_dir}/trace.bin' \
|
||||||
-virtfs local,path=9p,mount_tag=host_scratch,security_model=mapped,id=host_scratch \
|
-virtfs local,path=9p,mount_tag=host_scratch,security_model=mapped,id=host_scratch \
|
||||||
-virtfs local,path=${out_dir}/build,mount_tag=host_out,security_model=mapped,id=host_out \
|
-virtfs local,path=${out_dir}/build,mount_tag=host_out,security_model=mapped,id=host_out \
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -35,5 +35,10 @@
|
|||||||
|`-K` | |Use KVM. Only works if guest arch == host arch.
|
|`-K` | |Use KVM. Only works if guest arch == host arch.
|
||||||
|`-k` | |Enable KGDB.
|
|`-k` | |Enable KGDB.
|
||||||
|`-m` | |Set the memory size of the guest. E.g.: `-m 512M`. Default: `256M`.
|
|`-m` | |Set the memory size of the guest. E.g.: `-m 512M`. Default: `256M`.
|
||||||
|
|`-T` | |Enable extra QEMU trace events.
|
||||||
|
`./configure --enable-trace-backends=simple` seems to enable
|
||||||
|
some by default, e.g. `pr_manager_run`, and I don't know how to
|
||||||
|
get rid of them. But those events are rare and should not impact
|
||||||
|
performance, so we just ignore them for now.
|
||||||
|`-x` | |Run in graphic mode. Mnemonic: X11.
|
|`-x` | |Run in graphic mode. Mnemonic: X11.
|
||||||
|===
|
|===
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ while getopts a: OPT; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
set_common_vars "$arch" false
|
set_common_vars "$arch" false
|
||||||
time ./run -a "$arch" -e 'init=/poweroff.out' -- -trace exec_tb,file="${lkmc_out_dir}/trace.bin"
|
time ./run -a "$arch" -e 'init=/poweroff.out' -T exec_tb
|
||||||
time ./qemu/scripts/simpletrace.py "${out_dir}/build/host-qemu-custom/trace-events-all" "${lkmc_out_dir}/trace.bin" >"${lkmc_out_dir}/trace.txt"
|
time ./qemu/scripts/simpletrace.py "${out_dir}/build/host-qemu-custom/trace-events-all" "${lkmc_out_dir}/trace.bin" >"${lkmc_out_dir}/trace.txt"
|
||||||
|
|
||||||
# Instruction count.
|
# Instruction count.
|
||||||
|
|||||||
Reference in New Issue
Block a user