linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf test: Omit test 68 for s390.
@ 2020-11-04  8:29 Thomas Richter
  2020-11-19 13:50 ` [PATCH] perf test: Skip test 68 for Powerpc Kajol Jain
  2020-11-19 13:55 ` [PATCH] perf test: Omit test 68 for s390 kajoljain
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Richter @ 2020-11-04  8:29 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme
  Cc: svens, gor, sumanthk, heiko.carstens, Thomas Richter

Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
adds a WINDOWS EXE file named tests/pe-file.exe, which is
examined by the test case 'PE file support'.

This test reads the buildid from the file tests/pe-file.exe,
which is a Portable Executable (PE) binary file used by the
Windows operating system.

Since s390 does not support PE files, omit this test.

Output before:
[root@t35lp46 perf]# ./perf test -F 68
68: PE file support                               : Failed!
[root@t35lp46 perf]#

Output after:
[root@t35lp46 perf]# ./perf test -F 68
68: PE file support                               : Skip
[root@t35lp46 perf]#


Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/pe-file-parsing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
index 58b90c42eb38..4e45178c50f6 100644
--- a/tools/perf/tests/pe-file-parsing.c
+++ b/tools/perf/tests/pe-file-parsing.c
@@ -18,7 +18,7 @@
 
 #include "tests.h"
 
