lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7b4b82bced0755aecc026d8c14c2608aa0f9e89b@git.kernel.org>
Date:   Wed, 23 Nov 2016 20:15:30 -0800
From:   tip-bot for Jiri Olsa <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     namhyung@...nel.org, jmario@...hat.com, dzickus@...hat.com,
        dsahern@...il.com, mingo@...nel.org, a.p.zijlstra@...llo.nl,
        jolsa@...hat.com, jolsa@...nel.org, hpa@...or.com,
        linux-kernel@...r.kernel.org, andi@...stfloor.org,
        tglx@...utronix.de, acme@...hat.com
Subject: [tip:perf/core] perf tools: Show event fd in debug output

Commit-ID:  7b4b82bced0755aecc026d8c14c2608aa0f9e89b
Gitweb:     http://git.kernel.org/tip/7b4b82bced0755aecc026d8c14c2608aa0f9e89b
Author:     Jiri Olsa <jolsa@...nel.org>
AuthorDate: Mon, 21 Nov 2016 22:33:26 +0100
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 23 Nov 2016 10:44:03 -0300

perf tools: Show event fd in debug output

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@...hat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Joe Mario <jmario@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1479764011-10732-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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 e58a2fb..b2365a63 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1481,7 +1481,7 @@ retry_sample_id:
 
 			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 @@ retry_open:
 								     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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