summaryrefslogtreecommitdiff
path: root/sal/rtl/strimp.hxx
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2013-08-02 20:49:48 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-08-03 09:32:03 +0200
commiteeb3b8dc5c771915f9c011e95ae20babdf70bd02 (patch)
treef1602f8e92a9a0f9873bf0335e03cf23433b9e34 /sal/rtl/strimp.hxx
parentc2e2fbe6601ef14122371c380d91a48425a2b669 (diff)
Add SDT probes for RTL_LOG_STRING_NEW/DELETE.
Change-Id: I938259f90aee9d277c9ff5b72c9120b93311cbd3 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal/rtl/strimp.hxx')
-rw-r--r--sal/rtl/strimp.hxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx
index f54b88231fed..544d5796560f 100644
--- a/sal/rtl/strimp.hxx
+++ b/sal/rtl/strimp.hxx
@@ -20,6 +20,11 @@
#ifndef INCLUDED_RTL_SOURCE_STRIMP_HXX
#define INCLUDED_RTL_SOURCE_STRIMP_HXX
+#include <config_probes.h>
+#if USE_SDT_PROBES
+#include <sys/sdt.h>
+#endif
+
#include <osl/interlck.h>
#include "sal/types.h"
@@ -46,8 +51,21 @@ sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix );
sal_Bool rtl_ImplIsWhitespace( sal_Unicode c );
// string lifetime instrumentation / diagnostics
+#if USE_SDT_PROBES
+# define PROBE_SNAME(n,b) n ## _ ## b
+# 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 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)
+#else
# define RTL_LOG_STRING_NEW(s)
# define RTL_LOG_STRING_DELETE(s)
+#endif /* USE_SDT_PROBES */
#endif /* INCLUDED_RTL_SOURCE_STRIMP_HXX */