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: <1389469379-13340-7-git-send-email-andi@firstfloor.org>
Date:	Sat, 11 Jan 2014 11:42:56 -0800
From:	Andi Kleen <andi@...stfloor.org>
To:	acme@...radead.org
Cc:	jolsa@...hat.com, namhyung@...nel.org, mingo@...nel.org,
	dsahern@...il.com, fweisbec@...il.com, adrian.hunter@...el.com,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 6/9] perf, tools: Fix max stack handling with lbr-as-callgraph

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

The original lbr-as-callstack code ignored the maxium callgraph
length set by the user. Fix this.

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

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 4032634..853639c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1372,7 +1372,7 @@ static int machine__resolve_callchain_sample(struct machine *machine,
 	}
 
 	if (callchain_param.branch_callstack) {
-		int nr = branch->nr;
+		int nr = min(max_stack, branch->nr);
 		struct branch_entry be[nr];
 
 		for (i = 0; i < nr; i++) { 
@@ -1397,6 +1397,7 @@ static int machine__resolve_callchain_sample(struct machine *machine,
 			if (err)
 				return err;
 		}
+		chain_nr -= nr;
 	}
 
 	if (chain->nr > PERF_MAX_STACK_DEPTH) {
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