linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
@ 2023-05-23  9:57 Tiezhu Yang
  2023-05-23 10:26 ` Huacai Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Tiezhu Yang @ 2023-05-23  9:57 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter
  Cc: Leo Yan, linux-perf-users, linux-kernel, loongarch, loongson-kernel

We can see the following definitions in bfd/elfnn-loongarch.c:

  #define PLT_HEADER_INSNS 8
  #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4)

  #define PLT_ENTRY_INSNS 4
  #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4)

so plt header size is 32 and plt entry size is 16 on LoongArch,
let us add LoongArch case in get_plt_sizes().

Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

v2: Add EM_LOONGARCH definition to avoid build error

 tools/perf/util/symbol-elf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index b2ed9cc..b3dbf6c 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -35,6 +35,10 @@
 #define EM_AARCH64	183  /* ARM 64 bit */
 #endif
 
+#ifndef EM_LOONGARCH
+#define EM_LOONGARCH	258
+#endif
+
 #ifndef ELF32_ST_VISIBILITY
 #define ELF32_ST_VISIBILITY(o)	((o) & 0x03)
 #endif
@@ -411,6 +415,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
 		*plt_header_size = 32;
 		*plt_entry_size = 16;
 		return true;
+	case EM_LOONGARCH:
+		*plt_header_size = 32;
+		*plt_entry_size = 16;
+		return true;
 	case EM_SPARC:
 		*plt_header_size = 48;
 		*plt_entry_size = 12;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
  2023-05-23  9:57 [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes() Tiezhu Yang
@ 2023-05-23 10:26 ` Huacai Chen
  2023-06-08  7:01   ` Tiezhu Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Huacai Chen @ 2023-05-23 10:26 UTC (permalink / raw)
  To: Tiezhu Yang
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Leo Yan, linux-perf-users,
	linux-kernel, loongarch, loongson-kernel

Acked-by: Huacai Chen <chenhuacai@loongson.cn>

On Tue, May 23, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> We can see the following definitions in bfd/elfnn-loongarch.c:
>
>   #define PLT_HEADER_INSNS 8
>   #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4)
>
>   #define PLT_ENTRY_INSNS 4
>   #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4)
>
> so plt header size is 32 and plt entry size is 16 on LoongArch,
> let us add LoongArch case in get_plt_sizes().
>
> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>
> v2: Add EM_LOONGARCH definition to avoid build error
>
>  tools/perf/util/symbol-elf.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index b2ed9cc..b3dbf6c 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -35,6 +35,10 @@
>  #define EM_AARCH64     183  /* ARM 64 bit */
>  #endif
>
> +#ifndef EM_LOONGARCH
> +#define EM_LOONGARCH   258
> +#endif
> +
>  #ifndef ELF32_ST_VISIBILITY
>  #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
>  #endif
> @@ -411,6 +415,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
>                 *plt_header_size = 32;
>                 *plt_entry_size = 16;
>                 return true;
> +       case EM_LOONGARCH:
> +               *plt_header_size = 32;
> +               *plt_entry_size = 16;
> +               return true;
>         case EM_SPARC:
>                 *plt_header_size = 48;
>                 *plt_entry_size = 12;
> --
> 2.1.0
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
  2023-05-23 10:26 ` Huacai Chen
@ 2023-06-08  7:01   ` Tiezhu Yang
  2023-06-21  3:00     ` Tiezhu Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Tiezhu Yang @ 2023-06-08  7:01 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Leo Yan, linux-perf-users,
	linux-kernel, loongarch, loongson-kernel

Hi Arnaldo,

On 05/23/2023 06:26 PM, Huacai Chen wrote:
> Acked-by: Huacai Chen <chenhuacai@loongson.cn>
>
> On Tue, May 23, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>>
>> We can see the following definitions in bfd/elfnn-loongarch.c:
>>
>>   #define PLT_HEADER_INSNS 8
>>   #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4)
>>
>>   #define PLT_ENTRY_INSNS 4
>>   #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4)
>>
>> so plt header size is 32 and plt entry size is 16 on LoongArch,
>> let us add LoongArch case in get_plt_sizes().
>>
>> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c
>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>> ---
>>
>> v2: Add EM_LOONGARCH definition to avoid build error
>>
>>  tools/perf/util/symbol-elf.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
>> index b2ed9cc..b3dbf6c 100644
>> --- a/tools/perf/util/symbol-elf.c
>> +++ b/tools/perf/util/symbol-elf.c
>> @@ -35,6 +35,10 @@
>>  #define EM_AARCH64     183  /* ARM 64 bit */
>>  #endif
>>
>> +#ifndef EM_LOONGARCH
>> +#define EM_LOONGARCH   258
>> +#endif
>> +
>>  #ifndef ELF32_ST_VISIBILITY
>>  #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
>>  #endif
>> @@ -411,6 +415,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
>>                 *plt_header_size = 32;
>>                 *plt_entry_size = 16;
>>                 return true;
>> +       case EM_LOONGARCH:
>> +               *plt_header_size = 32;
>> +               *plt_entry_size = 16;
>> +               return true;
>>         case EM_SPARC:
>>                 *plt_header_size = 48;
>>                 *plt_entry_size = 12;
>> --
>> 2.1.0

