diff options
Diffstat (limited to 'tools/perf/util')
-rwxr-xr-x | tools/perf/util/PERF-VERSION-GEN | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 5 | ||||
-rw-r--r-- | tools/perf/util/svghelper.c | 16 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 3 | ||||
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 17 |
5 files changed, 29 insertions, 14 deletions
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN index c561d1538c0..54552a00a11 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/parse-events.c b/tools/perf/util/parse-events.c index 87c424de79e..8cfb48cbbea 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/svghelper.c b/tools/perf/util/svghelper.c index a778fd0f4ae..b3637db025a 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
@@ -28,7 +28,7 @@ static u64 turbo_frequency, max_freq; | |||
28 | 28 | ||
29 | int svg_page_width = 1000; | 29 | int svg_page_width = 1000; |
30 | 30 | ||
31 | #define MIN_TEXT_SIZE 0.001 | 31 | #define MIN_TEXT_SIZE 0.01 |
32 | 32 | ||
33 | static u64 total_height; | 33 | static u64 total_height; |
34 | static FILE *svgfile; | 34 | static FILE *svgfile; |
@@ -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"); |
@@ -217,6 +217,18 @@ static char *cpu_model(void) | |||
217 | } | 217 | } |
218 | fclose(file); | 218 | fclose(file); |
219 | } | 219 | } |
220 | |||
221 | /* CPU type */ | ||
222 | file = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies", "r"); | ||
223 | if (file) { | ||
224 | while (fgets(buf, 255, file)) { | ||
225 | unsigned int freq; | ||
226 | freq = strtoull(buf, NULL, 10); | ||
227 | if (freq > max_freq) | ||
228 | max_freq = freq; | ||
229 | } | ||
230 | fclose(file); | ||
231 | } | ||
220 | return cpu_m; | 232 | return cpu_m; |
221 | } | 233 | } |
222 | 234 | ||
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 559fb06210f..47ea0609a76 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -324,8 +324,7 @@ static inline int elf_sym__is_function(const GElf_Sym *sym) | |||
324 | { | 324 | { |
325 | return elf_sym__type(sym) == STT_FUNC && | 325 | return elf_sym__type(sym) == STT_FUNC && |
326 | sym->st_name != 0 && | 326 | sym->st_name != 0 && |
327 | sym->st_shndx != SHN_UNDEF && | 327 | sym->st_shndx != SHN_UNDEF; |
328 | sym->st_size != 0; | ||
329 | } | 328 | } |
330 | 329 | ||
331 | static inline int elf_sym__is_label(const GElf_Sym *sym) | 330 | static inline int elf_sym__is_label(const GElf_Sym *sym) |
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index f6a8437141c..55c9659a56e 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 | } |
@@ -1968,10 +1968,11 @@ static const struct flag flags[] = { | |||
1968 | { "NET_TX_SOFTIRQ", 2 }, | 1968 | { "NET_TX_SOFTIRQ", 2 }, |
1969 | { "NET_RX_SOFTIRQ", 3 }, | 1969 | { "NET_RX_SOFTIRQ", 3 }, |
1970 | { "BLOCK_SOFTIRQ", 4 }, | 1970 | { "BLOCK_SOFTIRQ", 4 }, |
1971 | { "TASKLET_SOFTIRQ", 5 }, | 1971 | { "BLOCK_IOPOLL_SOFTIRQ", 5 }, |
1972 | { "SCHED_SOFTIRQ", 6 }, | 1972 | { "TASKLET_SOFTIRQ", 6 }, |
1973 | { "HRTIMER_SOFTIRQ", 7 }, | 1973 | { "SCHED_SOFTIRQ", 7 }, |
1974 | { "RCU_SOFTIRQ", 8 }, | 1974 | { "HRTIMER_SOFTIRQ", 8 }, |
1975 | { "RCU_SOFTIRQ", 9 }, | ||
1975 | 1976 | ||
1976 | { "HRTIMER_NORESTART", 0 }, | 1977 | { "HRTIMER_NORESTART", 0 }, |
1977 | { "HRTIMER_RESTART", 1 }, | 1978 | { "HRTIMER_RESTART", 1 }, |