All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] perf build: Report failure for testing feature libopencsd
@ 2021-09-02  8:18 Leo Yan
  2021-09-02 12:22 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Yan @ 2021-09-02  8:18 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, James Clark, mathieu.poirier,
	coresight, linux-perf-users, mike.leach, suzuki.poulose,
	Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel
  Cc: Leo Yan

When build perf tool with passing option 'CORESIGHT=1' explicitly, if
the feature test fails for library libopencsd, the build doesn't
complain the feature failure and continue to build the tool with
disabling the CoreSight feature insteadly.

This patch changes the building behaviour, when build perf tool with the
option 'CORESIGHT=1' and detect the failure for testing feature
libopencsd, the build process will be aborted and it shows the complaint
info.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---

Changes from v1:
Fixed a typo in the error message.

 tools/perf/Makefile.config | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 4a0d9a6defc7..5df79538486b 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -489,6 +489,8 @@ ifdef CORESIGHT
         CFLAGS += -DCS_RAW_PACKED
       endif
     endif
+  else
+    dummy := $(error Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1)
   endif
 endif
 
-- 
2.25.1


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

* Re: [PATCH v2] perf build: Report failure for testing feature libopencsd
  2021-09-02  8:18 [PATCH v2] perf build: Report failure for testing feature libopencsd Leo Yan
@ 2021-09-02 12:22 ` Arnaldo Carvalho de Melo
  2021-09-02 12:45   ` Leo Yan
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-09-02 12:22 UTC (permalink / raw)
  To: Leo Yan
  Cc: James Clark, mathieu.poirier, coresight, linux-perf-users,
	mike.leach, suzuki.poulose, Peter Zijlstra, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel

Em Thu, Sep 02, 2021 at 04:18:00PM +0800, Leo Yan escreveu:
> When build perf tool with passing option 'CORESIGHT=1' explicitly, if
> the feature test fails for library libopencsd, the build doesn't
> complain the feature failure and continue to build the tool with
> disabling the CoreSight feature insteadly.
> 
> This patch changes the building behaviour, when build perf tool with the
> option 'CORESIGHT=1' and detect the failure for testing feature
> libopencsd, the build process will be aborted and it shows the complaint
> info.

Thanks, added some committer notes to show that it now works:

commit 8fb36b1f54873870262810d3db10526559e1d6c2
Author: Leo Yan <leo.yan@linaro.org>
Date:   Thu Sep 2 16:18:00 2021 +0800

    perf build: Report failure for testing feature libopencsd
    
    When build perf tool with passing option 'CORESIGHT=1' explicitly, if
    the feature test fails for library libopencsd, the build doesn't
    complain the feature failure and continue to build the tool with
    disabling the CoreSight feature insteadly.
    
    This patch changes the building behaviour, when build perf tool with the
    option 'CORESIGHT=1' and detect the failure for testing feature
    libopencsd, the build process will be aborted and it shows the complaint
    info.
    
    Committer testing:
    
    First make sure there is no opencsd library installed:
    
      $ rpm -qa | grep -i csd
      $ sudo rm -rf `find /usr/local -name "*csd*"`
      $ find /usr/local -name "*csd*"
      $
    
    Then cleanup the perf build output directory:
    
      $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ;
      $
    
    And try to build explicitely asking for coresight:
    
      $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin
      make: Entering directory '/var/home/acme/git/perf/tools/perf'
        BUILD:   Doing 'make -j24' parallel build
        HOSTCC  /tmp/build/perf/fixdep.o
        HOSTLD  /tmp/build/perf/fixdep-in.o
        LINK    /tmp/build/perf/fixdep
      Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1.  Stop.
      make[1]: *** [Makefile.perf:238: sub-make] Error 2
      make: *** [Makefile:113: install-bin] Error 2
      make: Leaving directory '/var/home/acme/git/perf/tools/perf'
      $
    
    Now install the opencsd library present in Fedora 34:
    
      $ sudo dnf install opencsd-devel
      <SNIP>
      Installed:
        opencsd-1.0.0-1.fc34.x86_64 opencsd-devel-1.0.0-1.fc34.x86_64
      Complete!
      $
    
    Try again building with coresight:
    
      $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin
      make: Entering directory '/var/home/acme/git/perf/tools/perf'
        BUILD:   Doing 'make -j24' parallel build
      Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1.  Stop.
      make[1]: *** [Makefile.perf:238: sub-make] Error 2
      make: *** [Makefile:113: install-bin] Error 2
      make: Leaving directory '/var/home/acme/git/perf/tools/perf'
      $
    
    Since Fedora 34 is pretty recent, one assumes we need to get it from its
    upstream git repository, use rpm to find where that is:
    
      $ rpm -q --qf "%{URL}\n" opencsd
      https://github.com/Linaro/OpenCSD
      $
    
    Go there, clone the repo, build it and install into /usr/local, then try
    again:
    
      $ cd ~acme/git/perf
      $ make O=/tmp/build/perf VF=1 CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin | grep -i opencsd
      ...                    libopencsd: [ on  ]
        PERF_VERSION = 5.14.g454719f67a3d
      $ export LD_LIBRARY_PATH=/usr/local/lib
      $ ldd ~/bin/perf | grep opencsd
            libopencsd_c_api.so.1 => /usr/local/lib/libopencsd_c_api.so.1 (0x00007f28f78a4000)
            libopencsd.so.1 => /usr/local/lib/libopencsd.so.1 (0x00007f28f6a2e000)
      $
    
    Now it works.
    
    Requested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Leo Yan <leo.yan@linaro.org>
    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: James Clark <james.clark@arm.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
    Cc: coresight@lists.linaro.org
    Link: http://lore.kernel.org/lkml/20210902081800.550016-1-leo.yan@linaro.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index b051c0c312c5243a..b66cf128cbc76d07 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -489,6 +489,8 @@ ifdef CORESIGHT
         CFLAGS += -DCS_RAW_PACKED
       endif
     endif
