All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Resubmitted forgotten patches
@ 2017-07-19  1:18 David Carrillo-Cisneros
  2017-07-19  1:18 ` [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set David Carrillo-Cisneros
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: David Carrillo-Cisneros @ 2017-07-19  1:18 UTC (permalink / raw)
  To: linux-kernel, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Kees Kook, Sudeep Holla, Alexander Shishkin, Wang Nan,
	Elena Reshetova, Stephane Eranian, Paul Turner,
	David Carrillo-Cisneros

Pickup some small fixes that have been forgotten.

David Carrillo-Cisneros (3):
  perf tool cgroup: Initialize cgroup refcnt with refcount_set
  perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile
  perf annotate: Process tracing data in pipe mode

Sudeep Holla (1):
  tools: perf: Fix linker error when libelf config is disabled

 tools/perf/Makefile.perf      | 10 ++++++++--
 tools/perf/builtin-annotate.c |  1 +
 tools/perf/util/cgroup.c      |  5 ++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.13.2.932.g7449e964c-goog

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

* [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set
  2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
@ 2017-07-19  1:18 ` David Carrillo-Cisneros
  2017-07-21 16:55   ` Arnaldo Carvalho de Melo
  2017-07-19  1:18 ` [PATCH 2/4] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile David Carrillo-Cisneros
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: David Carrillo-Cisneros @ 2017-07-19  1:18 UTC (permalink / raw)
  To: linux-kernel, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Kees Kook, Sudeep Holla, Alexander Shishkin, Wang Nan,
	Elena Reshetova, Stephane Eranian, Paul Turner,
	David Carrillo-Cisneros

Atomic reference counters were replaced by refcount_t in
  commit 79c5fe6db8c7 ("perf/core: Fix error handling in perf_event_alloc()")

In util/cgroup.c atomic_inc was replaced by refcount_inc, but the latter
is not mean to initiliaze refcounts with zero value. Add a path
to initialize cgrp->refcnt == 0 using refcount_set.

Before this patch:

  $ perf stat -e cycles -C 0 -G /
  perf_before: /usr/local/.../tools/include/linux/refcount.h:108: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed.
  Aborted (core dumped)

After this patch:

  $ perf stat -e cycles -C 0 -G /
  Performance counter stats for 'CPU(s) 0':
     17,516,664      cycles                    /

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Change-Id: I8f00f61aaecce876e7df448bd7f850b20db13ef1
---
 tools/perf/util/cgroup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 03347748f3fa..7bbc19b3caf3 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -133,7 +133,10 @@ static int add_cgroup(struct perf_evlist *evlist, char *str)
 
 	return -1;
 found:
-	refcount_inc(&cgrp->refcnt);
+	if (refcount_read(&cgrp->refcnt) == 0)
+		refcount_set(&cgrp->refcnt, 1);
+	else
+		refcount_inc(&cgrp->refcnt);
 	counter->cgrp = cgrp;
 	return 0;
 }
-- 
2.13.2.932.g7449e964c-goog

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

* [PATCH 2/4] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile
  2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
  2017-07-19  1:18 ` [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set David Carrillo-Cisneros
@ 2017-07-19  1:18 ` David Carrillo-Cisneros
  2017-07-26 17:22   ` [tip:perf/core] " tip-bot for David Carrillo-Cisneros
  2017-07-19  1:18 ` [PATCH 3/4] perf annotate: Process tracing data in pipe mode David Carrillo-Cisneros
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: David Carrillo-Cisneros @ 2017-07-19  1:18 UTC (permalink / raw)
  To: linux-kernel, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Kees Kook, Sudeep Holla, Alexander Shishkin, Wang Nan,
	Elena Reshetova, Stephane Eranian, Paul Turner,
	David Carrillo-Cisneros

The goal is to allow users to override linking of libraries that
were automatically added to PERFLIBS.

EXCLUDE_EXTLIBS contains linker flags to be removed from LIBS
while EXTRA_PERFLIBS contains linker flags to be added.

My use case is to force certain library to be build statically,
e.g. for libelf:

  EXCLUDE_EXTLIBS=-lelf EXTRA_PERFLIBS=path/libelf.a

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
 tools/perf/Makefile.perf | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 5008f51a08a2..100a6c1670c8 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -33,6 +33,11 @@ include ../scripts/utilities.mak
 #
 # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
 #
+# Define EXCLUDE_EXTLIBS=-lmylib to exclude libmylib from the auto-generated
+# EXTLIBS.
+#
+# Define EXTRA_PERFLIBS to pass extra libraries to PERFLIBS.
+#
 # Define NO_DWARF if you do not want debug-info analysis feature at all.
 #
 # Define WERROR=0 to disable treating any warnings as errors.
