1
0
Fork 0

perf/urgent fixes:

. Fix command line callchain attribute tests to handle the new
   -g/--call-chain semantics.
 
 . 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: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSc8CTAAoJENZQFvNTUqpAsWAP/1IubBucZ9BBx6MrxtntFw0/
 e47flZpENFo9VEq/9+yIaL7PIz/TSEJAtZUOGYvUWZk8yM6BCatLKdSk+y5+cSaz
 HIbEdzJ/yCGaOIIXLY+y3s1gdW7GRgKYjtOWDvJHMr+8+pKG2WrASEwuEaObZhka
 3Ck6GKM618vZi+yynTxGlkOnuIM2aiT8lwQfdPh1T4SiKzs9ScpI1Ai0SGOnPOP2
 NHPBleNkta7QXuWaxgL4dQAiWRvNCYPTyCBVOf+0u2lD5qfw4LxnlA/EN8BzsMdj
 bbCOGZW0JdOTeoxC3deeBBOB+juJtWz5XZI5x8UmAZTxA39OwD8VtVPpY+90zLTp
 lGvw4yas8jVJjpYkOKOhSg8H4SXbL7LOYgV6wCHPtBmQF0tnAD5wUDOSpWpbBY2b
 cPRctufbOwbS5vNotH1Qeoe7KBCoAtDcua33mCtqClQbD5wECkXJ/FpOW6d1AfrC
 XCNt6b4DQ+uWicUXh0x3++AUCGT7G08J4W+N1f4Qkxs3lN0P/9oLJx/3OWEiNgSz
 u6pk4OGDgrMNX7zDyORmoB0G6EulfSTmhOxN1vhCL/708asdzMTtdJOZJQ0XXVUP
 7fjvUjMaZzRXbExlCUyUBjoIQmBrHKCgnv+3aZCI9gZJgbPhpQBnaBrSQTsjPwMy
 GGPlpcIEuGB/2pvkOPMm
 =LSjp
 -----END PGP SIGNATURE-----

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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
hifive-unleashed-5.1
Ingo Molnar 2013-11-04 07:44:31 +01:00
commit 215432ed30
8 changed files with 19 additions and 12 deletions

View File

@ -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);

View File

@ -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)

View File

@ -1,6 +1,6 @@
[config]
command = record
args = -g -- kill >/dev/null 2>&1
args = -g kill >/dev/null 2>&1
[event:base-record]
sample_type=295

View File

@ -1,6 +1,6 @@
[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

View File

@ -1,6 +1,6 @@
[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

View File

@ -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) \

View File

@ -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);
}

View File

@ -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);