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 _LTTNG_UTILS_H
19 #define _LTTNG_UTILS_H
23 #include <lttng/lttng.h>
25 extern char *opt_relayd_path
;
26 extern int opt_no_sessiond
;
27 extern char * opt_sessiond_path
;
28 extern pid_t sessiond_pid
;
32 char *get_session_name(void);
33 char *get_session_name_quiet(void);
34 void list_commands(struct cmd_struct
*commands
, FILE *ofp
);
35 void list_cmd_options(FILE *ofp
, struct poptOption
*options
);
38 * Return the minimum order for which x <= (1UL << order).
39 * Return -1 if x is 0.
41 int get_count_order_u32(uint32_t x
);
44 * Return the minimum order for which x <= (1UL << order).
45 * Return -1 if x is 0.
47 int get_count_order_u64(uint64_t x
);
50 * Return the minimum order for which x <= (1UL << order).
51 * Return -1 if x is 0.
53 int get_count_order_ulong(unsigned long x
);
55 const char *get_domain_str(enum lttng_domain_type domain
);
56 const char *get_event_type_str(enum lttng_event_type event_type
);
58 int print_missing_or_multiple_domains(unsigned int sum
);
60 int spawn_relayd(const char *pathname
, int port
);
61 int check_relayd(void);
62 void print_session_stats(const char *session_name
);
63 int show_cmd_help(const char *cmd_name
, const char *help_msg
);
65 int print_trace_archive_location(
66 const struct lttng_trace_archive_location
*location
,
67 const char *session_name
);
69 #endif /* _LTTNG_UTILS_H */