linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/2] perf/urgent fixes
@ 2015-07-28 16:09 Arnaldo Carvalho de Melo
  2015-07-28 16:09 ` [PATCH 1/2] perf stat: Fix transaction lenght metrics Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-28 16:09 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
	Jiri Olsa, Namhyung Kim, Pawel Moll, Peter Zijlstra,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 00a2916f7f82c348a2a94dbb572874173bc308a3:

  perf: Fix running time accounting (2015-07-27 13:52:19 +0200)

are available in the git repository at:

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

for you to fetch changes up to 0927beeca5f9d1a7978f8da9c9d28647859816d3:

  perf tools: Fix test build error when bindir contains double slash (2015-07-28 13:03:49 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Fix 'perf stat' transaction lenght metrics (Andi Kleen)

Developer visible:

- Fix test build error when bindir contains double slash (Pawel Moll)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Andi Kleen (1):
      perf stat: Fix transaction lenght metrics

Pawel Moll (1):
      perf tools: Fix test build error when bindir contains double slash

 tools/perf/config/Makefile    | 2 +-
 tools/perf/util/stat-shadow.c | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

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

* [PATCH 1/2] perf stat: Fix transaction lenght metrics
  2015-07-28 16:09 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2015-07-28 16:09 ` Arnaldo Carvalho de Melo
  2015-07-28 16:09 ` [PATCH 2/2] perf tools: Fix test build error when bindir contains double slash Arnaldo Carvalho de Melo
  2015-07-31  7:59 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-28 16:09 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

The transaction length metrics in perf stat -T broke recently.

It would not match the metric correctly and always print K/sec.

This was caused by a incorrect update of the cycles_in_tx statistics.

Update the correct variable.

Also the check for zero division was reversed, which resulted in K/sec
being printed for no transactions. Fix this also up.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1438039491-22091-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/stat-shadow.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 53e8bb7bc852..2a5d8d7698ae 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -85,7 +85,7 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count,
 	else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES))
 		update_stats(&runtime_cycles_stats[ctx][cpu], count[0]);
 	else if (perf_stat_evsel__is(counter, CYCLES_IN_TX))
-		update_stats(&runtime_transaction_stats[ctx][cpu], count[0]);
+		update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count[0]);
 	else if (perf_stat_evsel__is(counter, TRANSACTION_START))
 		update_stats(&runtime_transaction_stats[ctx][cpu], count[0]);
 	else if (perf_stat_evsel__is(counter, ELISION_START))
@@ -398,20 +398,18 @@ void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel,
 				" #   %5.2f%% aborted cycles         ",
 				100.0 * ((total2-avg) / total));
 	} else if (perf_stat_evsel__is(evsel, TRANSACTION_START) &&
-		   avg > 0 &&
 		   runtime_cycles_in_tx_stats[ctx][cpu].n != 0) {
 		total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]);
 
-		if (total)
+		if (avg)
 			ratio = total / avg;
 
 		fprintf(out, " # %8.0f cycles / transaction   ", ratio);
 	} else if (perf_stat_evsel__is(evsel, ELISION_START) &&
-		   avg > 0 &&
 		   runtime_cycles_in_tx_stats[ctx][cpu].n != 0) {
 		total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]);
 
-		if (total)
+		if (avg)
 			ratio = total / avg;
 
 		fprintf(out, " # %8.0f cycles / elision       ", ratio);
-- 
2.1.0


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

* [PATCH 2/2] perf tools: Fix test build error when bindir contains double slash
  2015-07-28 16:09 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2015-07-28 16:09 ` [PATCH 1/2] perf stat: Fix transaction lenght metrics Arnaldo Carvalho de Melo
@ 2015-07-28 16:09 ` Arnaldo Carvalho de Melo
  2015-07-31  7:59 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-28 16:09 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Pawel Moll, Adrian Hunter, Namhyung Kim,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Pawel Moll <pawel.moll@arm.com>

When building with a prefix ending with a slash, for example:

	$ make prefix=/usr/local/

one of the perf tests fail to compile due to BUILD_STR macro mishandling
bindir_SQ string containing with two slashes:

	-DBINDIR="BUILD_STR(/usr/local//bin)"

with the following error:

	  CC       tests/attr.o
	tests/attr.c: In function ‘test__attr’:
	tests/attr.c:168:50: error: expected ‘)’ before ‘;’ token
	  snprintf(path_perf, PATH_MAX, "%s/perf", BINDIR);
                                                  ^
	tests/attr.c:176:1: error: expected ‘;’ before ‘}’ token
	 }
	 ^
	tests/attr.c:176:1: error: control reaches end of non-void function [-Werror=return-type]
	 }
	 ^
	cc1: all warnings being treated as errors

This patch works around the problem by "cleaning" the bindir string
using make's abspath function.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1438092613-21014-1-git-send-email-pawel.moll@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/config/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 094ddaee104c..d31fac19c30b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -638,7 +638,7 @@ ifndef DESTDIR
 prefix ?= $(HOME)
 endif
 bindir_relative = bin
-bindir = $(prefix)/$(bindir_relative)
+bindir = $(abspath $(prefix)/$(bindir_relative))
 mandir = share/man
 infodir = share/info
 perfexecdir = libexec/perf-core
-- 
2.1.0


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

* Re: [GIT PULL 0/2] perf/urgent fixes
  2015-07-28 16:09 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2015-07-28 16:09 ` [PATCH 1/2] perf stat: Fix transaction lenght metrics Arnaldo Carvalho de Melo
  2015-07-28 16:09 ` [PATCH 2/2] perf tools: Fix test build error when bindir contains double slash Arnaldo Carvalho de Melo
@ 2015-07-31  7:59 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2015-07-31  7:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Jiri Olsa, Namhyung Kim,
	Pawel Moll, Peter Zijlstra, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 00a2916f7f82c348a2a94dbb572874173bc308a3:
> 
>   perf: Fix running time accounting (2015-07-27 13:52:19 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
> 
> for you to fetch changes up to 0927beeca5f9d1a7978f8da9c9d28647859816d3:
> 
>   perf tools: Fix test build error when bindir contains double slash (2015-07-28 13:03:49 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> User visible:
> 
> - Fix 'perf stat' transaction lenght metrics (Andi Kleen)
> 
> Developer visible:
> 
> - Fix test build error when bindir contains double slash (Pawel Moll)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (1):
>       perf stat: Fix transaction lenght metrics
> 
> Pawel Moll (1):
>       perf tools: Fix test build error when bindir contains double slash
> 
>  tools/perf/config/Makefile    | 2 +-
>  tools/perf/util/stat-shadow.c | 8 +++-----
>  2 files changed, 4 insertions(+), 6 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

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

end of thread, other threads:[~2015-07-31  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 16:09 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2015-07-28 16:09 ` [PATCH 1/2] perf stat: Fix transaction lenght metrics Arnaldo Carvalho de Melo
2015-07-28 16:09 ` [PATCH 2/2] perf tools: Fix test build error when bindir contains double slash Arnaldo Carvalho de Melo
2015-07-31  7:59 ` [GIT PULL 0/2] 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).