Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1453370 > unrolled thread

[RFC 0/4] tools lib traceevent: Install fixes

Started byJiri Olsa <jolsa@kernel.org>
First post2016-08-01 19:50 +0200
Last post2016-08-07 15:00 +0200
Articles 19 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [RFC 0/4] tools lib traceevent: Install fixes Jiri Olsa <jolsa@kernel.org> - 2016-08-01 19:50 +0200
    [PATCH 3/4] tools lib traceevent: Rename LIB_FILE to LIB_TARGET Jiri Olsa <jolsa@kernel.org> - 2016-08-01 19:50 +0200
    [PATCH 1/4] tools lib traceevent: Add install_headers target Jiri Olsa <jolsa@kernel.org> - 2016-08-01 19:50 +0200
      Re: [PATCH 1/4] tools lib traceevent: Add install_headers target Namhyung Kim <namhyung@kernel.org> - 2016-08-02 04:40 +0200
        Re: [PATCH 1/4] tools lib traceevent: Add install_headers target Jiri Olsa <jolsa@redhat.com> - 2016-08-02 11:40 +0200
    Re: [RFC 0/4] tools lib traceevent: Install fixes Namhyung Kim <namhyung@kernel.org> - 2016-08-02 05:20 +0200
      [PATCH 1/2] tools lib traceevent: Ignore generated library files Namhyung Kim <namhyung@kernel.org> - 2016-08-02 07:20 +0200
        [PATCH 2/2] tools lib traceevent: Add str_error_r() Namhyung Kim <namhyung@kernel.org> - 2016-08-02 07:20 +0200
          Re: [PATCH 2/2] tools lib traceevent: Add str_error_r() Namhyung Kim <namhyung@kernel.org> - 2016-08-02 17:30 +0200
        [tip:perf/urgent] tools lib traceevent: Ignore generated library  files tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-08-04 11:40 +0200
      Re: [RFC 0/4] tools lib traceevent: Install fixes Jiri Olsa <jolsa@redhat.com> - 2016-08-02 11:40 +0200
        Re: [RFC 0/4] tools lib traceevent: Install fixes Steven Rostedt <rostedt@goodmis.org> - 2016-08-02 16:00 +0200
          Re: [RFC 0/4] tools lib traceevent: Install fixes Jiri Olsa <jolsa@redhat.com> - 2016-08-02 16:10 +0200
            Re: [RFC 0/4] tools lib traceevent: Install fixes Namhyung Kim <namhyung@kernel.org> - 2016-08-02 16:20 +0200
              Re: [RFC 0/4] tools lib traceevent: Install fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-02 16:20 +0200
            Re: [RFC 0/4] tools lib traceevent: Install fixes Steven Rostedt <rostedt@goodmis.org> - 2016-08-02 16:20 +0200
            Re: [RFC 0/4] tools lib traceevent: Install fixes Steven Rostedt <rostedt@goodmis.org> - 2016-08-05 16:20 +0200
              Re: [RFC 0/4] tools lib traceevent: Install fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-05 16:50 +0200
                Re: [RFC 0/4] tools lib traceevent: Install fixes Jiri Olsa <jolsa@redhat.com> - 2016-08-07 15:00 +0200

#1453370 — [RFC 0/4] tools lib traceevent: Install fixes

FromJiri Olsa <jolsa@kernel.org>
Date2016-08-01 19:50 +0200
Subject[RFC 0/4] tools lib traceevent: Install fixes
Message-ID<s1pvH-YH-3@gated-at.bofh.it>
hi,
sending traceevent changes to make this lib installable
under rpm spec.

Basically adding support to:
  - install header files
  - install version links

Having this patchset applied over the fedora source,
I could built following rpms:

  kernel-tools-libs
  kernel-tools-libs-devel

with added libtraceevent stuff:

  $ rpm -ql kernel-tools-libs
  /usr/lib64/libcpupower.so.0
  /usr/lib64/libcpupower.so.0.0.0
  /usr/lib64/libtraceevent.so.1
  /usr/lib64/libtraceevent.so.1.1.0

  $ rpm -ql kernel-tools-libs-devel
  /usr/include/cpufreq.h
  /usr/include/traceevent
  /usr/include/traceevent/event-parse.h
  /usr/include/traceevent/event-utils.h
  /usr/include/traceevent/kbuffer.h
  /usr/lib64/libcpupower.so
  /usr/lib64/libtraceevent.a
  /usr/lib64/libtraceevent.so

