public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH 5/5] IA64 dynamic ftrace support
Date: Wed, 24 Dec 2008 01:00:24 +0000	[thread overview]
Message-ID: <1230080424.30177.115.camel@localhost.localdomain> (raw)
In-Reply-To: <1230012500.10933.102.camel@sli10-desk.sh.intel.com>


On Wed, 2008-12-24 at 08:54 +0800, Shaohua Li wrote:

> 
> > > +static unsigned char *ftrace_nop_replace(void)
> > > +{
> > > +     return ftrace_nop_code;
> > > +}
> > > +
> > > +/* In IA64, each function will be added below two bundles with -pg option */
> > > +static unsigned char __attribute__((aligned(8)))
> > > +ftrace_call_code[MCOUNT_INSN_SIZE] = {
> > > +     0x02, 0x40, 0x31, 0x10, 0x80, 0x05, /* alloc r40=ar.pfs,12,8,0 */
> > > +     0xb0, 0x02, 0x00, 0x00, 0x42, 0x40, /* mov r43=r0;; */
> > > +     0x05, 0x00, 0xc4, 0x00,             /* mov r42° */
> > > +     0x11, 0x48, 0x01, 0x02, 0x00, 0x21, /* mov r41=r1 */
> > > +     0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */
> > 
> > If you made your own PLT stub, could you just change the one line to
> > jump to that stub?
> A simple jump to PLT stub doesn't work in IA64, as a lot of registers
> should be saved. I'll do more investigation.

So the registers are different depending on what function is called?
That is, you would have to change more than one of these lines if you
were to change it from calling _mcount to calling ftrace_stub?


> 
> > > Index: linux/scripts/recordmcount.pl
> > > =================================> > > --- linux.orig/scripts/recordmcount.pl        2008-12-23 13:24:59.000000000 +0800
> > > +++ linux/scripts/recordmcount.pl     2008-12-23 13:30:09.000000000 +0800
> > > @@ -206,6 +206,13 @@ if ($arch eq "x86_64") {
> > >      $alignment = 2;
> > >      $section_type = '%progbits';
> > >
> > > +} elsif ($arch eq "ia64") {
> > > +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
> > > +    $type = "data8";
> > > +
> > > +    if ($is_module eq "0") {
> > > +        $cc .= " -mconstant-gp";
> > > +    }
> > 
> > I wonder if it would be better to pass in CFLAGS and then be able to
> > parse that instead. Then we can find out a lot more about what we are
> > working on.
> CFLAGS seems have a lot of useless flags here.

OK, I was hoping to start making the parameters a bit smaller. But this
is fine.

-- Steve



  parent reply	other threads:[~2008-12-24  1:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23  6:08 [PATCH 5/5] IA64 dynamic ftrace support Shaohua Li
2008-12-23 14:35 ` Steven Rostedt
2008-12-24  0:54 ` Shaohua Li
2008-12-24  1:00 ` Steven Rostedt [this message]
2008-12-24  8:08 ` Shaohua Li
2008-12-24 13:29 ` Steven Rostedt
2008-12-24 21:50 ` Keith Owens
2008-12-25  1:08 ` Shaohua Li
2008-12-25  3:54 ` Steven Rostedt
2008-12-25  4:01 ` Shaohua Li
2008-12-26  2:42 ` Shaohua Li
2008-12-31  9:11 ` Shaohua Li
2009-01-06  0:42 ` Luck, Tony
2009-01-08  8:05 ` Shaohua Li
2009-01-08 17:08 ` Steven Rostedt
2009-01-08 20:25 ` Luck, Tony
2009-01-08 22:24 ` Luck, Tony
2009-01-09  2:42 ` Shaohua Li

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=1230080424.30177.115.camel@localhost.localdomain \
    --to=srostedt@redhat.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