以下dtrace呼叫曾經在 MacOS 11.6.2 上作業,但在升級到 MacOS 12.2.1 后它停止作業
sudo --non-interactive dtrace -l -b 16m -x mangled -x disallow_dsym -x strip -x evaltime=preinit -x preallocate=256m -n 'oneshot$target:a.out::entry { hdr_vm_addr = ((thread_t)curthread)->task->mach_header_vm_address; }' -w -p 4557
dtrace: invalid probe specifier oneshot$target:a.out::entry { hdr_vm_addr = ((thread_t)curthread)->task->mach_header_vm_address; }: in action list: task is not a member of struct thread
我如何task從thread_t現在開始?
uj5u.com熱心網友回復:
看起來可能是這樣t_task。以下是查看內置變數型別的方法,例如curthread:
$ sudo dtrace -n 'BEGIN { print(*curthread); exit(0); }'
dtrace: description 'BEGIN ' matched 1 probe
CPU ID FUNCTION:NAME
4 1 :BEGIN struct thread {
union {
queue_chain_t runq_links = {
struct queue_entry *next = 0
struct queue_entry *prev = 0
}
...
struct task *t_task = 0xffffff8bd07859f0
...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/434555.html
上一篇:SwiftUI表單編號輸入
