Subject: Re: bug#72559: 31.0.50; profiler-report-write-profile produced unreadable data

From: Eli Zaretskii <[email-masked]>
Date: Sat, 17 Aug 2024 17:27:08 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Sat, 17 Aug 2024 10:07:59 -0400
> 
> > This seems to avoid errors, but I still see problems in the profile
> > read from a file, which is displayed like this:
> >
> >      Samples    %   Function
> >           35  31%   redisplay_internal (C function)
> >           28  25% + command-execute
> >           28  25%   Automatic GC
> >            8   7% + #<string 540>
> >            7   6% + ...
> >            4   3% + #<string 54A>
> >            2   1% + #<string 57C>
> >
> > Those "<string XYZ>" thingies are actually written in the file as
> > "#<byte-code-function F85>" strings, and I suspect that they should
> > have been written as function objects, not as strings.
> 
> I don't think we want to write them as function objects, because then
> we'll again bump into the problem that some function objects contain
> unprintable objects like buffers.

But Emacs 29 does succeed there, at least in my testing, including
when the profile shows byte-compiled functions.  So how come Emacs 30
cannot?

> Better would be to print the "#<byte-code-function F85>" strings
> as-is instead of printing them as #<string 540>.

Again, Emacs 30 shows the functions called by such byte-compiled
functions.