Commit 215432ed authored by Ingo Molnar's avatar Ingo Molnar

Merge tag 'perf-urgent-for-mingo' of...

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

  * Fix command line callchain attribute tests to handle the new
    -g/--call-chain semantics, from Arnaldo Carvalho de Melo.

  * Remove cast of non-variadic function to variadic, fixing perf output
    on armhf arch. Fix from Michael Hudson-Doyle.

  * Fix 32-bit building of 'perf bench', from Wei Yang.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 5e01dc7b 46d525ea
......@@ -1110,7 +1110,7 @@ static void *worker_thread(void *__tdata)
/* Check whether our max runtime timed out: */
if (g->p.nr_secs) {
timersub(&stop, &start0, &diff);
if (diff.tv_sec >= g->p.nr_secs) {
if (diff.tv_sec >= (time_t)g->p.nr_secs) {
g->stop_work = true;
break;
}
......@@ -1157,7 +1157,7 @@ static void *worker_thread(void *__tdata)
runtime_ns_max += diff.tv_usec * 1000;
if (details >= 0) {
printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016lx]\n",
printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016"PRIu64"]\n",
process_nr, thread_nr, runtime_ns_max / bytes_done, val);
}
fflush(stdout);
......
......@@ -44,9 +44,9 @@ Following tests are defined (with perf commands):
perf record -c 123 kill (test-record-count)
perf record -d kill (test-record-data)
perf record -F 100 kill (test-record-freq)
perf record -g -- kill (test-record-graph-default)
perf record -g dwarf -- kill (test-record-graph-dwarf)
perf record -g fp kill (test-record-graph-fp)
perf record -g kill (test-record-graph-default)
perf record --call-graph dwarf kill (test-record-graph-dwarf)
perf record --call-graph fp kill (test-record-graph-fp)
perf record --group -e cycles,instructions kill (test-record-group)
perf record -e '{cycles,instructions}' kill (test-record-group1)
perf record -D kill (test-record-no-delay)
......
[config]
command = record
args = -g -- kill >/dev/null 2>&1
args = -g kill >/dev/null 2>&1
[event:base-record]
sample_type=295
[config]
command = record
args = -g dwarf -- kill >/dev/null 2>&1
args = --call-graph dwarf -- kill >/dev/null 2>&1
[event:base-record]
sample_type=12583
......
[config]
command = record
args = -g fp kill >/dev/null 2>&1
args = --call-graph fp kill >/dev/null 2>&1
[event:base-record]
sample_type=295
......@@ -117,7 +117,7 @@ static int hpp__color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \
struct perf_hpp *hpp, struct hist_entry *he) \
{ \
return __hpp__fmt(hpp, he, he_get_##_field, " %6.2f%%", \
(hpp_snprint_fn)percent_color_snprintf, true); \
percent_color_snprintf, true); \
}
#define __HPP_ENTRY_PERCENT_FN(_type, _field) \
......
......@@ -318,8 +318,15 @@ int percent_color_fprintf(FILE *fp, const char *fmt, double percent)
return r;
}
int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent)
int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...)
{
const char *color = get_percent_color(percent);
va_list args;
double percent;
const char *color;
va_start(args, fmt);
percent = va_arg(args, double);
va_end(args);
color = get_percent_color(percent);
return color_snprintf(bf, size, color, fmt, percent);
}
......@@ -39,7 +39,7 @@ int color_fprintf(FILE *fp, const char *color, const char *fmt, ...);
int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...);
int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...);
int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf);
int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent);
int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...);
int percent_color_fprintf(FILE *fp, const char *fmt, double percent);
const char *get_percent_color(double percent);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment