This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-08-10 01:00:00 +00:00
parent 4e3f8be59e
commit 7dc9681045
4 changed files with 136 additions and 4 deletions

View File

@@ -13048,12 +13048,58 @@ Library support is automatically detected, and only built if you have it install
===== gem5 only dump selected stats
TODO
https://stackoverflow.com/questions/52014953/how-to-dump-only-a-single-or-certain-selected-stats-in-gem5
To prevent the stats file from becoming humongous.
https://stackoverflow.com/questions/52014953/how-to-dump-only-a-single-or-certain-selected-stats-in-gem5/57221132#57221132
===== Meaning of each gem5 stat
Well, run minimal examples, and reverse engineer them up!
We can start with link:userland/arch/x86_64/freestanding/linux/hello.S[] on atomic with <<gem5-execall-trace-format>>.
....
./run \
--arch aarch64 \
--emulator gem5 \
--userland userland/arch/aarch64/freestanding/linux/hello.S \
--trace ExecAll \
--trace-stdout \
;
....
which gives:
....
0: system.cpu: A0 T0 : @_start : movz x0, #1, #0 : IntAlu : D=0x0000000000000001 flags=(IsInteger)
500: system.cpu: A0 T0 : @_start+4 : adr x1, #28 : IntAlu : D=0x0000000000400098 flags=(IsInteger)
1000: system.cpu: A0 T0 : @_start+8 : ldr w2, #4194464 : MemRead : D=0x0000000000000006 A=0x4000a0 flags=(IsInteger|IsMemRef|IsLoad)
1500: system.cpu: A0 T0 : @_start+12 : movz x8, #64, #0 : IntAlu : D=0x0000000000000040 flags=(IsInteger)
2000: system.cpu: A0 T0 : @_start+16 : svc #0x0 : IntAlu : flags=(IsSerializeAfter|IsNonSpeculative|IsSyscall)
2500: system.cpu: A0 T0 : @_start+20 : movz x0, #0, #0 : IntAlu : D=0x0000000000000000 flags=(IsInteger)
3000: system.cpu: A0 T0 : @_start+24 : movz x8, #93, #0 : IntAlu : D=0x000000000000005d flags=(IsInteger)
3500: system.cpu: A0 T0 : @_start+28 : svc #0x0 : IntAlu : flags=(IsSerializeAfter|IsNonSpeculative|IsSyscall)
....
The most important stat of all is usually the cycle count, which is a direct measure of performance if you modelled you system well:
....
sim_ticks 3500 # Number of ticks simulated
....
Next, `sim_insts` and `sim_ops` are often critical:
....
sim_insts 6 # Number of instructions simulated
sim_ops 6 # Number of ops (including micro ops) simulated
....
`sim_ops` is like `sim_insts` but it also includes <<gem5-microops>>.
In <<gem5-syscall-emulation-mode>>, syscall instructions are magic, and therefore appear to not be counted, that is why we get 6 instructions instead of 8.
===== gem5 stats internals
This describes the internals of the <<gem5-m5out-stats-txt-file>>.
@@ -13183,7 +13229,7 @@ On Ubuntu 20.04, you can also see the dot file "directly" with xdot:
xdot "$(./getvar --arch arm --emulator gem5 m5out_dir)/config.dot"
....
which is kind of really cool because it allows you to graph arrows with clicks.
which is kind of really cool because it allows you to view graph arrows on hover. This can be very useful because the PDF and SVG often overlap so many arrows together that you just can't know which one is coming from/going to where.
It is worth noting that if you are running a bunch of short simulations, dot/SVG/PDF generation could have a significant impact in simulation startup time, so it is something to watch out for. As per https://gem5-review.googlesource.com/c/public/gem5/+/29232 it can be turned off with:
@@ -13392,7 +13438,7 @@ A trivial and very direct way to see message would be:
....
./run \
--emulator gem5 \
--userland \userland/arch/x86_64/freestanding/linux/hello.S \
--userland userland/arch/x86_64/freestanding/linux/hello.S \
--trace-insts-stdout \
-- \
--param 'system.cpu[0].max_insts_all_threads = 3' \
@@ -20155,6 +20201,7 @@ MyClassToString { a: 1, b: 2 }
toString
my type is MyClassToString and a is 1 and b is 2
....
* link:rootfs_overlay/lkmc/nodejs/http.js[]: `http` module to create a simple HTTP server: https://nodejs.org/api/http.html
===== NPM