-#ifdef HAVE_LIBBFD_SUPPORT
+#if defined(HAVE_LIBBFD_SUPPORT) && !defined(__s390x__)
 
 static int run_dir(const char *d)
 {
-- 
2.26.2


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

* [PATCH] perf test: Skip test 68 for Powerpc
  2020-11-04  8:29 [PATCH] perf test: Omit test 68 for s390 Thomas Richter
@ 2020-11-19 13:50 ` Kajol Jain
  2020-11-24  9:34   ` Ravi Bangoria
  2020-11-19 13:55 ` [PATCH] perf test: Omit test 68 for s390 kajoljain
  1 sibling, 1 reply; 10+ messages in thread
From: Kajol Jain @ 2020-11-19 13:50 UTC (permalink / raw)
  To: acme
  Cc: jolsa, namhyung, linux-perf-users, linux-kernel, irogers,
	ravi.bangoria, tmricht, kjain, rbernon, maddy, atrajeev

Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
adds a WINDOWS EXE file named tests/pe-file.exe, which is
examined by the test case 'PE file support'. As powerpc doesn't support
it, we are skipping this test.

Result in power9 platform before this patach:
[command]# ./perf test -F 68
68: PE file support                               : Failed!

Result in power9 platform after this patch:
[command]# ./perf test -F 68
68: PE file support                               : Skip

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
---
 tools/perf/tests/pe-file-parsing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
index 4e45178c50f6..14f675f5ffb2 100644
--- a/tools/perf/tests/pe-file-parsing.c
+++ b/tools/perf/tests/pe-file-parsing.c
@@ -18,7 +18,7 @@
 
 #include "tests.h"
 
-#if defined(HAVE_LIBBFD_SUPPORT) && !defined(__s390x__)
+#if defined(HAVE_LIBBFD_SUPPORT) && !defined(__s390x__) && !defined(__powerpc__)
 
 static int run_dir(const char *d)
 {
-- 
2.27.0


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

* Re: [PATCH] perf test: Omit test 68 for s390.
  2020-11-04  8:29 [PATCH] perf test: Omit test 68 for s390 Thomas Richter
  2020-11-19 13:50 ` [PATCH] perf test: Skip test 68 for Powerpc Kajol Jain
@ 2020-11-19 13:55 ` kajoljain
  1 sibling, 0 replies; 10+ messages in thread
From: kajoljain @ 2020-11-19 13:55 UTC (permalink / raw)
  To: Thomas Richter, linux-kernel, linux-perf-users, acme
  Cc: svens, gor, sumanthk, heiko.carstens



On 11/4/20 1:59 PM, Thomas Richter wrote:
> Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
> adds a WINDOWS EXE file named tests/pe-file.exe, which is
> examined by the test case 'PE file support'.
> 
> This test reads the buildid from the file tests/pe-file.exe,
> which is a Portable Executable (PE) binary file used by the
> Windows operating system.
> 
> Since s390 does not support PE files, omit this test.
> 
> Output before:
> [root@t35lp46 perf]# ./perf test -F 68
> 68: PE file support                               : Failed!
> [root@t35lp46 perf]#
> 
> Output after:
> [root@t35lp46 perf]# ./perf test -F 68
> 68: PE file support                               : Skip
> [root@t35lp46 perf]#
> 
> 

Patch looks good to me. Thanks for correcting it. Since in powerpc also we are having similar issue,
I send patch on top of this change. 

Reviewed-By: Kajol Jain<kjain@linux.ibm.com>

Thanks,
Kajol Jain

> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
>  tools/perf/tests/pe-file-parsing.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
> index 58b90c42eb38..4e45178c50f6 100644
> --- a/tools/perf/tests/pe-file-parsing.c
> +++ b/tools/perf/tests/pe-file-parsing.c
> @@ -18,7 +18,7 @@
>  
>  #include "tests.h"
>  
> -#ifdef HAVE_LIBBFD_SUPPORT
> +#if defined(HAVE_LIBBFD_SUPPORT) && !defined(__s390x__)
>  
>  static int run_dir(const char *d)
>  {
> 

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-11-19 13:50 ` [PATCH] perf test: Skip test 68 for Powerpc Kajol Jain
@ 2020-11-24  9:34   ` Ravi Bangoria
  2020-12-07 16:35     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 10+ messages in thread
From: Ravi Bangoria @ 2020-11-24  9:34 UTC (permalink / raw)
  To: Kajol Jain, acme
  Cc: jolsa, namhyung, linux-perf-users, linux-kernel, irogers,
	tmricht, rbernon, maddy, atrajeev, Ravi Bangoria



On 11/19/20 7:20 PM, Kajol Jain wrote:
> Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
> adds a WINDOWS EXE file named tests/pe-file.exe, which is
> examined by the test case 'PE file support'. As powerpc doesn't support
> it, we are skipping this test.
> 
> Result in power9 platform before this patach:
> [command]# ./perf test -F 68
> 68: PE file support                               : Failed!
> 
> Result in power9 platform after this patch:
> [command]# ./perf test -F 68
> 68: PE file support                               : Skip
> 
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>

Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-11-24  9:34   ` Ravi Bangoria
@ 2020-12-07 16:35     ` Arnaldo Carvalho de Melo
  2020-12-08 14:43       ` Thomas Richter
  0 siblings, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-12-07 16:35 UTC (permalink / raw)
  To: Ravi Bangoria
  Cc: Kajol Jain, jolsa, namhyung, linux-perf-users, linux-kernel,
	irogers, tmricht, rbernon, maddy, atrajeev

Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu:
> 
> 
> On 11/19/20 7:20 PM, Kajol Jain wrote:
> > Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
> > adds a WINDOWS EXE file named tests/pe-file.exe, which is
> > examined by the test case 'PE file support'. As powerpc doesn't support
> > it, we are skipping this test.
> > 
> > Result in power9 platform before this patach:
> > [command]# ./perf test -F 68
> > 68: PE file support                               : Failed!
> > 
> > Result in power9 platform after this patch:
> > [command]# ./perf test -F 68
> > 68: PE file support                               : Skip
> > 
> > Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
> 
> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>

But why is it failing? I.e. what is that

 perf test -v -F 68

outputs?

Using 'perf report' on a perf.data file containing samples in such
binaries, collected on x86 should work on whatever workstation a
developer uses.

Say, on a MacBook aarch64 one can look at a perf.data file collected on
a x86_64 system where Wine running a PE binary was present.

- Arnaldo

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-12-07 16:35     ` Arnaldo Carvalho de Melo
@ 2020-12-08 14:43       ` Thomas Richter
  2020-12-08 17:02         ` Ravi Bangoria
  2020-12-09 17:37         ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Richter @ 2020-12-08 14:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ravi Bangoria
  Cc: Kajol Jain, jolsa, namhyung, linux-perf-users, linux-kernel,
	irogers, rbernon, maddy, atrajeev

On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu:
>>
>>
>> On 11/19/20 7:20 PM, Kajol Jain wrote:
>>> Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
>>> adds a WINDOWS EXE file named tests/pe-file.exe, which is
>>> examined by the test case 'PE file support'. As powerpc doesn't support
>>> it, we are skipping this test.
>>>
>>> Result in power9 platform before this patach:
>>> [command]# ./perf test -F 68
>>> 68: PE file support                               : Failed!
>>>
>>> Result in power9 platform after this patch:
>>> [command]# ./perf test -F 68
>>> 68: PE file support                               : Skip
>>>
>>> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
>>
>> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> 
> But why is it failing? I.e. what is that
> 
>  perf test -v -F 68
> 
> outputs?
> 
> Using 'perf report' on a perf.data file containing samples in such
> binaries, collected on x86 should work on whatever workstation a
> developer uses.
> 
> Say, on a MacBook aarch64 one can look at a perf.data file collected on
> a x86_64 system where Wine running a PE binary was present.
> 
> - Arnaldo
> 

Hi 

What is the distro you are using?
I observed the same issue on s390 but this was fixed for fedora33 somehow.
The error just went away after a dnf update....

[root@m35lp76 perf]# cat /etc/fedora-release 
Fedora release 33 (Thirty Three)
[root@m35lp76 perf]# ./perf test -F 68
68: PE file support                                                 : Ok
[root@m35lp76 perf]# 


However on my fedora32 machine it still fails:
[root@t35lp46 perf]# cat /etc/fedora-release 
Fedora release 32 (Thirty Two)
[root@t35lp46 perf]# ./perf test -F 68
68: PE file support                                                 : FAILED!
[root@t35lp46 perf]# 

Note that I am running the same kernel on both machines: linux 5.10.0rc7 downloaded
this morning.


-- 
Thomas Richter, Dept 3252, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-12-08 14:43       ` Thomas Richter
@ 2020-12-08 17:02         ` Ravi Bangoria
  2020-12-09 17:49           ` Arnaldo Carvalho de Melo
  2020-12-09 17:37         ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 10+ messages in thread
From: Ravi Bangoria @ 2020-12-08 17:02 UTC (permalink / raw)
  To: Thomas Richter, Arnaldo Carvalho de Melo
  Cc: Kajol Jain, jolsa, namhyung, linux-perf-users, linux-kernel,
	irogers, rbernon, maddy, atrajeev, Ravi Bangoria



On 12/8/20 8:13 PM, Thomas Richter wrote:
> On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote:
>> Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu:
>>>
>>>
>>> On 11/19/20 7:20 PM, Kajol Jain wrote:
>>>> Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
>>>> adds a WINDOWS EXE file named tests/pe-file.exe, which is
>>>> examined by the test case 'PE file support'. As powerpc doesn't support
>>>> it, we are skipping this test.
>>>>
>>>> Result in power9 platform before this patach:
>>>> [command]# ./perf test -F 68
>>>> 68: PE file support                               : Failed!
>>>>
>>>> Result in power9 platform after this patch:
>>>> [command]# ./perf test -F 68
>>>> 68: PE file support                               : Skip
>>>>
>>>> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
>>>
>>> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
>>
>> But why is it failing? I.e. what is that
>>
>>   perf test -v -F 68
>>
>> outputs?
>>
>> Using 'perf report' on a perf.data file containing samples in such
>> binaries, collected on x86 should work on whatever workstation a
>> developer uses.
>>
>> Say, on a MacBook aarch64 one can look at a perf.data file collected on
>> a x86_64 system where Wine running a PE binary was present.
>>
>> - Arnaldo
>>
> 
> Hi
> 
> What is the distro you are using?
> I observed the same issue on s390 but this was fixed for fedora33 somehow.
> The error just went away after a dnf update....
> 
> [root@m35lp76 perf]# cat /etc/fedora-release
> Fedora release 33 (Thirty Three)
> [root@m35lp76 perf]# ./perf test -F 68
> 68: PE file support                                                 : Ok
> [root@m35lp76 perf]#
> 
> 
> However on my fedora32 machine it still fails:
> [root@t35lp46 perf]# cat /etc/fedora-release
> Fedora release 32 (Thirty Two)
> [root@t35lp46 perf]# ./perf test -F 68
> 68: PE file support                                                 : FAILED!
> [root@t35lp46 perf]#
> 
> Note that I am running the same kernel on both machines: linux 5.10.0rc7 downloaded
> this morning.
> 

Ok that's interesting. I don't see that on powerpc.

Fedora 32 with 5.10.0-rc2+ kernel:

   $ ./perf test -vv -F 68
   68: PE file support                                                 :
   --- start ---
   filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
   FAILED tests/pe-file-parsing.c:40 Failed to read build_id
   ---- end ----
   PE file support: FAILED!

Fedora 33 with 5.10.0-rc3 kernel:

   $ ./perf test -vv -F 68
   68: PE file support                                                 :
   --- start ---
   filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
   FAILED tests/pe-file-parsing.c:40 Failed to read build_id
   ---- end ----
   PE file support: FAILED!

Ubuntu 18.04.5 with 4.15.0-126-generic kernel:

   $ ./perf test -vv -F 68
   68: PE file support                                                 :
   --- start ---
   filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
   FAILED tests/pe-file-parsing.c:41 Failed to read build_id
   ---- end ----
   PE file support: FAILED!


I assumed bfd is not capable to parse PE files on powerpc. Though,
I didn't check it in more detail. I'll look into it tomorrow.

Ravi

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-12-08 14:43       ` Thomas Richter
  2020-12-08 17:02         ` Ravi Bangoria
@ 2020-12-09 17:37         ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-12-09 17:37 UTC (permalink / raw)
  To: Thomas Richter
  Cc: Ravi Bangoria, Kajol Jain, jolsa, namhyung, linux-perf-users,
	linux-kernel, irogers, rbernon, maddy, atrajeev

Em Tue, Dec 08, 2020 at 03:43:17PM +0100, Thomas Richter escreveu:
> On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu:
> >>
> >>
> >> On 11/19/20 7:20 PM, Kajol Jain wrote:
> >>> Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
> >>> adds a WINDOWS EXE file named tests/pe-file.exe, which is
> >>> examined by the test case 'PE file support'. As powerpc doesn't support
> >>> it, we are skipping this test.
> >>>
> >>> Result in power9 platform before this patach:
> >>> [command]# ./perf test -F 68
> >>> 68: PE file support                               : Failed!
> >>>
> >>> Result in power9 platform after this patch:
> >>> [command]# ./perf test -F 68
> >>> 68: PE file support                               : Skip
> >>>
> >>> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
> >>
> >> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> > 
> > But why is it failing? I.e. what is that
> > 
> >  perf test -v -F 68
> > 
> > outputs?
> > 
> > Using 'perf report' on a perf.data file containing samples in such
> > binaries, collected on x86 should work on whatever workstation a
> > developer uses.
> > 
> > Say, on a MacBook aarch64 one can look at a perf.data file collected on
> > a x86_64 system where Wine running a PE binary was present.
> > 
> > - Arnaldo
> > 
> 
> Hi 
> 
> What is the distro you are using?
> I observed the same issue on s390 but this was fixed for fedora33 somehow.
> The error just went away after a dnf update....
> 
> [root@m35lp76 perf]# cat /etc/fedora-release 
> Fedora release 33 (Thirty Three)
> [root@m35lp76 perf]# ./perf test -F 68
> 68: PE file support                                                 : Ok
> [root@m35lp76 perf]# 
> 
> 
> However on my fedora32 machine it still fails:
> [root@t35lp46 perf]# cat /etc/fedora-release 
> Fedora release 32 (Thirty Two)
> [root@t35lp46 perf]# ./perf test -F 68
> 68: PE file support                                                 : FAILED!
> [root@t35lp46 perf]# 
> 
> Note that I am running the same kernel on both machines: linux 5.10.0rc7 downloaded
> this morning.

Fedora 33.

What does 'perf test -v -F 68' says?

- Arnaldo

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-12-08 17:02         ` Ravi Bangoria
@ 2020-12-09 17:49           ` Arnaldo Carvalho de Melo
  2020-12-10  5:52             ` Ravi Bangoria
  0 siblings, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-12-09 17:49 UTC (permalink / raw)
  To: Ravi Bangoria
  Cc: Thomas Richter, Kajol Jain, jolsa, namhyung, linux-perf-users,
	linux-kernel, irogers, rbernon, maddy, atrajeev

Em Tue, Dec 08, 2020 at 10:32:33PM +0530, Ravi Bangoria escreveu:
> On 12/8/20 8:13 PM, Thomas Richter wrote:
> > On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote:
> > > Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu:
> > > > On 11/19/20 7:20 PM, Kajol Jain wrote:
> > > > > Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
> > > > > adds a WINDOWS EXE file named tests/pe-file.exe, which is
> > > > > examined by the test case 'PE file support'. As powerpc doesn't support
> > > > > it, we are skipping this test.

> > > > > Result in power9 platform before this patach:
> > > > > [command]# ./perf test -F 68
> > > > > 68: PE file support                               : Failed!

> > > > > Result in power9 platform after this patch:
> > > > > [command]# ./perf test -F 68
> > > > > 68: PE file support                               : Skip

> > > > > Signed-off-by: Kajol Jain <kjain@linux.ibm.com>

> > > > Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>

> > > But why is it failing? I.e. what is that

> > >   perf test -v -F 68

> > > outputs?

> > > Using 'perf report' on a perf.data file containing samples in such
> > > binaries, collected on x86 should work on whatever workstation a
> > > developer uses.

> > > Say, on a MacBook aarch64 one can look at a perf.data file collected on
> > > a x86_64 system where Wine running a PE binary was present.

> > What is the distro you are using?
> > I observed the same issue on s390 but this was fixed for fedora33 somehow.
> > The error just went away after a dnf update....

> > [root@m35lp76 perf]# cat /etc/fedora-release
> > Fedora release 33 (Thirty Three)
> > [root@m35lp76 perf]# ./perf test -F 68
> > 68: PE file support                                                 : Ok
> > [root@m35lp76 perf]#

> > However on my fedora32 machine it still fails:
> > [root@t35lp46 perf]# cat /etc/fedora-release
> > Fedora release 32 (Thirty Two)
> > [root@t35lp46 perf]# ./perf test -F 68
> > 68: PE file support                                                 : FAILED!
> > [root@t35lp46 perf]#
> > 
> > Note that I am running the same kernel on both machines: linux 5.10.0rc7 downloaded
> > this morning.
> > 
> 
> Ok that's interesting. I don't see that on powerpc.
> 
> Fedora 32 with 5.10.0-rc2+ kernel:
> 
>   $ ./perf test -vv -F 68
>   68: PE file support                                                 :
>   --- start ---
>   filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
>   FAILED tests/pe-file-parsing.c:40 Failed to read build_id
>   ---- end ----
>   PE file support: FAILED!
> 
> Fedora 33 with 5.10.0-rc3 kernel:
> 
>   $ ./perf test -vv -F 68
>   68: PE file support                                                 :
>   --- start ---
>   filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
>   FAILED tests/pe-file-parsing.c:40 Failed to read build_id
>   ---- end ----
>   PE file support: FAILED!
> 
> Ubuntu 18.04.5 with 4.15.0-126-generic kernel:
> 
>   $ ./perf test -vv -F 68
>   68: PE file support                                                 :
>   --- start ---
>   filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
>   FAILED tests/pe-file-parsing.c:41 Failed to read build_id
>   ---- end ----
>   PE file support: FAILED!
> 
> 
> I assumed bfd is not capable to parse PE files on powerpc. Though,
> I didn't check it in more detail. I'll look into it tomorrow.

Humm, so this is something related to installation? I.e. that
pe-file.exe isn't being found...

It first assumes that the developers are in the tools/perf/ directory,
can you please add the patch below and see if it helps?

Without it and without having actually installed perf (for instance with
'make -C tools/perf install' I get:

[acme@five perf]$ perf test -F 68
68: PE file support                                                 : FAILED!
[acme@five perf]$

[acme@five perf]$ perf test -F -v 68
Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc
68: PE file support                                                 :
--- start ---
FAILED tests/pe-file-parsing.c:40 Failed to read build_id
---- end ----
PE file support: FAILED!
[acme@five perf]$

If I go to tools/perf:

[acme@five perf]$ perf test 68
68: PE file support                                                 : Ok
[acme@five perf]$

With the patch below it works both at the top level dir and at
tools/perf/ on a system without a perf installation containing these
PE files.

We have this in tools/perf/Makefile.perf:

install-tests: all install-gtk
        $(call QUIET_INSTALL, tests) \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
                $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
                $(INSTALL) tests/pe-file.exe* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \    <---------------------------------------------
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
                $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \
                $(INSTALL) tests/shell/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \
                $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \
                $(INSTALL) tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'

install-bin: install-tools install-tests install-traceevent-plugins

- Arnaldo

diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
index 58b90c42eb38c1b9..a380d31b645b58dd 100644
--- a/tools/perf/tests/pe-file-parsing.c
+++ b/tools/perf/tests/pe-file-parsing.c
@@ -78,6 +78,9 @@ int test__pe_file_parsing(struct test *test __maybe_unused,
 	if (!lstat("./tests", &st))
 		return run_dir("./tests");
 
+	if (!lstat("./tools/perf/tests", &st))
+		return run_dir("./tools/perf/tests");
+
 	/* Then installed path. */
 	snprintf(path_dir, PATH_MAX, "%s/tests", get_argv_exec_path());
 

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

* Re: [PATCH] perf test: Skip test 68 for Powerpc
  2020-12-09 17:49           ` Arnaldo Carvalho de Melo
@ 2020-12-10  5:52             ` Ravi Bangoria
  0 siblings, 0 replies; 10+ messages in thread
From: Ravi Bangoria @ 2020-12-10  5:52 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Thomas Richter, Kajol Jain, jolsa, namhyung, linux-perf-users,
	linux-kernel, irogers, rbernon, maddy, atrajeev, Ravi Bangoria



On 12/9/20 11:19 PM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Dec 08, 2020 at 10:32:33PM +0530, Ravi Bangoria escreveu:
>> On 12/8/20 8:13 PM, Thomas Richter wrote:
>>> On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote:
>>>> Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu:
>>>>> On 11/19/20 7:20 PM, Kajol Jain wrote:
>>>>>> Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support")
>>>>>> adds a WINDOWS EXE file named tests/pe-file.exe, which is
>>>>>> examined by the test case 'PE file support'. As powerpc doesn't support
>>>>>> it, we are skipping this test.
> 
>>>>>> Result in power9 platform before this patach:
>>>>>> [command]# ./perf test -F 68
>>>>>> 68: PE file support                               : Failed!
> 
>>>>>> Result in power9 platform after this patch:
>>>>>> [command]# ./perf test -F 68
>>>>>> 68: PE file support                               : Skip
> 
>>>>>> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
> 
>>>>> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> 
>>>> But why is it failing? I.e. what is that
> 
>>>>    perf test -v -F 68
> 
>>>> outputs?
> 
>>>> Using 'perf report' on a perf.data file containing samples in such
>>>> binaries, collected on x86 should work on whatever workstation a
>>>> developer uses.
> 
>>>> Say, on a MacBook aarch64 one can look at a perf.data file collected on
>>>> a x86_64 system where Wine running a PE binary was present.
> 
>>> What is the distro you are using?
>>> I observed the same issue on s390 but this was fixed for fedora33 somehow.
>>> The error just went away after a dnf update....
> 
>>> [root@m35lp76 perf]# cat /etc/fedora-release
>>> Fedora release 33 (Thirty Three)
>>> [root@m35lp76 perf]# ./perf test -F 68
>>> 68: PE file support                                                 : Ok
>>> [root@m35lp76 perf]#
> 
>>> However on my fedora32 machine it still fails:
>>> [root@t35lp46 perf]# cat /etc/fedora-release
>>> Fedora release 32 (Thirty Two)
>>> [root@t35lp46 perf]# ./perf test -F 68
>>> 68: PE file support                                                 : FAILED!
>>> [root@t35lp46 perf]#
>>>
>>> Note that I am running the same kernel on both machines: linux 5.10.0rc7 downloaded
>>> this morning.
>>>
>>
>> Ok that's interesting. I don't see that on powerpc.
>>
>> Fedora 32 with 5.10.0-rc2+ kernel:
>>
>>    $ ./perf test -vv -F 68
>>    68: PE file support                                                 :
>>    --- start ---
>>    filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
>>    FAILED tests/pe-file-parsing.c:40 Failed to read build_id
>>    ---- end ----
>>    PE file support: FAILED!
>>
>> Fedora 33 with 5.10.0-rc3 kernel:
>>
>>    $ ./perf test -vv -F 68
>>    68: PE file support                                                 :
>>    --- start ---
>>    filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
>>    FAILED tests/pe-file-parsing.c:40 Failed to read build_id
>>    ---- end ----
>>    PE file support: FAILED!
>>
>> Ubuntu 18.04.5 with 4.15.0-126-generic kernel:
>>
>>    $ ./perf test -vv -F 68
>>    68: PE file support                                                 :
>>    --- start ---
>>    filename__read_build_id: cannot read ./tests/pe-file.exe bfd file.
>>    FAILED tests/pe-file-parsing.c:41 Failed to read build_id
>>    ---- end ----
>>    PE file support: FAILED!
>>
>>
>> I assumed bfd is not capable to parse PE files on powerpc. Though,
>> I didn't check it in more detail. I'll look into it tomorrow.
> 
> Humm, so this is something related to installation? I.e. that
> pe-file.exe isn't being found...
> 
> It first assumes that the developers are in the tools/perf/ directory,
> can you please add the patch below and see if it helps?

I'm using upstream perf from tools/perf/

I checked bfd code and it's bfd_check_format() who is returning error
"bfd_error_file_not_recognized".

I cross verified with objdump as well:

On x86:

   $ objdump -d ./tests/pe-file.exe
   ./tests/pe-file.exe:     file format pei-x86-64
     
   Disassembly of section .text:
   
   0000000000401000 <__mingw_invalidParameterHandler>:
     401000:       c3                      retq
     401001:       66 66 2e 0f 1f 84 00    data16 nopw %cs:0x0(%rax,%rax,1)
     401008:       00 00 00 00
     40100c:       0f 1f 40 00             nopl   0x0(%rax)

On powerpc:

   $ objdump -d ./tests/pe-file.exe
   objdump: ./tests/pe-file.exe: file format not recognized

Objdump is also returning *same* error.

I dig more into bfd logs and found that Powerpc PE support was removed
recently (Jul 2020) with this commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=fe49679d5193f6ff7cfd333e30883d293112a3d1

Ravi

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

end of thread, other threads:[~2020-12-10  5:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  8:29 [PATCH] perf test: Omit test 68 for s390 Thomas Richter
2020-11-19 13:50 ` [PATCH] perf test: Skip test 68 for Powerpc Kajol Jain
2020-11-24  9:34   ` Ravi Bangoria
2020-12-07 16:35     ` Arnaldo Carvalho de Melo
2020-12-08 14:43       ` Thomas Richter
2020-12-08 17:02         ` Ravi Bangoria
2020-12-09 17:49           ` Arnaldo Carvalho de Melo
2020-12-10  5:52             ` Ravi Bangoria
2020-12-09 17:37         ` Arnaldo Carvalho de Melo
2020-11-19 13:55 ` [PATCH] perf test: Omit test 68 for s390 kajoljain

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