mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	a.p.zijlstra@chello.nl, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:core/locking] lockdep: Fix backtraces
Date: Sun, 2 Aug 2009 13:14:17 GMT	[thread overview]
Message-ID: <tip-96c6ab754464eb2d214b81392551ed581bd573ed@git.kernel.org> (raw)
In-Reply-To: <1248096665.15751.8816.camel@twins>

Commit-ID:  96c6ab754464eb2d214b81392551ed581bd573ed
Gitweb:     http://git.kernel.org/tip/96c6ab754464eb2d214b81392551ed581bd573ed
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Mon, 20 Jul 2009 15:27:04 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 2 Aug 2009 14:59:29 +0200

lockdep: Fix backtraces

Truncate stupid -1 entries in backtraces.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1248096665.15751.8816.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/lockdep.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 1cedb00..2f09702 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -367,11 +367,21 @@ static int save_trace(struct stack_trace *trace)
 
 	save_stack_trace(trace);
 
+	/*
+	 * Some daft arches put -1 at the end to indicate its a full trace.
+	 *
+	 * <rant> this is buggy anyway, since it takes a whole extra entry so a
+	 * complete trace that maxes out the entries provided will be reported
+	 * as incomplete, friggin useless </rant>
+	 */
+	if (trace->entries[trace->nr_entries-1] == ULONG_MAX)
+		trace->nr_entries--;
+
 	trace->max_entries = trace->nr_entries;
 
 	nr_stack_trace_entries += trace->nr_entries;
 
-	if (nr_stack_trace_entries == MAX_STACK_TRACE_ENTRIES) {
+	if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES-1) {
 		if (!debug_locks_off_graph_unlock())
 			return 0;
 

  reply	other threads:[~2009-08-02 13:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 15:25 [PATCH 1/3] Increase lockdep limits: MAX_STACK_TRACE_ENTRIES Joao Correia
2009-07-07 15:33 ` Peter Zijlstra
     [not found]   ` <a5d9929e0907070838q7ed3306du3bb7880e47d7207b@mail.gmail.com>
2009-07-07 15:38     ` Fwd: " Joao Correia
     [not found]     ` <1246981444.9777.11.camel@twins>
2009-07-07 15:50       ` Joao Correia
2009-07-07 15:55         ` Peter Zijlstra
2009-07-07 15:59           ` Joao Correia
2009-07-08 17:22           ` Dave Jones
2009-07-08 18:36             ` Peter Zijlstra
2009-07-08 18:44               ` Dave Jones
2009-07-08 19:48               ` Joao Correia
2009-07-08 19:56                 ` Peter Zijlstra
2009-07-09  4:39               ` Dave Jones
2009-07-09  8:02                 ` Peter Zijlstra
2009-07-09 16:10                   ` Dave Jones
2009-07-09 17:07                     ` Peter Zijlstra
2009-07-10 15:50                       ` Joao Correia
2009-07-09  9:06               ` Catalin Marinas
2009-07-09  9:09                 ` Peter Zijlstra
2009-07-20 13:31                   ` [PATCH] lockdep: fixup stacktrace wastage Peter Zijlstra
2009-08-02 13:14                     ` tip-bot for Peter Zijlstra [this message]
2009-08-02 13:51                     ` [tip:core/locking] lockdep: Fix backtraces tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-96c6ab754464eb2d214b81392551ed581bd573ed@git.kernel.org \
    --to=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome