Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

README, touch.py: the new debugging aids (stacks top, systrace_name)

vcvkk2567b58307fa
diff --git a/README.md b/README.md
index 1dadb03..4bb6014 100644
--- a/README.md
+++ b/README.md
@@ -124,7 +124,7 @@ XL_SECS=900 XL_CMDLINE="touchscreen=1 cpufreq=1 bootcpu=7" ./xl run # 15 м
| `rec_secs=N` | записывать экран N секунд (`rec_start=S`, `rec_mb=M`, не больше 640); потом `./xl recording out.mp4` |
| `-v` | текст загрузки на экране (по умолчанию у `xl run`, если `XL_CMDLINE` не задана) |
| `applog=1` / `applog=2` | stderr приложений в журнал / плюс os_log всех процессов |
-| `systrace=1` | печатать неудачные системные вызовы и аварии процессов |
+| `systrace=1` | печатать неудачные системные вызовы и аварии процессов (`systrace_name=ИМЯ` — только процессов с этим именем) |
| `machine_name=1` | представляться iPhone10,3 (иначе устройство называется «iPod touch»); мало проверено |
## Сборка из исходников
@@ -225,7 +225,8 @@ Userland не изменён ни в одном байте: всё, чего е
драйвер сенсора раз в минуту — сводку касаний.
- `userabort:` в журнале — стек процесса, вызвавшего `abort()`; `usertrap:` (с `systrace=1`) — аварии.
- Стеки зависшего процесса на лету (QEMU): `qemu/touch.py stacks ИМЯ`, затем `qemu/symstack.py ЖУРНАЛ ИМЯ`
- (нужен [`ipsw`](https://github.com/blacktop/ipsw)).
+ (нужен [`ipsw`](https://github.com/blacktop/ipsw)). `qemu/touch.py stacks top` — кто занимал процессор с прошлого
+ такого запроса (строки `top:` в журнале): «тормозит» система или чего-то ждёт, на экране не отличить.
- `userland/jobinfo.py [-s СЛУЖБА | МЕТКА…]` — штатные задания launchd и кто даёт Mach-службу.
- `OSLOG=all userland/build.sh` — os_log всех заданий на консоль (очень многословно).
diff --git a/qemu/touch.py b/qemu/touch.py
index 58346ca..6c90d36 100755
--- a/qemu/touch.py
+++ b/qemu/touch.py
@@ -8,7 +8,9 @@ usage: touch.py STEP...
key NAME [MS] press a button: lock, home, volup, voldown; fivefingers = five fingers on the
screen for MS (held 1500 ms they end the run)
stacks PROCESS have the kernel print where the threads of that process are (the
- addresses come out in the log; qemu/symstack.py names them)
+ addresses come out in the log; qemu/symstack.py names them).
+ "stacks top" is something else: which processes have had the processor
+ since it was last asked ("top:" lines in the log)
wait SECONDS
Positions are fractions of the screen: 0 0 is the top left corner, 1 1 the bottom right.
Example, the "swipe up to open" gesture: touch.py swipe 0.5 0.98 0.5 0.4 250