a51c8579a8e42d7de4549f44d0792ae0a5971f25
[lttng-tools.git] / src / bin / lttng / utils.h
1 /*
2 * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8 #ifndef _LTTNG_UTILS_H
9 #define _LTTNG_UTILS_H
10
11 #include <popt.h>
12 #include "common/argpar/argpar.h"
13
14 #include <lttng/lttng.h>
15
16 extern char *opt_relayd_path;
17 extern int opt_no_sessiond;
18 extern char * opt_sessiond_path;
19 extern pid_t sessiond_pid;
20
21 struct cmd_struct;
22
23 char *get_session_name(void);
24 char *get_session_name_quiet(void);
25 void list_commands(struct cmd_struct *commands, FILE *ofp);
26 void list_cmd_options(FILE *ofp, struct poptOption *options);
27 void list_cmd_options_argpar(FILE *ofp, const struct argpar_opt_descr *options);
28
29 /*
30 * Return the minimum order for which x <= (1UL << order).
31 * Return -1 if x is 0.
32 */
33 int get_count_order_u32(uint32_t x);
34
35 /*
36 * Return the minimum order for which x <= (1UL << order).
37 * Return -1 if x is 0.
38 */
39 int get_count_order_u64(uint64_t x);
40
41 /*
42 * Return the minimum order for which x <= (1UL << order).
43 * Return -1 if x is 0.
44 */
45 int get_count_order_ulong(unsigned long x);
46
47 const char *get_domain_str(enum lttng_domain_type domain);
48 const char *get_event_type_str(enum lttng_event_type event_type);
49
50 int print_missing_or_multiple_domains(unsigned int domain_count,
51 bool include_agent_domains);
52
53 int spawn_relayd(const char *pathname, int port);
54 int check_relayd(void);
55 void print_session_stats(const char *session_name);
56 int get_session_stats_str(const char *session_name, char **str);
57 int show_cmd_help(const char *cmd_name, const char *help_msg);
58
59 int print_trace_archive_location(
60 const struct lttng_trace_archive_location *location,
61 const char *session_name);
62
63 #endif /* _LTTNG_UTILS_H */
This page took 0.031796 seconds and 3 git commands to generate.