and could build following ex.c outside the kernel tree:

  $ cat ex.c 
  #include <traceevent/event-parse.h>

  int main(void)
  {
          struct pevent *pevent = pevent_alloc();
          printf("krava %p\n", pevent);
          return 0;
  }
  $ gcc -o ex ex.c -ltraceevent -ldl
  $ ./ex
  krava 0x10c6010
  $


I'll send out fedora rpm build changes once we decide
on this patchset.

Also available in:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  traceevent/install

thanks,
jirka


---
Jiri Olsa (4):
      tools lib traceevent: Add install_headers target
      tools lib traceevent: Add do_install_mkdir Makefile function
      tools lib traceevent: Rename LIB_FILE to LIB_TARGET
      tools lib traceevent: Add version for traceevent shared object

 tools/lib/traceevent/Makefile | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)

[toc] | [next] | [standalone]


#1453374 — [PATCH 3/4] tools lib traceevent: Rename LIB_FILE to LIB_TARGET

FromJiri Olsa <jolsa@kernel.org>
Date2016-08-01 19:50 +0200
Subject[PATCH 3/4] tools lib traceevent: Rename LIB_FILE to LIB_TARGET
Message-ID<s1pvI-YH-29@gated-at.bofh.it>
In reply to#1453370
To ease up following patch.

Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/n/tip-zpv5gd8y7clwrhh6dq03ucd5@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/traceevent/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index deeae5201ec9..0d7e1725a0f8 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -99,7 +99,7 @@ libdir_SQ = $(subst ','\'',$(libdir))
 libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
 plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
 
-LIB_FILE = libtraceevent.a libtraceevent.so
+LIB_TARGET = libtraceevent.a libtraceevent.so
 
 CONFIG_INCLUDES = 
 CONFIG_LIBS	=
@@ -156,11 +156,11 @@ PLUGINS += plugin_cfg80211.so
 PLUGINS    := $(addprefix $(OUTPUT),$(PLUGINS))
 PLUGINS_IN := $(PLUGINS:.so=-in.o)
 
-TE_IN    := $(OUTPUT)libtraceevent-in.o
-LIB_FILE := $(addprefix $(OUTPUT),$(LIB_FILE))
+TE_IN      := $(OUTPUT)libtraceevent-in.o
+LIB_TARGET := $(addprefix $(OUTPUT),$(LIB_TARGET))
 DYNAMIC_LIST_FILE := $(OUTPUT)libtraceevent-dynamic-list
 
-CMD_TARGETS = $(LIB_FILE) $(PLUGINS) $(DYNAMIC_LIST_FILE)
+CMD_TARGETS = $(LIB_TARGET) $(PLUGINS) $(DYNAMIC_LIST_FILE)
 
 TARGETS = $(CMD_TARGETS)
 
@@ -261,8 +261,8 @@ define do_generate_dynamic_list_file
 endef
 
 install_lib: all_cmd install_plugins
-	$(call QUIET_INSTALL, $(LIB_FILE)) \
-		$(call do_install,$(LIB_FILE),$(libdir_SQ))
+	$(call QUIET_INSTALL, $(LIB_TARGET)) \
+		$(call do_install,$(LIB_TARGET),$(libdir_SQ))
 
 install_plugins: $(PLUGINS)
 	$(call QUIET_INSTALL, trace_plugins) \
-- 
2.4.11

[toc] | [prev] | [next] | [standalone]


#1453375 — [PATCH 1/4] tools lib traceevent: Add install_headers target

