diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-11-26 04:50:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-26 04:50:42 -0500 |
commit | 16bc67edeb49b531940b2ba6c183780a1b5c472d (patch) | |
tree | 71b4bc48e47e54f2c0b3126d8f81d2f31b707ea8 /tools | |
parent | f6630114d9198aa959ac95c131334c020038f253 (diff) | |
parent | 047106adcc85e3023da210143a6ab8a55df9e0fc (diff) |
Merge branch 'sched/urgent' into sched/core
Merge reason: Pick up fixes that did not make it into .32.0
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Makefile | 9 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-timechart.c | 28 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rwxr-xr-x | tools/perf/util/PERF-VERSION-GEN | 2 | ||||
-rw-r--r-- | tools/perf/util/svghelper.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 6 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 10 |
8 files changed, 51 insertions, 12 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 742a32eee8fc..7e190d522cd5 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -177,8 +177,7 @@ endif | |||
177 | # Include saner warnings here, which can catch bugs: | 177 | # Include saner warnings here, which can catch bugs: |
178 | # | 178 | # |
179 | 179 | ||
180 | EXTRA_WARNINGS := -Wcast-align | 180 | EXTRA_WARNINGS := -Wformat |
181 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat | ||
182 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security | 181 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security |
183 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k | 182 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k |
184 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow | 183 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow |
@@ -422,7 +421,11 @@ ifeq ($(uname_S),Darwin) | |||
422 | PTHREAD_LIBS = | 421 | PTHREAD_LIBS = |
423 | endif | 422 | endif |
424 | 423 | ||
425 | 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) | 424 | ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 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 | 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) | ||
426 | BASIC_CFLAGS += -DLIBELF_NO_MMAP | ||
427 | endif | ||
428 | else | ||
426 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); | 429 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); |
427 | endif | 430 | endif |
428 | 431 | ||
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 3eeef339c787..a4be453fc8a9 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -426,7 +426,7 @@ try_again: | |||
426 | if (fd[nr_cpu][counter] < 0) { | 426 | if (fd[nr_cpu][counter] < 0) { |
427 | int err = errno; | 427 | int err = errno; |
428 | 428 | ||
429 | if (err == EPERM) | 429 | if (err == EPERM || err == EACCES) |
430 | die("Permission error - are you root?\n"); | 430 | die("Permission error - are you root?\n"); |
431 | else if (err == ENODEV && profile_cpu != -1) | 431 | else if (err == ENODEV && profile_cpu != -1) |
432 | die("No such device - did you specify an out-of-range profile CPU?\n"); | 432 | die("No such device - did you specify an out-of-range profile CPU?\n"); |
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 702d8fe58fbc..e8a510d935e5 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -765,19 +765,40 @@ static void draw_wakeups(void) | |||
765 | if (c->Y && c->start_time <= we->time && c->end_time >= we->time) { | 765 | if (c->Y && c->start_time <= we->time && c->end_time >= we->time) { |
766 | if (p->pid == we->waker) { | 766 | if (p->pid == we->waker) { |
767 | from = c->Y; | 767 | from = c->Y; |
768 | task_from = c->comm; | 768 | task_from = strdup(c->comm); |
769 | } | 769 | } |
770 | if (p->pid == we->wakee) { | 770 | if (p->pid == we->wakee) { |
771 | to = c->Y; | 771 | to = c->Y; |
772 | task_to = c->comm; | 772 | task_to = strdup(c->comm); |
773 | } | 773 | } |
774 | } | 774 | } |
775 | c = c->next; | 775 | c = c->next; |
776 | } | 776 | } |
777 | c = p->all; | ||
778 | while (c) { | ||
779 | if (p->pid == we->waker && !from) { | ||
780 | from = c->Y; | ||
781 | task_from = strdup(c->comm); | ||
782 | } | ||
783 | if (p->pid == we->wakee && !to) { | ||
784 | to = c->Y; | ||
785 | task_to = strdup(c->comm); | ||
786 | } | ||
787 | c = c->next; | ||
788 | } | ||
777 | } | 789 | } |
778 | p = p->next; | 790 | p = p->next; |
779 | } | 791 | } |
780 | 792 | ||
793 | if (!task_from) { | ||
794 | task_from = malloc(40); | ||
795 | sprintf(task_from, "[%i]", we->waker); | ||
796 | } | ||
797 | if (!task_to) { | ||
798 | task_to = malloc(40); | ||
799 | sprintf(task_to, "[%i]", we->wakee); | ||
800 | } | ||
801 | |||
781 | if (we->waker == -1) | 802 | if (we->waker == -1) |
782 | svg_interrupt(we->time, to); | 803 | svg_interrupt(we->time, to); |
783 | else if (from && to && abs(from - to) == 1) | 804 | else if (from && to && abs(from - to) == 1) |
@@ -785,6 +806,9 @@ static void draw_wakeups(void) | |||
785 | else | 806 | else |
786 | svg_partial_wakeline(we->time, from, task_from, to, task_to); | 807 | svg_partial_wakeline(we->time, from, task_from, to, task_to); |
787 | we = we->next; | 808 | we = we->next; |
809 | |||
810 | free(task_from); | ||
811 | free(task_to); | ||
788 | } | 812 | } |
789 | } | 813 | } |
790 | 814 | ||
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 37512e936235..e23bc74e734f 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -686,6 +686,8 @@ static void handle_keypress(int c) | |||
686 | switch (c) { | 686 | switch (c) { |
687 | case 'd': | 687 | case 'd': |
688 | prompt_integer(&delay_secs, "Enter display delay"); | 688 | prompt_integer(&delay_secs, "Enter display delay"); |
689 | if (delay_secs < 1) | ||
690 | delay_secs = 1; | ||
689 | break; | 691 | break; |
690 | case 'e': | 692 | case 'e': |
691 | prompt_integer(&print_entries, "Enter display entries (lines)"); | 693 | prompt_integer(&print_entries, "Enter display entries (lines)"); |
@@ -1025,7 +1027,7 @@ try_again: | |||
1025 | if (fd[i][counter] < 0) { | 1027 | if (fd[i][counter] < 0) { |
1026 | int err = errno; | 1028 | int err = errno; |
1027 | 1029 | ||
1028 | if (err == EPERM) | 1030 | if (err == EPERM || err == EACCES) |
1029 | die("No permission - are you root?\n"); | 1031 | die("No permission - are you root?\n"); |
1030 | /* | 1032 | /* |
1031 | * If it's cycles then fall back to hrtimer | 1033 | * If it's cycles then fall back to hrtimer |
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN index c561d1538c03..54552a00a117 100755 --- a/tools/perf/util/PERF-VERSION-GEN +++ b/tools/perf/util/PERF-VERSION-GEN | |||
@@ -1,7 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | GVF=PERF-VERSION-FILE | 3 | GVF=PERF-VERSION-FILE |
4 | DEF_VER=v0.0.1.PERF | 4 | DEF_VER=v0.0.2.PERF |
5 | 5 | ||
6 | LF=' | 6 | LF=' |
7 | ' | 7 | ' |
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index 856655d8b0b8..b3637db025a2 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
@@ -103,7 +103,7 @@ void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end) | |||
103 | fprintf(svgfile, " rect.process2 { fill:rgb(180,180,180); fill-opacity:0.9; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); | 103 | fprintf(svgfile, " rect.process2 { fill:rgb(180,180,180); fill-opacity:0.9; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); |
104 | fprintf(svgfile, " rect.sample { fill:rgb( 0, 0,255); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); | 104 | fprintf(svgfile, " rect.sample { fill:rgb( 0, 0,255); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); |
105 | fprintf(svgfile, " rect.blocked { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); | 105 | fprintf(svgfile, " rect.blocked { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); |
106 | fprintf(svgfile, " rect.waiting { fill:rgb(214,214, 0); fill-opacity:0.3; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); | 106 | fprintf(svgfile, " rect.waiting { fill:rgb(224,214, 0); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); |
107 | fprintf(svgfile, " rect.WAITING { fill:rgb(255,214, 48); fill-opacity:0.6; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); | 107 | fprintf(svgfile, " rect.WAITING { fill:rgb(255,214, 48); fill-opacity:0.6; stroke-width:0; stroke:rgb( 0, 0, 0); } \n"); |
108 | fprintf(svgfile, " rect.cpu { fill:rgb(192,192,192); fill-opacity:0.2; stroke-width:0.5; stroke:rgb(128,128,128); } \n"); | 108 | fprintf(svgfile, " rect.cpu { fill:rgb(192,192,192); fill-opacity:0.2; stroke-width:0.5; stroke:rgb(128,128,128); } \n"); |
109 | fprintf(svgfile, " rect.pstate { fill:rgb(128,128,128); fill-opacity:0.8; stroke-width:0; } \n"); | 109 | fprintf(svgfile, " rect.pstate { fill:rgb(128,128,128); fill-opacity:0.8; stroke-width:0; } \n"); |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 47ea0609a760..226f44a2357d 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -413,7 +413,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, int v) | |||
413 | if (fd < 0) | 413 | if (fd < 0) |
414 | goto out; | 414 | goto out; |
415 | 415 | ||
416 | elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); | 416 | elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); |
417 | if (elf == NULL) | 417 | if (elf == NULL) |
418 | goto out_close; | 418 | goto out_close; |
419 | 419 | ||
@@ -533,7 +533,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name, | |||
533 | Elf *elf; | 533 | Elf *elf; |
534 | int nr = 0, kernel = !strcmp("[kernel]", self->name); | 534 | int nr = 0, kernel = !strcmp("[kernel]", self->name); |
535 | 535 | ||
536 | elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); | 536 | elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); |
537 | if (elf == NULL) { | 537 | if (elf == NULL) { |
538 | if (v) | 538 | if (v) |
539 | fprintf(stderr, "%s: cannot read %s ELF file.\n", | 539 | fprintf(stderr, "%s: cannot read %s ELF file.\n", |
@@ -675,7 +675,7 @@ static char *dso__read_build_id(struct dso *self, int v) | |||
675 | if (fd < 0) | 675 | if (fd < 0) |
676 | goto out; | 676 | goto out; |
677 | 677 | ||
678 | elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); | 678 | elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); |
679 | if (elf == NULL) { | 679 | if (elf == NULL) { |
680 | if (v) | 680 | if (v) |
681 | fprintf(stderr, "%s: cannot read %s ELF file.\n", | 681 | fprintf(stderr, "%s: cannot read %s ELF file.\n", |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 6e8490716408..829da9edba64 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -27,6 +27,16 @@ static inline char *bfd_demangle(void __used *v, const char __used *c, | |||
27 | #endif | 27 | #endif |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | /* | ||
31 | * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP; | ||
32 | * for newer versions we can use mmap to reduce memory usage: | ||
33 | */ | ||
34 | #ifdef LIBELF_NO_MMAP | ||
35 | # define PERF_ELF_C_READ_MMAP ELF_C_READ | ||
36 | #else | ||
37 | # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP | ||
38 | #endif | ||
39 | |||
30 | #ifndef DMGL_PARAMS | 40 | #ifndef DMGL_PARAMS |
31 | #define DMGL_PARAMS (1 << 0) /* Include function args */ | 41 | #define DMGL_PARAMS (1 << 0) /* Include function args */ |
32 | #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ | 42 | #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ |