Move to kernel style SPDX license identifiers
[lttng-ust.git] / liblttng-ust / lttng-ust-statedump.c
index f40b7195af4f9474d946609192423a22f8fbd76f..4387cab4931ad8221b59d6d99df63eaff2904f7b 100644 (file)
@@ -1,24 +1,11 @@
 /*
- * Copyright (C) 2013  Paul Woegerer <paul_woegerer@mentor.com>
- * Copyright (C) 2015  Antoine Busque <abusque@efficios.com>
- * Copyright (C) 2016  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * SPDX-License-Identifier: LGPL-2.1-or-later
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ * Copyright (C) 2013 Paul Woegerer <paul_woegerer@mentor.com>
+ * Copyright (C) 2015 Antoine Busque <abusque@efficios.com>
+ * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
-#define _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <link.h>
 #include <limits.h>
@@ -35,6 +22,7 @@
 #include "lttng-ust-statedump.h"
 #include "jhash.h"
 #include "getenv.h"
+#include "compat.h"
 
 #define TRACEPOINT_DEFINE
 #include "ust_lib.h"                           /* Only define. */
@@ -246,6 +234,13 @@ void trace_debug_link_cb(struct lttng_session *session, void *priv)
                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)
 {
@@ -593,6 +588,16 @@ int do_baddr_statedump(void *owner)
        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)
@@ -611,6 +616,7 @@ int do_lttng_ust_statedump(void *owner)
        trace_statedump_start(owner);
        ust_unlock();
 
+       do_procname_statedump(owner);
        do_baddr_statedump(owner);
 
        ust_lock_nocheck();
This page took 0.024153 seconds and 4 git commands to generate.