linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: libtraceevent installing in wrong folder
       [not found] <20191108161157.g5aadocnfvragqb2@debian>
@ 2019-11-08 17:05 ` Steven Rostedt
  2019-11-10  0:44   ` Sudip Mukherjee
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2019-11-08 17:05 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, Linux Trace Devel


[ I also added linux-trace-devel, but it was good to Cc LKML too ]

On Fri, 8 Nov 2019 16:11:57 +0000
Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:

> Hi Steve,
> 
> I tried to install libtraceevent. and I used the command:
> "make DESTDIR=/home/sudip/test prefix=/usr install" from tool/lib/traceevent
> 
> And this is what I get:
> sudip@debian:~/test$ pwd
> /home/sudip/test
> 
> sudip@debian:~/test$ find .
> .
> ./usr
> ./usr/local
> ./usr/local/lib
> ./usr/local/lib/x86_64-linux-gnu
> ./usr/local/lib/x86_64-linux-gnu/pkgconfig
> ./usr/local/lib/x86_64-linux-gnu/pkgconfig/libtraceevent.pc
> ./usr/lib64
> ./usr/lib64/traceevent
> ./usr/lib64/traceevent/plugins
> ./usr/lib64/traceevent/plugins/plugin_hrtimer.so
> ./usr/lib64/traceevent/plugins/plugin_sched_switch.so
> ./usr/lib64/traceevent/plugins/plugin_jbd2.so
> ./usr/lib64/traceevent/plugins/plugin_kvm.so
> ./usr/lib64/traceevent/plugins/plugin_cfg80211.so
> ./usr/lib64/traceevent/plugins/plugin_kmem.so
> ./usr/lib64/traceevent/plugins/plugin_scsi.so
> ./usr/lib64/traceevent/plugins/plugin_mac80211.so
> ./usr/lib64/traceevent/plugins/plugin_function.so
> ./usr/lib64/traceevent/plugins/plugin_xen.so
> ./usr/lib64/libtraceevent.so
> ./usr/lib64/libtraceevent.so.1.1.0
> ./usr/lib64/libtraceevent.a
> ./usr/lib64/libtraceevent.so.1
> ./home
> ./home/sudip
> ./home/sudip/test
> ./home/sudip/test/usr
> ./home/sudip/test/usr/include
> ./home/sudip/test/usr/include/traceevent
> ./home/sudip/test/usr/include/traceevent/event-parse.h
> ./home/sudip/test/usr/include/traceevent/trace-seq.h
> ./home/sudip/test/usr/include/traceevent/kbuffer.h
> ./home/sudip/test/usr/include/traceevent/event-utils.h
> 
> I am seeing two problems:
> 1) It created another home/sudip/test folder inside /home/sudip/test and
> the header files are installed in /home/sudip/test/home/sudip/test/usr/include folder.
> They should have been in /home/sudip/test/usr/include.
> 
> 2) I used prefix=/usr but the 'pkgconfig' still went to /usr/local
> 
> Did I do something wrong?

No, but you showed that the installation part is poorly tested. I
mostly tested just the code from trace-cmd, and even the installation
paths from that repo. I should have tested the kernel repo as well, but
failed to do this.

Thanks for reporting, I need to take a look, or if you want to have a go
at it, that would be great too :-)

-- Steve



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

* Re: libtraceevent installing in wrong folder
  2019-11-08 17:05 ` libtraceevent installing in wrong folder Steven Rostedt
@ 2019-11-10  0:44   ` Sudip Mukherjee
  0 siblings, 0 replies; 2+ messages in thread
From: Sudip Mukherjee @ 2019-11-10  0:44 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Linux Trace Devel

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

On Fri, Nov 08, 2019 at 12:05:48PM -0500, Steven Rostedt wrote:
> 
> [ I also added linux-trace-devel, but it was good to Cc LKML too ]
> 
> On Fri, 8 Nov 2019 16:11:57 +0000
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> 
> > Hi Steve,
> > 
> > I tried to install libtraceevent. and I used the command:
> > "make DESTDIR=/home/sudip/test prefix=/usr install" from tool/lib/traceevent
> > 

<snip>

> > 
> > I am seeing two problems:
> > 1) It created another home/sudip/test folder inside /home/sudip/test and
> > the header files are installed in /home/sudip/test/home/sudip/test/usr/include folder.
> > They should have been in /home/sudip/test/usr/include.
> > 
> > 2) I used prefix=/usr but the 'pkgconfig' still went to /usr/local
> > 
> > Did I do something wrong?
> 
> No, but you showed that the installation part is poorly tested. I
> mostly tested just the code from trace-cmd, and even the installation
> paths from that repo. I should have tested the kernel repo as well, but
> failed to do this.
> 
> Thanks for reporting, I need to take a look, or if you want to have a go
> at it, that would be great too :-)

Attached is a patch for the wrong installation of header files.
For the pkgconfig, the problem is at:
pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG)                 \
                        --variable pc_path pkg-config | tr ":" " "))

This is checking 'pc_path' which is the search path used by pkg-config
and then its taking the first path from that list and using in pkgconfig_dir,
which can be wrong.
A reliable way to get the pkg-config location is if I use:

pkg=$(pkg-config --list-all | head -1 | cut -d ' ' -f 1)
pkg-config --variable=pcfiledir $pkg

But I will need to see how I can use this in a Makefile, will send this
patch later, or if you can find a better way before me that will be great.

--
Regards
Sudip

[-- Attachment #2: 0001-libtraceevent-fix-header-installation.patch --]
[-- Type: text/x-diff, Size: 1700 bytes --]

From 1ff159997d1dd299bb0e612baeb573aac45eac03 Mon Sep 17 00:00:00 2001
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Sat, 9 Nov 2019 23:33:54 +0000
Subject: [PATCH] libtraceevent: fix header installation

When we passed some location in DESTDIR, install_headers called
do_install with DESTDIR as part of the second argument. But do_install
is again using '$(DESTDIR_SQ)$2', so as a result the headers were
installed in a location $DESTDIR/$DESTDIR. In my testing I passed
DESTDIR=/home/sudip/test and the headers were installed in:
/home/sudip/test/home/sudip/test/usr/include/traceevent.
Lets remove DESTDIR from the second argument of do_install so that the
headers are installed in the correct location.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 tools/lib/traceevent/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 5315f3787f8d..cbb429f55062 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -232,10 +232,10 @@ install_pkgconfig:
 
 install_headers:
 	$(call QUIET_INSTALL, headers) \
-		$(call do_install,event-parse.h,$(DESTDIR)$(includedir_SQ),644); \
-		$(call do_install,event-utils.h,$(DESTDIR)$(includedir_SQ),644); \
-		$(call do_install,trace-seq.h,$(DESTDIR)$(includedir_SQ),644); \
-		$(call do_install,kbuffer.h,$(DESTDIR)$(includedir_SQ),644)
+		$(call do_install,event-parse.h,$(includedir_SQ),644); \
+		$(call do_install,event-utils.h,$(includedir_SQ),644); \
+		$(call do_install,trace-seq.h,$(includedir_SQ),644); \
+		$(call do_install,kbuffer.h,$(includedir_SQ),644)
 
 install: install_lib
 
-- 
2.11.0


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

end of thread, other threads:[~2019-11-10  0:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191108161157.g5aadocnfvragqb2@debian>
2019-11-08 17:05 ` libtraceevent installing in wrong folder Steven Rostedt
2019-11-10  0:44   ` Sudip Mukherjee

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