@@ -352,7 +357,8 @@ ifdef ASCIIDOC8
   export ASCIIDOC8
 endif
 
-LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+EXTLIBS := $(call filter-out,$(EXCLUDE_EXTLIBS),$(EXTLIBS))
+LIBS = -Wl,--whole-archive $(PERFLIBS) $(EXTRA_PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
 ifeq ($(USE_CLANG), 1)
   CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization
-- 
2.13.2.932.g7449e964c-goog

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

* [PATCH 3/4] perf annotate: Process tracing data in pipe mode
  2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
  2017-07-19  1:18 ` [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set David Carrillo-Cisneros
  2017-07-19  1:18 ` [PATCH 2/4] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile David Carrillo-Cisneros
@ 2017-07-19  1:18 ` David Carrillo-Cisneros
  2017-07-26 17:22   ` [tip:perf/core] " tip-bot for David Carrillo-Cisneros
  2017-07-19  1:18 ` [PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled David Carrillo-Cisneros
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: David Carrillo-Cisneros @ 2017-07-19  1:18 UTC (permalink / raw)
  To: linux-kernel, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Kees Kook, Sudeep Holla, Alexander Shishkin, Wang Nan,
	Elena Reshetova, Stephane Eranian, Paul Turner,
	David Carrillo-Cisneros

perf annotate was missing the handler for tracing data records.

Prior to this patch we obtained "unhandled" records when piping
trace events to perf annotate (using -D option to show the
dump_printf messages in process_event_synth_tracing_data_stub):

  $ perf record -o - -e block:bio_free sleep 2 | perf annotate -D --stdio
  ...
  0x78 [0xc]: PERF_RECORD_TRACING_DATA: unhandled!
  ...

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
 tools/perf/builtin-annotate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 5205408e795b..ffe28002dc4f 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -397,6 +397,7 @@ int cmd_annotate(int argc, const char **argv)
 			.namespaces = perf_event__process_namespaces,
 			.attr	= perf_event__process_attr,
 			.build_id = perf_event__process_build_id,
+			.tracing_data   = perf_event__process_tracing_data,
 			.feature	= perf_event__process_feature,
 			.ordered_events = true,
 			.ordering_requires_timestamps = true,
-- 
2.13.2.932.g7449e964c-goog

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

* [PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled
  2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
                   ` (2 preceding siblings ...)
  2017-07-19  1:18 ` [PATCH 3/4] perf annotate: Process tracing data in pipe mode David Carrillo-Cisneros
@ 2017-07-19  1:18 ` David Carrillo-Cisneros
  2017-07-26 17:23   ` [tip:perf/core] perf jvmti: " tip-bot for Sudeep Holla
  2017-07-19  8:45 ` [PATCH 0/4] Resubmitted forgotten patches Jiri Olsa
  2017-07-21 17:00 ` Arnaldo Carvalho de Melo
  5 siblings, 1 reply; 11+ messages in thread
From: David Carrillo-Cisneros @ 2017-07-19  1:18 UTC (permalink / raw)
  To: linux-kernel, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Kees Kook, Sudeep Holla, Alexander Shishkin, Wang Nan,
	Elena Reshetova, Stephane Eranian, Paul Turner, Peter Zijlstra,
	Ingo Molnar, Sudeep Holla

From: Sudeep Holla <Sudeep.Holla@arm.com>

When libelf is disabled in the configuration, we get the following
linker error:
  LINK     libperf-jvmti.so
  ld: cannot find -lelf
  Makefile.perf:515: recipe for target 'libperf-jvmti.so' failed

Jiri pointed out that both librt and libelf are not really required. So
this patch fixes the linker error by getting rid of unwanted libraries
in the linker stage.

Fixes: 209045adc2bb ("perf tools: add JVMTI agent library")
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: David Carrillo-Cisneros <davidcc@google.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 100a6c1670c8..d66f90e6be5c 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -518,7 +518,7 @@ $(LIBJVMTI_IN): FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti
 
 $(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN)
-	$(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< -lelf -lrt
+	$(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $<
 endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
-- 
2.13.2.932.g7449e964c-goog

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

* Re: [PATCH 0/4] Resubmitted forgotten patches
  2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
                   ` (3 preceding siblings ...)
  2017-07-19  1:18 ` [PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled David Carrillo-Cisneros
@ 2017-07-19  8:45 ` Jiri Olsa
  2017-07-21 17:00 ` Arnaldo Carvalho de Melo
  5 siblings, 0 replies; 11+ messages in thread
From: Jiri Olsa @ 2017-07-19  8:45 UTC (permalink / raw)
  To: David Carrillo-Cisneros
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Jiri Olsa, Kees Kook,
	Sudeep Holla, Alexander Shishkin, Wang Nan, Elena Reshetova,
	Stephane Eranian, Paul Turner

On Tue, Jul 18, 2017 at 06:18:35PM -0700, David Carrillo-Cisneros wrote:
> Pickup some small fixes that have been forgotten.
> 
> David Carrillo-Cisneros (3):
>   perf tool cgroup: Initialize cgroup refcnt with refcount_set
>   perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile
>   perf annotate: Process tracing data in pipe mode
> 
> Sudeep Holla (1):
>   tools: perf: Fix linker error when libelf config is disabled

for patchset:

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

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

* Re: [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set
  2017-07-19  1:18 ` [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set David Carrillo-Cisneros
@ 2017-07-21 16:55   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-07-21 16:55 UTC (permalink / raw)
  To: David Carrillo-Cisneros
  Cc: linux-kernel, Jiri Olsa, Kees Kook, Sudeep Holla,
	Alexander Shishkin, Wang Nan, Elena Reshetova, Stephane Eranian,
	Paul Turner

Em Tue, Jul 18, 2017 at 06:18:36PM -0700, David Carrillo-Cisneros escreveu:
> Atomic reference counters were replaced by refcount_t in
>   commit 79c5fe6db8c7 ("perf/core: Fix error handling in perf_event_alloc()")
> 
> In util/cgroup.c atomic_inc was replaced by refcount_inc, but the latter
> is not mean to initiliaze refcounts with zero value. Add a path
> to initialize cgrp->refcnt == 0 using refcount_set.
> 
> Before this patch:
> 
>   $ perf stat -e cycles -C 0 -G /
>   perf_before: /usr/local/.../tools/include/linux/refcount.h:108: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed.
>   Aborted (core dumped)
> 
> After this patch:
> 
>   $ perf stat -e cycles -C 0 -G /
>   Performance counter stats for 'CPU(s) 0':
>      17,516,664      cycles                    /

Ok, so this one was also reported by Brendan and I came up with an
alternative patch, that follows the usual sequence of steps, see below.

- Arnaldo

commit b13ca9843c4ea07c5a1dbf0295986b5dfeb6ef6f
Author: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Date:   Tue Jul 18 20:20:19 2017 -0300

    perf cgroup: Fix refcount usage
    
    When converting from atomic_t to refcount_t we didn't follow the usual
    step of initializing it to one before taking any new reference, which
    trips over checking if taking a reference for a freed refcount_t, fix
    it.
    
    Brendan's report:
    
     ---
    It's 4.12-rc7, with node v4.4.1. I'm building 4.13-rc1 now, as I hit
    what I think is another unrelated perf bug and I'm starting to wonder
    what else is broken on that version:
    
    (root) /mnt/src/linux-4.12-rc7/tools/perf # ./perf record -F 99 -a -e
    cpu-clock --cgroup=docker/f9e9d5df065b14646e8a11edc837a13877fd90c171137b2ba3feb67a0201cb65
    -g
    perf: /mnt/src/linux-4.12-rc7/tools/include/linux/refcount.h:108:
    refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed.
    Aborted
    
    that used to work...
     ---
    
    Testing it:
    
    Before:
    
      # perf stat -e cycles -C 0 --cgroup /
      perf: /home/acme/git/linux/tools/include/linux/refcount.h:108: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed.
      Aborted (core dumped)
      #
    
    After:
    
      # perf stat -e cycles -C 0 --cgroup /
    ^C
      Performance counter stats for 'CPU(s) 0':
    
           132,081,393      cycles                    /
    
           2.492942763 seconds time elapsed
    
      #
    
    Reported-by: Brendan Gregg <brendan.d.gregg@gmail.com>
    Acked-by: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: David Carrillo-Cisneros <davidcc@google.com>
    Cc: Kees Kook <keescook@chromium.org>
    Cc: Krister Johansen <kjlx@templeofstupid.com>
    Cc: Paul Turner <pjt@google.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Sudeep Holla <Sudeep.Holla@arm.com>
    Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
    Cc: Wang Nan <wangnan0@huawei.com>
    Fixes: 79c5fe6db8c7 ("perf cgroup: Convert cgroup_sel.refcnt from atomic_t to refcount_t")
    Link: http://lkml.kernel.org/n/tip-l7ovfblq14ip2i08m1g0fkhv@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 03347748f3fa..0e77bc9e5f3c 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -98,8 +98,10 @@ static int add_cgroup(struct perf_evlist *evlist, char *str)
 		cgrp = counter->cgrp;
 		if (!cgrp)
 			continue;
-		if (!strcmp(cgrp->name, str))
+		if (!strcmp(cgrp->name, str)) {
+			refcount_inc(&cgrp->refcnt);
 			break;
+		}
 
 		cgrp = NULL;
 	}
@@ -110,6 +112,7 @@ static int add_cgroup(struct perf_evlist *evlist, char *str)
 			return -1;
 
 		cgrp->name = str;
+		refcount_set(&cgrp->refcnt, 1);
 
 		cgrp->fd = open_cgroup(str);
 		if (cgrp->fd == -1) {
@@ -128,12 +131,11 @@ static int add_cgroup(struct perf_evlist *evlist, char *str)
 			goto found;
 		n++;
 	}
-	if (refcount_read(&cgrp->refcnt) == 0)
+	if (refcount_dec_and_test(&cgrp->refcnt))
 		free(cgrp);
 
 	return -1;
 found:
-	refcount_inc(&cgrp->refcnt);
 	counter->cgrp = cgrp;
 	return 0;
 }

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

