linux-mips
[Top] [All Lists]

Re: [PATCH 5/5] tracing, MIPS: Fix set_graph_function of function graph

To: Sergei Shtylyov <sshtylyov@mvista.com>
Subject: Re: [PATCH 5/5] tracing, MIPS: Fix set_graph_function of function graph tracer
From: wu zhangjin <wuzhangjin@gmail.com>
Date: Thu, 20 Jan 2011 20:46:20 +0800
Cc: Ralf Baechle <ralf@linux-mips.org>, Steven Rostedt <srostedt@redhat.com>, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=wwT7IWJkVFuzjQfbLtjxjSLUdnV4neaIewoHvH4aPy4=; b=WqJqSmGCYDGb4iNDmorSOU6STCwOu5ceTRHg5yz8NFtECFioY5isvKXH6MAvJgz3f0 JVX8UnmNP8jl8mvrpZtiwHiRNhvdcDz7XE9AiwwWXmgnhnot86bU6gDga1BoGh9UDzlh zF50urzjVlaXtn3tuRWYsUerwl02vPMrtkWNs=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=C+GYz4SUDJduy5uPAyRqhptw/LAGn97MyMuRad6MHAH7TJQUhILz9sZxTsKlWKo/d+ ddoC+qv9le/x2xmtBpo6MAJSSSl7F57Yh8kZ6U9zr25Iqt/mktKkpAjeN/qkmIHcpPHj 1rC9pWbhVRl6ZriM5Xehc65U7VUO0tq1wrry4=
In-reply-to: <4D381677.3000502@mvista.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cover.1295464855.git.wuzhangjin@gmail.com> <9967898043e58db7b311d35695e9422e67cef5f6.1295464855.git.wuzhangjin@gmail.com> <4D381677.3000502@mvista.com>
Sender: linux-mips-bounce@linux-mips.org
On Thu, Jan 20, 2011 at 7:03 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
> On 19-01-2011 22:28, Wu Zhangjin wrote:
>
>> trace.func should be set to the recorded ip of the mcount calling site
>> in the __mcount_loc section to filter the function entries configured
>> through the tracing/set_graph_function interface, but before, this is
>> set to the self_ra(the return address of mcount), which has made
>> set_graph_function not work as expects.
>
>   Expected?

Yeah ;-)

>
>> This fixes it via calculating the right recorded ip in the __mcount_loc
>> section and assign it to trace.func.
>
>> Reported-by: Zhiping Zhong<xzhong86@163.com>
>> Signed-off-by: Wu Zhangjin<wuzhangjin@gmail.com>
>> ---
>>  arch/mips/kernel/ftrace.c |   11 +++++++++--
>>  1 files changed, 9 insertions(+), 2 deletions(-)
>
>> diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
>> index bc91e4a..62775d7 100644
>> --- a/arch/mips/kernel/ftrace.c
>> +++ b/arch/mips/kernel/ftrace.c
>
> [...]
>>
>> @@ -304,7 +304,14 @@ void prepare_ftrace_return(unsigned long
>> *parent_ra_addr, unsigned long self_ra,
>>                return;
>>        }
>>
>> -       trace.func = self_ra;
>> +       /*
>> +        * Get the recorded ip of the current mcount calling site in the
>> +        * __mcount_loc section, which will be used to filter the function
>> +        * entries configured through the tracing/set_graph_function
>> interface.
>> +        */
>> +
>> +       insns = (in_kernel_space(self_ra)) ? 2 : (MCOUNT_OFFSET_INSNS +
>> 1);
>
>   Unneeded parens.

ok.

>
>> +       trace.func = self_ra - (MCOUNT_INSN_SIZE * insns);
>
>   Here too.

ok.

Thanks,
Wu Zhangjin

>
> WBR, Sergei
>

<Prev in Thread] Current Thread [Next in Thread>