diff options
-rw-r--r-- | tools/perf/bench/numa.c | 4 | ||||
-rw-r--r-- | tools/perf/tests/attr/README | 6 | ||||
-rw-r--r-- | tools/perf/tests/attr/test-record-graph-default | 2 | ||||
-rw-r--r-- | tools/perf/tests/attr/test-record-graph-dwarf | 2 | ||||
-rw-r--r-- | tools/perf/tests/attr/test-record-graph-fp | 2 | ||||
-rw-r--r-- | tools/perf/ui/hist.c | 2 | ||||
-rw-r--r-- | tools/perf/util/color.c | 11 | ||||
-rw-r--r-- | tools/perf/util/color.h | 2 |
8 files changed, 19 insertions, 12 deletions
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 30d1c3225b46..a73c4ed8af17 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c | |||
@@ -1110,7 +1110,7 @@ static void *worker_thread(void *__tdata) | |||
1110 | /* Check whether our max runtime timed out: */ | 1110 | /* Check whether our max runtime timed out: */ |
1111 | if (g->p.nr_secs) { | 1111 | if (g->p.nr_secs) { |
1112 | timersub(&stop, &start0, &diff); | 1112 | timersub(&stop, &start0, &diff); |
1113 | if (diff.tv_sec >= g->p.nr_secs) { | 1113 | if (diff.tv_sec >= (time_t)g->p.nr_secs) { |
1114 | g->stop_work = true; | 1114 | g->stop_work = true; |
1115 | break; | 1115 | break; |
1116 | } | 1116 | } |
@@ -1157,7 +1157,7 @@ static void *worker_thread(void *__tdata) | |||
1157 | runtime_ns_max += diff.tv_usec * 1000; | 1157 | runtime_ns_max += diff.tv_usec * 1000; |
1158 | 1158 | ||
1159 | if (details >= 0) { | 1159 | if (details >= 0) { |
1160 | printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016lx]\n", | 1160 | printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016"PRIu64"]\n", |
1161 | process_nr, thread_nr, runtime_ns_max / bytes_done, val); | 1161 | process_nr, thread_nr, runtime_ns_max / bytes_done, val); |
1162 | } | 1162 | } |
1163 | fflush(stdout); | 1163 | fflush(stdout); |
diff --git a/tools/perf/tests/attr/README b/tools/perf/tests/attr/README index d102957cd59a..430024f618f1 100644 --- a/tools/perf/tests/attr/README +++ b/tools/perf/tests/attr/README | |||
@@ -44,9 +44,9 @@ Following tests are defined (with perf commands): | |||
44 | perf record -c 123 kill (test-record-count) | 44 | perf record -c 123 kill (test-record-count) |
45 | perf record -d kill (test-record-data) | 45 | perf record -d kill (test-record-data) |
46 | perf record -F 100 kill (test-record-freq) | 46 | perf record -F 100 kill (test-record-freq) |
47 | perf record -g -- kill (test-record-graph-default) | 47 | perf record -g kill (test-record-graph-default) |
48 | perf record -g dwarf -- kill (test-record-graph-dwarf) | 48 | perf record --call-graph dwarf kill (test-record-graph-dwarf) |
49 | perf record -g fp kill (test-record-graph-fp) | 49 | perf record --call-graph fp kill (test-record-graph-fp) |
50 | perf record --group -e cycles,instructions kill (test-record-group) | 50 | perf record --group -e cycles,instructions kill (test-record-group) |
51 | perf record -e '{cycles,instructions}' kill (test-record-group1) | 51 | perf record -e '{cycles,instructions}' kill (test-record-group1) |
52 | perf record -D kill (test-record-no-delay) | 52 | perf record -D kill (test-record-no-delay) |
diff --git a/tools/perf/tests/attr/test-record-graph-default b/tools/perf/tests/attr/test-record-graph-default index 833d1849d767..853597a9a8f6 100644 --- a/tools/perf/tests/attr/test-record-graph-default +++ b/tools/perf/tests/attr/test-record-graph-default | |||
@@ -1,6 +1,6 @@ | |||
1 | [config] | 1 | [config] |
2 | command = record | 2 | command = record |
3 | args = -g -- kill >/dev/null 2>&1 | 3 | args = -g kill >/dev/null 2>&1 |
4 | 4 | ||
5 | [event:base-record] | 5 | [event:base-record] |
6 | sample_type=295 | 6 | sample_type=295 |
diff --git a/tools/perf/tests/attr/test-record-graph-dwarf b/tools/perf/tests/attr/test-record-graph-dwarf index e93e082f5208..d6f324ea578c 100644 --- a/tools/perf/tests/attr/test-record-graph-dwarf +++ b/tools/perf/tests/attr/test-record-graph-dwarf | |||
@@ -1,6 +1,6 @@ | |||
1 | [config] | 1 | [config] |
2 | command = record | 2 | command = record |
3 | args = -g dwarf -- kill >/dev/null 2>&1 | 3 | args = --call-graph dwarf -- kill >/dev/null 2>&1 |
4 | 4 | ||
5 | [event:base-record] | 5 | [event:base-record] |
6 | sample_type=12583 | 6 | sample_type=12583 |
diff --git a/tools/perf/tests/attr/test-record-graph-fp b/tools/perf/tests/attr/test-record-graph-fp index 7cef3743f03f..055e3bee7993 100644 --- a/tools/perf/tests/attr/test-record-graph-fp +++ b/tools/perf/tests/attr/test-record-graph-fp | |||
@@ -1,6 +1,6 @@ | |||
1 | [config] | 1 | [config] |
2 | command = record | 2 | command = record |
3 | args = -g fp kill >/dev/null 2>&1 | 3 | args = --call-graph fp kill >/dev/null 2>&1 |
4 | 4 | ||
5 | [event:base-record] | 5 | [event:base-record] |
6 | sample_type=295 | 6 | sample_type=295 |
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 0a193281eba8..78f4c92e9b73 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -117,7 +117,7 @@ static int hpp__color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \ | |||
117 | struct perf_hpp *hpp, struct hist_entry *he) \ | 117 | struct perf_hpp *hpp, struct hist_entry *he) \ |
118 | { \ | 118 | { \ |
119 | return __hpp__fmt(hpp, he, he_get_##_field, " %6.2f%%", \ | 119 | return __hpp__fmt(hpp, he, he_get_##_field, " %6.2f%%", \ |
120 | (hpp_snprint_fn)percent_color_snprintf, true); \ | 120 | percent_color_snprintf, true); \ |
121 | } | 121 | } |
122 | 122 | ||
123 | #define __HPP_ENTRY_PERCENT_FN(_type, _field) \ | 123 | #define __HPP_ENTRY_PERCENT_FN(_type, _field) \ |
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c index 11e46da17bbb..66e44a5019d5 100644 --- a/tools/perf/util/color.c +++ b/tools/perf/util/color.c | |||
@@ -318,8 +318,15 @@ int percent_color_fprintf(FILE *fp, const char *fmt, double percent) | |||
318 | return r; | 318 | return r; |
319 | } | 319 | } |
320 | 320 | ||
321 | int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent) | 321 | int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...) |
322 | { | 322 | { |
323 | const char *color = get_percent_color(percent); | 323 | va_list args; |
324 | double percent; | ||
325 | const char *color; | ||
326 | |||
327 | va_start(args, fmt); | ||
328 | percent = va_arg(args, double); | ||
329 | va_end(args); | ||
330 | color = get_percent_color(percent); | ||
324 | return color_snprintf(bf, size, color, fmt, percent); | 331 | return color_snprintf(bf, size, color, fmt, percent); |
325 | } | 332 | } |
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h index dea082b79602..fced3840e99c 100644 --- a/tools/perf/util/color.h +++ b/tools/perf/util/color.h | |||
@@ -39,7 +39,7 @@ int color_fprintf(FILE *fp, const char *color, const char *fmt, ...); | |||
39 | int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...); | 39 | int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...); |
40 | int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...); | 40 | int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...); |
41 | int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf); | 41 | int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf); |
42 | int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent); | 42 | int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...); |
43 | int percent_color_fprintf(FILE *fp, const char *fmt, double percent); | 43 | int percent_color_fprintf(FILE *fp, const char *fmt, double percent); |
44 | const char *get_percent_color(double percent); | 44 | const char *get_percent_color(double percent); |
45 | 45 | ||