This instance will be upgraded to Heptapod 0.27.1 on 2021-12-02 at 15:00 UTC+1 (a few minutes of down time)

Commit 4a8058b5 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU logging: updated DryOS and VxWorks task switch handling

It was quite hard to pass the test suite, as there were lots of edge cases:

- context switch may happen either in a timer interrupt, or in a regular task (e.g. msleep, sempahores and so on)
- context switch is not atomic - it happens a few instructions (or function calls!) afterh updating the current task pointer
- until the registers are swapped for the new task, we are still on the stack of the previous task
- there may be dummy task switches (i.e. from one task to the same task)
- an interrupt can occur in the middle of a (non-atomic) context switch (!)
- VxWorks models do not even use a unique task ID (!)

Result: QEMU no longer crashes during logging tests!

Issue: these cameras do not appear to use an unique task ID. Workaround: assign our own task IDs.

--HG--
branch : qemu
parent 2db600ab6a08
2f6635ca656a73b583cbba70b5fd01c1 calls-main.log
f56b7edce3c6ae87bbc715dc11ab8659 calls-main.log
c6a485437869c137c693722f889909d4 calls-main.idc
8ccc21ecbe4e300565f683b93a665ba5 calls-main-basic.log
f3f3a92e5f1388519c9fa6c7d7a93b00 calls-main-basic.idc
f30f30d05cf07eedcd08399dbb2a703b calls-main.log
c9903432b80f6ab50b7d68dbacccbc2a calls-main.log
0d69a7d87554905e92ed48f814a94e1a calls-main.idc
32e58a6dc3cb4538704e262f8a4a93fd calls-main-basic.log
e9d3ae71cc91f1c1d0ab9825178d70ab calls-main-basic.idc
0b4b2fd3b4cba068bd7d49690e69e149 calls-main.log
b7297c199eacd77d8e652ec2edb10244 calls-main.log
cc2befee42d44f2477a89bf719bcaf45 calls-main.idc
c487cbfa506dac1cfa41845aece394c9 calls-main-basic.log
6311299e1380ee2510b15c2ea9640f96 calls-main-basic.idc
98279beee6778b48679201a3b2fb79b3 calls-main.log
b1c3af935632edd7ee27d37b3e1f75fb calls-main.log
ca125ed5170ca47fe752f393d4becde6 calls-main.idc
62d0de1b7b1168e786f198b90f14c101 calls-main-basic.log
62f4ab58a5dc12aa548e8611e563ca1c calls-main-basic.idc
34d84726baf8c1717e13f080ce234f99 calls-main.log
1b6705fbbade17575ee71a0754bf4af4 calls-main.log
87eb975fe530a4eeb436ea95e2719a32 calls-main.idc
b091d78014f2890d8a692e5539400096 calls-main-basic.log
ea20d42c1c5e61f2f9b8ed932da1ad36 calls-main-basic.log
3bc141c31f6af678b90bdf6d6fcdb994 calls-main-basic.idc
ec470362430e13ce1959ed938f8a5229 calls-main.log
0eb7cce0b2b992c56eeb3caafc48fdbb calls-main.log
be42f7617090cd4d235a186ffe77d14b calls-main.idc
52dfe9f9e5a83d3abb2b1b88974dcb7a calls-main-basic.log
3fda3c755a07568d87e46486c78c62f3 calls-main-basic.idc
fefa544c0801de1cef089153aa13acc1 calls-main.log
0bea79af9a6b52a2f98e9e5dbc5f56df calls-main.log
8ad219bb9f359c382938c1035044f565 calls-main.idc
a75467f1dc6ece5540983deb2ce53f48 calls-main-basic.log
b62db66a949d86610081a12d13c92cfe calls-main-basic.idc
a9852b2b51dd23da03ffa957c7c4e6ec calls-main.log
1d15189e939ddd47d26a663fe74fc1c0 calls-main.log
99c16212731dca901d6ea1ffe95d822d calls-main.idc
52c866bc78e2cdbeb12c7c1861700d39 calls-main-basic.log
cc8845fa31870a400836df9483090d9a calls-main-basic.idc
2a1ceb7c8efd9e488a0dd291347e0562 calls-main.log
7fb444a2d78b02b87fed3596557878c3 calls-main.log
16d48c8bf4e1ac7d97c51fa345ad09c4 calls-main.idc
fdcf6ca504d0f404f6dd9567365b0b4b calls-main-basic.log
0b3638d0ad622e9f0da942cc1ac47dbd calls-main-basic.idc
d3085ec0c6dcb4057343996352a3c859 calls-main.idc
cbc4582fee4b37a5f70b9e42798a1923 calls-main-basic.log
d0b31ceed138eb774ab0893069a9f4f1 calls-main-basic.log
1ec1769c8f9f770a81ac3630489f1d34 calls-main-basic.idc
3c2e8c3698c1654db4bc106236b74815 calls-main.log
a2da497427ea579685dc09b11c3cfdc9 calls-main.log
dc8d89dcc337a6c95616a2dfe714ee71 calls-main.idc
68ff0eae9c0eefc1742964a214858eaa calls-main-basic.log
e18550b14074b05faa64fc00e1febe85 calls-main-basic.idc
d82c2f91659d0429c6474aca13389939 calls-main.log
22eda72a13f8f8fa937b023dad57cca2 calls-main.log
2102981ce2a6c0bb194ba9aaac864df6 calls-main.idc
ff2942b8af81731e566654f93c13edb8 calls-main-basic.log
71ed0135a7364a38867040a00d5749f6 calls-main-basic.idc
2bf410a5e7c5d1da7f054868a6180968 calls-main.idc
09cd8c05d7f9f17b5bd245f4bb2deb9b calls-main-basic.log
1a87eeeca1622fe08ef34df34078b97c calls-main-basic.log
d10caf116e5bbb1630893a94c6e245e5 calls-main-basic.idc
6e323e62e6d4bdee039e71e26552b3fe calls-main.log
3fe82128a424f713574fa9937f568ae3 calls-main.log
2584f8681f3c7e8f4ffb4b103ec16dbd calls-main.idc
036cd3f6a8ca2db73a370992522175e6 calls-main-basic.log
4259fc145af1aabde4bb9f9e215fe45c calls-main-basic.idc
a8f2335a5ee5d2799289695cfc7e49ab calls-main.log
f16b104962478ab875335342db5e6a36 calls-main.log
af17b4b7931281d72e901b70e0364f05 calls-main.idc
f772169600f8fdc7681ede890f7ad957 calls-main-basic.log
d381dcfbce3ec597d9004c4c8dc2bc62 calls-main-basic.idc
0394e9b62a16d548ff41abc01ecb2338 calls-main.log
f4fe53399543c90dba1b17cdf0746215 calls-main.log
817d6ff43314202c17d0bba3df50cb6a calls-main.idc
68bc0c7fd60a069fb37fd69f871c7f74 calls-main-basic.log
57c3f5a48232619934e82a63b70dc726 calls-main-basic.idc
......@@ -1361,12 +1361,6 @@ done; cleanup
function test_calls_cstack {
# skip VxWorks models for now
if grep -q VxWorks $CAM/ROM1.BIN; then
echo "skipping"
return
fi
# log all function calls/returns, interrupts
# and DebugMsg calls with call stack for each message
if [ -f $CAM/patches.gdb ]; then
......
......@@ -71,7 +71,7 @@ for line in lines:
pass
else:
assert line[0] == "["
if not startup_workaround or stackid != "Startup":
if not startup_workaround or stackid not in ["Startup", "tStartup"]:
assert current_stack == callstacks[stackid]
match_stacks(current_stack, printed_stack)
printed_stack = None
......@@ -81,9 +81,9 @@ for line in lines:
call_stacks += 1
continue
elif "Task switch" in line:
elif "Task switch to" in line:
task_switches += 1
m = re.search(" to ([^: ]*):", line)
m = re.search(" to .. ([^: ]*):", line)
assert m
if stackid != "interrupt":
stackid = m.groups()[0]
......@@ -105,7 +105,7 @@ for line in lines:
callstacks[stackid].append(line)
interrupts += 1
elif startup_workaround and stackid == "Startup":
elif startup_workaround and stackid in ["Startup", "tStartup"]:
# fixme: some cameras start two different tasks with the same name
# this confuses our checks; skip it for now
pass
......@@ -115,7 +115,7 @@ for line in lines:
assert level == len(current_stack)
current_stack.append(line)
elif "return " in line:
elif "return " in line and "to 0x" in line:
level = line.index("return ")
assert level < len(current_stack)
current_stack = callstacks[stackid] = current_stack[:level]
......@@ -135,10 +135,10 @@ for line in lines:
# fixme: currently, context info is printed for the new (updated) state
# e.g. task switch to init:... at [init:...]
# or: interrupt 10h ... at [INT-10:...]
# todo: task switch to foobar:... at [old_task:...]
# interrupt 10h ... at [old_task:...]
# todo: task switch to foobar:... at [old_task:...] (done outside interrupts)
# interrupt 10h ... at [old_task:...] (not done)
at = re.search(" at \[(.+):(.+):(.+)\]", line)
if at:
if at and "Task switch" not in line: # skip checking "Task switch" lines for now
at_task, at_a1, at_a2 = at.groups()
debug("<%s:%s:%s>", at_task, at_a1, at_a2)
assert stackid == ("interrupt" if at_task.startswith("INT-") else at_task)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment