From: Will Deacon <will.deacon@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
Christopher Covington <cov@codeaurora.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] arm64: Fix task tracing
Date: Mon, 15 Apr 2013 14:19:52 +0100 [thread overview]
Message-ID: <20130415131952.GH9827@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20130415114307.GC29528@arm.com>
On Mon, Apr 15, 2013 at 12:43:07PM +0100, Catalin Marinas wrote:
> On Mon, Apr 15, 2013 at 11:58:40AM +0100, Catalin Marinas wrote:
> > On Mon, Apr 15, 2013 at 11:45:42AM +0100, Will Deacon wrote:
> > > Really? If prev is NULL in context_switch(...), the scheduler will implode,
> > > and I can't see where else switch_to is called from.
> > >
> > > Which code path are you thinking of?
> >
> > copy_thread() zeros cpu_context which is used by cpu_switch_to() to load
> > the next saved registers. The switch_to() function sets prev to last as
> > returned by __switch_to(), so this is valid but in __switch_to() we
> > don't have a valid prev (nor next) after cpu_switch_to() for newly
> > created threads.
>
> Correction - newly created threads return to ret_from_fork rather than
> __switch_to(), which means that we miss the first
> contextidr_thread_switch() call for a new thread. I would vote for
> Christopher's original patch moving the call before cpu_switch_to(). The
> alternative is to define finish_arch_switch() and add the call there. If
> you are primarily tracing user space, it doesn't really matter whether
> the stack was switched or not when we set the contextidr. For kernel
> tracking, it could be a problem as we have the next task with the old
> stack. But the same could be said about the prev task with the new
> stack.
The sp defines the current task, which is what the debugger will be
interested in and will likely try to correlate with the PID reported in
the contextidr, so I still maintain that it's important for these to be
in sync.
Will
prev parent reply other threads:[~2013-04-15 13:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 18:01 [PATCH] " Christopher Covington
2013-04-03 18:04 ` Will Deacon
2013-04-08 14:42 ` Christopher Covington
2013-04-08 15:31 ` Will Deacon
2013-04-09 12:33 ` [PATCH v2] " Christopher Covington
2013-04-10 11:41 ` Will Deacon
2013-04-10 13:12 ` Christopher Covington
2013-04-15 10:11 ` Catalin Marinas
2013-04-15 10:45 ` Will Deacon
2013-04-15 10:58 ` Catalin Marinas
2013-04-15 11:43 ` Catalin Marinas
2013-04-15 13:09 ` Christopher Covington
2013-04-15 15:23 ` Catalin Marinas
2013-04-15 13:19 ` Will Deacon [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=20130415131952.GH9827@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=catalin.marinas@arm.com \
--cc=cov@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®