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


Groups > linux.kernel > #1528584

[PATCH 06/18] perf tools: Show event fd in debug output

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 06/18] perf tools: Show event fd in debug output
Date 2016-11-23 17:50 +0100
Message-ID <sGIUb-7ig-51@gated-at.bofh.it> (permalink)
References <sGIU9-7ig-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Jiri Olsa <jolsa@kernel.org>

It is useful for debug to see file descriptors for each event.

Before:

  $ perf stat -vvv -e cycles,cache-misses ls
  ...
  sys_perf_event_open: pid 12146  cpu -1  group_fd -1  flags 0x8
  ...
  sys_perf_event_open: pid 12146  cpu -1  group_fd 3  flags 0x8
  sys_perf_event_open failed, error -13

Now:

  $ perf stat -vvv -e cycles,cache-misses ls
  ...
  sys_perf_event_open: pid 12858  cpu -1  group_fd -1  flags 0x8 = 3
  ...
  sys_perf_event_open: pid 12858  cpu -1  group_fd 3  flags 0x8
  sys_perf_event_open failed, error -13

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1479764011-10732-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index e58a2fbf3b16..b2365a63db45 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1481,7 +1481,7 @@ static int __perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
 
 			group_fd = get_group_fd(evsel, cpu, thread);
 retry_open:
-			pr_debug2("sys_perf_event_open: pid %d  cpu %d  group_fd %d  flags %#lx\n",
+			pr_debug2("sys_perf_event_open: pid %d  cpu %d  group_fd %d  flags %#lx",
 				  pid, cpus->map[cpu], group_fd, flags);
 
 			FD(evsel, cpu, thread) = sys_perf_event_open(&evsel->attr,
@@ -1490,11 +1490,13 @@ static int __perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus,
 								     group_fd, flags);
 			if (FD(evsel, cpu, thread) < 0) {
 				err = -errno;
-				pr_debug2("sys_perf_event_open failed, error %d\n",
+				pr_debug2("\nsys_perf_event_open failed, error %d\n",
 					  err);
 				goto try_fallback;
 			}
 
+			pr_debug2(" = %d\n", FD(evsel, cpu, thread));
+
 			if (evsel->bpf_fd >= 0) {
 				int evt_fd = FD(evsel, cpu, thread);
 				int bpf_fd = evsel->bpf_fd;
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 12/18] perf symbols: Print symbol offsets conditionally Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 06/18] perf tools: Show event fd in debug output Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 11/18] perf c2c: Support cascading options Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 13/18] perf evsel: Support printing callchains with arrows Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 14/18] perf sched timehist: Introduce timehist command Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 10/18] perf c2c report: Display total HITMs on default Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 01/18] perf annotate: Start supporting cross arch annotation Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 02/18] perf annotate: Allow arches to specify functions to skip Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 03/18] perf annotate: Add per arch instructions annotate handlers Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 17/18] perf sched timehist: Add call graph options Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  [PATCH 15/18] perf sched timehist: Add summary options Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-23 17:50 +0100
  Re: [GIT PULL 00/18] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-11-24 05:20 +0100

csiph-web