| 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 | |
| 23 | char *get_session_name(void); |
| 24 | void list_cmd_options(FILE *ofp, struct poptOption *options); |
| 25 | |
| 26 | /* |
| 27 | * Return the minimum order for which x <= (1UL << order). |
| 28 | * Return -1 if x is 0. |
| 29 | */ |
| 30 | int get_count_order_u32(uint32_t x); |
| 31 | |
| 32 | /* |
| 33 | * Return the minimum order for which x <= (1UL << order). |
| 34 | * Return -1 if x is 0. |
| 35 | */ |
| 36 | int get_count_order_u64(uint64_t x); |
| 37 | |
| 38 | /* |
| 39 | * Return the minimum order for which x <= (1UL << order). |
| 40 | * Return -1 if x is 0. |
| 41 | */ |
| 42 | int get_count_order_ulong(unsigned long x); |
| 43 | |
| 44 | #endif /* _LTTNG_UTILS_H */ |