FreeBSD Bugzilla – Attachment 206046 Details for
Bug 239351
panic: spin lock held too long under heavy load (net/wireguard affected, SOLVED: Upgrading BIOS to 1.24)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
kgdb script
acttrace.py (text/plain), 1.36 KB, created by
Mark Johnston
on 2019-07-25 01:08:05 UTC
(
hide
)
Description:
kgdb script
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2019-07-25 01:08:05 UTC
Size:
1.36 KB
patch
obsolete
>import gdb >import math > >def cpu_foreach(): > all_cpus = gdb.lookup_global_symbol("all_cpus").value() > bitsz = gdb.lookup_type("long").sizeof * 8 > maxid = gdb.lookup_global_symbol("mp_maxid").value() > > cpu = 0 > while cpu <= maxid: > upper = cpu >> int(math.log(bitsz, 2)) > lower = 1 << (cpu & (bitsz - 1)) > if (all_cpus['__bits'][upper] & lower) != 0: > yield cpu > cpu = cpu + 1 > >class acttrace(gdb.Command): > def __init__(self): > super(acttrace, self).__init__("acttrace", gdb.COMMAND_USER) > > def _thread_by_tid(self, tid): > threads = gdb.inferiors()[0].threads() > for td in threads: > if td.ptid[2] == tid: > return td > > def invoke(self, arg, from_tty): > # Save the currently selected thread. > curthread = gdb.selected_thread() > > # This works on most, but not all platforms. > pcpu = gdb.lookup_global_symbol("__pcpu").value() > for cpu in cpu_foreach(): > td = pcpu[cpu]['pc_curthread'] > p = td['td_proc'] > self._thread_by_tid(td['td_tid']).switch() > > print("Tracing command {} pid {} tid {} (CPU {})".format( > p['p_comm'].string(), p['p_pid'], td['td_tid'], cpu)) > gdb.execute("bt") > print > > # Switch back to the starting thread. > curthread.switch() > >acttrace()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 239351
:
205949
|
206031
|
206032
|
206036
|
206043
|
206045
| 206046 |
206050
|
206051
|
206056
|
206061
|
206063