[Tarantool-patches] [PATCH luajit v4 4/4] memprof: add info about trace start to symtab
Igor Munkin
imun at tarantool.org
Wed Nov 24 19:44:58 MSK 2021
Misha,
Thanks for the fixes! Considering your next reply with reverting the
remaining excess changes, LGTM.
On 22.11.21, Mikhail Shishatskiy wrote:
> Igor,
> Thank you for the review! Hope, I got your comments right :)
Yes, everything is fine now :)
>
<snipped>
> >> >> + -- recording started.
> >> >> + if trace and trace.addr == loc.addr then
> >> >> + return symtab.demangle(symbols, loc).." started at "..
> >> >> + symtab.demangle(symbols, trace.start)
> >> >
> >> >Finally, I got the thing that bothers me the most. Why do you make
> >> ><describe_location> so complex? It looks that you can move all these
> >> >if-else branching to <symtab.demangle> and concatenation to
> >> ><demangle_trace> function, doesn't it? AFAICS, you can remove
> >> ><describe_location> as a result and trace demangling will be
> >> >encapsulated in scope of <demangle_trace> function. Feel free to correct
> >> >me if I'm wrong.
> >>
> >> Initially it was implemented, as you suggest now. But Sergey in his
> >> review led me to believe, that "started at" part should ideologically
> >> relate to the humanizer module. And I agree with that point, but maybe
> >> I decomposed things not in a very good way.
> >
> >Em... In that way all other types (such as "INTERNAL" and "CFUNC %#x")
> >should also be in the humanizer module, since this representation is
> >specific for a particular output format. All in all nobody stops you
> >from moving <symtab.demangle> to the humanize module, since it's used
> >only there (and need to be used only there).
> >
> >BTW, Sergey is also in Cc, so he can also drop a few words regarding it.
> >
> >>
> >> Another way to implement this is to demangle without "started at" and
> >> then insert it to the demangled name. What do you think?
> >
> >My point is to have the whole "stringification" mess encapsulated in a
> >single function (like it's almost done within <symtab.demangle>). And
> >the only thing remaining outside of this function is "started at" tail.
> >I hope this fits your vision regarding decomposition :)
>
> So, I decided to decompose things, as you suggested initially. Now
> traces are demangled separately inside the <demangle_trace> function.
> The "started at" string also moved to that function in order not to
> spout some convoluted logic of injecting this string inside the
> demangled string outside the demangler module. The only nuance is
> a possibility of recursion calls:
>
> | symtab.demangle -> demangle_trace -> symtab.demangle -> demangle_trace -> ...
>
> But I inserted asserts to prevent such cases.
Neato, thanks a lot!
>
<snipped>
>
> --
> Best regards,
> Mikhail Shishatskiy
--
Best regards,
IM
More information about the Tarantool-patches
mailing list