Commit | Line | Data |
---|---|---|
f3ed775e | 1 | /* |
21cf9b6b | 2 | * Copyright (C) 2011 EfficiOS Inc. |
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 | ||
e358ddd5 | 11 | #include <common/argpar/argpar.h> |
c9e313bc | 12 | #include <common/dynamic-array.hpp> |
679b4943 | 13 | |
b9dfb167 DG |
14 | #include <lttng/lttng.h> |
15 | ||
28f23191 JG |
16 | #include <popt.h> |
17 | ||
8960e9cd | 18 | extern char *opt_relayd_path; |
92360082 | 19 | extern int opt_no_sessiond; |
28f23191 | 20 | extern char *opt_sessiond_path; |
92360082 | 21 | extern pid_t sessiond_pid; |
8960e9cd | 22 | |
3c9bd23c SM |
23 | struct cmd_struct; |
24 | ||
f3ed775e | 25 | char *get_session_name(void); |
1dac0189 | 26 | char *get_session_name_quiet(void); |
3c9bd23c | 27 | void list_commands(struct cmd_struct *commands, FILE *ofp); |
679b4943 | 28 | void list_cmd_options(FILE *ofp, struct poptOption *options); |
b083f028 | 29 | void list_cmd_options_argpar(FILE *ofp, const struct argpar_opt_descr *options); |
f3ed775e | 30 | |
8ce58bad MD |
31 | /* |
32 | * Return the minimum order for which x <= (1UL << order). | |
33 | * Return -1 if x is 0. | |
34 | */ | |
35 | int get_count_order_u32(uint32_t x); | |
36 | ||
37 | /* | |
38 | * Return the minimum order for which x <= (1UL << order). | |
39 | * Return -1 if x is 0. | |
40 | */ | |
41 | int get_count_order_u64(uint64_t x); | |
42 | ||
43 | /* | |
44 | * Return the minimum order for which x <= (1UL << order). | |
45 | * Return -1 if x is 0. | |
46 | */ | |
47 | int get_count_order_ulong(unsigned long x); | |
48 | ||
4fd2697f | 49 | const char *get_event_type_str(enum lttng_event_type event_type); |
b9dfb167 | 50 | |
28f23191 | 51 | int print_missing_or_multiple_domains(unsigned int domain_count, bool include_agent_domains); |
b9dfb167 | 52 | |
8960e9cd DG |
53 | int spawn_relayd(const char *pathname, int port); |
54 | int check_relayd(void); | |
20fb9e02 | 55 | void print_session_stats(const char *session_name); |
58f237ca | 56 | int get_session_stats_str(const char *session_name, char **str); |
4fc83d94 | 57 | int show_cmd_help(const char *cmd_name, const char *help_msg); |
8960e9cd | 58 | |
28f23191 JG |
59 | int print_trace_archive_location(const struct lttng_trace_archive_location *location, |
60 | const char *session_name); | |
bbbfd849 | 61 | |
e358ddd5 | 62 | int validate_exclusion_list(const char *event_name, |
28f23191 | 63 | const struct lttng_dynamic_pointer_array *exclusions); |
e358ddd5 | 64 | |
f3ed775e | 65 | #endif /* _LTTNG_UTILS_H */ |