emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPS: profiler


From: Gerd Möllmann
Subject: Re: MPS: profiler
Date: Fri, 21 Jun 2024 09:43:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Helmut Eller <eller.helmut@gmail.com> writes:

> On Fri, Jun 21 2024, Gerd Möllmann wrote:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>> Also, can 'static struct profiler_log cpu', which is being worked on
>>> by record_backtrace, be affected by MPS in any way?
>>
>> I'd guess that just "touching" Lisp objects in the SIGPROF handler can
>> be problematic because these objects themselves can be behind a barrier,
>> either the same that MPS is currently working on when it got interrupted
>> or another one.
>
> Perhaps dflt_scan should block SIGPROF while it is running.  Or perhaps
> dflt_scan should set some global flag while it running so that the
> profiler knows that it's too dangerous to touch anything.  

I kind of doubt that's sufficient because there are time windows in MPS
itself where dflt_scan is not running, and it maybe doing dangerous
things. There is no guarantee I'd say.

> Any better ideas?
>
> I can use this command to reproduce the problem:
>
> run -Q -batch -eval '(progn
>   (defvar *baz* nil)
>   (defun bar (len)
>     (let ((data (make-list len nil)))
>       (setq *baz* (lambda () (bar len) data))))
>   (defun foo ()
>     (bar 1000)
>     (dotimes (_ 10000)
>       (funcall *baz*)))
>   (profiler-start (quote cpu))
>   (foo))'

Could we park or clamp the arena while profiling?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]