diff options
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r-- | tools/perf/util/util.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index a53535949043..c8f362daba87 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -128,6 +128,8 @@ void put_tracing_file(char *file); | |||
128 | #endif | 128 | #endif |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #define PERF_GTK_DSO "libperf-gtk.so" | ||
132 | |||
131 | /* General helper functions */ | 133 | /* General helper functions */ |
132 | extern void usage(const char *err) NORETURN; | 134 | extern void usage(const char *err) NORETURN; |
133 | extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); | 135 | extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); |
@@ -241,6 +243,7 @@ static inline int sane_case(int x, int high) | |||
241 | 243 | ||
242 | int mkdir_p(char *path, mode_t mode); | 244 | int mkdir_p(char *path, mode_t mode); |
243 | int copyfile(const char *from, const char *to); | 245 | int copyfile(const char *from, const char *to); |
246 | int copyfile_mode(const char *from, const char *to, mode_t mode); | ||
244 | 247 | ||
245 | s64 perf_atoll(const char *str); | 248 | s64 perf_atoll(const char *str); |
246 | char **argv_split(const char *str, int *argcp); | 249 | char **argv_split(const char *str, int *argcp); |
@@ -270,6 +273,13 @@ bool is_power_of_2(unsigned long n) | |||
270 | return (n != 0 && ((n & (n - 1)) == 0)); | 273 | return (n != 0 && ((n & (n - 1)) == 0)); |
271 | } | 274 | } |
272 | 275 | ||
276 | static inline unsigned next_pow2(unsigned x) | ||
277 | { | ||
278 | if (!x) | ||
279 | return 1; | ||
280 | return 1ULL << (32 - __builtin_clz(x - 1)); | ||
281 | } | ||
282 | |||
273 | size_t hex_width(u64 v); | 283 | size_t hex_width(u64 v); |
274 | int hex2u64(const char *ptr, u64 *val); | 284 | int hex2u64(const char *ptr, u64 *val); |
275 | 285 | ||
@@ -281,4 +291,20 @@ void dump_stack(void); | |||
281 | extern unsigned int page_size; | 291 | extern unsigned int page_size; |
282 | 292 | ||
283 | void get_term_dimensions(struct winsize *ws); | 293 | void get_term_dimensions(struct winsize *ws); |
294 | |||
295 | struct parse_tag { | ||
296 | char tag; | ||
297 | int mult; | ||
298 | }; | ||
299 | |||
300 | unsigned long parse_tag_value(const char *str, struct parse_tag *tags); | ||
301 | |||
302 | #define SRCLINE_UNKNOWN ((char *) "??:0") | ||
303 | |||
304 | struct dso; | ||
305 | |||
306 | char *get_srcline(struct dso *dso, unsigned long addr); | ||
307 | void free_srcline(char *srcline); | ||
308 | |||
309 | int filename__read_int(const char *filename, int *value); | ||
284 | #endif /* GIT_COMPAT_UTIL_H */ | 310 | #endif /* GIT_COMPAT_UTIL_H */ |