+struct extract_data {
+ void *owner;
+ void *exec_baddr; /* executable base address */
+};
+
+/*
+ * Trace baddr into all sessions for which statedump is pending owned by
+ * the caller thread.
+ */
+static
+int trace_baddr(void *base_addr_ptr,
+ const char *resolved_path,
+ int vdso,
+ void *owner)
+{
+ struct cds_list_head *sessionsp;
+ struct lttng_session *session;
+ struct stat sostat;
+
+ if (vdso || stat(resolved_path, &sostat)) {
+ sostat.st_size = 0;
+ sostat.st_mtime = -1;
+ }
+ /*
+ * UST lock nests within dynamic loader lock.
+ */
+ if (ust_lock()) {
+ /*
+ * Stop iteration on headers if need to exit.
+ */
+ ust_unlock();
+ return 1;
+ }
+
+ sessionsp = _lttng_get_sessions();
+ cds_list_for_each_entry(session, sessionsp, node) {
+ if (session->owner != owner)
+ continue;
+ if (!session->statedump_pending)
+ continue;
+ tracepoint(ust_baddr_statedump, soinfo,
+ session, base_addr_ptr,
+ resolved_path, sostat.st_size,
+ sostat.st_mtime);
+ }
+ ust_unlock();
+ return 0;
+}
+
+static
+int extract_soinfo_events(struct dl_phdr_info *info, size_t size, void *_data)