fd8f9116d21585d46fb1ac541272b397759cb293
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2 only,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #ifndef _LTT_SESSION_H
19 #define _LTT_SESSION_H
23 #include <urcu/list.h>
25 #include "trace-kernel.h"
26 #include "trace-ust.h"
29 * Tracing session list
31 * Statically declared in session.c and can be accessed by using
32 * session_get_list() function that returns the pointer to the list.
34 struct ltt_session_list
{
36 * This lock protects any read/write access to the list and count (which is
37 * basically the list size). All public functions in session.c acquire this
38 * lock and release it before returning. If none of those functions are
39 * used, the lock MUST be acquired in order to iterate or/and do any
40 * actions on that list.
45 * Number of element in the list. The session list lock MUST be acquired if
46 * this counter is used when iterating over the session list.
50 /* Linked list head */
51 struct cds_list_head head
;
55 * This data structure contains information needed to identify a tracing
56 * session for both LTTng and UST.
61 struct ltt_kernel_session
*kernel_session
;
62 struct ltt_ust_session
*ust_session
;
64 * Protect any read/write on this session data structure. This lock must be
65 * acquired *before* using any public functions declared below. Use
66 * session_lock() and session_unlock() for that.
69 struct cds_list_head list
;
70 int enabled
; /* enabled/started flag */
71 int id
; /* session unique identifier */
72 /* UID/GID of the user owning the session */
78 int session_create(char *name
, char *path
, uid_t uid
, gid_t gid
);
79 int session_destroy(struct ltt_session
*session
);
81 void session_lock(struct ltt_session
*session
);
82 void session_lock_list(void);
83 void session_unlock(struct ltt_session
*session
);
84 void session_unlock_list(void);
86 struct ltt_session
*session_find_by_name(char *name
);
87 struct ltt_session_list
*session_get_list(void);
89 #endif /* _LTT_SESSION_H */
This page took 0.032024 seconds and 5 git commands to generate.