diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-18 11:19:03 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-18 11:19:03 -0400 |
| commit | 4d7b4ac22fbec1a03206c6cde353f2fd6942f828 (patch) | |
| tree | 2d96a9e9c28cf6fa628a278decc00ad55a8b043b /tools/perf/util/util.h | |
| parent | 3aaf51ace5975050ab43c7d4d7e439e0ae7d13d7 (diff) | |
| parent | 94f3ca95787ada3d64339a4ecb2754236ab563f6 (diff) | |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (311 commits)
perf tools: Add mode to build without newt support
perf symbols: symbol inconsistency message should be done only at verbose=1
perf tui: Add explicit -lslang option
perf options: Type check all the remaining OPT_ variants
perf options: Type check OPT_BOOLEAN and fix the offenders
perf options: Check v type in OPT_U?INTEGER
perf options: Introduce OPT_UINTEGER
perf tui: Add workaround for slang < 2.1.4
perf record: Fix bug mismatch with -c option definition
perf options: Introduce OPT_U64
perf tui: Add help window to show key associations
perf tui: Make <- exit menus too
perf newt: Add single key shortcuts for zoom into DSO and threads
perf newt: Exit browser unconditionally when CTRL+C, q or Q is pressed
perf newt: Fix the 'A'/'a' shortcut for annotate
perf newt: Make <- exit the ui_browser
x86, perf: P4 PMU - fix counters management logic
perf newt: Make <- zoom out filters
perf report: Report number of events, not samples
perf hist: Clarify events_stats fields usage
...
Fix up trivial conflicts in kernel/fork.c and tools/perf/builtin-record.c
Diffstat (limited to 'tools/perf/util/util.h')
| -rw-r--r-- | tools/perf/util/util.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 0f5b2a6f1080..0795bf304b19 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
| @@ -42,12 +42,14 @@ | |||
| 42 | #define _ALL_SOURCE 1 | 42 | #define _ALL_SOURCE 1 |
| 43 | #define _GNU_SOURCE 1 | 43 | #define _GNU_SOURCE 1 |
| 44 | #define _BSD_SOURCE 1 | 44 | #define _BSD_SOURCE 1 |
| 45 | #define HAS_BOOL | ||
| 45 | 46 | ||
| 46 | #include <unistd.h> | 47 | #include <unistd.h> |
| 47 | #include <stdio.h> | 48 | #include <stdio.h> |
| 48 | #include <sys/stat.h> | 49 | #include <sys/stat.h> |
| 49 | #include <sys/statfs.h> | 50 | #include <sys/statfs.h> |
| 50 | #include <fcntl.h> | 51 | #include <fcntl.h> |
| 52 | #include <stdbool.h> | ||
| 51 | #include <stddef.h> | 53 | #include <stddef.h> |
| 52 | #include <stdlib.h> | 54 | #include <stdlib.h> |
| 53 | #include <stdarg.h> | 55 | #include <stdarg.h> |
| @@ -78,6 +80,7 @@ | |||
| 78 | #include <pwd.h> | 80 | #include <pwd.h> |
| 79 | #include <inttypes.h> | 81 | #include <inttypes.h> |
| 80 | #include "../../../include/linux/magic.h" | 82 | #include "../../../include/linux/magic.h" |
| 83 | #include "types.h" | ||
| 81 | 84 | ||
| 82 | 85 | ||
| 83 | #ifndef NO_ICONV | 86 | #ifndef NO_ICONV |
| @@ -295,6 +298,13 @@ extern void *xmemdupz(const void *data, size_t len); | |||
| 295 | extern char *xstrndup(const char *str, size_t len); | 298 | extern char *xstrndup(const char *str, size_t len); |
| 296 | extern void *xrealloc(void *ptr, size_t size) __attribute__((weak)); | 299 | extern void *xrealloc(void *ptr, size_t size) __attribute__((weak)); |
| 297 | 300 | ||
| 301 | static inline void *xzalloc(size_t size) | ||
| 302 | { | ||
| 303 | void *buf = xmalloc(size); | ||
| 304 | |||
| 305 | return memset(buf, 0, size); | ||
| 306 | } | ||
| 307 | |||
| 298 | static inline void *zalloc(size_t size) | 308 | static inline void *zalloc(size_t size) |
| 299 | { | 309 | { |
| 300 | return calloc(1, size); | 310 | return calloc(1, size); |
| @@ -309,6 +319,7 @@ static inline int has_extension(const char *filename, const char *ext) | |||
| 309 | { | 319 | { |
| 310 | size_t len = strlen(filename); | 320 | size_t len = strlen(filename); |
| 311 | size_t extlen = strlen(ext); | 321 | size_t extlen = strlen(ext); |
| 322 | |||
| 312 | return len > extlen && !memcmp(filename + len - extlen, ext, extlen); | 323 | return len > extlen && !memcmp(filename + len - extlen, ext, extlen); |
| 313 | } | 324 | } |
| 314 | 325 | ||
| @@ -322,6 +333,7 @@ static inline int has_extension(const char *filename, const char *ext) | |||
| 322 | #undef isalnum | 333 | #undef isalnum |
| 323 | #undef tolower | 334 | #undef tolower |
| 324 | #undef toupper | 335 | #undef toupper |
| 336 | |||
| 325 | extern unsigned char sane_ctype[256]; | 337 | extern unsigned char sane_ctype[256]; |
| 326 | #define GIT_SPACE 0x01 | 338 | #define GIT_SPACE 0x01 |
| 327 | #define GIT_DIGIT 0x02 | 339 | #define GIT_DIGIT 0x02 |
| @@ -406,4 +418,14 @@ void git_qsort(void *base, size_t nmemb, size_t size, | |||
| 406 | int mkdir_p(char *path, mode_t mode); | 418 | int mkdir_p(char *path, mode_t mode); |
| 407 | int copyfile(const char *from, const char *to); | 419 | int copyfile(const char *from, const char *to); |
| 408 | 420 | ||
| 421 | s64 perf_atoll(const char *str); | ||
| 422 | char **argv_split(const char *str, int *argcp); | ||
| 423 | void argv_free(char **argv); | ||
| 424 | bool strglobmatch(const char *str, const char *pat); | ||
| 425 | bool strlazymatch(const char *str, const char *pat); | ||
| 426 | unsigned long convert_unit(unsigned long value, char *unit); | ||
| 427 | |||
| 428 | #define _STR(x) #x | ||
| 429 | #define STR(x) _STR(x) | ||
| 430 | |||
| 409 | #endif | 431 | #endif |
