All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH 2/2] sparc64: Fix stack dumping and tracing when
Date: Thu, 22 Apr 2010 19:20:32 +0000	[thread overview]
Message-ID: <20100422192029.GC5600@nowhere> (raw)
In-Reply-To: <20100421.032355.147982685.davem@davemloft.net>

On Wed, Apr 21, 2010 at 03:23:55AM -0700, David Miller wrote:
> 
> Like x86, when the function graph tracer is enabled, emit the ftrace
> stub as well as the program counter it will be transformed back into.
> 
> We duplicate a lot of similar stack walking logic in 3 or 4 spots, so
> eventually we should consolidate things like x86 does.



Yeah, in fact if we want a kind a arch agnostic graph stack walker,
we could make it an iterator.

(Modifying print_ftrace_graph_addr a bit)

static unsigned long
walk_ftrace_graph_stack(unsigned long addr,
			struct task_struct *task, int *idx)
{
	unsigned long ret_addr;
	int index = task->curr_ret_stack;

	if (addr != (unsigned long)return_to_handler)
		return -ENOENT;

	if (!task->ret_stack || index < *idx)
		return -ENOENT;

	index -= *idx;
	ret_addr = task->ret_stack[index].ret;

	(*idx)++;

	return ret_addr;
}

Hmm?

I can make it in tracing/core but I fear it won't be available
for the sparc tree until .35


      reply	other threads:[~2010-04-22 19:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 10:23 [PATCH 2/2] sparc64: Fix stack dumping and tracing when function David Miller
2010-04-22 19:20 ` Frederic Weisbecker [this message]

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=20100422192029.GC5600@nowhere \
    --to=fweisbec@gmail.com \
    --cc=sparclinux@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.