From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
Steven Rostedt <srostedt@redhat.com>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer with dynamic tracing
Date: Fri, 13 Feb 2009 15:15:09 +1100 [thread overview]
Message-ID: <1234498509.26036.35.camel@pasglop> (raw)
In-Reply-To: <20090212011343.074329920@goodmis.org>
> @@ -55,8 +56,9 @@ static unsigned char *ftrace_call_replace(unsigned
> long ip, unsigned long addr)
> */
> addr = GET_ADDR(addr);
>
> - /* Set to "bl addr" */
> - op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> + /* if (link) set op to 'bl' else 'b' */
> + op = 0x48000000 | (link ? 1 : 0);
> + op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
Any reason why you aren't using the code in
arch/powerpc/lib/code-patching.c here ?
> new = ftrace_call_replace(ip, stub, 0);
> + memcpy(old, new, MCOUNT_INSN_SIZE);
> + new = ftrace_call_replace(ip, addr, 0);
> +
> + return ftrace_modify_code(ip, old, new);
> +}
Heh, memcpy of 4 bytes :-) I hope gcc is smart enough to turn that into
a simple load/store ..
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer with dynamic tracing
Date: Fri, 13 Feb 2009 15:15:09 +1100 [thread overview]
Message-ID: <1234498509.26036.35.camel@pasglop> (raw)
In-Reply-To: <20090212011343.074329920@goodmis.org>
> @@ -55,8 +56,9 @@ static unsigned char *ftrace_call_replace(unsigned
> long ip, unsigned long addr)
> */
> addr = GET_ADDR(addr);
>
> - /* Set to "bl addr" */
> - op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> + /* if (link) set op to 'bl' else 'b' */
> + op = 0x48000000 | (link ? 1 : 0);
> + op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
Any reason why you aren't using the code in
arch/powerpc/lib/code-patching.c here ?
> new = ftrace_call_replace(ip, stub, 0);
> + memcpy(old, new, MCOUNT_INSN_SIZE);
> + new = ftrace_call_replace(ip, addr, 0);
> +
> + return ftrace_modify_code(ip, old, new);
> +}
Heh, memcpy of 4 bytes :-) I hope gcc is smart enough to turn that into
a simple load/store ..
Cheers,
Ben.
next prev parent reply other threads:[~2009-02-13 4:15 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 1:10 [PATCH 0/7][RFC] function graph tracer port to PowerPC Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 1/7][RFC] tracing/function-graph-tracer: make arch generic push pop functions Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 2/7][RFC] powerpc64: port of the function graph tracer Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-13 4:12 ` Benjamin Herrenschmidt
2009-02-13 4:12 ` Benjamin Herrenschmidt
2009-02-13 4:18 ` Steven Rostedt
2009-02-13 4:18 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer with dynamic tracing Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-13 4:15 ` Benjamin Herrenschmidt [this message]
2009-02-13 4:15 ` Benjamin Herrenschmidt
2009-02-13 4:20 ` Steven Rostedt
2009-02-13 4:20 ` Steven Rostedt
2009-02-13 5:22 ` Steven Rostedt
2009-02-13 5:22 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 4/7][RFC] powerpc64, ftrace: save toc only on modules for function graph Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 5/7][RFC] powerpc32, ftrace: save and restore mcount regs with macro Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 6/7][RFC] powerpc32, ftrace: port function graph tracer to ppc32, static only Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-12 1:10 ` [PATCH 7/7][RFC] powerpc32, ftrace: dynamic function graph tracer Steven Rostedt
2009-02-12 1:10 ` Steven Rostedt
2009-02-12 1:55 ` [PATCH 0/7][RFC] function graph tracer port to PowerPC Frederic Weisbecker
2009-02-12 1:55 ` Frederic Weisbecker
2009-02-12 2:16 ` Steven Rostedt
2009-02-12 2:16 ` Steven Rostedt
2009-02-12 4:08 ` Frederic Weisbecker
2009-02-12 4:08 ` Frederic Weisbecker
2009-02-12 16:31 ` Steven Rostedt
2009-02-12 16:31 ` Steven Rostedt
2009-02-12 16:47 ` Frederic Weisbecker
2009-02-12 16:47 ` Frederic Weisbecker
2009-02-12 16:58 ` Steven Rostedt
2009-02-12 16:58 ` Steven Rostedt
2009-02-13 4:18 ` Benjamin Herrenschmidt
2009-02-13 4:18 ` Benjamin Herrenschmidt
2009-02-12 2:23 ` Michael Ellerman
2009-02-12 2:23 ` Michael Ellerman
2009-02-12 2:37 ` Steven Rostedt
2009-02-12 2:37 ` Steven Rostedt
2009-02-12 16:35 ` Steven Rostedt
2009-02-12 16:35 ` Steven Rostedt
2009-02-12 23:32 ` Geoff Levand
2009-02-12 23:32 ` Geoff Levand
2009-02-12 23:41 ` Steven Rostedt
2009-02-12 23:41 ` Steven Rostedt
2009-02-12 23:44 ` Josh Boyer
2009-02-12 23:44 ` Josh Boyer
2009-02-12 23:44 ` Geoff Levand
2009-02-12 23:44 ` Geoff Levand
2009-02-12 23:51 ` Steven Rostedt
2009-02-12 23:51 ` Steven Rostedt
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=1234498509.26036.35.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.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 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.