|Debug link file name.
|===
+`lttng_ust_statedump:procname`::
+ The process procname at process start.
++
+Fields:
++
+[options="header"]
+|===
+|Field name |Description
+
+|`procname`
+|The process name.
+
+|===
+
[[ust-lib]]
Shared library load/unload tracking
If set, prevents `liblttng-ust` from performing a base address state
dump (see the <<state-dump,LTTng-UST state dump>> section above).
+`LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP`::
+ If set, prevents `liblttng-ust` from performing a procname state
+ dump (see the <<state-dump,LTTng-UST state dump>> section above).
+
include::common-footer.txt[]
#define LTTNG_UST_CALLER_IP() __builtin_return_address(0)
#endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */
+/*
+ * LTTNG_HIDDEN: set the hidden attribute for internal functions
+ * On Windows, symbols are local unless explicitly exported,
+ * see https://gcc.gnu.org/wiki/Visibility
+ */
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define LTTNG_HIDDEN
+#else
+#define LTTNG_HIDDEN __attribute__((visibility("hidden")))
+#endif
+
#endif /* _LTTNG_UST_HELPER_H */
#include <lttng/bug.h>
#include <lttng/ringbuffer-config.h>
#include <usterr-signal-safe.h>
+#include <helper.h>
/*
* The longuest possible namespace proc path is with the cgroup ns
int lttng_get_notify_socket(void *owner);
+LTTNG_HIDDEN
+char* lttng_ust_sockinfo_get_procname(void *owner);
+
void lttng_ust_sockinfo_session_enabled(void *owner);
void lttng_ust_malloc_wrapper_init(void);
/* Keep track of lazy state dump not performed yet. */
int statedump_pending;
int initial_statedump_done;
+ /* Keep procname for statedump */
+ char procname[LTTNG_UST_PROCNAME_LEN];
};
/* Socket from app (connect) to session daemon (listen) for communication */
.statedump_pending = 0,
.initial_statedump_done = 0,
+ .procname[0] = '\0'
};
/* TODO: allow global_apps_sock_path override */
.statedump_pending = 0,
.initial_statedump_done = 0,
+ .procname[0] = '\0'
};
static int wait_poll_fallback;
return info->notify_socket;
}
+
+LTTNG_HIDDEN
+char* lttng_ust_sockinfo_get_procname(void *owner)
+{
+ struct sock_info *info = owner;
+
+ return info->procname;
+}
+
static
void print_cmd(int cmd, int handle)
{
}
global_apps.allowed = 1;
+ lttng_ust_getprocname(global_apps.procname);
error:
return ret;
}
ret = -EIO;
goto end;
}
+
+ lttng_ust_getprocname(local_apps.procname);
end:
return ret;
}
#include <stdint.h>
#include <unistd.h>
#include <lttng/ust-events.h>
+#include "compat.h"
#define LTTNG_UST_STATEDUMP_PROVIDER
#include <lttng/tracepoint.h>
)
)
+TRACEPOINT_EVENT(lttng_ust_statedump, procname,
+ TP_ARGS(
+ struct lttng_session *, session,
+ char *, name
+ ),
+ TP_FIELDS(
+ ctf_array_text(char, procname, name, LTTNG_UST_PROCNAME_LEN)
+ )
+)
+
TRACEPOINT_EVENT(lttng_ust_statedump, end,
TP_ARGS(struct lttng_session *, session),
TP_FIELDS()
#include "lttng-ust-statedump.h"
#include "jhash.h"
#include "getenv.h"
+#include "compat.h"
#define TRACEPOINT_DEFINE
#include "ust_lib.h" /* Only define. */
bin_data->dbg_file, bin_data->crc);
}
+static
+void procname_cb(struct lttng_session *session, void *priv)
+{
+ char *procname = (char *) priv;
+ tracepoint(lttng_ust_statedump, procname, session, procname);
+}
+
static
void trace_start_cb(struct lttng_session *session, void *priv)
{
return 0;
}
+static
+int do_procname_statedump(void *owner)
+{
+ if (lttng_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP"))
+ return 0;
+
+ trace_statedump_event(procname_cb, owner, lttng_ust_sockinfo_get_procname(owner));
+ return 0;
+}
+
/*
* Generate a statedump of a given traced application. A statedump is
* delimited by start and end events. For a given (process, session)
trace_statedump_start(owner);
ust_unlock();
+ do_procname_statedump(owner);
do_baddr_statedump(owner);
ust_lock_nocheck();