Commit | Line | Data |
---|---|---|
f3ed775e | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca> |
f3ed775e | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: GPL-2.0-only |
f3ed775e | 5 | * |
f3ed775e DG |
6 | */ |
7 | ||
8 | #ifndef _LTTNG_UTILS_H | |
9 | #define _LTTNG_UTILS_H | |
10 | ||
679b4943 SM |
11 | #include <popt.h> |
12 | ||
b9dfb167 DG |
13 | #include <lttng/lttng.h> |
14 | ||
8960e9cd | 15 | extern char *opt_relayd_path; |
92360082 JG |
16 | extern int opt_no_sessiond; |
17 | extern char * opt_sessiond_path; | |
92360082 | 18 | extern pid_t sessiond_pid; |
8960e9cd | 19 | |
3c9bd23c SM |
20 | struct cmd_struct; |
21 | ||
f3ed775e | 22 | char *get_session_name(void); |
1dac0189 | 23 | char *get_session_name_quiet(void); |
3c9bd23c | 24 | void list_commands(struct cmd_struct *commands, FILE *ofp); |
679b4943 | 25 | void list_cmd_options(FILE *ofp, struct poptOption *options); |
f3ed775e | 26 | |
8ce58bad MD |
27 | /* |
28 | * Return the minimum order for which x <= (1UL << order). | |
29 | * Return -1 if x is 0. | |
30 | */ | |
31 | int get_count_order_u32(uint32_t x); | |
32 | ||
33 | /* | |
34 | * Return the minimum order for which x <= (1UL << order). | |
35 | * Return -1 if x is 0. | |
36 | */ | |
37 | int get_count_order_u64(uint64_t x); | |
38 | ||
39 | /* | |
40 | * Return the minimum order for which x <= (1UL << order). | |
41 | * Return -1 if x is 0. | |
42 | */ | |
43 | int get_count_order_ulong(unsigned long x); | |
44 | ||
b9dfb167 | 45 | const char *get_domain_str(enum lttng_domain_type domain); |
4fd2697f | 46 | const char *get_event_type_str(enum lttng_event_type event_type); |
b9dfb167 | 47 | |
3533d06b JG |
48 | int print_missing_or_multiple_domains(unsigned int domain_count, |
49 | bool include_agent_domains); | |
b9dfb167 | 50 | |
8960e9cd DG |
51 | int spawn_relayd(const char *pathname, int port); |
52 | int check_relayd(void); | |
20fb9e02 | 53 | void print_session_stats(const char *session_name); |
58f237ca | 54 | int get_session_stats_str(const char *session_name, char **str); |
4fc83d94 | 55 | int show_cmd_help(const char *cmd_name, const char *help_msg); |
8960e9cd | 56 | |
bbbfd849 JG |
57 | int print_trace_archive_location( |
58 | const struct lttng_trace_archive_location *location, | |
59 | const char *session_name); | |
60 | ||
f3ed775e | 61 | #endif /* _LTTNG_UTILS_H */ |