<font size=2 face="sans-serif">Yes, that would be of value to me.</font>
<br><font size=2 face="sans-serif">Can you also have a variable to avoid
tracking dlopen()/dlclose() ? Maybe one variable to disable both?</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br>
<br><font size=2 color=#000080 face="sans-serif">Amit Margalit</font>
<br><font size=2 color=#808000 face="sans-serif">IBM XIV </font><font size=2 face="sans-serif">-
<i>Storage Reinvented</i></font>
<br><font size=2 face="sans-serif">XIV-NAS Development Team</font>
<br><font size=2 face="sans-serif">Tel. 03</font><font size=2 face="Arial">-689-7774</font>
<br><font size=2 face="Arial">Fax. 03-689-7230</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:      
 </font><font size=1 face="sans-serif">"Woegerer, Paul"
<Paul_Woegerer@mentor.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:      
 </font><font size=1 face="sans-serif">Amit Margalit/Israel/IBM@IBMIL,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:      
 </font><font size=1 face="sans-serif"><lttng-dev@lists.lttng.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">11/19/2013 04:41 PM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">Re: [lttng-dev]
[PATCH v3 2/2] Implement base-address-state tracing</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>On 11/18/2013 08:59 AM, Amit Margalit wrote:<br>
> Hi,<br>
><br>
> I understand, and I see two issue with this -<br>
><br>
>  1. The application will still perform all the tracking, but
when the<br>
>     event is to be generated, it will be checked and since
it is<br>
>     disabled, will not be emitted.<br>
>     While the overhead of checking whether the event is
enabled is<br>
>     indeed minimal, the overhead of tracking existing state,
is not<br>
>     negligible - it includes code, data and CPU cycles.<br>
>  2. I believe that the average user will simply want to use<br>
>     "enable-event -u -a" or similar, and should
not care about later<br>
>     disabling these specific events.<br>
><br>
><br>
> I believe this ought to be a compile-time option, and I don't mind
if<br>
> it defaults to "Enabled"...<br>
<br>
How about an environment variable (e.g.<br>
LTTNG_UST_WITHOUT_BADDR_STATEDUMP) that suppresses base address state<br>
tracing.<br>
<br>
Would that be of value to you ?<br>
<br>
--<br>
Best,<br>
Paul<br>
<br>
><br>
> What do you think?<br>
><br>
> Amit Margalit<br>
> IBM XIV - /Storage Reinvented/<br>
> XIV-NAS Development Team<br>
> Tel. 03-689-7774<br>
> Fax. 03-689-7230<br>
><br>
><br>
><br>
> From:        Mathieu Desnoyers <mathieu.desnoyers@efficios.com><br>
> To:        Amit Margalit/Israel/IBM@IBMIL<br>
> Cc:        lttng-dev@lists.lttng.org, Paul Woegerer<br>
> <paul_woegerer@mentor.com><br>
> Date:        11/17/2013 04:02 PM<br>
> Subject:        Re: [lttng-dev] [PATCH v3 2/2]
Implement<br>
> base-address-state tracing<br>
> ------------------------------------------------------------------------<br>
><br>
><br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> *From: *"Amit Margalit" <AMITM@il.ibm.com>*<br>
> To: *"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>*<br>
> Cc: *lttng-dev@lists.lttng.org, "Paul Woegerer"<br>
> <paul_woegerer@mentor.com>*<br>
> Sent: *Sunday, November 17, 2013 4:36:19 AM*<br>
> Subject: *Re: [lttng-dev] [PATCH v3 2/2] Implement base-address-state<br>
> tracing<br>
><br>
> I guess I missed something in the discussion - is this going to be<br>
> active all the time, or can I disable it somehow?<br>
><br>
> Maybe a command-line switch to turn this off?<br>
><br>
> For me this is overhead that I don't need and don't want.<br>
><br>
> You just have to not enable those new events if you don't care about<br>
> them.<br>
><br>
> Thanks,<br>
><br>
> Mathieu<br>
><br>
><br>
> Thanks,<br>
><br>
> Amit Margalit<br>
> IBM XIV - /Storage Reinvented/<br>
> XIV-NAS Development Team<br>
> Tel. 03-689-7774<br>
> Fax. 03-689-7230<br>
><br>
><br>
><br>
> From:        Mathieu Desnoyers <mathieu.desnoyers@efficios.com><br>
> To:        Paul Woegerer <paul_woegerer@mentor.com><br>
> Cc:        lttng-dev@lists.lttng.org<br>
> Date:        11/14/2013 09:30 PM<br>
> Subject:        Re: [lttng-dev] [PATCH v3 2/2]
Implement<br>
> base-address-state tracing<br>
> ------------------------------------------------------------------------<br>
><br>
><br>
><br>
> ----- Original Message -----<br>
> > From: "Paul Woegerer" <paul_woegerer@mentor.com><br>
> > To: lttng-dev@lists.lttng.org, "mathieu desnoyers"<br>
> <mathieu.desnoyers@efficios.com><br>
> > Sent: Thursday, November 14, 2013 1:39:49 PM<br>
> > Subject: [PATCH v3 2/2] Implement base-address-state tracing<br>
> ><br>
> > Dump the base-address state (executable and shared objects) into
session<br>
> > on session-enable (per-session events).<br>
><br>
> Merged, thanks !<br>
><br>
> Mathieu<br>
><br>
> ><br>
> > Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com><br>
> > ---<br>
> >  include/lttng/ust-tracepoint-event.h     | 14
+++++++<br>
> >  liblttng-ust-baddr/Makefile.am        
  |  4 +-<br>