Are you OK with this change?
Could you please pick it up in your tree?

Thanks,
Tiezhu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
  2023-06-08  7:01   ` Tiezhu Yang
@ 2023-06-21  3:00     ` Tiezhu Yang
  2023-06-22 22:33       ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Tiezhu Yang @ 2023-06-21  3:00 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Huacai Chen, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Leo Yan, linux-perf-users, linux-kernel, loongarch,
	loongson-kernel



On 06/08/2023 03:01 PM, Tiezhu Yang wrote:
> Hi Arnaldo,
>
> On 05/23/2023 06:26 PM, Huacai Chen wrote:
>> Acked-by: Huacai Chen <chenhuacai@loongson.cn>
>>
>> On Tue, May 23, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@loongson.cn>
>> wrote:
>>>
>>> We can see the following definitions in bfd/elfnn-loongarch.c:

...

>
> Are you OK with this change?
> Could you please pick it up in your tree?

Ping. What is the status of this patch? Any more comments?
Is there a chance to merge it for this coming merge window?

Thanks,
Tiezhu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
  2023-06-21  3:00     ` Tiezhu Yang
@ 2023-06-22 22:33       ` Namhyung Kim
  2023-06-23 18:01         ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2023-06-22 22:33 UTC (permalink / raw)
  To: Tiezhu Yang
  Cc: Arnaldo Carvalho de Melo, Huacai Chen, Peter Zijlstra,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Leo Yan, linux-perf-users,
	linux-kernel, loongarch, loongson-kernel

Hello,

On Tue, Jun 20, 2023 at 9:36 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
>
>
> On 06/08/2023 03:01 PM, Tiezhu Yang wrote:
> > Hi Arnaldo,
> >
> > On 05/23/2023 06:26 PM, Huacai Chen wrote:
> >> Acked-by: Huacai Chen <chenhuacai@loongson.cn>
> >>
> >> On Tue, May 23, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@loongson.cn>
> >> wrote:
> >>>
> >>> We can see the following definitions in bfd/elfnn-loongarch.c:
>
> ...
>
> >
> > Are you OK with this change?
> > Could you please pick it up in your tree?
>
> Ping. What is the status of this patch? Any more comments?
> Is there a chance to merge it for this coming merge window?

Sorry for the late reply,  I'll apply it to the perf-tools-next tree.

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
  2023-06-22 22:33       ` Namhyung Kim
@ 2023-06-23 18:01         ` Namhyung Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2023-06-23 18:01 UTC (permalink / raw)
  To: Tiezhu Yang
  Cc: Arnaldo Carvalho de Melo, Huacai Chen, Peter Zijlstra,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Leo Yan, linux-perf-users,
	linux-kernel, loongarch, loongson-kernel

On Thu, Jun 22, 2023 at 3:33 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hello,
>
> On Tue, Jun 20, 2023 at 9:36 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> >
> >
> > On 06/08/2023 03:01 PM, Tiezhu Yang wrote:
> > > Hi Arnaldo,
> > >
> > > On 05/23/2023 06:26 PM, Huacai Chen wrote:
> > >> Acked-by: Huacai Chen <chenhuacai@loongson.cn>
> > >>
> > >> On Tue, May 23, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@loongson.cn>
> > >> wrote:
> > >>>
> > >>> We can see the following definitions in bfd/elfnn-loongarch.c:
> >
> > ...
> >
> > >
> > > Are you OK with this change?
> > > Could you please pick it up in your tree?
> >
> > Ping. What is the status of this patch? Any more comments?
> > Is there a chance to merge it for this coming merge window?
>
> Sorry for the late reply,  I'll apply it to the perf-tools-next tree.

Applied to perf-tools-next, thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-23 18:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23  9:57 [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes() Tiezhu Yang
2023-05-23 10:26 ` Huacai Chen
2023-06-08  7:01   ` Tiezhu Yang
2023-06-21  3:00     ` Tiezhu Yang
2023-06-22 22:33       ` Namhyung Kim
2023-06-23 18:01         ` Namhyung Kim

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).