X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-statedump.c;h=ff24e7c8de2df75914fab7101aa330a2ee61ae29;hb=cbba5e044240cd4e5b90b1a312cb1cd692e027ea;hp=040223d58409bd93b2ceedb9d8d8979e463beac1;hpb=94be38e8fd2d71397f79c0a368ba95678052e32d;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-statedump.c b/liblttng-ust/lttng-ust-statedump.c index 040223d5..ff24e7c8 100644 --- a/liblttng-ust/lttng-ust-statedump.c +++ b/liblttng-ust/lttng-ust-statedump.c @@ -1,24 +1,11 @@ /* - * Copyright (C) 2013 Paul Woegerer - * Copyright (C) 2015 Antoine Busque - * Copyright (C) 2016 Mathieu Desnoyers + * 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 + * Copyright (C) 2015 Antoine Busque + * Copyright (C) 2016 Mathieu Desnoyers */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -30,12 +17,13 @@ #include #include -#include +#include #include "lttng-tracer-core.h" #include "lttng-ust-statedump.h" #include "jhash.h" #include "getenv.h" #include "compat.h" +#include "ust-events-internal.h" #define TRACEPOINT_DEFINE #include "ust_lib.h" /* Only define. */ @@ -203,15 +191,15 @@ static void trace_statedump_event(tracepoint_cb tp_cb, void *owner, void *priv) { struct cds_list_head *sessionsp; - struct lttng_session *session; + struct lttng_ust_session_private *session_priv; - sessionsp = _lttng_get_sessions(); - cds_list_for_each_entry(session, sessionsp, node) { - if (session->owner != owner) + sessionsp = lttng_get_sessions(); + cds_list_for_each_entry(session_priv, sessionsp, node) { + if (session_priv->owner != owner) continue; - if (!session->statedump_pending) + if (!session_priv->statedump_pending) continue; - tp_cb(session, priv); + tp_cb(session_priv->pub, priv); } } @@ -560,7 +548,7 @@ void lttng_ust_dl_update(void *ip) { struct dl_iterate_data data; - if (lttng_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP")) + if (lttng_ust_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP")) return; /* @@ -594,7 +582,7 @@ void lttng_ust_dl_update(void *ip) static int do_baddr_statedump(void *owner) { - if (lttng_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP")) + if (lttng_ust_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP")) return 0; lttng_ust_dl_update(LTTNG_UST_CALLER_IP()); ust_dl_table_statedump(owner); @@ -604,7 +592,7 @@ int do_baddr_statedump(void *owner) static int do_procname_statedump(void *owner) { - if (lttng_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP")) + if (lttng_ust_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP")) return 0; trace_statedump_event(procname_cb, owner, lttng_ust_sockinfo_get_procname(owner));