> >  liblttng-ust-baddr/lttng-ust-baddr.c     | 72<br>
> >  ++++++++++++++++++++++++++++++++<br>
> >  liblttng-ust-baddr/ust_baddr_statedump.c | 21 ++++++++++<br>
> >  liblttng-ust-baddr/ust_baddr_statedump.h | 60<br>
> ++++++++++++++++++++++++++<br>
> >  liblttng-ust/lttng-events.c        
     |  2 +<br>
> >  liblttng-ust/lttng-tracer-core.h        
|  3 ++<br>
> >  liblttng-ust/lttng-ust-comm.c        
   | 60<br>
> ++++++++++++++++++++++++++<br>
> >  8 files changed, 235 insertions(+), 1 deletion(-)<br>
> >  create mode 100644 liblttng-ust-baddr/ust_baddr_statedump.c<br>
> >  create mode 100644 liblttng-ust-baddr/ust_baddr_statedump.h<br>
> ><br>
> > diff --git a/include/lttng/ust-tracepoint-event.h<br>
> > b/include/lttng/ust-tracepoint-event.h<br>
> > index bb3a05d..be58030 100644<br>
> > --- a/include/lttng/ust-tracepoint-event.h<br>
> > +++ b/include/lttng/ust-tracepoint-event.h<br>
> > @@ -480,6 +480,18 @@ size_t<br>
> > __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))
     \<br>
> >  #define TP_FIELDS(...) __VA_ARGS__<br>
> >  <br>
> >  /*<br>
> > + * For state dump, check that "session" argument (mandatory)<br>
> matches the<br>
> > + * session this event belongs to. Ensures that we write state
dump<br>
> data only<br>
> > + * into the started session, not into all sessions.<br>
> > + */<br>
> > +#undef _TP_SESSION_CHECK<br>
> > +#ifdef TP_SESSION_CHECK<br>
> > +#define _TP_SESSION_CHECK(session, csession)   (session
== csession)<br>
> > +#else /* TP_SESSION_CHECK */<br>
> > +#define _TP_SESSION_CHECK(session, csession)   1<br>
> > +#endif /* TP_SESSION_CHECK */<br>
> > +<br>
> > +/*<br>
> >   * Using twice size for filter stack data to hold size
and pointer for<br>
> >   * each field (worse case). For integers, max size required
is 64-bit.<br>
> >   * Same for double-precision floats. Those fit within<br>
> > @@ -506,6 +518,8 @@ void<br>
> > __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))
 <br>
>                    
\<br>
> >                  
                     
                     
     <br>
>                    
                     
                     
     <br>
>                    
  \<br>
> >                  
if (0)                    
                     
 <br>
>                    
                     
                     
     <br>
>                    
       \<br>
> >                  
                 (void) __dynamic_len_idx;
       <br>
>         /* don't warn if unused */    \<br>
> > +                 if
(!_TP_SESSION_CHECK(session, __chan->session))<br>
>                    
                   \<br>
