linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/3] perf/urgent fixes
@ 2013-11-01 14:56 Arnaldo Carvalho de Melo
  2013-11-01 14:56 ` [PATCH 1/3] perf tools: Remove cast of non-variadic function to variadic Arnaldo Carvalho de Melo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-11-01 14:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Michael Hudson-Doyle, Mike Galbraith, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Wei Yang,
	Will Deacon, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit e8a923cc1fff6e627f906655ad52ee694ef2f6d7:

  perf/x86: Fix NMI measurements (2013-10-29 12:01:20 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo

for you to fetch changes up to 46d525eae2a076adfde92dca1db12d9a3b8ad8bb:

  perf test: Update command line callchain attribute tests (2013-11-01 10:42:57 -0300)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      perf test: Update command line callchain attribute tests

Michael Hudson-Doyle (1):
      perf tools: Remove cast of non-variadic function to variadic

Wei Yang (1):
      perf bench: Fix two warnings

 tools/perf/bench/numa.c                         |  4 ++--
 tools/perf/tests/attr/README                    |  6 +++---
 tools/perf/tests/attr/test-record-graph-default |  2 +-
 tools/perf/tests/attr/test-record-graph-dwarf   |  2 +-
 tools/perf/tests/attr/test-record-graph-fp      |  2 +-
 tools/perf/ui/hist.c                            |  2 +-
 tools/perf/util/color.c                         | 11 +++++++++--
 tools/perf/util/color.h                         |  2 +-
 8 files changed, 19 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] perf tools: Remove cast of non-variadic function to variadic
  2013-11-01 14:56 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2013-11-01 14:56 ` Arnaldo Carvalho de Melo
  2013-11-01 14:56 ` [PATCH 2/3] perf bench: Fix two warnings Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-11-01 14:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Michael Hudson-Doyle, Jean Pihet, Jiri Olsa,
	Will Deacon, stable, Arnaldo Carvalho de Melo

From: Michael Hudson-Doyle <michael.hudson@linaro.org>

The 4fb71074a570 (perf ui/hist: Consolidate hpp helpers) cset introduced
a cast of percent_color_snprintf to a function pointer type with
varargs.  Change percent_color_snprintf to be variadic and remove the
cast.

The symptom of this was all percentages being reported as 0.00% in perf
report --stdio output on the armhf arch.

Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/87zjppvw7y.fsf@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c    |  2 +-
 tools/perf/util/color.c | 11 +++++++++--
 tools/perf/util/color.h |  2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

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,		\
 			      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)					\
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)
 	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);
 }
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, ...);
 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);
 
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] perf bench: Fix two warnings
  2013-11-01 14:56 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
  2013-11-01 14:56 ` [PATCH 1/3] perf tools: Remove cast of non-variadic function to variadic Arnaldo Carvalho de Melo
@ 2013-11-01 14:56 ` Arnaldo Carvalho de Melo
  2013-11-01 14:56 ` [PATCH 3/3] perf test: Update command line callchain attribute tests Arnaldo Carvalho de Melo
  2013-11-04  6:50 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-11-01 14:56 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Wei Yang, Ingo Molnar, Arnaldo Carvalho de Melo

From: Wei Yang <weiyang@linux.vnet.ibm.com>

There are two warnings in bench/numa, when building this on 32-bit
machine.

The warning output is attached:

bench/numa.c:1113:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
bench/numa.c:1161:6: error: format ‘%lx’ expects argument of t'long unsigned int’, but argument 5 has type ‘u64’ [-Werror=format]