+  else
+    dummy := $(error Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1)
   endif
 endif
 

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

* Re: [PATCH v2] perf build: Report failure for testing feature libopencsd
  2021-09-02 12:22 ` Arnaldo Carvalho de Melo
@ 2021-09-02 12:45   ` Leo Yan
  2021-09-02 13:00     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Yan @ 2021-09-02 12:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: James Clark, mathieu.poirier, coresight, linux-perf-users,
	mike.leach, suzuki.poulose, Peter Zijlstra, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel

On Thu, Sep 02, 2021 at 09:22:21AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Sep 02, 2021 at 04:18:00PM +0800, Leo Yan escreveu:
> > When build perf tool with passing option 'CORESIGHT=1' explicitly, if
> > the feature test fails for library libopencsd, the build doesn't
> > complain the feature failure and continue to build the tool with
> > disabling the CoreSight feature insteadly.
> > 
> > This patch changes the building behaviour, when build perf tool with the
> > option 'CORESIGHT=1' and detect the failure for testing feature
> > libopencsd, the build process will be aborted and it shows the complaint
> > info.
> 
> Thanks, added some committer notes to show that it now works:
> 
> commit 8fb36b1f54873870262810d3db10526559e1d6c2
> Author: Leo Yan <leo.yan@linaro.org>
> Date:   Thu Sep 2 16:18:00 2021 +0800
> 
>     perf build: Report failure for testing feature libopencsd
>     
>     When build perf tool with passing option 'CORESIGHT=1' explicitly, if
>     the feature test fails for library libopencsd, the build doesn't
>     complain the feature failure and continue to build the tool with
>     disabling the CoreSight feature insteadly.
>     
>     This patch changes the building behaviour, when build perf tool with the
>     option 'CORESIGHT=1' and detect the failure for testing feature
>     libopencsd, the build process will be aborted and it shows the complaint
>     info.
>     
>     Committer testing:
>     
>     First make sure there is no opencsd library installed:
>     
>       $ rpm -qa | grep -i csd
>       $ sudo rm -rf `find /usr/local -name "*csd*"`
>       $ find /usr/local -name "*csd*"
>       $
>     
>     Then cleanup the perf build output directory:
>     
>       $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ;
>       $
>     
>     And try to build explicitely asking for coresight:
>     
>       $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin

The build command contains duplicate 'O=/tmp/build/perf'.

