diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-14 13:57:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-14 13:57:16 -0400 |
commit | b25c6cee55c720e5e8502aa37104409aacd16ad3 (patch) | |
tree | fc577f6fa60ce90e2ffef2cb7c0048c546b6d170 /tools | |
parent | 5e5013c6b5150b8009d980d72495a55b79bf5134 (diff) | |
parent | d7a702f0b1033cf402fef65bd6395072738f0844 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"Misc fixes: PMU driver corner cases, tooling fixes, and an 'AUX'
(Intel PT) race related core fix"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/x86/intel/cqm: Do not access cpu_data() from CPU_UP_PREPARE handler
perf/x86/intel: Fix memory leak on hot-plug allocation fail
perf: Fix PERF_EVENT_IOC_PERIOD migration race
perf: Fix double-free of the AUX buffer
perf: Fix fasync handling on inherited events
perf tools: Fix test build error when bindir contains double slash
perf stat: Fix transaction lenght metrics
perf: Fix running time accounting
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/config/Makefile | 2 | ||||
-rw-r--r-- | tools/perf/util/stat-shadow.c | 8 |
2 files changed, 4 insertions, 6 deletions
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 | |||
638 | prefix ?= $(HOME) | 638 | prefix ?= $(HOME) |
639 | endif | 639 | endif |
640 | bindir_relative = bin | 640 | bindir_relative = bin |
641 | bindir = $(prefix)/$(bindir_relative) | 641 | bindir = $(abspath $(prefix)/$(bindir_relative)) |
642 | mandir = share/man | 642 | mandir = share/man |
643 | infodir = share/info | 643 | infodir = share/info |
644 | perfexecdir = libexec/perf-core | 644 | perfexecdir = libexec/perf-core |
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, | |||
85 | else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) | 85 | else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) |
86 | update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); | 86 | update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); |
87 | else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) | 87 | else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) |
88 | update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); | 88 | update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count[0]); |
89 | else if (perf_stat_evsel__is(counter, TRANSACTION_START)) | 89 | else if (perf_stat_evsel__is(counter, TRANSACTION_START)) |
90 | update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); | 90 | update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); |
91 | else if (perf_stat_evsel__is(counter, ELISION_START)) | 91 | 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, | |||
398 | " # %5.2f%% aborted cycles ", | 398 | " # %5.2f%% aborted cycles ", |
399 | 100.0 * ((total2-avg) / total)); | 399 | 100.0 * ((total2-avg) / total)); |
400 | } else if (perf_stat_evsel__is(evsel, TRANSACTION_START) && | 400 | } else if (perf_stat_evsel__is(evsel, TRANSACTION_START) && |
401 | avg > 0 && | ||
402 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { | 401 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { |
403 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); | 402 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); |
404 | 403 | ||
405 | if (total) | 404 | if (avg) |
406 | ratio = total / avg; | 405 | ratio = total / avg; |
407 | 406 | ||
408 | fprintf(out, " # %8.0f cycles / transaction ", ratio); | 407 | fprintf(out, " # %8.0f cycles / transaction ", ratio); |
409 | } else if (perf_stat_evsel__is(evsel, ELISION_START) && | 408 | } else if (perf_stat_evsel__is(evsel, ELISION_START) && |
410 | avg > 0 && | ||
411 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { | 409 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { |
412 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); | 410 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); |
413 | 411 | ||
414 | if (total) | 412 | if (avg) |
415 | ratio = total / avg; | 413 | ratio = total / avg; |
416 | 414 | ||
417 | fprintf(out, " # %8.0f cycles / elision ", ratio); | 415 | fprintf(out, " # %8.0f cycles / elision ", ratio); |