FromJiri Olsa <jolsa@kernel.org>
Date2016-08-01 19:50 +0200
Subject[PATCH 1/4] tools lib traceevent: Add install_headers target
Message-ID<s1pvI-YH-31@gated-at.bofh.it>
In reply to#1453370
Adding install_headers target to install all headers
under 'include/traceevent' path, like:

  $ make DESTDIR=/tmp/krava prefix=/usr install_headers
  $ find /tmp/krava/ -type f
  /tmp/krava/usr/include/traceevent/kbuffer.h
  /tmp/krava/usr/include/traceevent/event-utils.h
  /tmp/krava/usr/include/traceevent/event-parse.h

Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/n/tip-if70lj3zhdc3csdqm5webjvc@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/traceevent/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 7851df1490e0..8e44bea646ee 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -240,7 +240,7 @@ define do_install
 	if [ ! -d '$(DESTDIR_SQ)$2' ]; then		\
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2';	\
 	fi;						\
-	$(INSTALL) $1 '$(DESTDIR_SQ)$2'
+	$(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
 endef
 
 define do_install_plugins
@@ -264,6 +264,12 @@ install_plugins: $(PLUGINS)
 	$(call QUIET_INSTALL, trace_plugins) \
 		$(call do_install_plugins, $(PLUGINS))
 
+install_headers:
+	$(call QUIET_INSTALL, headers) \
+		$(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \
+		$(call do_install,event-utils.h,$(prefix)/include/traceevent,644); \
+		$(call do_install,kbuffer.h,$(prefix)/include/traceevent,644)
+
 install: install_lib
 
 clean:
-- 
2.4.11

[toc] | [prev] | [next] | [standalone]


#1453554 — Re: [PATCH 1/4] tools lib traceevent: Add install_headers target

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 04:40 +0200
SubjectRe: [PATCH 1/4] tools lib traceevent: Add install_headers target
Message-ID<s1xMC-6FX-9@gated-at.bofh.it>
In reply to#1453375
Hi Jiri,

On Mon, Aug 01, 2016 at 07:41:29PM +0200, Jiri Olsa wrote:
> Adding install_headers target to install all headers
> under 'include/traceevent' path, like:
> 
>   $ make DESTDIR=/tmp/krava prefix=/usr install_headers
>   $ find /tmp/krava/ -type f
>   /tmp/krava/usr/include/traceevent/kbuffer.h
>   /tmp/krava/usr/include/traceevent/event-utils.h
>   /tmp/krava/usr/include/traceevent/event-parse.h
> 
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Link: http://lkml.kernel.org/n/tip-if70lj3zhdc3csdqm5webjvc@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/lib/traceevent/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index 7851df1490e0..8e44bea646ee 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -240,7 +240,7 @@ define do_install
>  	if [ ! -d '$(DESTDIR_SQ)$2' ]; then		\
>  		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2';	\
>  	fi;						\
> -	$(INSTALL) $1 '$(DESTDIR_SQ)$2'
> +	$(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
>  endef
>  
>  define do_install_plugins
> @@ -264,6 +264,12 @@ install_plugins: $(PLUGINS)
>  	$(call QUIET_INSTALL, trace_plugins) \
>  		$(call do_install_plugins, $(PLUGINS))
>  
> +install_headers:
> +	$(call QUIET_INSTALL, headers) \
> +		$(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \
> +		$(call do_install,event-utils.h,$(prefix)/include/traceevent,644); \
> +		$(call do_install,kbuffer.h,$(prefix)/include/traceevent,644)

For possible future changes, what about making it to use the wildcard
somehow?  Or else, we could define HEADER_FILES variable..

Thanks,
Namhyung


> +
>  install: install_lib
>  
>  clean:
> -- 
> 2.4.11
> 

[toc] | [prev] | [next] | [standalone]


#1453707 — Re: [PATCH 1/4] tools lib traceevent: Add install_headers target

FromJiri Olsa <jolsa@redhat.com>
Date2016-08-02 11:40 +0200
SubjectRe: [PATCH 1/4] tools lib traceevent: Add install_headers target
Message-ID<s1El3-2B6-25@gated-at.bofh.it>
In reply to#1453554
On Tue, Aug 02, 2016 at 11:19:08AM +0900, Namhyung Kim wrote:
> Hi Jiri,
> 
> On Mon, Aug 01, 2016 at 07:41:29PM +0200, Jiri Olsa wrote:
> > Adding install_headers target to install all headers
> > under 'include/traceevent' path, like:
> > 
> >   $ make DESTDIR=/tmp/krava prefix=/usr install_headers
> >   $ find /tmp/krava/ -type f
> >   /tmp/krava/usr/include/traceevent/kbuffer.h
> >   /tmp/krava/usr/include/traceevent/event-utils.h
> >   /tmp/krava/usr/include/traceevent/event-parse.h
> > 
> > Cc: Steven Rostedt <rostedt@goodmis.org>
> > Link: http://lkml.kernel.org/n/tip-if70lj3zhdc3csdqm5webjvc@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/lib/traceevent/Makefile | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> > index 7851df1490e0..8e44bea646ee 100644
> > --- a/tools/lib/traceevent/Makefile
> > +++ b/tools/lib/traceevent/Makefile
> > @@ -240,7 +240,7 @@ define do_install
> >  	if [ ! -d '$(DESTDIR_SQ)$2' ]; then		\
> >  		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2';	\
> >  	fi;						\
> > -	$(INSTALL) $1 '$(DESTDIR_SQ)$2'
> > +	$(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
> >  endef
> >  
> >  define do_install_plugins
> > @@ -264,6 +264,12 @@ install_plugins: $(PLUGINS)
> >  	$(call QUIET_INSTALL, trace_plugins) \
> >  		$(call do_install_plugins, $(PLUGINS))
> >  
> > +install_headers:
> > +	$(call QUIET_INSTALL, headers) \
> > +		$(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \
> > +		$(call do_install,event-utils.h,$(prefix)/include/traceevent,644); \
> > +		$(call do_install,kbuffer.h,$(prefix)/include/traceevent,644)
> 
> For possible future changes, what about making it to use the wildcard
> somehow?  Or else, we could define HEADER_FILES variable..

right we can.. but I dont expect increase of header files any time soon ;-)

jirka

[toc] | [prev] | [next] | [standalone]


#1453562

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 05:20 +0200
Message-ID<s1ypj-786-1@gated-at.bofh.it>
In reply to#1453370
On Mon, Aug 01, 2016 at 07:41:28PM +0200, Jiri Olsa wrote:
> hi,
> sending traceevent changes to make this lib installable
> under rpm spec.
> 
> Basically adding support to:
>   - install header files
>   - install version links
> 
> Having this patchset applied over the fedora source,
> I could built following rpms:
> 
>   kernel-tools-libs
>   kernel-tools-libs-devel
> 
> with added libtraceevent stuff:
> 
>   $ rpm -ql kernel-tools-libs
>   /usr/lib64/libcpupower.so.0
>   /usr/lib64/libcpupower.so.0.0.0
>   /usr/lib64/libtraceevent.so.1
>   /usr/lib64/libtraceevent.so.1.1.0
> 
>   $ rpm -ql kernel-tools-libs-devel
>   /usr/include/cpufreq.h
>   /usr/include/traceevent
>   /usr/include/traceevent/event-parse.h
>   /usr/include/traceevent/event-utils.h
>   /usr/include/traceevent/kbuffer.h
>   /usr/lib64/libcpupower.so
>   /usr/lib64/libtraceevent.a
>   /usr/lib64/libtraceevent.so
> 
> and could build following ex.c outside the kernel tree:
> 
>   $ cat ex.c 
>   #include <traceevent/event-parse.h>
> 
>   int main(void)
>   {
>           struct pevent *pevent = pevent_alloc();
>           printf("krava %p\n", pevent);
>           return 0;
>   }
>   $ gcc -o ex ex.c -ltraceevent -ldl
>   $ ./ex
>   krava 0x10c6010
>   $

On my system, building ex.c with libtraceevent failed:

$ gcc -I ~/.local/include/ ex.c -L ~/.local/lib64 -ltraceevent -ldl
/home/namhyung/.local/lib64/libtraceevent.so: undefined reference to `str_error_r'
collect2: error: ld returned 1 exit status


Also I think it'd be better for libtraceevent has dependency to libdl
explicitly so that we can get rid of -ldl at the end.


From ac7dc027274cb31f5860c4cf6219ea7584611e17 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <namhyung@kernel.org>
Date: Tue, 2 Aug 2016 12:03:00 +0900
Subject: [PATCH] tools lib traceevent: Add dependency to libdl

The libtraceevent has dependency to libdl due to plugins.  So if
external program wants to link libtraceevent it also needs to add -ldl
to the compiler command line.  Make it explicit so that external
programs doesn't care about the internel dependency of libtraceevent
anymore.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/lib/traceevent/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index c76012ebdb9c..bae0c090c638 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -173,7 +173,7 @@ $(TE_IN): force
 	$(Q)$(MAKE) $(build)=libtraceevent
 
 $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
-	$(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
+	$(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@ -ldl
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
 
-- 
2.9.2

[toc] | [prev] | [next] | [standalone]


#1453593 — [PATCH 1/2] tools lib traceevent: Ignore generated library files

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 07:20 +0200
Subject[PATCH 1/2] tools lib traceevent: Ignore generated library files
Message-ID<s1Ahr-6s-3@gated-at.bofh.it>
In reply to#1453562
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/lib/traceevent/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/traceevent/.gitignore b/tools/lib/traceevent/.gitignore
index 3c60335fe7be..9e9f25fb1922 100644
--- a/tools/lib/traceevent/.gitignore
+++ b/tools/lib/traceevent/.gitignore
@@ -1,2 +1,3 @@
 TRACEEVENT-CFLAGS
 libtraceevent-dynamic-list
+libtraceevent.so.*
-- 
2.9.2

[toc] | [prev] | [next] | [standalone]


#1453594 — [PATCH 2/2] tools lib traceevent: Add str_error_r()

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 07:20 +0200
Subject[PATCH 2/2] tools lib traceevent: Add str_error_r()
Message-ID<s1Ahr-6s-5@gated-at.bofh.it>
In reply to#1453593
The libtraceevent uses str_error_r() but its implementation is outside
of the library.  So if an external program wants to link the
libtraceevent it'd fail due to missing str_error_r.  Add it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/lib/traceevent/Build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/lib/traceevent/Build b/tools/lib/traceevent/Build
index c681d0575d16..a4efdf7876ce 100644
--- a/tools/lib/traceevent/Build
+++ b/tools/lib/traceevent/Build
@@ -4,6 +4,10 @@ libtraceevent-y += trace-seq.o
 libtraceevent-y += parse-filter.o
 libtraceevent-y += parse-utils.o
 libtraceevent-y += kbuffer-parse.o
+libtraceevent-y += str_error_r.o
+
+str_error_r.o: ../str_error_r.c
+	$(call if_changed_dep,cc_o_c)
 
 plugin_jbd2-y         += plugin_jbd2.o
 plugin_hrtimer-y      += plugin_hrtimer.o
-- 
2.9.2

[toc] | [prev] | [next] | [standalone]


#1454752 — Re: [PATCH 2/2] tools lib traceevent: Add str_error_r()

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 17:30 +0200
SubjectRe: [PATCH 2/2] tools lib traceevent: Add str_error_r()
Message-ID<s1JNM-6gj-31@gated-at.bofh.it>
In reply to#1453594
On Tue, Aug 2, 2016 at 2:01 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> The libtraceevent uses str_error_r() but its implementation is outside
> of the library.  So if an external program wants to link the
> libtraceevent it'd fail due to missing str_error_r.  Add it.

Please ignore this as it breaks perf build due to multiple definition. :-/

Thanks,
Namhyung


>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/lib/traceevent/Build | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/tools/lib/traceevent/Build b/tools/lib/traceevent/Build
> index c681d0575d16..a4efdf7876ce 100644
> --- a/tools/lib/traceevent/Build
> +++ b/tools/lib/traceevent/Build
> @@ -4,6 +4,10 @@ libtraceevent-y += trace-seq.o
>  libtraceevent-y += parse-filter.o
>  libtraceevent-y += parse-utils.o
>  libtraceevent-y += kbuffer-parse.o
> +libtraceevent-y += str_error_r.o
> +
> +str_error_r.o: ../str_error_r.c
> +       $(call if_changed_dep,cc_o_c)
>
>  plugin_jbd2-y         += plugin_jbd2.o
>  plugin_hrtimer-y      += plugin_hrtimer.o
> --
> 2.9.2
>



-- 
Thanks,
Namhyung

[toc] | [prev] | [next] | [standalone]


#1456270 — [tip:perf/urgent] tools lib traceevent: Ignore generated library files

Fromtip-bot for Namhyung Kim <tipbot@zytor.com>
Date2016-08-04 11:40 +0200
Subject[tip:perf/urgent] tools lib traceevent: Ignore generated library files
Message-ID<s2nia-73p-9@gated-at.bofh.it>
In reply to#1453593
Commit-ID:  979a70a237efb68e15b1cee36f9f92037e71d1fd
Gitweb:     http://git.kernel.org/tip/979a70a237efb68e15b1cee36f9f92037e71d1fd
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Tue, 2 Aug 2016 14:01:47 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 2 Aug 2016 12:16:13 -0300

tools lib traceevent: Ignore generated library files

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20160802050148.3413-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/traceevent/.gitignore b/tools/lib/traceevent/.gitignore
index 3c60335..9e9f25f 100644
--- a/tools/lib/traceevent/.gitignore
+++ b/tools/lib/traceevent/.gitignore
@@ -1,2 +1,3 @@
 TRACEEVENT-CFLAGS
 libtraceevent-dynamic-list
+libtraceevent.so.*

[toc] | [prev] | [next] | [standalone]


#1453704

FromJiri Olsa <jolsa@redhat.com>
Date2016-08-02 11:40 +0200
Message-ID<s1El3-2B6-11@gated-at.bofh.it>
In reply to#1453562
On Tue, Aug 02, 2016 at 12:10:55PM +0900, Namhyung Kim wrote:
> On Mon, Aug 01, 2016 at 07:41:28PM +0200, Jiri Olsa wrote:
> > hi,
> > sending traceevent changes to make this lib installable
> > under rpm spec.
> > 
> > Basically adding support to:
> >   - install header files
> >   - install version links
> > 
> > Having this patchset applied over the fedora source,
> > I could built following rpms:
> > 
> >   kernel-tools-libs
> >   kernel-tools-libs-devel
> > 
> > with added libtraceevent stuff:
> > 
> >   $ rpm -ql kernel-tools-libs
> >   /usr/lib64/libcpupower.so.0
> >   /usr/lib64/libcpupower.so.0.0.0
> >   /usr/lib64/libtraceevent.so.1
> >   /usr/lib64/libtraceevent.so.1.1.0
> > 
> >   $ rpm -ql kernel-tools-libs-devel
> >   /usr/include/cpufreq.h
> >   /usr/include/traceevent
> >   /usr/include/traceevent/event-parse.h
> >   /usr/include/traceevent/event-utils.h
> >   /usr/include/traceevent/kbuffer.h
> >   /usr/lib64/libcpupower.so
> >   /usr/lib64/libtraceevent.a
> >   /usr/lib64/libtraceevent.so
> > 
> > and could build following ex.c outside the kernel tree:
> > 
> >   $ cat ex.c 
> >   #include <traceevent/event-parse.h>
> > 
> >   int main(void)
> >   {
> >           struct pevent *pevent = pevent_alloc();
> >           printf("krava %p\n", pevent);
> >           return 0;
> >   }
> >   $ gcc -o ex ex.c -ltraceevent -ldl
> >   $ ./ex
> >   krava 0x10c6010
> >   $
> 
> On my system, building ex.c with libtraceevent failed:
> 
> $ gcc -I ~/.local/include/ ex.c -L ~/.local/lib64 -ltraceevent -ldl
> /home/namhyung/.local/lib64/libtraceevent.so: undefined reference to `str_error_r'
> collect2: error: ld returned 1 exit status
> 
> 
> Also I think it'd be better for libtraceevent has dependency to libdl
> explicitly so that we can get rid of -ldl at the end.

agreed, I'll queue your patch if v2 is needed

thanks,
jirka

> 
> 
> From ac7dc027274cb31f5860c4cf6219ea7584611e17 Mon Sep 17 00:00:00 2001
> From: Namhyung Kim <namhyung@kernel.org>
> Date: Tue, 2 Aug 2016 12:03:00 +0900
> Subject: [PATCH] tools lib traceevent: Add dependency to libdl
> 
> The libtraceevent has dependency to libdl due to plugins.  So if
> external program wants to link libtraceevent it also needs to add -ldl
> to the compiler command line.  Make it explicit so that external
> programs doesn't care about the internel dependency of libtraceevent
> anymore.
> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/lib/traceevent/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index c76012ebdb9c..bae0c090c638 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -173,7 +173,7 @@ $(TE_IN): force
>  	$(Q)$(MAKE) $(build)=libtraceevent
>  
>  $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
> -	$(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
> +	$(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@ -ldl
>  	@ln -sf $(@F) $(OUTPUT)libtraceevent.so
>  	@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
>  
> -- 
> 2.9.2
> 

[toc] | [prev] | [next] | [standalone]


#1454470

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-08-02 16:00 +0200
Message-ID<s1IoH-5bC-53@gated-at.bofh.it>
In reply to#1453704
On Tue, 2 Aug 2016 11:31:34 +0200
Jiri Olsa <jolsa@redhat.com> wrote:

> On Tue, Aug 02, 2016 at 12:10:55PM +0900, Namhyung Kim wrote:
> > On Mon, Aug 01, 2016 at 07:41:28PM +0200, Jiri Olsa wrote:  
> > > hi,
> > > sending traceevent changes to make this lib installable
> > > under rpm spec.
> > > 
> > > Basically adding support to:
> > >   - install header files
> > >   - install version links
> > > 
> > > Having this patchset applied over the fedora source,
> > > I could built following rpms:
> > > 
> > >   kernel-tools-libs
> > >   kernel-tools-libs-devel
> > > 
> > > with added libtraceevent stuff:
> > > 
> > >   $ rpm -ql kernel-tools-libs
> > >   /usr/lib64/libcpupower.so.0
> > >   /usr/lib64/libcpupower.so.0.0.0
> > >   /usr/lib64/libtraceevent.so.1
> > >   /usr/lib64/libtraceevent.so.1.1.0
> > > 
> > >   $ rpm -ql kernel-tools-libs-devel
> > >   /usr/include/cpufreq.h
> > >   /usr/include/traceevent
> > >   /usr/include/traceevent/event-parse.h
> > >   /usr/include/traceevent/event-utils.h
> > >   /usr/include/traceevent/kbuffer.h
> > >   /usr/lib64/libcpupower.so
> > >   /usr/lib64/libtraceevent.a
> > >   /usr/lib64/libtraceevent.so
> > > 
> > > and could build following ex.c outside the kernel tree:
> > > 
> > >   $ cat ex.c 
> > >   #include <traceevent/event-parse.h>
> > > 
> > >   int main(void)
> > >   {
> > >           struct pevent *pevent = pevent_alloc();
> > >           printf("krava %p\n", pevent);
> > >           return 0;
> > >   }
> > >   $ gcc -o ex ex.c -ltraceevent -ldl
> > >   $ ./ex
> > >   krava 0x10c6010
> > >   $  
> > 
> > On my system, building ex.c with libtraceevent failed:
> > 
> > $ gcc -I ~/.local/include/ ex.c -L ~/.local/lib64 -ltraceevent -ldl
> > /home/namhyung/.local/lib64/libtraceevent.so: undefined reference to `str_error_r'
> > collect2: error: ld returned 1 exit status
> > 
> > 
> > Also I think it'd be better for libtraceevent has dependency to libdl
> > explicitly so that we can get rid of -ldl at the end.  
> 
> agreed, I'll queue your patch if v2 is needed
> 

BTW, before we start making this ready for their own libraries, I'd
like to make some changes with the naming convention. Mainly with
event_format and format_field.

Perhaps we should change them to pevent_event and pevent_field?

-- Steve

[toc] | [prev] | [next] | [standalone]


#1454491

FromJiri Olsa <jolsa@redhat.com>
Date2016-08-02 16:10 +0200
Message-ID<s1Iym-5ut-43@gated-at.bofh.it>
In reply to#1454470
On Tue, Aug 02, 2016 at 09:48:23AM -0400, Steven Rostedt wrote:

SNIP

> > > 
> > > 
> > > Also I think it'd be better for libtraceevent has dependency to libdl
> > > explicitly so that we can get rid of -ldl at the end.  
> > 
> > agreed, I'll queue your patch if v2 is needed
> > 
> 
> BTW, before we start making this ready for their own libraries, I'd
> like to make some changes with the naming convention. Mainly with
> event_format and format_field.
> 
> Perhaps we should change them to pevent_event and pevent_field?

right, it does not have any global prefix for public symbols

I'd actualy expect something like 'traceevent_',
but 'pevent' is ok as well I guess

jirka

[toc] | [prev] | [next] | [standalone]


#1454505

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 16:20 +0200
Message-ID<s1II1-5y4-1@gated-at.bofh.it>
In reply to#1454491
On Tue, Aug 02, 2016 at 04:01:44PM +0200, Jiri Olsa wrote:
> On Tue, Aug 02, 2016 at 09:48:23AM -0400, Steven Rostedt wrote:
> 
> SNIP
> 
> > > > 
> > > > 
> > > > Also I think it'd be better for libtraceevent has dependency to libdl
> > > > explicitly so that we can get rid of -ldl at the end.  
> > > 
> > > agreed, I'll queue your patch if v2 is needed
> > > 
> > 
> > BTW, before we start making this ready for their own libraries, I'd
> > like to make some changes with the naming convention. Mainly with
> > event_format and format_field.
> > 
> > Perhaps we should change them to pevent_event and pevent_field?
> 
> right, it does not have any global prefix for public symbols
> 
> I'd actualy expect something like 'traceevent_',
> but 'pevent' is ok as well I guess

The 'pevent' prefix would be more consistent to similar APIs IMHO.

Maybe it's worth splitting public header and internal header files?

Thanks,
Namhyung

[toc] | [prev] | [next] | [standalone]


#1454506

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-08-02 16:20 +0200
Message-ID<s1II1-5y4-3@gated-at.bofh.it>
In reply to#1454505
Em Tue, Aug 02, 2016 at 11:14:11PM +0900, Namhyung Kim escreveu:
> On Tue, Aug 02, 2016 at 04:01:44PM +0200, Jiri Olsa wrote:
> > On Tue, Aug 02, 2016 at 09:48:23AM -0400, Steven Rostedt wrote:
> > 
> > SNIP
> > 
> > > > > 
> > > > > 
> > > > > Also I think it'd be better for libtraceevent has dependency to libdl
> > > > > explicitly so that we can get rid of -ldl at the end.  
> > > > 
> > > > agreed, I'll queue your patch if v2 is needed
> > > > 
> > > 
> > > BTW, before we start making this ready for their own libraries, I'd
> > > like to make some changes with the naming convention. Mainly with
> > > event_format and format_field.
> > > 
> > > Perhaps we should change them to pevent_event and pevent_field?
> > 
> > right, it does not have any global prefix for public symbols
> > 
> > I'd actualy expect something like 'traceevent_',
> > but 'pevent' is ok as well I guess
> 
> The 'pevent' prefix would be more consistent to similar APIs IMHO.
> 
> Maybe it's worth splitting public header and internal header files?

I'd suggest exporting just what is already used by tools, exposing more
as the need arises.

- Arnaldo

[toc] | [prev] | [next] | [standalone]


#1454526

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-08-02 16:20 +0200
Message-ID<s1II3-5y4-49@gated-at.bofh.it>
In reply to#1454491
On Tue, 2 Aug 2016 16:01:44 +0200
Jiri Olsa <jolsa@redhat.com> wrote:


> I'd actualy expect something like 'traceevent_',
> but 'pevent' is ok as well I guess
> 

Hmm, I like pevent because it is short (less typing ;-), but as this is
going to be in libtracevent, I'm wondering if we want to rename it to
traceevent_ or maybe tevent? or what about kevent?

-- Steve

[toc] | [prev] | [next] | [standalone]


#1457122

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-08-05 16:20 +0200
Message-ID<s2O8G-bi-19@gated-at.bofh.it>
In reply to#1454491
On Tue, 2 Aug 2016 16:01:44 +0200
Jiri Olsa <jolsa@redhat.com> wrote:

> > BTW, before we start making this ready for their own libraries, I'd
> > like to make some changes with the naming convention. Mainly with
> > event_format and format_field.
> > 
> > Perhaps we should change them to pevent_event and pevent_field?  
> 
> right, it does not have any global prefix for public symbols
> 
> I'd actualy expect something like 'traceevent_',
> but 'pevent' is ok as well I guess

OK, what's the consensus here? Should we keep "pevent_" or switch to
the longer "traceevent_"?

I want to make the patch that gets this ready to ship!

-- Steve

[toc] | [prev] | [next] | [standalone]


#1457142

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-08-05 16:50 +0200
Message-ID<s2OBI-lD-17@gated-at.bofh.it>
In reply to#1457122
Em Fri, Aug 05, 2016 at 10:13:52AM -0400, Steven Rostedt escreveu:
> On Tue, 2 Aug 2016 16:01:44 +0200
> Jiri Olsa <jolsa@redhat.com> wrote:
> > > BTW, before we start making this ready for their own libraries, I'd
> > > like to make some changes with the naming convention. Mainly with
> > > event_format and format_field.
> > > 
> > > Perhaps we should change them to pevent_event and pevent_field?  
> > 
> > right, it does not have any global prefix for public symbols
> > 
> > I'd actualy expect something like 'traceevent_',
> > but 'pevent' is ok as well I guess
> 
> OK, what's the consensus here? Should we keep "pevent_" or switch to
> the longer "traceevent_"?

traceevent_ matches libtraceevent, so I think would be more obvious the
association of code with the library.

- Arnaldo
 
> I want to make the patch that gets this ready to ship!
> 
> -- Steve

[toc] | [prev] | [next] | [standalone]


#1457451

FromJiri Olsa <jolsa@redhat.com>
Date2016-08-07 15:00 +0200
Message-ID<s3vQl-3Sv-7@gated-at.bofh.it>
In reply to#1457142
On Fri, Aug 05, 2016 at 11:42:41AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Fri, Aug 05, 2016 at 10:13:52AM -0400, Steven Rostedt escreveu:
> > On Tue, 2 Aug 2016 16:01:44 +0200
> > Jiri Olsa <jolsa@redhat.com> wrote:
> > > > BTW, before we start making this ready for their own libraries, I'd
> > > > like to make some changes with the naming convention. Mainly with
> > > > event_format and format_field.
> > > > 
> > > > Perhaps we should change them to pevent_event and pevent_field?  
> > > 
> > > right, it does not have any global prefix for public symbols
> > > 
> > > I'd actualy expect something like 'traceevent_',
> > > but 'pevent' is ok as well I guess
> > 
> > OK, what's the consensus here? Should we keep "pevent_" or switch to
> > the longer "traceevent_"?
> 
> traceevent_ matches libtraceevent, so I think would be more obvious the
> association of code with the library.

+1 for traceevent_ ... makes more sense to me

jirka

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web