Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 08/02/2013 09:30 PM, Mark Wielaard wrote:
On Tue, Jul 30, 2013 at 09:29:31AM +0100, Michael Meeks wrote:
        You saw the OUString debugging code: RTL_LOG_STRING_NEW /
_STRING_DELETE etc. that can produce a long but crunch-able set of
printfs on stdout: many of which are sadly not that useful due to
OUStringBuffer mutation (IIRC - but presumably some more work could
clean that up).

I hadn't seen that yet, but that might be useful to see which strings
are recreated multiple times and so are candidates for interning.
Is there already code to enable/trigger RTL_LOG_STRING_NEW?
Or should I just write my own hooks?

        I guess you just write your own fprintf(stderr,) etc. in the strimp.hxx
header ? of course, converting them to UTF8 and printing them is a bit
of a PITA since strimp.hxx is used in both 8bit and 16bit strings.

I decided to add some SDT probes at the RTL_LOG_STRING_NEW/DELETE
locations. With a little preprocessor magic you can easily split it
in 8bit and 16bit variants (so this introduces probes for new_string_8,
new_string_16, delete_string_8, delete_string_16 with as arguments the
string, the refcount, length and buffer). The SDT probes have zero
overhead (just adds a NOP and a special ELF NOTES section to the binary)
and can be used with gdb or systemtap to collect some statistics
(or simply just log/print all strings created/deleted). They are also
source compatible with dtrace for systems that supports that (I have never
used dtrace so I hope someone could test that). Could you have a look if
that looks fine to integrate: https://gerrit.libreoffice.org/5256

Cool.  Pushed.  Thanks,
Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.