[Libreoffice-commits] core.git: sal/rtl
Mark Wielaard
mark at klomp.org
Thu Aug 8 12:14:02 PDT 2013
sal/rtl/strimp.hxx | 10 ++++++++++
sal/rtl/ustring.cxx | 3 +++
2 files changed, 13 insertions(+)
New commits:
commit 3cf0b5cdb05e1d77610431b1b1328102bf05b602
Author: Mark Wielaard <mark at klomp.org>
Date: Wed Aug 7 23:52:44 2013 +0200
Add SDT probes for interning rtl_uStrings.
This adds RTL_LOG_STRING_INTERN_NEW and RTL_LOG_STRING_INTERN_DELETE
which are connected to SDT probes if available. It introduces two new
SDT probes. new_string_intern_16 and delete_string_intern_16
(there is currently no interning for 8-bit rtl_Strings).
For consistency both have the same 4 arguments as new_string_(8|16)
and delete_string_(8|16). new_string_intern_16 has as 5th argument
the address of the original rtl_uString being interned (which may
or may not be the same as $arg1).
Change-Id: Ib117bba932c1908abc70a7fdd4140c0af76d54cb
Reviewed-on: https://gerrit.libreoffice.org/5308
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx
index 544d579..997d72c 100644
--- a/sal/rtl/strimp.hxx
+++ b/sal/rtl/strimp.hxx
@@ -56,15 +56,25 @@ sal_Bool rtl_ImplIsWhitespace( sal_Unicode c );
# define PROBE_NAME(n,b) PROBE_SNAME(n,b)
# define PROBE_NEW PROBE_NAME (new_string,RTL_LOG_STRING_BITS)
# define PROBE_DEL PROBE_NAME (delete_string,RTL_LOG_STRING_BITS)
+# define PROBE_INTERN_NEW PROBE_NAME (new_string_intern,RTL_LOG_STRING_BITS)
+# define PROBE_INTERN_DEL PROBE_NAME (delete_string_intern,RTL_LOG_STRING_BITS)
# define RTL_LOG_STRING_NEW(s) \
DTRACE_PROBE4(libreoffice, PROBE_NEW, s, \
(s)->refCount, (s)->length, (s)->buffer)
# define RTL_LOG_STRING_DELETE(s) \
DTRACE_PROBE4(libreoffice, PROBE_DEL, s, \
(s)->refCount, (s)->length, (s)->buffer)
+# define RTL_LOG_STRING_INTERN_NEW(s,o) \
+ DTRACE_PROBE5(libreoffice, PROBE_INTERN_NEW, s, \
+ (s)->refCount, (s)->length, (s)->buffer, o)
+# define RTL_LOG_STRING_INTERN_DELETE(s) \
+ DTRACE_PROBE4(libreoffice, PROBE_INTERN_DEL, s, \
+ (s)->refCount, (s)->length, (s)->buffer)
#else
# define RTL_LOG_STRING_NEW(s)
# define RTL_LOG_STRING_DELETE(s)
+# define RTL_LOG_STRING_INTERN_NEW(s,o)
+# define RTL_LOG_STRING_INTERN_DELETE(s)
#endif /* USE_SDT_PROBES */
#endif /* INCLUDED_RTL_SOURCE_STRIMP_HXX */
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index 1c02dfc..abf9db7 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -817,6 +817,8 @@ static void rtl_ustring_intern_internal( rtl_uString ** newStr,
osl_releaseMutex( pPoolMutex );
+ RTL_LOG_STRING_INTERN_NEW(*newStr, str);
+
if( can_return && *newStr != str )
{ /* we dupped, then found a match */
rtl_freeMemory( str );
@@ -947,6 +949,7 @@ internRelease (rtl_uString *pThis)
if ( SAL_STRING_REFCOUNT(
osl_atomic_decrement( &(pThis->refCount) ) ) == 0)
{
+ RTL_LOG_STRING_INTERN_DELETE(pThis);
pPoolMutex = getInternMutex();
osl_acquireMutex( pPoolMutex );
More information about the Libreoffice-commits
mailing list