linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abel Vesa <abelvesa@gmail.com>
To: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Steven Rostedt <rostedt@goodmis.org>,
	mingo@redhat.com, viro@zeniv.linux.org.uk,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	zhouchengming <zhouchengming1@huawei.com>
Subject: Re: [PATCH] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS
Date: Tue, 24 Jan 2017 00:43:19 +0000	[thread overview]
Message-ID: <CAEZQSseKMRnkxEQt4dLSUQfxRk00hJOOe8puA9esVX9JNt_KWg@mail.gmail.com> (raw)
In-Reply-To: <CACh+v5MsC8_qOMYdm1qpduEPVmRG+mgCDibVEfyc3Pzk06V1Eg@mail.gmail.com>

Hi Jean-Jacques,

Here is the implementation I've made for ftrace_graph_regs_caller:

.macro __ftrace_graph_regs_caller

       sub     r0, fp, #4                          @ lr of
instrumented routine (parent)

       @ called from __ftrace_regs_caller
       ldr     r1, [sp, #56]                       @ instrumented routine (func)
       mcount_adjust_addr      r1, r1

       sub     r2, r0, #4                          @ frame pointer
       bl      prepare_ftrace_return

       ldr     lr, [sp, #64]                        @ restore lr from the stack
       ldmia   sp, {r0-r11, ip, sp}            @ restore r0 through sp
       ret     ip

.endm

AFAIK, you can still use fp (see the implementation without regs) since
it is an alternative name for r11. The FRAME_POINTER config options does
something else entirely and has nothing to do with what we need here.

I tested it but unfortunately, my current setup is with qemu and I don't have
a real hardware here close to test it properly. Could you please tell me if this
works on your setup?

Also the way I tested it was to comment out the code that uses the default
ftrace_graph_caller in ftrace_modify_graph_caller and enforced the usage of
the one with regs.

I will create a proper patch later today (I need to cleanup some stuff
first) and
send it.

Thanks,
Abel

  reply	other threads:[~2017-01-24  0:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 21:46 [PATCH] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS Abel Vesa
2016-12-08 22:46 ` Abel Vesa
2017-01-10 15:51   ` Petr Mladek
2017-01-12  0:19     ` Abel Vesa
2017-01-12 14:30       ` Jean-Jacques Hiblot
2017-01-13  8:30         ` Jean-Jacques Hiblot
2017-01-24  0:43           ` Abel Vesa [this message]
2016-12-08 22:49 Abel Vesa
2017-05-12 20:38 abelvesa
2017-05-12 21:05 ` Abel Vesa
2017-05-12 21:06 Abel Vesa
2017-05-23 19:53 ` Russell King - ARM Linux

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=CAEZQSseKMRnkxEQt4dLSUQfxRk00hJOOe8puA9esVX9JNt_KWg@mail.gmail.com \
    --to=abelvesa@gmail.com \
    --cc=jjhiblot@traphandler.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=robin.murphy@arm.com \
    --cc=rostedt@goodmis.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zhouchengming1@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).