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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-5b2ea6f2f6ac81a230e6cc68e1473e796a583f00@git.kernel.org>
Date:	Sat, 20 Feb 2016 03:41:38 -0800
From:	tip-bot for Namhyung Kim <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	dsahern@...il.com, namhyung@...nel.org, hpa@...or.com,
	wangnan0@...wei.com, jolsa@...nel.org, eranian@...gle.com,
	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	andi@...stfloor.org, acme@...hat.com, peterz@...radead.org,
	mingo@...nel.org
Subject: [tip:perf/core] perf report:
  Check error during report__collapse_hists()

Commit-ID:  5b2ea6f2f6ac81a230e6cc68e1473e796a583f00
Gitweb:     http://git.kernel.org/tip/5b2ea6f2f6ac81a230e6cc68e1473e796a583f00
Author:     Namhyung Kim <namhyung@...nel.org>
AuthorDate: Tue, 16 Feb 2016 23:08:26 +0900
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 19 Feb 2016 19:17:50 -0300

perf report: Check error during report__collapse_hists()

If it returns an error, warn user and bail out instead of silently
ignoring it.

Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/1455631723-17345-9-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-report.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 1eab50a..760e886 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -469,10 +469,11 @@ static int report__browse_hists(struct report *rep)
 	return ret;
 }
 
-static void report__collapse_hists(struct report *rep)
+static int report__collapse_hists(struct report *rep)
 {
 	struct ui_progress prog;
 	struct perf_evsel *pos;
+	int ret = 0;
 
 	ui_progress__init(&prog, rep->nr_entries, "Merging related events...");
 
@@ -484,7 +485,9 @@ static void report__collapse_hists(struct report *rep)
 
 		hists->socket_filter = rep->socket_filter;
 
-		hists__collapse_resort(hists, &prog);
+		ret = hists__collapse_resort(hists, &prog);
+		if (ret < 0)
+			break;
 
 		/* Non-group events are considered as leader */
 		if (symbol_conf.event_group &&
@@ -497,6 +500,7 @@ static void report__collapse_hists(struct report *rep)
 	}
 
 	ui_progress__finish();
+	return ret;
 }
 
 static void report__output_resort(struct report *rep)
@@ -564,7 +568,11 @@ static int __cmd_report(struct report *rep)
 		}
 	}
 
-	report__collapse_hists(rep);
+	ret = report__collapse_hists(rep);
+	if (ret) {
+		ui__error("failed to process hist entry\n");
+		return ret;
+	}
 
 	if (session_done())
 		return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