freenode/#sbcl - IRC Chatlog
Search
6:51:44
no-defun-allowed
Is there something like Clozure's CCL:MAP-CALL-FRAMES that would allow me to iterate over the call stack of a thread?
7:10:03
no-defun-allowed
Yes, but of another thread (which I guess I didn't make clear). I can give :process to map-call-frames.
7:12:50
no-defun-allowed
That probably would be an awful idea without interrupting the thread; could just do that in a BT:INTERRUPT-THREAD to get its call stack.
7:23:04
scymtym
no-defun-allowed: a quick and dirty version could go like this: (defun frames-of (thread) (let ((frames '())) (sb-thread:interrupt-thread thread (lambda () (setf frames (sb-debug:list-backtrace)))) (loop :until frames) frames))
7:25:53
scymtym
minimal improvements for a proper version: 1) do something about the busy looping 2) check whether things need to be copied based on SB-EXT:STACK-ALLOCATED-P
7:32:35
scymtym
i see. i only saw the virtual speedup part in the paper. i didn't read closely enough to get how they measure
7:34:05
no-defun-allowed
They pause everything proportionally to the speedup, and it works out somehow.
7:34:22
scymtym
advice and sb-sprof in https://github.com/scymtym/clim.flamegraph/tree/advice-backend/src/backend could have some tools for deterministic and statistical measurements
7:34:50
no-defun-allowed
I think their implementation is a statistical profiler, so I've been skimming sb-sprof sources for ideas.
7:38:51
scymtym
the statistical part in the above is like sb-sprof. sb-sprof samples executing threads more frequently than blocked or sleeping ones. depending on what the authors do, that could be an obstacle
9:56:08
no-defun-allowed
I basically did (mapcar #'call (stack)), which hopefully wouldn't touch dynamic-extent stuff.