mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sathvika Vasireddy <sv@linux.vnet.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	"aik@ozlabs.ru" <aik@ozlabs.ru>,
	"mbenes@suse.cz" <mbenes@suse.cz>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"jpoimboe@redhat.com" <jpoimboe@redhat.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: Re: [RFC PATCH v2 0/7] objtool: Enable and implement --mcount option on powerpc
Date: Wed, 25 May 2022 23:42:49 +0530	[thread overview]
Message-ID: <0d2a6ea3-71cc-a8e1-22eb-7b66f533b3bf@linux.vnet.ibm.com> (raw)
In-Reply-To: <ea64b232-e002-9317-dca1-c5933fb94e03@csgroup.eu>


On 25/05/22 23:09, Christophe Leroy wrote:
> Hi Sathvika,
>
> Le 25/05/2022 à 12:14, Sathvika Vasireddy a écrit :
>> Hi Christophe,
>>
>> On 24/05/22 18:47, Christophe Leroy wrote:
>>> This draft series adds PPC32 support to Sathvika's series.
>>> Verified on pmac32 on QEMU.
>>>
>>> It should in principle also work for PPC64 BE but for the time being
>>> something goes wrong. In the beginning I had a segfaut hence the first
>>> patch. But I still get no mcount section in the files.
>> Since PPC64 BE uses older elfv1 ABI, it prepends a dot to symbols.
>> And so, the relocation records in case of PPC64BE point to "._mcount",
>> rather than just "_mcount". We should be looking for "._mcount" to be
>> able to generate mcount_loc section in the files.
>>
>> Like:
>>
>> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
>> index 70be5a72e838..7da5bf8c7236 100644
>> --- a/tools/objtool/check.c
>> +++ b/tools/objtool/check.c
>> @@ -2185,7 +2185,7 @@ static int classify_symbols(struct objtool_file
>> *file)
>>                           if (arch_is_retpoline(func))
>>                                   func->retpoline_thunk = true;
>>
>> -                       if ((!strcmp(func->name, "__fentry__")) ||
>> (!strcmp(func->name, "_mcount")))
>> +                       if ((!strcmp(func->name, "__fentry__")) ||
>> (!strcmp(func->name, "_mcount")) || (!strcmp(func->name, "._mcount")))
>>                                   func->fentry = true;
>>
>>                           if (is_profiling_func(func->name))
>>
>>
>> With this change, I could see __mcount_loc section being
>> generated in individual ppc64be object files.
>>
> Or should we implement an equivalent of arch_ftrace_match_adjust() in
> objtool ?

Yeah, I think it makes more sense if we make it arch specific.
Thanks for the suggestion. I'll make this change in next revision :-)

- Sathvika



  reply	other threads:[~2022-05-25 18:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 13:17 Christophe Leroy
2022-05-24 13:17 ` [RFC PATCH v2 1/7] objtool: Fix SEGFAULT Christophe Leroy
2022-05-24 13:17 ` [RFC PATCH v2 2/7] objtool: Use target file endianness instead of a compiled constant Christophe Leroy
2022-05-24 13:17 ` [RFC PATCH v2 3/7] objtool: Use target file class size " Christophe Leroy
2022-05-24 17:59   ` Peter Zijlstra
2022-05-24 13:17 ` [RFC PATCH v2 4/7] objtool: Add --mnop as an option to --mcount Christophe Leroy
2022-05-24 13:17 ` [RFC PATCH v2 5/7] objtool: Enable objtool to run only on files with ftrace enabled Christophe Leroy
2022-05-24 18:01   ` Peter Zijlstra
2022-05-24 18:02     ` Peter Zijlstra
2022-05-24 18:59       ` Christophe Leroy
2022-05-24 19:50         ` Peter Zijlstra
2022-05-24 13:17 ` [RFC PATCH v2 6/7] objtool/powerpc: Enable objtool to be built on ppc Christophe Leroy
2022-05-24 13:17 ` [RFC PATCH v2 7/7] objtool/powerpc: Add --mcount specific implementation Christophe Leroy
2022-05-25 10:14 ` [RFC PATCH v2 0/7] objtool: Enable and implement --mcount option on powerpc Sathvika Vasireddy
2022-05-25 16:51   ` Segher Boessenkool
2022-05-25 17:39   ` Christophe Leroy
2022-05-25 18:12     ` Sathvika Vasireddy [this message]
2022-06-15 16:03       ` Christophe Leroy
2022-06-18  4:56         ` Sathvika Vasireddy
2022-06-24  7:08           ` Christophe Leroy
2022-06-24 18:44             ` Sathvika Vasireddy

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=0d2a6ea3-71cc-a8e1-22eb-7b66f533b3bf@linux.vnet.ibm.com \
    --to=sv@linux.vnet.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mbenes@suse.cz \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sv@linux.ibm.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

Powered by JetHome