X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fsessiond-trace-chunks.h;h=2c771d8094fe172628bd41b8ecea38af7dca2bdd;hb=4878de5c7deb512bbdac4fdfc498907efa06fb7c;hp=39804679c811e7306be044faaecec7b579a7db0d;hpb=0c1b0f77482b0d1856fefabc42978b82b5dd267c;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/sessiond-trace-chunks.h b/src/bin/lttng-relayd/sessiond-trace-chunks.h index 39804679c..2c771d809 100644 --- a/src/bin/lttng-relayd/sessiond-trace-chunks.h +++ b/src/bin/lttng-relayd/sessiond-trace-chunks.h @@ -1,27 +1,28 @@ /* - * Copyright (C) 2019 - Jérémie Galarneau + * Copyright (C) 2019 Jérémie Galarneau * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program 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 General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef SESSIOND_TRACE_CHUNK_REGISTRY_H #define SESSIOND_TRACE_CHUNK_REGISTRY_H -#include +#include #include #include +/* + * A session trace chunk registry allows the relay daemon to share trace chunks + * used by different "relay sessions" when they were created for the same + * user-visible session daemon session. Tracing multiple domains (e.g. ust and + * kernel) results in per-domain relay sessions being created. + * + * Sharing trace chunks, and their output directory more specifically, is + * essential to properly implement session rotations. The sharing of output + * directory handles allows directory renames to be performed once and without + * races that would stem from from multiple renames. + */ struct sessiond_trace_chunk_registry; struct sessiond_trace_chunk_registry * @@ -55,4 +56,9 @@ sessiond_trace_chunk_registry_get_chunk( const lttng_uuid sessiond_uuid, uint64_t session_id, uint64_t chunk_id); +int sessiond_trace_chunk_registry_chunk_exists( + struct sessiond_trace_chunk_registry *sessiond_registry, + const lttng_uuid sessiond_uuid, + uint64_t session_id, uint64_t chunk_id, bool *chunk_exists); + #endif /* SESSIOND_TRACE_CHUNK_REGISTRY_H */