* Re: [PATCH 0/4] Resubmitted forgotten patches
  2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
                   ` (4 preceding siblings ...)
  2017-07-19  8:45 ` [PATCH 0/4] Resubmitted forgotten patches Jiri Olsa
@ 2017-07-21 17:00 ` Arnaldo Carvalho de Melo
  5 siblings, 0 replies; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-07-21 17:00 UTC (permalink / raw)
  To: David Carrillo-Cisneros
  Cc: linux-kernel, Jiri Olsa, Kees Kook, Sudeep Holla,
	Alexander Shishkin, Wang Nan, Elena Reshetova, Stephane Eranian,
	Paul Turner

Em Tue, Jul 18, 2017 at 06:18:35PM -0700, David Carrillo-Cisneros escreveu:
> Pickup some small fixes that have been forgotten.

Thanks, applied 2-4, and sent the alternative patch for 1/4 for your
information.

- Arnaldo

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

* [tip:perf/core] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile
  2017-07-19  1:18 ` [PATCH 2/4] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile David Carrillo-Cisneros
@ 2017-07-26 17:22   ` tip-bot for David Carrillo-Cisneros
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for David Carrillo-Cisneros @ 2017-07-26 17:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: eranian, tglx, sudeep.holla, hpa, pjt, mingo, jolsa,
	linux-kernel, davidcc, acme, elena.reshetova, alexander.shishkin,
	wangnan0, keescook

Commit-ID:  cb281fea4b0a326d2a2104f8ffae2b6895c561fd
Gitweb:     http://git.kernel.org/tip/cb281fea4b0a326d2a2104f8ffae2b6895c561fd
Author:     David Carrillo-Cisneros <davidcc@google.com>
AuthorDate: Tue, 18 Jul 2017 18:18:37 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 25 Jul 2017 11:23:51 -0300

perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile

The goal is to allow users to override linking of libraries that
were automatically added to PERFLIBS.

EXCLUDE_EXTLIBS contains linker flags to be removed from LIBS
while EXTRA_PERFLIBS contains linker flags to be added.

My use case is to force certain library to be build statically,
e.g. for libelf:

  EXCLUDE_EXTLIBS=-lelf EXTRA_PERFLIBS=path/libelf.a

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Kees Kook <keescook@chromium.org>
Cc: Paul Turner <pjt@google.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170719011839.99399-3-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 5008f51..100a6c1 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -33,6 +33,11 @@ include ../scripts/utilities.mak
 #
 # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
 #
+# Define EXCLUDE_EXTLIBS=-lmylib to exclude libmylib from the auto-generated
+# EXTLIBS.
+#
+# Define EXTRA_PERFLIBS to pass extra libraries to PERFLIBS.
+#
 # Define NO_DWARF if you do not want debug-info analysis feature at all.
 #
 # Define WERROR=0 to disable treating any warnings as errors.
@@ -352,7 +357,8 @@ ifdef ASCIIDOC8
   export ASCIIDOC8
 endif
 
-LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+EXTLIBS := $(call filter-out,$(EXCLUDE_EXTLIBS),$(EXTLIBS))
+LIBS = -Wl,--whole-archive $(PERFLIBS) $(EXTRA_PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
 
 ifeq ($(USE_CLANG), 1)
   CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization

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

* [tip:perf/core] perf annotate: Process tracing data in pipe mode
  2017-07-19  1:18 ` [PATCH 3/4] perf annotate: Process tracing data in pipe mode David Carrillo-Cisneros