> > +                  
               return;    
                     <br>
>                    
                     
                     
     <br>
>                    
        \<br>
> >                  
if<br>
> (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active)))  
         <br>
>           \<br>
> >                  
                 return;  
                     
 <br>
>                    
                     
                     
     <br>
>                    
        \<br>
> >                  
if<br>
> (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled)))    
               <br>
>                    \<br>
> > diff --git a/liblttng-ust-baddr/Makefile.am<br>
> b/liblttng-ust-baddr/Makefile.am<br>
> > index afa9489..0d3cf28 100644<br>
> > --- a/liblttng-ust-baddr/Makefile.am<br>
> > +++ b/liblttng-ust-baddr/Makefile.am<br>
> > @@ -5,7 +5,9 @@ lib_LTLIBRARIES = liblttng-ust-baddr.la<br>
> >  liblttng_ust_baddr_la_SOURCES = \<br>
> >                  
lttng-ust-baddr.c \<br>
> >                  
ust_baddr.c \<br>
> > -                 ust_baddr.h<br>
> > +                 ust_baddr.h
\<br>
> > +                 ust_baddr_statedump.c
\<br>
> > +                 ust_baddr_statedump.h<br>
> >  liblttng_ust_baddr_la_LIBADD = \<br>
> >                  
-L$(top_builddir)/liblttng-ust/.libs \<br>
> >                  
-llttng-ust<br>
> > diff --git a/liblttng-ust-baddr/lttng-ust-baddr.c<br>
> > b/liblttng-ust-baddr/lttng-ust-baddr.c<br>
> > index f24a171..a856965 100644<br>
> > --- a/liblttng-ust-baddr/lttng-ust-baddr.c<br>
> > +++ b/liblttng-ust-baddr/lttng-ust-baddr.c<br>
> > @@ -34,6 +34,7 @@<br>
> >  <br>
> >  #define TRACEPOINT_DEFINE<br>
> >  #include "ust_baddr.h"<br>
> > +#include "ust_baddr_statedump.h"<br>
> >  <br>
> >  int<br>
> >  lttng_ust_push_baddr(void *so_base, const char *so_name)<br>
> > @@ -62,3 +63,74 @@ lttng_ust_pop_baddr(void *so_base)<br>
> >                  
tracepoint(ust_baddr, pop, so_base);<br>
> >                  
return 0;<br>
> >  }<br>
> > +<br>
> > +static int<br>
> > +extract_soinfo_events(struct dl_phdr_info *info, size_t size,
void<br>
> *data)<br>
> > +{<br>
> > +                 int
j;<br>
> > +                 int
num_loadable_segment = 0;<br>
> > +<br>
> > +                 for
(j = 0; j < info->dlpi_phnum; j++) {<br>
> > +                  
               char resolved_path[PATH_MAX];<br>
> > +                  
               struct stat sostat;<br>
> > +                  
               void *base_addr_ptr;<br>
> > +<br>
> > +                  
               if (info->dlpi_phdr[j].p_type
!=<br>
> PT_LOAD)<br>
> > +                  
                     
          continue;<br>
> > +<br>
> > +                  
               /* Calculate virtual
memory<br>
> address of the loadable segment */<br>
> > +                  
               base_addr_ptr =
(void *)<br>
> info->dlpi_addr<br>
> > +                  
                     
          +<br>
> info->dlpi_phdr[j].p_vaddr;<br>
> > +<br>
> > +                  
               num_loadable_segment
+= 1;<br>
> > +                  
               if ((info->dlpi_name
== NULL ||<br>
> info->dlpi_name[0] == 0)<br>
> > +                  
                     
                     
   <br>
>  && num_loadable_segment == 1) {<br>
> > +                  
                     
          /*<br>
> > +                  
                     
           * If the<br>
> iterated element is the executable itself we<br>
> > +                  
                     
           * have to use<br>
> Dl_info to determine its full path<br>
> > +                  
                     
           */<br>
> > +                  
                     
          Dl_info dl_info<br>
> = { 0 };<br>
> > +                  
                     
          if<br>
> (!dladdr(base_addr_ptr, &dl_info))<br>
> > +                  
                     
                     
   <br>
>  return 0;<br>
> > +                  
                     
          if<br>
> (!realpath(dl_info.dli_fname, resolved_path))<br>
> > +                  
                     
                     
   <br>
>  return 0;<br>
> > +                  
               } else {<br>
> > +                  
                     
          /*<br>
> > +                  
                     
           * For regular<br>
> dl_phdr_info entries we have to check if<br>
> > +                  
                     
           * the path to<br>
> the shared object really exists<br>
> > +                  
                     
           */<br>
> > +                  
                     
          if<br>
> (!realpath(info->dlpi_name, resolved_path)) {<br>
> > +                  
                     
                     
   <br>
>  /* Found vDSO, put the 'path' into brackets */<br>
> > +                  
                     
                     
   <br>
>  snprintf(resolved_path, PATH_MAX - 1, "[%s]",<br>
> > +                  
                     
                     
   <br>
>                    
               info->dlpi_name);<br>
> > +                  
                     
          }<br>
> > +                  
               }<br>
> > +<br>
> > +                  
               if (stat(resolved_path,
&sostat)) {<br>
> > +                  
                     
          sostat.st_size = 0;<br>
> > +                  
                     
          sostat.st_mtime<br>
> = -1;<br>
> > +                  
               }<br>
> > +<br>
> > +                  
               tracepoint(ust_baddr_statedump,<br>
> soinfo,<br>
> > +                  
                     
                     
   <br>
>  (struct lttng_session *) data, base_addr_ptr,<br>
> > +                  
                     
                     
   <br>
>  resolved_path, sostat.st_size, sostat.st_mtime);<br>
> > +<br>
> > +                  
               /*<br>
> > +                  
                * We are only interested
in the<br>
> base address (lowest virtual<br>
> > +                  
                * address associated
with the<br>
> memory image), skip the rest<br>
> > +                  
                */<br>
> > +                  
               break;<br>
> > +                 }<br>
> > +                 return
0;<br>
> > +}<br>
> > +<br>
> > +int<br>
> > +lttng_ust_baddr_statedump(struct lttng_session *session)<br>
> > +{<br>
> > +                 /*<br>
> > +                  *
Iterate through the list of currently loaded<br>
> shared objects and<br>
> > +                  *
generate events for loadable segments using<br>
> extract_soinfo_events<br>
> > +                  */<br>
> > +                 dl_iterate_phdr(extract_soinfo_events,
session);<br>
> > +                 return
0;<br>
> > +}<br>
> > diff --git a/liblttng-ust-baddr/ust_baddr_statedump.c<br>
> > b/liblttng-ust-baddr/ust_baddr_statedump.c<br>
> > new file mode 100644<br>
> > index 0000000..75f74ca<br>
> > --- /dev/null<br>
> > +++ b/liblttng-ust-baddr/ust_baddr_statedump.c<br>
> > @@ -0,0 +1,21 @@<br>
> > +/*<br>
> > + * Copyright (C) 2013  Paul Woegerer <paul_woegerer@mentor.com><br>
> > + *<br>
> > + * This library is free software; you can redistribute it and/or<br>
> > + * modify it under the terms of the GNU Lesser General Public<br>
> > + * License as published by the Free Software Foundation; either<br>
> > + * version 2.1 of the License, or (at your option) any later
version.<br>
> > + *<br>
> > + * This library is distributed in the hope that it will be useful,<br>
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty
of<br>
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
the GNU<br>
> > + * Lesser General Public License for more details.<br>
> > + *<br>
> > + * You should have received a copy of the GNU Lesser General
Public<br>
> > + * License along with this library; if not, write to the Free
Software<br>
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA<br>
>  02110-1301<br>
> > USA<br>
> > + */<br>
> > +<br>
> > +#define TRACEPOINT_CREATE_PROBES<br>
> > +#define TP_SESSION_CHECK<br>
> > +#include "ust_baddr_statedump.h"<br>
> > diff --git a/liblttng-ust-baddr/ust_baddr_statedump.h<br>
> > b/liblttng-ust-baddr/ust_baddr_statedump.h<br>
> > new file mode 100644<br>
> > index 0000000..77a9af4<br>
> > --- /dev/null<br>
> > +++ b/liblttng-ust-baddr/ust_baddr_statedump.h<br>
> > @@ -0,0 +1,60 @@<br>
> > +#undef TRACEPOINT_PROVIDER<br>
> > +#define TRACEPOINT_PROVIDER ust_baddr_statedump<br>
> > +<br>
> > +#if !defined(_TRACEPOINT_UST_BADDR_STATEDUMP_H) ||<br>
> > defined(TRACEPOINT_HEADER_MULTI_READ)<br>
> > +#define _TRACEPOINT_UST_BADDR_STATEDUMP_H<br>
> > +<br>
> > +#ifdef __cplusplus<br>
> > +extern "C" {<br>
> > +#endif<br>
> > +<br>
> > +/*<br>
> > + * Copyright (C) 2013  Paul Woegerer <paul_woegerer@mentor.com><br>
> > + *<br>
> > + * Permission is hereby granted, free of charge, to any person<br>
> obtaining a<br>
> > copy<br>
> > + * of this software and associated documentation files (the<br>
> "Software"), to<br>
> > deal<br>
> > + * in the Software without restriction, including without<br>
> limitation the<br>
> > rights<br>
> > + * to use, copy, modify, merge, publish, distribute, sublicense,<br>
> and/or sell<br>
> > + * copies of the Software, and to permit persons to whom the<br>
> Software is<br>
> > + * furnished to do so, subject to the following conditions:<br>
> > + *<br>
> > + * The above copyright notice and this permission notice shall
be<br>
> included<br>
> > in<br>
> > + * all copies or substantial portions of the Software.<br>
> > + *<br>
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
OF ANY KIND,<br>
> EXPRESS<br>
> > OR<br>
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>
> MERCHANTABILITY,<br>
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO<br>
> EVENT SHALL<br>
> > THE<br>
> > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR<br>
> OTHER<br>
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
> ARISING<br>
> > FROM,<br>
> > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
> DEALINGS IN<br>
> > THE<br>
> > + * SOFTWARE.<br>
> > + */<br>
> > +<br>
> > +#include <stdint.h><br>
> > +#include <unistd.h><br>
> > +#include <lttng/ust-events.h><br>
> > +<br>
> > +#define LTTNG_UST_BADDR_STATEDUMP_PROVIDER<br>
> > +#include <lttng/tracepoint.h><br>
> > +<br>
> > +TRACEPOINT_EVENT(ust_baddr_statedump, soinfo,<br>
> > +                 TP_ARGS(struct
lttng_session *, session, void *,<br>
> baddr, const char*,<br>
> > sopath, int64_t, size, int64_t, mtime),<br>
> > +                 TP_FIELDS(<br>
> > +                  
               ctf_integer_hex(void
*, baddr, baddr)<br>
> > +                  
               ctf_string(sopath,
sopath)<br>
> > +                  
               ctf_integer(int64_t,
size, size)<br>
> > +                  
               ctf_integer(int64_t,
mtime, mtime)<br>
> > +                 )<br>
> > +)<br>
> > +<br>
> > +#endif /* _TRACEPOINT_UST_BADDR_STATEDUMP_H */<br>
> > +<br>
> > +#undef TRACEPOINT_INCLUDE<br>
> > +#define TRACEPOINT_INCLUDE "./ust_baddr_statedump.h"<br>
> > +<br>
> > +/* This part must be outside ifdef protection */<br>
> > +#include <lttng/tracepoint-event.h><br>
> > +<br>
> > +#ifdef __cplusplus<br>
> > +}<br>
> > +#endif<br>
> > diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c<br>
> > index 26601a6..21e3639 100644<br>
> > --- a/liblttng-ust/lttng-events.c<br>
> > +++ b/liblttng-ust/lttng-events.c<br>
> > @@ -293,6 +293,8 @@ int lttng_session_enable(struct lttng_session<br>
> *session)<br>
> >                  
/* Set atomically the state to "active" */<br>
> >                  
CMM_ACCESS_ONCE(session->active) = 1;<br>
> >                  
CMM_ACCESS_ONCE(session->been_active) = 1;<br>
> > +<br>
> > +                 lttng_ust_sockinfo_session_enabled(session->owner,<br>
> session);<br>
> >  end:<br>
> >                  
return ret;<br>
> >  }<br>
> > diff --git a/liblttng-ust/lttng-tracer-core.h<br>
> > b/liblttng-ust/lttng-tracer-core.h<br>
> > index f643a7e..e7f549e 100644<br>
> > --- a/liblttng-ust/lttng-tracer-core.h<br>
> > +++ b/liblttng-ust/lttng-tracer-core.h<br>
> > @@ -45,4 +45,7 @@ const char *lttng_ust_obj_get_name(int id);<br>
> >  <br>
> >  int lttng_get_notify_socket(void *owner);<br>
> >  <br>
> > +void lttng_ust_sockinfo_session_enabled(void *owner,<br>
> > +                  
               struct lttng_session<br>
> *session_enabled);<br>
> > +<br>
> >  #endif /* _LTTNG_TRACER_CORE_H */<br>
> > diff --git a/liblttng-ust/lttng-ust-comm.c<br>
> b/liblttng-ust/lttng-ust-comm.c<br>
> > index a6e4ba3..6ef3006 100644<br>
> > --- a/liblttng-ust/lttng-ust-comm.c<br>
> > +++ b/liblttng-ust/lttng-ust-comm.c<br>
> > @@ -34,6 +34,7 @@<br>
> >  #include <time.h><br>
> >  #include <assert.h><br>
> >  #include <signal.h><br>
> > +#include <dlfcn.h><br>
> >  #include <urcu/uatomic.h><br>
> >  #include <urcu/futex.h><br>
> >  #include <urcu/compiler.h><br>
> > @@ -106,6 +107,7 @@ struct sock_info {<br>
> >  <br>
> >                  
char wait_shm_path[PATH_MAX];<br>
> >                  
char *wait_shm_mmap;<br>
> > +                 struct
lttng_session *session_enabled;<br>
> >  };<br>
> >  <br>
> >  /* Socket from app (connect) to session daemon (listen)
for<br>
> communication */<br>
> > @@ -122,6 +124,8 @@ struct sock_info global_apps = {<br>
> >                  
.notify_socket = -1,<br>
> >  <br>
> >                  
.wait_shm_path = "/" LTTNG_UST_WAIT_FILENAME,<br>
> > +<br>
> > +                 .session_enabled
= NULL,<br>
> >  };<br>
> >  <br>
> >  /* TODO: allow global_apps_sock_path override */<br>
> > @@ -135,6 +139,8 @@ struct sock_info local_apps = {<br>
> >  <br>
> >                  
.socket = -1,<br>
> >                  
.notify_socket = -1,<br>
> > +<br>
> > +                 .session_enabled
= NULL,<br>
> >  };<br>
> >  <br>
> >  static int wait_poll_fallback;<br>
> > @@ -176,6 +182,7 @@ static const char *cmd_name_mapping[] = {<br>
> >  <br>
> >  static const char *str_timeout;<br>
> >  static int got_timeout_env;<br>
> > +static void *ust_baddr_handle;<br>
> >  <br>
> >  extern void lttng_ring_buffer_client_overwrite_init(void);<br>
> >  extern void lttng_ring_buffer_client_overwrite_rt_init(void);<br>
> > @@ -235,6 +242,39 @@ void print_cmd(int cmd, int handle)<br>
> >  }<br>
> >  <br>
> >  static<br>
> > +void *lttng_ust_baddr_handle(void)<br>
> > +{<br>
> > +                 if
(!ust_baddr_handle) {<br>
> > +                  
               ust_baddr_handle
= dlopen(<br>
> > +                  
                     
         <br>
> "liblttng-ust-baddr.so.0", RTLD_NOW | RTLD_GLOBAL);<br>
> > +                  
               if (ust_baddr_handle
== NULL)<br>
> > +                  
                     
          ERR("%s",<br>
> dlerror());<br>
> > +                 }<br>
> > +                 return
ust_baddr_handle;<br>
> > +}<br>
> > +<br>
> > +static<br>
> > +int lttng_ust_baddr_statedump(struct lttng_session *session)<br>
> > +{<br>
> > +                 static<br>
> > +                 int
(*lttng_ust_baddr_init_fn)(struct<br>
> lttng_session *);<br>
> > +<br>
> > +                 if
(!lttng_ust_baddr_init_fn) {<br>
> > +                  
               void *baddr_handle
=<br>
> lttng_ust_baddr_handle();<br>
> > +                  
               if (baddr_handle)
{<br>
> > +                  
                     
         <br>
> lttng_ust_baddr_init_fn = dlsym(baddr_handle,<br>
> > +                  
                     
                     
   <br>
>  "lttng_ust_baddr_statedump");<br>
> > +                  
                     
          if<br>
> (lttng_ust_baddr_init_fn == NULL)<br>
> > +                  
                     
                     
   <br>
>  ERR("%s", dlerror());<br>
> > +                  
               }<br>
> > +                  
               if (!lttng_ust_baddr_init_fn)<br>
> > +                  
                     
          return -1;<br>
> > +                 }<br>
> > +<br>
> > +                 return
lttng_ust_baddr_init_fn(session);<br>
> > +}<br>
> > +<br>
> > +static<br>
> >  int setup_local_apps(void)<br>
> >  {<br>
> >                  
const char *home_dir;<br>
> > @@ -1143,6 +1183,13 @@ restart:<br>
> >                  
                     
            ret =<br>
> handle_message(sock_info, sock, &lum);<br>
> >                  
                     
            if (ret) {<br>
> >                  
                     
                     
     <br>
>  ERR("Error handling message for %s socket", sock_info->name);<br>
> > +                  
                     
          } else {<br>
> > +                  
                     
                     
   <br>
>  struct lttng_session *session =<br>
> > +                  
                     
                     
   <br>
>                   sock_info->session_enabled;<br>
> > +                  
                     
                     
   <br>
>  if (session) {<br>
> > +                  
                     
                     
   <br>
>                   sock_info->session_enabled
= NULL;<br>
> > +                  
                     
                     
   <br>
>                   lttng_ust_baddr_statedump(session);<br>
> > +                  
                     
                     
     }<br>
> >                  
                     
            }<br>
> >                  
                     
            continue;<br>
> >                  
                 default:<br>
> > @@ -1379,6 +1426,12 @@ void __attribute__((destructor))<br>
> lttng_ust_exit(void)<br>
> >                  
 * cleanup the threads if there are stalled in a<br>
> syscall.<br>
> >                  
 */<br>
> >                  
lttng_ust_cleanup(1);<br>
> > +<br>
> > +                 if
(ust_baddr_handle) {<br>
> > +                  
               int ret = dlclose(ust_baddr_handle);<br>
> > +                  
               if (ret)<br>
> > +                  
                     
          ERR("%s",<br>
> dlerror());<br>
> > +                 }<br>
> >  }<br>
> >  <br>
> >  /*<br>
> > @@ -1456,3 +1509,10 @@ void ust_after_fork_child(sigset_t<br>
> *restore_sigset)<br>
> >                  
ust_after_fork_common(restore_sigset);<br>
> >                  
lttng_ust_init();<br>
> >  }<br>
> > +</font></tt>
<br><tt><font size=2>> > +void lttng_ust_sockinfo_session_enabled(void
*owner,<br>
> > +                  
               struct lttng_session<br>
> *session_enabled)<br>
> > +{<br>
> > +                 struct
sock_info *sock_info = owner;<br>
> > +                 sock_info->session_enabled
= session_enabled;<br>
> > +}<br>
> > --<br>
> > 1.8.4.2<br>
> ><br>
> ><br>
><br>
> -- <br>
> Mathieu Desnoyers<br>
> EfficiOS Inc._<br>
> __http://www.efficios.com_ <</font></tt><a href=http://www.efficios.com/><tt><font size=2>http://www.efficios.com/</font></tt></a><tt><font size=2>><br>
><br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> lttng-dev@lists.lttng.org_<br>
> __http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev_<br>
><br>
><br>
><br>
><br>
><br>
> -- <br>
> Mathieu Desnoyers<br>
> EfficiOS Inc.<br>
> </font></tt><a href=http://www.efficios.com/><tt><font size=2>http://www.efficios.com</font></tt></a><tt><font size=2>
<</font></tt><a href=http://www.efficios.com/><tt><font size=2>http://www.efficios.com/</font></tt></a><tt><font size=2>><br>
<br>
<br>
-- <br>
Paul Woegerer, SW Development Engineer<br>
Sourcery Analyzer <</font></tt><a href=http://go.mentor.com/sourceryanalyzer><tt><font size=2>http://go.mentor.com/sourceryanalyzer</font></tt></a><tt><font size=2>><br>
Mentor Graphics, Embedded Software Division<br>
<br>
</font></tt>
<br>