Fix: relayd: session destruction does not complete in live mode
[lttng-tools.git] / src / bin / lttng-relayd / viewer-session.h
CommitLineData
7591bab1
MD
1#ifndef _VIEWER_SESSION_H
2#define _VIEWER_SESSION_H
3
4/*
5 * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
6 * David Goulet <dgoulet@efficios.com>
7 * 2015 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License, version 2 only, as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * this program; if not, write to the Free Software Foundation, Inc., 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#include <limits.h>
24#include <inttypes.h>
25#include <pthread.h>
26#include <urcu/list.h>
27#include <urcu/ref.h>
28
29#include <common/hashtable/hashtable.h>
b66a15d1 30#include <common/trace-chunk.h>
7591bab1
MD
31
32#include "session.h"
33
34struct relay_viewer_session {
35 /*
36 * Session list. Updates are protected by the session_list_lock.
37 * Traversals are protected by RCU.
38 * This list limits the design to having the sessions in at most
39 * one viewer session.
40 */
41 struct cds_list_head session_list; /* RCU list. */
42 pthread_mutex_t session_list_lock; /* Protects list updates. */
b66a15d1
JG
43 /* Once set, the current trace chunk of a viewer must not change. */
44 struct lttng_trace_chunk *current_trace_chunk;
7591bab1
MD
45};
46
47struct relay_viewer_session *viewer_session_create(void);
48void viewer_session_destroy(struct relay_viewer_session *vsession);
49void viewer_session_close(struct relay_viewer_session *vsession);
50
51int viewer_session_attach(struct relay_viewer_session *vsession,
52 struct relay_session *session);
53int viewer_session_is_attached(struct relay_viewer_session *vsession,
54 struct relay_session *session);
d62023be
JD
55void viewer_session_close_one_session(struct relay_viewer_session *vsession,
56 struct relay_session *session);
b66a15d1
JG
57int viewer_session_set_trace_chunk(struct relay_viewer_session *vsession,
58 struct lttng_trace_chunk *relay_session_trace_chunk);
7591bab1
MD
59
60#endif /* _VIEWER_SESSION_H */
This page took 0.034975 seconds and 4 git commands to generate.