Fix: destroy session removes the default config file
[lttng-tools.git] / src / bin / lttng / utils.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 *
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.
7 *
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.
12 *
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.
16 */
17
18#ifndef _LTTNG_UTILS_H
19#define _LTTNG_UTILS_H
20
21#include <popt.h>
22#include "version.h"
23
24#include <lttng/lttng.h>
25
26extern char *opt_relayd_path;
27
28struct cmd_struct;
29
30char *get_session_name(void);
31char *get_session_name_quiet(void);
32void list_commands(struct cmd_struct *commands, FILE *ofp);
33void list_cmd_options(FILE *ofp, struct poptOption *options);
34
35/*
36 * Return the minimum order for which x <= (1UL << order).
37 * Return -1 if x is 0.
38 */
39int get_count_order_u32(uint32_t x);
40
41/*
42 * Return the minimum order for which x <= (1UL << order).
43 * Return -1 if x is 0.
44 */
45int get_count_order_u64(uint64_t x);
46
47/*
48 * Return the minimum order for which x <= (1UL << order).
49 * Return -1 if x is 0.
50 */
51int get_count_order_ulong(unsigned long x);
52
53const char *get_domain_str(enum lttng_domain_type domain);
54
55static inline
56void print_missing_domain(void)
57{
58 ERR("Please specify a domain (-k/-u/-j).");
59}
60
61int spawn_relayd(const char *pathname, int port);
62int check_relayd(void);
63
64#endif /* _LTTNG_UTILS_H */
This page took 0.022795 seconds and 4 git commands to generate.