diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-15 02:44:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-15 02:44:44 -0400 |
commit | b226f744d40b052ac126c4cb16c76f66e5185128 (patch) | |
tree | e86f5c059dde241472689cbe2d55429cd15b2d56 /tools/perf | |
parent | d5b889f2ecec7849e851ddd31c34bdfb3482b5de (diff) | |
parent | a3ccf63ee643ef243cbf8918da8b3f9238f10029 (diff) |
Merge branch 'linus' into perf/core
Merge reason: pick up tools/perf/ changes from upstream.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Makefile | 21 | ||||
-rw-r--r-- | tools/perf/builtin-sched.c | 4 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 5 | ||||
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 8 |
4 files changed, 24 insertions, 14 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 495eb6d97fa0..106c15055b50 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -157,11 +157,18 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') | |||
157 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') | 157 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
158 | uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') | 158 | uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') |
159 | 159 | ||
160 | # If we're on a 64-bit kernel, use -m64 | 160 | # |
161 | ifndef NO_64BIT | 161 | # Add -m32 for cross-builds: |
162 | ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) | 162 | # |
163 | M64 := -m64 | 163 | ifdef NO_64BIT |
164 | endif | 164 | MBITS := -m32 |
165 | else | ||
166 | # | ||
167 | # If we're on a 64-bit kernel, use -m64: | ||
168 | # | ||
169 | ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) | ||
170 | MBITS := -m64 | ||
171 | endif | ||
165 | endif | 172 | endif |
166 | 173 | ||
167 | # CFLAGS and LDFLAGS are for the users to override from the command line. | 174 | # CFLAGS and LDFLAGS are for the users to override from the command line. |
@@ -194,7 +201,7 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition | |||
194 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes | 201 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes |
195 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement | 202 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement |
196 | 203 | ||
197 | CFLAGS = $(M64) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) | 204 | CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) |
198 | LDFLAGS = -lpthread -lrt -lelf -lm | 205 | LDFLAGS = -lpthread -lrt -lelf -lm |
199 | ALL_CFLAGS = $(CFLAGS) | 206 | ALL_CFLAGS = $(CFLAGS) |
200 | ALL_LDFLAGS = $(LDFLAGS) | 207 | ALL_LDFLAGS = $(LDFLAGS) |
@@ -422,7 +429,7 @@ ifeq ($(uname_S),Darwin) | |||
422 | endif | 429 | endif |
423 | 430 | ||
424 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) | 431 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) |
425 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); | 432 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); |
426 | endif | 433 | endif |
427 | 434 | ||
428 | ifdef NO_DEMANGLE | 435 | ifdef NO_DEMANGLE |
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 73bdad029730..c9c68563e964 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1352,7 +1352,7 @@ static struct sort_dimension *available_sorts[] = { | |||
1352 | 1352 | ||
1353 | static LIST_HEAD(sort_list); | 1353 | static LIST_HEAD(sort_list); |
1354 | 1354 | ||
1355 | static int sort_dimension__add(char *tok, struct list_head *list) | 1355 | static int sort_dimension__add(const char *tok, struct list_head *list) |
1356 | { | 1356 | { |
1357 | int i; | 1357 | int i; |
1358 | 1358 | ||
@@ -1896,7 +1896,7 @@ static void setup_sorting(void) | |||
1896 | 1896 | ||
1897 | free(str); | 1897 | free(str); |
1898 | 1898 | ||
1899 | sort_dimension__add((char *)"pid", &cmp_pid); | 1899 | sort_dimension__add("pid", &cmp_pid); |
1900 | } | 1900 | } |
1901 | 1901 | ||
1902 | static const char *record_args[] = { | 1902 | static const char *record_args[] = { |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 87c424de79ee..8cfb48cbbea0 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -691,7 +691,10 @@ static void store_event_type(const char *orgname) | |||
691 | FILE *file; | 691 | FILE *file; |
692 | int id; | 692 | int id; |
693 | 693 | ||
694 | sprintf(filename, "/sys/kernel/debug/tracing/events/%s/id", orgname); | 694 | sprintf(filename, "%s/", debugfs_path); |
695 | strncat(filename, orgname, strlen(orgname)); | ||
696 | strcat(filename, "/id"); | ||
697 | |||
695 | c = strchr(filename, ':'); | 698 | c = strchr(filename, ':'); |
696 | if (c) | 699 | if (c) |
697 | *c = '/'; | 700 | *c = '/'; |
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 6f851f98b5b4..eef60df7a5bf 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -618,7 +618,7 @@ static int test_type(enum event_type type, enum event_type expect) | |||
618 | } | 618 | } |
619 | 619 | ||
620 | static int test_type_token(enum event_type type, char *token, | 620 | static int test_type_token(enum event_type type, char *token, |
621 | enum event_type expect, char *expect_tok) | 621 | enum event_type expect, const char *expect_tok) |
622 | { | 622 | { |
623 | if (type != expect) { | 623 | if (type != expect) { |
624 | die("Error: expected type %d but read %d", | 624 | die("Error: expected type %d but read %d", |
@@ -650,7 +650,7 @@ static int read_expect_type(enum event_type expect, char **tok) | |||
650 | return __read_expect_type(expect, tok, 1); | 650 | return __read_expect_type(expect, tok, 1); |
651 | } | 651 | } |
652 | 652 | ||
653 | static int __read_expected(enum event_type expect, char *str, int newline_ok) | 653 | static int __read_expected(enum event_type expect, const char *str, int newline_ok) |
654 | { | 654 | { |
655 | enum event_type type; | 655 | enum event_type type; |
656 | char *token; | 656 | char *token; |
@@ -668,12 +668,12 @@ static int __read_expected(enum event_type expect, char *str, int newline_ok) | |||
668 | return 0; | 668 | return 0; |
669 | } | 669 | } |
670 | 670 | ||
671 | static int read_expected(enum event_type expect, char *str) | 671 | static int read_expected(enum event_type expect, const char *str) |
672 | { | 672 | { |
673 | return __read_expected(expect, str, 1); | 673 | return __read_expected(expect, str, 1); |
674 | } | 674 | } |
675 | 675 | ||
676 | static int read_expected_item(enum event_type expect, char *str) | 676 | static int read_expected_item(enum event_type expect, const char *str) |
677 | { | 677 | { |
678 | return __read_expected(expect, str, 0); | 678 | return __read_expected(expect, str, 0); |
679 | } | 679 | } |