From: Stephane Eranian <eranian@hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Attribute spinlock contention ticks to caller.
Date: Thu, 15 Sep 2005 06:34:35 +0000 [thread overview]
Message-ID: <1126766075.7372.16.camel@uluru.grenoble.hp.com> (raw)
In-Reply-To: <20050914222644.GA5036@lnx-holt.americas.sgi.com>
Robin,
> +
> static int
> default_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct pt_regs *regs, unsigned long stamp)
> {
> @@ -165,6 +175,12 @@ default_handler(struct task_struct *task
> * where did the fault happen (includes slot number)
> */
> ent->ip = regs->cr_iip | ((regs->cr_ipsr >> 41) & 0x3);
> +#ifdef CONFIG_SMP
> + /* Fix up the ip for code in the spinlock contention path. */
> + if ((ent->ip >= (unsigned long)ia64_spinlock_contention) &&
> + (ent->ip < (unsigned long)ia64_spinlock_contention_end))
> + ent->ip = regs->b6;
> +#endif
I think SGI already submitted something similar for the 2.4 kernel.
I understand your motivations for doing this. Yet it does not look
so clean and error proof. Keith already mentioned a potential gap.
I also think it is hard to maintain because if for some reasons someone
changes from b6 to b7 there is no way of tracking this from default_handler().
For your purpose, the value of b6 is more interesting than ip. Would that
always be the case for every measurement?
This also opens the door for people submitted other special cases.
This is the reasons why I designed sampling formats to be plug-in
modules such that for special needs, people can simply develop their
own format. I understand that your modification does not deeply alter
the default format and integrates seamlessly with existing applications.
But it seems there ought to be a cleaner way of doing this.
--
-stephane
next prev parent reply other threads:[~2005-09-15 6:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-14 22:26 Attribute spinlock contention ticks to caller Robin Holt
2005-09-15 0:10 ` Keith Owens
2005-09-15 6:34 ` Stephane Eranian [this message]
2005-09-15 8:19 ` Stephane Eranian
2005-09-15 17:14 ` Robin Holt
2005-09-15 17:23 ` Robin Holt
2005-09-15 17:37 ` Luck, Tony
2005-09-15 22:29 ` Robin Holt
2005-09-15 22:54 ` Zou Nan hai
2005-09-16 9:37 ` Stephane Eranian
2005-09-16 22:29 ` Robin Holt
2005-09-17 1:08 ` David Mosberger-Tang
2005-09-18 23:06 ` Robin Holt
2005-09-19 1:18 ` David Mosberger-Tang
2005-09-19 8:35 ` Stephane Eranian
2005-09-19 15:17 ` Robin Holt
2005-09-19 17:52 ` David Mosberger-Tang
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=1126766075.7372.16.camel@uluru.grenoble.hp.com \
--to=eranian@hpl.hp.com \
--cc=linux-ia64@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