lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  1 Mar 2016 15:32:37 -0800
From:	Andi Kleen <andi@...stfloor.org>
To:	acme@...nel.org
Cc:	jolsa@...nel.org, linux-kernel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH] perf, tools, stat: Avoid crash with --per-thread

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

Bug fix:

The earlier metrics changes broke --per-thread causing a segfault.
Handle this case correctly. We actually don't print metrics
in per thread mode, so using a 0 shadow CPU is fine.

Could be folded into
"perf, tools, stat: Support metrics in --per-core/socket mode"

Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 tools/perf/builtin-stat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index c11374b..52a37a5 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -977,6 +977,9 @@ static int first_shadow_cpu(struct perf_evsel *evsel, int id)
 {
 	int i;
 
+	if (!aggr_get_id)
+		return 0;
+
 	if (stat_config.aggr_mode == AGGR_NONE)
 		return id;
 
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