@ 2017-07-26 17:22   ` tip-bot for David Carrillo-Cisneros
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for David Carrillo-Cisneros @ 2017-07-26 17:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: pjt, jolsa, mingo, alexander.shishkin, davidcc, sudeep.holla,
	elena.reshetova, hpa, tglx, acme, wangnan0, linux-kernel,
	eranian, keescook

Commit-ID:  f4849599086c6462d65543637058c9b55f4803e4
Gitweb:     http://git.kernel.org/tip/f4849599086c6462d65543637058c9b55f4803e4
Author:     David Carrillo-Cisneros <davidcc@google.com>
AuthorDate: Tue, 18 Jul 2017 18:18:38 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 25 Jul 2017 11:23:52 -0300

perf annotate: Process tracing data in pipe mode

'perf annotate' was missing the handler for tracing data records.

Prior to this patch we obtained "unhandled" records when piping trace
events to perf annotate (using -D option to show the dump_printf
messages in process_event_synth_tracing_data_stub):

  $ perf record -o - -e block:bio_free sleep 2 | perf annotate -D --stdio
  ...
  0x78 [0xc]: PERF_RECORD_TRACING_DATA: unhandled!
  ...

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Kees Kook <keescook@chromium.org>
Cc: Paul Turner <pjt@google.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170719011839.99399-4-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-annotate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 7e33278..6db782d 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -396,6 +396,7 @@ int cmd_annotate(int argc, const char **argv)
 			.namespaces = perf_event__process_namespaces,
 			.attr	= perf_event__process_attr,
 			.build_id = perf_event__process_build_id,
+			.tracing_data   = perf_event__process_tracing_data,
 			.feature	= perf_event__process_feature,
 			.ordered_events = true,
 			.ordering_requires_timestamps = true,

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

* [tip:perf/core] perf jvmti: Fix linker error when libelf config is disabled
  2017-07-19  1:18 ` [PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled David Carrillo-Cisneros
@ 2017-07-26 17:23   ` tip-bot for Sudeep Holla
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Sudeep Holla @ 2017-07-26 17:23 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, keescook, mingo, peterz, Sudeep.Holla, tglx,
	alexander.shishkin, elena.reshetova, acme, wangnan0, davidcc,
	eranian, pjt, linux-kernel, sudeep.holla, hpa

Commit-ID:  5d90faf45427dd76fadbe7a4dc4fce3b6f87b550
Gitweb:     http://git.kernel.org/tip/5d90faf45427dd76fadbe7a4dc4fce3b6f87b550
Author:     Sudeep Holla <Sudeep.Holla@arm.com>
AuthorDate: Tue, 18 Jul 2017 18:18:39 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 25 Jul 2017 11:23:53 -0300

perf jvmti: Fix linker error when libelf config is disabled

When libelf is disabled in the configuration, we get the following
linker error:

  LINK     libperf-jvmti.so
  ld: cannot find -lelf
  Makefile.perf:515: recipe for target 'libperf-jvmti.so' failed

Jiri pointed out that both librt and libelf are not really required. So
this patch fixes the linker error by getting rid of unwanted libraries
in the linker stage.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: David Carrillo-Cisneros <davidcc@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Kees Kook <keescook@chromium.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 209045adc2bb ("perf tools: add JVMTI agent library")
Link: http://lkml.kernel.org/r/20170719011839.99399-5-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 100a6c1..d66f90e 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -518,7 +518,7 @@ $(LIBJVMTI_IN): FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti
 
 $(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN)
-	$(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< -lelf -lrt
+	$(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $<
 endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)

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

end of thread, other threads:[~2017-07-26 17:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19  1:18 [PATCH 0/4] Resubmitted forgotten patches David Carrillo-Cisneros
2017-07-19  1:18 ` [PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set David Carrillo-Cisneros
2017-07-21 16:55   ` Arnaldo Carvalho de Melo
2017-07-19  1:18 ` [PATCH 2/4] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile David Carrillo-Cisneros
2017-07-26 17:22   ` [tip:perf/core] " tip-bot for David Carrillo-Cisneros
2017-07-19  1:18 ` [PATCH 3/4] perf annotate: Process tracing data in pipe mode David Carrillo-Cisneros
2017-07-26 17:22   ` [tip:perf/core] " tip-bot for David Carrillo-Cisneros
2017-07-19  1:18 ` [PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled David Carrillo-Cisneros
2017-07-26 17:23   ` [tip:perf/core] perf jvmti: " tip-bot for Sudeep Holla
2017-07-19  8:45 ` [PATCH 0/4] Resubmitted forgotten patches Jiri Olsa
2017-07-21 17: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.