This patch fixes these two warnings.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Link: http://lkml.kernel.org/r/1379839764-9245-1-git-send-email-weiyang@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/bench/numa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 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)
 		/* 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);
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] perf test: Update command line callchain attribute tests
  2013-11-01 14:56 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
  2013-11-01 14:56 ` [PATCH 1/3] perf tools: Remove cast of non-variadic function to variadic Arnaldo Carvalho de Melo
  2013-11-01 14:56 ` [PATCH 2/3] perf bench: Fix two warnings Arnaldo Carvalho de Melo
@ 2013-11-01 14:56 ` Arnaldo Carvalho de Melo
  2013-11-04  6:50 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-11-01 14:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The "struct perf_event_attr setup" entry in 'perf test' is in fact a
series of tests that will exec the tools, passing different sets of
command line arguments to then intercept the sys_perf_event_open
syscall, in user space, to check that the perf_event_attr->sample_type
and other feature request bits are setup as expected.

We recently restored the callchain requesting command line argument, -g,
to not require a parameter ("dwarf" or "fp"), instead using a default
("fp" for now) and making the long option variant, --call-chain, be the
one to be used when a different callchain collection method is
preferred.

The "struct perf_event_attr setup" test failed because we forgot to
update the tests involving callchains, not switching from, '-g dwarf' to
'--call-chain dwarf', making 'perf test' detect it:

  [root@sandy ~]# perf test -v 13
  13: struct perf_event_attr setup                           :
  --- start ---
  running '/home/acme/libexec/perf-core/tests/attr/test-record-basic'
  running '/home/acme/libexec/perf-core/tests/attr/test-record-branch-any'
  <SNIP>
  running '/home/acme/libexec/perf-core/tests/attr/test-record-graph-default'
  running '/home/acme/libexec/perf-core/tests/attr/test-record-graph-dwarf'
  expected sample_type=12583, got 295
  expected exclude_callchain_user=1, got 0
  expected sample_stack_user=8192, got 0
  FAILED '/home/acme/libexec/perf-core/tests/attr/test-record-graph-dwarf' - match failure
  ---- end ----
  struct perf_event_attr setup: FAILED!
  [root@sandy ~]#

Fix all of them now to use --call-chain when explicitely specifying a
method.

There is still work to do, as '-g fp', for instance, passed without
problems.

In that case 'perf test' saw no problems as the intercepted syscall got
the bits as expected, i.e. the default is 'fp', but the fact that 'fp'
may be an existing program and the specified workload would then be
passed as a parameter to it is an usability problem that needs fixing.

Next merge window tho.

Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-jr3oq1k5iywnp7vvqlslzydm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/attr/README                    | 6 +++---
 tools/perf/tests/attr/test-record-graph-default | 2 +-
 tools/perf/tests/attr/test-record-graph-dwarf   | 2 +-
 tools/perf/tests/attr/test-record-graph-fp      | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

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):
   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)
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 @@
 [config]
 command = record
-args    = -g -- kill >/dev/null 2>&1
+args    = -g kill >/dev/null 2>&1
 
 [event:base-record]
 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 @@
 [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
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 @@
 [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
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [GIT PULL 0/3] perf/urgent fixes
  2013-11-01 14:56 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2013-11-01 14:56 ` [PATCH 3/3] perf test: Update command line callchain attribute tests Arnaldo Carvalho de Melo
@ 2013-11-04  6:50 ` Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2013-11-04  6:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Michael Hudson-Doyle, Mike Galbraith, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Wei Yang,
	Will Deacon, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit e8a923cc1fff6e627f906655ad52ee694ef2f6d7:
> 
>   perf/x86: Fix NMI measurements (2013-10-29 12:01:20 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
> 
> for you to fetch changes up to 46d525eae2a076adfde92dca1db12d9a3b8ad8bb:
> 
>   perf test: Update command line callchain attribute tests (2013-11-01 10:42:57 -0300)
> 
> ----------------------------------------------------------------
> 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>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       perf test: Update command line callchain attribute tests
> 
> Michael Hudson-Doyle (1):
>       perf tools: Remove cast of non-variadic function to variadic
> 
> Wei Yang (1):
>       perf bench: Fix two warnings
> 
>  tools/perf/bench/numa.c                         |  4 ++--
>  tools/perf/tests/attr/README                    |  6 +++---
>  tools/perf/tests/attr/test-record-graph-default |  2 +-
>  tools/perf/tests/attr/test-record-graph-dwarf   |  2 +-
>  tools/perf/tests/attr/test-record-graph-fp      |  2 +-
>  tools/perf/ui/hist.c                            |  2 +-
>  tools/perf/util/color.c                         | 11 +++++++++--
>  tools/perf/util/color.h                         |  2 +-
>  8 files changed, 19 insertions(+), 12 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-04  6:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-01 14:56 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2013-11-01 14:56 ` [PATCH 1/3] perf tools: Remove cast of non-variadic function to variadic Arnaldo Carvalho de Melo
2013-11-01 14:56 ` [PATCH 2/3] perf bench: Fix two warnings Arnaldo Carvalho de Melo
2013-11-01 14:56 ` [PATCH 3/3] perf test: Update command line callchain attribute tests Arnaldo Carvalho de Melo
2013-11-04  6:50 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).