>       make: Entering directory '/var/home/acme/git/perf/tools/perf'
>         BUILD:   Doing 'make -j24' parallel build
>         HOSTCC  /tmp/build/perf/fixdep.o
>         HOSTLD  /tmp/build/perf/fixdep-in.o
>         LINK    /tmp/build/perf/fixdep
>       Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1.  Stop.
>       make[1]: *** [Makefile.perf:238: sub-make] Error 2
>       make: *** [Makefile:113: install-bin] Error 2
>       make: Leaving directory '/var/home/acme/git/perf/tools/perf'
>       $
>     
>     Now install the opencsd library present in Fedora 34:
>     
>       $ sudo dnf install opencsd-devel
>       <SNIP>
>       Installed:
>         opencsd-1.0.0-1.fc34.x86_64 opencsd-devel-1.0.0-1.fc34.x86_64
>       Complete!
>       $
>     
>     Try again building with coresight:
>     
>       $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin
>       make: Entering directory '/var/home/acme/git/perf/tools/perf'
>         BUILD:   Doing 'make -j24' parallel build
>       Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1.  Stop.
>       make[1]: *** [Makefile.perf:238: sub-make] Error 2
>       make: *** [Makefile:113: install-bin] Error 2
>       make: Leaving directory '/var/home/acme/git/perf/tools/perf'
>       $
>     
>     Since Fedora 34 is pretty recent, one assumes we need to get it from its
>     upstream git repository, use rpm to find where that is:
>     
>       $ rpm -q --qf "%{URL}\n" opencsd
>       https://github.com/Linaro/OpenCSD
>       $
>     
>     Go there, clone the repo, build it and install into /usr/local, then try
>     again:
>     
>       $ cd ~acme/git/perf
>       $ make O=/tmp/build/perf VF=1 CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin | grep -i opencsd
>       ...                    libopencsd: [ on  ]
>         PERF_VERSION = 5.14.g454719f67a3d
>       $ export LD_LIBRARY_PATH=/usr/local/lib
>       $ ldd ~/bin/perf | grep opencsd
>             libopencsd_c_api.so.1 => /usr/local/lib/libopencsd_c_api.so.1 (0x00007f28f78a4000)
>             libopencsd.so.1 => /usr/local/lib/libopencsd.so.1 (0x00007f28f6a2e000)
>       $
>     
>     Now it works.

Good to know the very detailed steps.  Thanks a lot for writing up
this!

Leo

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

* Re: [PATCH v2] perf build: Report failure for testing feature libopencsd
  2021-09-02 12:45   ` Leo Yan
@ 2021-09-02 13:00     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-09-02 13:00 UTC (permalink / raw)
  To: Leo Yan, Arnaldo Carvalho de Melo
  Cc: James Clark, mathieu.poirier, coresight, linux-perf-users,
	mike.leach, suzuki.poulose, Peter Zijlstra, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel



On September 2, 2021 9:45:29 AM GMT-03:00, Leo Yan <leo.yan@linaro.org> wrote:
>On Thu, Sep 02, 2021 at 09:22:21AM -0300, Arnaldo Carvalho de Melo wrote:
>> Em Thu, Sep 02, 2021 at 04:18:00PM +0800, Leo Yan escreveu:
>> > When build perf tool with passing option 'CORESIGHT=1' explicitly, if
>> > the feature test fails for library libopencsd, the build doesn't
>> > complain the feature failure and continue to build the tool with
>> > disabling the CoreSight feature insteadly.
>> > 
>> > This patch changes the building behaviour, when build perf tool with the
>> > option 'CORESIGHT=1' and detect the failure for testing feature
>> > libopencsd, the build process will be aborted and it shows the complaint
>> > info.
>> 
>> Thanks, added some committer notes to show that it now works:
>> 
>> commit 8fb36b1f54873870262810d3db10526559e1d6c2
>> Author: Leo Yan <leo.yan@linaro.org>
>> Date:   Thu Sep 2 16:18:00 2021 +0800
>> 
>>     perf build: Report failure for testing feature libopencsd
>>     
>>     When build perf tool with passing option 'CORESIGHT=1' explicitly, if
>>     the feature test fails for library libopencsd, the build doesn't
>>     complain the feature failure and continue to build the tool with
>>     disabling the CoreSight feature insteadly.
>>     
>>     This patch changes the building behaviour, when build perf tool with the
>>     option 'CORESIGHT=1' and detect the failure for testing feature
>>     libopencsd, the build process will be aborted and it shows the complaint
>>     info.
>>     
>>     Committer testing:
>>     
>>     First make sure there is no opencsd library installed:
>>     
>>       $ rpm -qa | grep -i csd
>>       $ sudo rm -rf `find /usr/local -name "*csd*"`
>>       $ find /usr/local -name "*csd*"
>>       $
>>     
>>     Then cleanup the perf build output directory:
>>     
>>       $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ;
>>       $
>>     
>>     And try to build explicitely asking for coresight:
>>     
>>       $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin
>
>The build command contains duplicate 'O=/tmp/build/perf'.

Oops, I'll fix it, thanks.

- Arnaldo


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

end of thread, other threads:[~2021-09-02 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  8:18 [PATCH v2] perf build: Report failure for testing feature libopencsd Leo Yan
2021-09-02 12:22 ` Arnaldo Carvalho de Melo
2021-09-02 12:45   ` Leo Yan
2021-09-02 13:00     ` Arnaldo Carvalho de Melo

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.