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


Groups > linux.kernel > #1691722 > unrolled thread

[GIT PULL 00/86] perf/core improvements and fixes

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2017-07-19 16:40 +0200
Last post2017-07-20 10:40 +0200
Articles 5 on this page of 85 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [GIT PULL 00/86] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 31/86] tools include uapi x86: Grab a copy of unistd.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 41/86] perf record: Do not ask for precise_ip with --no-samples Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 70/86] perf header: Use struct feat_fd for print Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 63/86] perf report: Enable finding kernel inline functions Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 81/86] perf/x86/intel: Record branch type Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 50/86] perf tests attr: Add proper return values Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 61/86] perf trace beauty fcntl: Beautify the 'arg' for DUPFD Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 71/86] perf header: Use struct feat_fd to process header records Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 52/86] perf tests attr: Fix sample_period setup Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 49/86] perf tests attr: Fix no-delay test Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 35/86] perf maps: Lookup maps in both intitial mountns and inner mountns. Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 57/86] perf trace beauty fcntl: Beautify F_GETLEASE and F_SETLEASE arg/return Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 38/86] perf buildid-cache: Cache debuginfo Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 84/86] perf util: Create branch.c/.h for common branch functions Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 77/86] perf tool: Add show_feature_header to perf_tool Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 25/86] perf trace beauty fcntl: Augment the return of F_DUPFD(_CLOEXEC) Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 05/86] tools: Update include/uapi/linux/fcntl.h copy from the kernel Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 09/86] perf trace beauty: Allow accessing syscall args values in a syscall arg formatter Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 78/86] perf tools: Add feature header record to pipe-mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 66/86] perf header: Fail on write_padded error Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 30/86] perf vendor events: Add POWER9 PVRs to mapfile Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 83/86] perf report: Refactor the branch info printing code Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 79/86] perf header: Add event desc to pipe-mode header Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 11/86] perf trace beauty: Introduce syscall arg beautifier for long integers Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 22/86] perf trace beauty fcntl: Beautify F_[GS]ETFD arg/return value Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 47/86] perf tests attr: Add 1s for exclude_kernel and task base bits Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 86/86] perf report: Show branch type in callchain entry Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 33/86] tools build: Add test for setns() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 17/86] perf trace beauty open flags: Support O_TMPFILE and O_NOFOLLOW Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 54/86] perf tests attr: Fix stat sample_type setup Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 65/86] perf header: Add PROCESS_STR_FUN macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 62/86] perf trace beauty: Simplify syscall return formatting Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 85/86] perf report: Show branch type statistics for stdio mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 18/86] perf trace beauty open flags: Do not depend on the system's O_LARGEFILE define Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 67/86] perf util: Add const modifier to buf in "writen" function Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 55/86] perf tests attr: Add optional term Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 48/86] perf tests attr: Fix record dwarf test Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 53/86] perf tests attr: Fix precise_ip setup Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 69/86] perf header: Add struct feat_fd for write Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 51/86] perf tests attr: Fix cpu test disabled term setup Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 40/86] perf evlist: Allow asking for max precise_ip in add_default() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 76/86] perf header: Change FEAT_OP* macros Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 45/86] perf tests attr: Make compare_data global Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 15/86] perf beauty open: Detach the syscall_arg agnostic bits from the flags formatter Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 32/86] tools include uapi x86: Add __NR_setns, if missing Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 14/86] perf trace: Beautify new write hint fcntl commands Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 73/86] perf header: Use struct feat_fd in read header records Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 10/86] perf trace beauty: Export the "int" and "hex" syscall arg formatters Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 74/86] perf header: Make write_pmu_mappings pipe-mode friendly Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 60/86] perf trace beauty fcntl: Do not suppress 'cmd' when zero, should be DUPFD Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 72/86] perf header: Don't pass struct perf_file_section to process_##_feat Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 19/86] perf trace beauty fcntl: Beautify F_GETFL return value Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 46/86] perf tests attr: Rename compare_data to data_equal Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 43/86] perf tests attr: Do not store failed events Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 02/86] perf annotate: Implement visual marker for macro fusion Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 04/86] perf trace: Beautify linux specific fcntl commands Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 36/86] perf probe: Allow placing uprobes in alternate namespaces. Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 23/86] perf trace beauty: Give syscall return beautifier more context Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 58/86] perf trace: Group per syscall arg formatter info into one struct Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 07/86] perf trace: Only build tools/perf/trace/beauty/ when building 'perf trace' Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 75/86] perf header: Add a buffer to struct feat_fd Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 28/86] perf pmu-events: Support additional POWER8+ PVR in mapfile Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 06/86] perf trace beauty: Export the strarrays scnprintf method Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 68/86] perf header: Revamp do_write() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 64/86] perf header: Encapsulate read and swap Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 03/86] perf trace: Remove F_ from some of the fcntl command strings Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 26/86] perf trace beauty: Export the pid beautifier for use in more places Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 20/86] perf trace beauty open flags: Move RDRW to the start of the output Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 01/86] perf annotate: Check for fused instructions Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 27/86] perf trace beauty fcntl: Beautify F_GETOWN and F_SETOWN Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 56/86] perf trace beauty: Export strarray for use in per-object beautifiers Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 82/86] perf record: Create a new option save_type in --branch-filter Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 13/86] perf trace beauty fcntl: Basic 'arg' beautifier Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:40 +0200
    [PATCH 34/86] perf symbols: Find symbols in different mount namespace Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 44/86] perf tests attr: Add test_attr__ready function Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 80/86] perf/core: Define the common branch type classification Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 59/86] perf trace: Allow syscall arg formatters to request non suppression of zeros Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 39/86] perf evsel: Allow asking for max precise_ip in new_cycles() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 42/86] perf test sdt: Handle realpath() failure Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 37/86] perf buildid-cache: Support binary objects from other namespaces Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 16:50 +0200
    [PATCH 21/86] perf trace beauty fcntl flags: Beautify F_SETFL arg Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 17:00 +0200
    [PATCH 24/86] perf trace beauty: Export the fd beautifier for use in more places Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 17:00 +0200
    [PATCH 12/86] tools include uapi asm-generic: Grab a copy of fcntl.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-19 17:00 +0200
    Re: [GIT PULL 00/86] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2017-07-20 10:40 +0200

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#1691810 — [PATCH 37/86] perf buildid-cache: Support binary objects from other namespaces

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-07-19 16:50 +0200
Subject[PATCH 37/86] perf buildid-cache: Support binary objects from other namespaces
Message-ID<u4Ysy-1t8-25@gated-at.bofh.it>
In reply to#1691722
From: Krister Johansen <kjlx@templeofstupid.com>

Teach buildid-cache how to add, remove, and update binary objects from
other mount namespaces.  Allow probe events tracing binaries in
different namespaces to add their objects to the probe and build-id
caches too.  As a handy side effect, this also lets us access SDT probes
in binaries from alternate mount namespaces.

Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1499305693-1599-5-git-send-email-kjlx@templeofstupid.com
[ Add util/namespaces.c to tools/perf/util/python-ext-sources, to fix the python binding 'perf test' ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-buildid-cache.txt |  5 +++
 tools/perf/Documentation/perf-probe.txt         |  5 +++
 tools/perf/builtin-buildid-cache.c              | 52 ++++++++++++++++++-------
 tools/perf/builtin-probe.c                      |  2 +-
 tools/perf/tests/sdt.c                          |  4 +-
 tools/perf/util/build-id.c                      | 47 ++++++++++++++--------
 tools/perf/util/build-id.h                      |  9 +++--
 tools/perf/util/dso.c                           | 12 +++++-
 tools/perf/util/parse-events.c                  |  2 +-
 tools/perf/util/probe-event.c                   |  6 +--
 tools/perf/util/probe-file.c                    | 19 +++++----
 tools/perf/util/probe-file.h                    |  4 +-
 tools/perf/util/python-ext-sources              |  1 +
 tools/perf/util/symbol.c                        | 19 ++++++---
 tools/perf/util/util.c                          | 34 +++++++++++++---
 tools/perf/util/util.h                          |  2 +
 16 files changed, 160 insertions(+), 63 deletions(-)

diff --git a/tools/perf/Documentation/perf-buildid-cache.txt b/tools/perf/Documentation/perf-buildid-cache.txt
index 058064db39d2..84681007f80f 100644
--- a/tools/perf/Documentation/perf-buildid-cache.txt
+++ b/tools/perf/Documentation/perf-buildid-cache.txt
@@ -61,6 +61,11 @@ OPTIONS
 --verbose::
 	Be more verbose.
 
+--target-ns=PID:
+	Obtain mount namespace information from the target pid.  This is
+	used when creating a uprobe for a process that resides in a
+	different mount namespace from the perf(1) utility.
+
 SEE ALSO
 --------
 linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-buildid-list[1]
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index a42aabc2b082..d7e4869905f1 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -273,6 +273,11 @@ Add a uprobe to a target process running in a different mount namespace
 
  ./perf probe --target-ns <target pid> -x /lib64/libc.so.6 malloc
 
+Add a USDT probe to a target process running in a different mount namespace
+
+ ./perf probe --target-ns <target pid> -x /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64/server/libjvm.so %sdt_hotspot:thread__sleep__end
+
+
 SEE ALSO
 --------
 linkperf:perf-trace[1], linkperf:perf-record[1], linkperf:perf-buildid-cache[1]
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 9eba7f1add1f..d65bd86bee99 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -14,6 +14,7 @@
 #include <unistd.h>
 #include "builtin.h"
 #include "perf.h"
+#include "namespaces.h"
 #include "util/cache.h"
 #include "util/debug.h"
 #include "util/header.h"
@@ -165,33 +166,41 @@ static int build_id_cache__add_kcore(const char *filename, bool force)
 	return 0;
 }
 
-static int build_id_cache__add_file(const char *filename)
+static int build_id_cache__add_file(const char *filename, struct nsinfo *nsi)
 {
 	char sbuild_id[SBUILD_ID_SIZE];
 	u8 build_id[BUILD_ID_SIZE];
 	int err;
+	struct nscookie nsc;
 
-	if (filename__read_build_id(filename, &build_id, sizeof(build_id)) < 0) {
+	nsinfo__mountns_enter(nsi, &nsc);
+	err = filename__read_build_id(filename, &build_id, sizeof(build_id));
+	nsinfo__mountns_exit(&nsc);
+	if (err < 0) {
 		pr_debug("Couldn't read a build-id in %s\n", filename);
 		return -1;
 	}
 
 	build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
-	err = build_id_cache__add_s(sbuild_id, filename,
+	err = build_id_cache__add_s(sbuild_id, filename, nsi,
 				    false, false);
 	pr_debug("Adding %s %s: %s\n", sbuild_id, filename,
 		 err ? "FAIL" : "Ok");
 	return err;
 }
 
-static int build_id_cache__remove_file(const char *filename)
+static int build_id_cache__remove_file(const char *filename, struct nsinfo *nsi)
 {
 	u8 build_id[BUILD_ID_SIZE];
 	char sbuild_id[SBUILD_ID_SIZE];
+	struct nscookie nsc;
 
 	int err;
 
-	if (filename__read_build_id(filename, &build_id, sizeof(build_id)) < 0) {
+	nsinfo__mountns_enter(nsi, &nsc);
+	err = filename__read_build_id(filename, &build_id, sizeof(build_id));
+	nsinfo__mountns_exit(&nsc);
+	if (err < 0) {
 		pr_debug("Couldn't read a build-id in %s\n", filename);
 		return -1;
 	}
@@ -204,13 +213,13 @@ static int build_id_cache__remove_file(const char *filename)
 	return err;
 }
 
-static int build_id_cache__purge_path(const char *pathname)
+static int build_id_cache__purge_path(const char *pathname, struct nsinfo *nsi)
 {
 	struct strlist *list;
 	struct str_node *pos;
 	int err;
 
-	err = build_id_cache__list_build_ids(pathname, &list);
+	err = build_id_cache__list_build_ids(pathname, nsi, &list);
 	if (err)
 		goto out;
 
@@ -256,24 +265,30 @@ static int build_id_cache__fprintf_missing(struct perf_session *session, FILE *f
 	return 0;
 }
 
-static int build_id_cache__update_file(const char *filename)
+static int build_id_cache__update_file(const char *filename, struct nsinfo *nsi)
 {
 	u8 build_id[BUILD_ID_SIZE];
 	char sbuild_id[SBUILD_ID_SIZE];
+	struct nscookie nsc;
 
-	int err = 0;
+	int err;
 
-	if (filename__read_build_id(filename, &build_id, sizeof(build_id)) < 0) {
+	nsinfo__mountns_enter(nsi, &nsc);
+	err = filename__read_build_id(filename, &build_id, sizeof(build_id));
+	nsinfo__mountns_exit(&nsc);
+	if (err < 0) {
 		pr_debug("Couldn't read a build-id in %s\n", filename);
 		return -1;
 	}
+	err = 0;
 
 	build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
 	if (build_id_cache__cached(sbuild_id))
 		err = build_id_cache__remove_s(sbuild_id);
 
 	if (!err)
-		err = build_id_cache__add_s(sbuild_id, filename, false, false);
+		err = build_id_cache__add_s(sbuild_id, filename, nsi, false,
+					    false);
 
 	pr_debug("Updating %s %s: %s\n", sbuild_id, filename,
 		 err ? "FAIL" : "Ok");
@@ -286,6 +301,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 	struct strlist *list;
 	struct str_node *pos;
 	int ret = 0;
+	int ns_id = -1;
 	bool force = false;
 	char const *add_name_list_str = NULL,
 		   *remove_name_list_str = NULL,
@@ -299,6 +315,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 		.mode  = PERF_DATA_MODE_READ,
 	};
 	struct perf_session *session = NULL;
+	struct nsinfo *nsi = NULL;
 
 	const struct option buildid_cache_options[] = {
 	OPT_STRING('a', "add", &add_name_list_str,
@@ -315,6 +332,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 	OPT_STRING('u', "update", &update_name_list_str, "file list",
 		    "file(s) to update"),
 	OPT_INCR('v', "verbose", &verbose, "be more verbose"),
+	OPT_INTEGER(0, "target-ns", &ns_id, "target pid for namespace context"),
 	OPT_END()
 	};
 	const char * const buildid_cache_usage[] = {
@@ -330,6 +348,9 @@ int cmd_buildid_cache(int argc, const char **argv)
 		     !missing_filename && !update_name_list_str))
 		usage_with_options(buildid_cache_usage, buildid_cache_options);
 
+	if (ns_id > 0)
+		nsi = nsinfo__new(ns_id);
+
 	if (missing_filename) {
 		file.path = missing_filename;
 		file.force = force;
@@ -348,7 +369,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 		list = strlist__new(add_name_list_str, NULL);
 		if (list) {
 			strlist__for_each_entry(pos, list)
-				if (build_id_cache__add_file(pos->s)) {
+				if (build_id_cache__add_file(pos->s, nsi)) {
 					if (errno == EEXIST) {
 						pr_debug("%s already in the cache\n",
 							 pos->s);
@@ -366,7 +387,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 		list = strlist__new(remove_name_list_str, NULL);
 		if (list) {
 			strlist__for_each_entry(pos, list)
-				if (build_id_cache__remove_file(pos->s)) {
+				if (build_id_cache__remove_file(pos->s, nsi)) {
 					if (errno == ENOENT) {
 						pr_debug("%s wasn't in the cache\n",
 							 pos->s);
@@ -384,7 +405,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 		list = strlist__new(purge_name_list_str, NULL);
 		if (list) {
 			strlist__for_each_entry(pos, list)
-				if (build_id_cache__purge_path(pos->s)) {
+				if (build_id_cache__purge_path(pos->s, nsi)) {
 					if (errno == ENOENT) {
 						pr_debug("%s wasn't in the cache\n",
 							 pos->s);
@@ -405,7 +426,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 		list = strlist__new(update_name_list_str, NULL);
 		if (list) {
 			strlist__for_each_entry(pos, list)
-				if (build_id_cache__update_file(pos->s)) {
+				if (build_id_cache__update_file(pos->s, nsi)) {
 					if (errno == ENOENT) {
 						pr_debug("%s wasn't in the cache\n",
 							 pos->s);
@@ -424,6 +445,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 
 out:
 	perf_session__delete(session);
+	nsinfo__zput(nsi);
 
 	return ret;
 }
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 3fb98d59cd27..c0065923a525 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -416,7 +416,7 @@ static int del_perf_probe_caches(struct strfilter *filter)
 	}
 
 	strlist__for_each_entry(nd, bidlist) {
-		cache = probe_cache__new(nd->s);
+		cache = probe_cache__new(nd->s, NULL);
 		if (!cache)
 			continue;
 		if (probe_cache__filter_purge(cache, filter) < 0 ||
diff --git a/tools/perf/tests/sdt.c b/tools/perf/tests/sdt.c
index 06eda675ae2c..5abe8cea54e6 100644
--- a/tools/perf/tests/sdt.c
+++ b/tools/perf/tests/sdt.c
@@ -33,7 +33,7 @@ static int build_id_cache__add_file(const char *filename)
 	}
 
 	build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
-	err = build_id_cache__add_s(sbuild_id, filename, false, false);
+	err = build_id_cache__add_s(sbuild_id, filename, NULL, false, false);
 	if (err < 0)
 		pr_debug("Failed to add build id cache of %s\n", filename);
 	return err;
@@ -54,7 +54,7 @@ static char *get_self_path(void)
 static int search_cached_probe(const char *target,
 			       const char *group, const char *event)
 {
-	struct probe_cache *cache = probe_cache__new(target);
+	struct probe_cache *cache = probe_cache__new(target, NULL);
 	int ret = 0;
 
 	if (!cache) {
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index e0148b081bdf..f7bfd90a7388 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -534,13 +534,14 @@ char *build_id_cache__complement(const char *incomplete_sbuild_id)
 }
 
 char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
-			       bool is_kallsyms, bool is_vdso)
+			       struct nsinfo *nsi, bool is_kallsyms,
+			       bool is_vdso)
 {
 	char *realname = (char *)name, *filename;
 	bool slash = is_kallsyms || is_vdso;
 
 	if (!slash) {
-		realname = realpath(name, NULL);
+		realname = nsinfo__realpath(name, nsi);
 		if (!realname)
 			return NULL;
 	}
@@ -556,13 +557,13 @@ char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
 	return filename;
 }
 
-int build_id_cache__list_build_ids(const char *pathname,
+int build_id_cache__list_build_ids(const char *pathname, struct nsinfo *nsi,
 				   struct strlist **result)
 {
 	char *dir_name;
 	int ret = 0;
 
-	dir_name = build_id_cache__cachedir(NULL, pathname, false, false);
+	dir_name = build_id_cache__cachedir(NULL, pathname, nsi, false, false);
 	if (!dir_name)
 		return -ENOMEM;
 
@@ -576,16 +577,20 @@ int build_id_cache__list_build_ids(const char *pathname,
 
 #if defined(HAVE_LIBELF_SUPPORT) && defined(HAVE_GELF_GETNOTE_SUPPORT)
 static int build_id_cache__add_sdt_cache(const char *sbuild_id,
-					  const char *realname)
+					  const char *realname,
+					  struct nsinfo *nsi)
 {
 	struct probe_cache *cache;
 	int ret;
+	struct nscookie nsc;
 
-	cache = probe_cache__new(sbuild_id);
+	cache = probe_cache__new(sbuild_id, nsi);
 	if (!cache)
 		return -1;
 
+	nsinfo__mountns_enter(nsi, &nsc);
 	ret = probe_cache__scan_sdt(cache, realname);
+	nsinfo__mountns_exit(&nsc);
 	if (ret >= 0) {
 		pr_debug4("Found %d SDTs in %s\n", ret, realname);
 		if (probe_cache__commit(cache) < 0)
@@ -595,11 +600,11 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
 	return ret;
 }
 #else
-#define build_id_cache__add_sdt_cache(sbuild_id, realname) (0)
+#define build_id_cache__add_sdt_cache(sbuild_id, realname, nsi) (0)
 #endif
 
 int build_id_cache__add_s(const char *sbuild_id, const char *name,
-			  bool is_kallsyms, bool is_vdso)
+			  struct nsinfo *nsi, bool is_kallsyms, bool is_vdso)
 {
 	const size_t size = PATH_MAX;
 	char *realname = NULL, *filename = NULL, *dir_name = NULL,
@@ -607,13 +612,16 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 	int err = -1;
 
 	if (!is_kallsyms) {
-		realname = realpath(name, NULL);
+		if (!is_vdso)
+			realname = nsinfo__realpath(name, nsi);
+		else
+			realname = realpath(name, NULL);
 		if (!realname)
 			goto out_free;
 	}
 
-	dir_name = build_id_cache__cachedir(sbuild_id, name,
-					    is_kallsyms, is_vdso);
+	dir_name = build_id_cache__cachedir(sbuild_id, name, nsi, is_kallsyms,
+					    is_vdso);
 	if (!dir_name)
 		goto out_free;
 
@@ -634,7 +642,10 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 
 	if (access(filename, F_OK)) {
 		if (is_kallsyms) {
-			 if (copyfile("/proc/kallsyms", filename))
+			if (copyfile("/proc/kallsyms", filename))
+				goto out_free;
+		} else if (nsi && nsi->need_setns) {
+			if (copyfile_ns(name, filename, nsi))
 				goto out_free;
 		} else if (link(realname, filename) && errno != EEXIST &&
 				copyfile(name, filename))
@@ -657,7 +668,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 		err = 0;
 
 	/* Update SDT cache : error is just warned */
-	if (realname && build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
+	if (realname &&
+	    build_id_cache__add_sdt_cache(sbuild_id, realname, nsi) < 0)
 		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
 
 out_free:
@@ -670,14 +682,15 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 }
 
 static int build_id_cache__add_b(const u8 *build_id, size_t build_id_size,
-				 const char *name, bool is_kallsyms,
-				 bool is_vdso)
+				 const char *name, struct nsinfo *nsi,
+				 bool is_kallsyms, bool is_vdso)
 {
 	char sbuild_id[SBUILD_ID_SIZE];
 
 	build_id__sprintf(build_id, build_id_size, sbuild_id);
 
-	return build_id_cache__add_s(sbuild_id, name, is_kallsyms, is_vdso);
+	return build_id_cache__add_s(sbuild_id, name, nsi, is_kallsyms,
+				     is_vdso);
 }
 
 bool build_id_cache__cached(const char *sbuild_id)
@@ -743,7 +756,7 @@ static int dso__cache_build_id(struct dso *dso, struct machine *machine)
 		name = nm;
 	}
 	return build_id_cache__add_b(dso->build_id, sizeof(dso->build_id), name,
-				     is_kallsyms, is_vdso);
+				     dso->nsinfo, is_kallsyms, is_vdso);
 }
 
 static int __dsos__cache_build_ids(struct list_head *head,
diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h
index 96690a55c62c..23970847d4c4 100644
--- a/tools/perf/util/build-id.h
+++ b/tools/perf/util/build-id.h
@@ -5,6 +5,7 @@
 #define SBUILD_ID_SIZE	(BUILD_ID_SIZE * 2 + 1)
 
 #include "tool.h"
+#include "namespaces.h"
 #include <linux/types.h>
 
 extern struct perf_tool build_id__mark_dso_hit_ops;
@@ -31,17 +32,19 @@ int perf_session__cache_build_ids(struct perf_session *session);
 char *build_id_cache__origname(const char *sbuild_id);
 char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size);
 char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
-			       bool is_kallsyms, bool is_vdso);
+			       struct nsinfo *nsi, bool is_kallsyms,
+			       bool is_vdso);
 
 struct strlist;
 
 struct strlist *build_id_cache__list_all(bool validonly);
 char *build_id_cache__complement(const char *incomplete_sbuild_id);
-int build_id_cache__list_build_ids(const char *pathname,
+int build_id_cache__list_build_ids(const char *pathname, struct nsinfo *nsi,
 				   struct strlist **result);
 bool build_id_cache__cached(const char *sbuild_id);
 int build_id_cache__add_s(const char *sbuild_id,
-			  const char *name, bool is_kallsyms, bool is_vdso);
+			  const char *name, struct nsinfo *nsi,
+			  bool is_kallsyms, bool is_vdso);
 int build_id_cache__remove_s(const char *sbuild_id);
 
 extern char buildid_dir[];
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index beda40ed63b0..dc9b49533a8f 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -504,7 +504,14 @@ static void check_data_close(void);
  */
 static int open_dso(struct dso *dso, struct machine *machine)
 {
-	int fd = __open_dso(dso, machine);
+	int fd;
+	struct nscookie nsc;
+
+	if (dso->binary_type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
+		nsinfo__mountns_enter(dso->nsinfo, &nsc);
+	fd = __open_dso(dso, machine);
+	if (dso->binary_type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
+		nsinfo__mountns_exit(&nsc);
 
 	if (fd >= 0) {
 		dso__list_add(dso);
@@ -1302,6 +1309,7 @@ bool __dsos__read_build_ids(struct list_head *head, bool with_hits)
 {
 	bool have_build_id = false;
 	struct dso *pos;
+	struct nscookie nsc;
 
 	list_for_each_entry(pos, head, node) {
 		if (with_hits && !pos->hit && !dso__is_vdso(pos))
@@ -1310,11 +1318,13 @@ bool __dsos__read_build_ids(struct list_head *head, bool with_hits)
 			have_build_id = true;
 			continue;
 		}
+		nsinfo__mountns_enter(pos->nsinfo, &nsc);
 		if (filename__read_build_id(pos->long_name, pos->build_id,
 					    sizeof(pos->build_id)) > 0) {
 			have_build_id	  = true;
 			pos->has_build_id = true;
 		}
+		nsinfo__mountns_exit(&nsc);
 	}
 
 	return have_build_id;
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 01e779b91c8e..84e301073885 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2124,7 +2124,7 @@ void print_sdt_events(const char *subsys_glob, const char *event_glob,
 		return;
 	}
 	strlist__for_each_entry(nd, bidlist) {
-		pcache = probe_cache__new(nd->s);
+		pcache = probe_cache__new(nd->s, NULL);
 		if (!pcache)
 			continue;
 		list_for_each_entry(ent, &pcache->entries, node) {
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index a80895a7e611..d7cd1142f4c6 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2769,7 +2769,7 @@ static int __add_probe_trace_events(struct perf_probe_event *pev,
 	if (ret == -EINVAL && pev->uprobes)
 		warn_uprobe_event_compat(tev);
 	if (ret == 0 && probe_conf.cache) {
-		cache = probe_cache__new(pev->target);
+		cache = probe_cache__new(pev->target, pev->nsi);
 		if (!cache ||
 		    probe_cache__add_entry(cache, pev, tevs, ntevs) < 0 ||
 		    probe_cache__commit(cache) < 0)
@@ -3119,7 +3119,7 @@ static int find_cached_events(struct perf_probe_event *pev,
 	int ntevs = 0;
 	int ret = 0;
 
-	cache = probe_cache__new(target);
+	cache = probe_cache__new(target, pev->nsi);
 	/* Return 0 ("not found") if the target has no probe cache. */
 	if (!cache)
 		return 0;
@@ -3209,7 +3209,7 @@ static int find_probe_trace_events_from_cache(struct perf_probe_event *pev,
 		else
 			return find_cached_events(pev, tevs, pev->target);
 	}
-	cache = probe_cache__new(pev->target);
+	cache = probe_cache__new(pev->target, pev->nsi);
 	if (!cache)
 		return 0;
 
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index d679389e627c..cdf8d83a484c 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -412,13 +412,15 @@ int probe_cache_entry__get_event(struct probe_cache_entry *entry,
 }
 
 /* For the kernel probe caches, pass target = NULL or DSO__NAME_KALLSYMS */
-static int probe_cache__open(struct probe_cache *pcache, const char *target)
+static int probe_cache__open(struct probe_cache *pcache, const char *target,
+			     struct nsinfo *nsi)
 {
 	char cpath[PATH_MAX];
 	char sbuildid[SBUILD_ID_SIZE];
 	char *dir_name = NULL;
 	bool is_kallsyms = false;
 	int ret, fd;
+	struct nscookie nsc;
 
 	if (target && build_id_cache__cached(target)) {
 		/* This is a cached buildid */
@@ -431,8 +433,11 @@ static int probe_cache__open(struct probe_cache *pcache, const char *target)
 		target = DSO__NAME_KALLSYMS;
 		is_kallsyms = true;
 		ret = sysfs__sprintf_build_id("/", sbuildid);
-	} else
+	} else {
+		nsinfo__mountns_enter(nsi, &nsc);
 		ret = filename__sprintf_build_id(target, sbuildid);
+		nsinfo__mountns_exit(&nsc);
+	}
 
 	if (ret < 0) {
 		pr_debug("Failed to get build-id from %s.\n", target);
@@ -441,7 +446,7 @@ static int probe_cache__open(struct probe_cache *pcache, const char *target)
 
 	/* If we have no buildid cache, make it */
 	if (!build_id_cache__cached(sbuildid)) {
-		ret = build_id_cache__add_s(sbuildid, target,
+		ret = build_id_cache__add_s(sbuildid, target, nsi,
 					    is_kallsyms, NULL);
 		if (ret < 0) {
 			pr_debug("Failed to add build-id cache: %s\n", target);
@@ -449,7 +454,7 @@ static int probe_cache__open(struct probe_cache *pcache, const char *target)
 		}
 	}
 
-	dir_name = build_id_cache__cachedir(sbuildid, target, is_kallsyms,
+	dir_name = build_id_cache__cachedir(sbuildid, target, nsi, is_kallsyms,
 					    false);
 found:
 	if (!dir_name) {
@@ -554,7 +559,7 @@ void probe_cache__delete(struct probe_cache *pcache)
 	free(pcache);
 }
 
-struct probe_cache *probe_cache__new(const char *target)
+struct probe_cache *probe_cache__new(const char *target, struct nsinfo *nsi)
 {
 	struct probe_cache *pcache = probe_cache__alloc();
 	int ret;
@@ -562,7 +567,7 @@ struct probe_cache *probe_cache__new(const char *target)
 	if (!pcache)
 		return NULL;
 
-	ret = probe_cache__open(pcache, target);
+	ret = probe_cache__open(pcache, target, nsi);
 	if (ret < 0) {
 		pr_debug("Cache open error: %d\n", ret);
 		goto out_err;
@@ -974,7 +979,7 @@ int probe_cache__show_all_caches(struct strfilter *filter)
 		return -EINVAL;
 	}
 	strlist__for_each_entry(nd, bidlist) {
-		pcache = probe_cache__new(nd->s);
+		pcache = probe_cache__new(nd->s, NULL);
 		if (!pcache)
 			continue;
 		if (!list_empty(&pcache->entries)) {
diff --git a/tools/perf/util/probe-file.h b/tools/perf/util/probe-file.h
index 5ecc9d3925db..2ca4163abafe 100644
--- a/tools/perf/util/probe-file.h
+++ b/tools/perf/util/probe-file.h
@@ -51,7 +51,7 @@ int probe_file__del_strlist(int fd, struct strlist *namelist);
 int probe_cache_entry__get_event(struct probe_cache_entry *entry,
 				 struct probe_trace_event **tevs);
 
-struct probe_cache *probe_cache__new(const char *target);
+struct probe_cache *probe_cache__new(const char *target, struct nsinfo *nsi);
 int probe_cache__add_entry(struct probe_cache *pcache,
 			   struct perf_probe_event *pev,
 			   struct probe_trace_event *tevs, int ntevs);
@@ -69,7 +69,7 @@ int probe_cache__show_all_caches(struct strfilter *filter);
 bool probe_type_is_available(enum probe_type type);
 bool kretprobe_offset_is_supported(void);
 #else	/* ! HAVE_LIBELF_SUPPORT */
-static inline struct probe_cache *probe_cache__new(const char *tgt __maybe_unused)
+static inline struct probe_cache *probe_cache__new(const char *tgt __maybe_unused, struct nsinfo *nsi __maybe_unused)
 {
 	return NULL;
 }
diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources
index 9f3b0d9754a8..e66dc495809a 100644
--- a/tools/perf/util/python-ext-sources
+++ b/tools/perf/util/python-ext-sources
@@ -10,6 +10,7 @@ util/ctype.c
 util/evlist.c
 util/evsel.c
 util/cpumap.c
+util/namespaces.c
 ../lib/bitmap.c
 ../lib/find_bit.c
 ../lib/hweight.c
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 21c97cc41cfc..8c7bae545617 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1464,7 +1464,6 @@ static int dso__find_perf_map(char *filebuf, size_t bufsz,
 	return rc;
 }
 
-
 int dso__load(struct dso *dso, struct map *map)
 {
 	char *name;
@@ -1565,6 +1564,8 @@ int dso__load(struct dso *dso, struct map *map)
 	for (i = 0; i < DSO_BINARY_TYPE__SYMTAB_CNT; i++) {
 		struct symsrc *ss = &ss_[ss_pos];
 		bool next_slot = false;
+		bool is_reg;
+		int sirc;
 
 		enum dso_binary_type symtab_type = binary_type_symtab[i];
 
@@ -1575,12 +1576,20 @@ int dso__load(struct dso *dso, struct map *map)
 						   root_dir, name, PATH_MAX))
 			continue;
 
-		if (!is_regular_file(name))
-			continue;
+		if (symtab_type == DSO_BINARY_TYPE__BUILD_ID_CACHE)
+			nsinfo__mountns_exit(&nsc);
+
+		is_reg = is_regular_file(name);
+		sirc = symsrc__init(ss, dso, name, symtab_type);
 
-		/* Name is now the name of the next image to try */
-		if (symsrc__init(ss, dso, name, symtab_type) < 0)
+		if (symtab_type == DSO_BINARY_TYPE__BUILD_ID_CACHE)
+			nsinfo__mountns_enter(dso->nsinfo, &nsc);
+
+		if (!is_reg || sirc < 0) {
+			if (sirc >= 0)
+				symsrc__destroy(ss);
 			continue;
+		}
 
 		if (!syms_ss && symsrc__has_symtab(ss)) {
 			syms_ss = ss;
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 988111e0bab5..9e4ea852f636 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -143,13 +143,17 @@ struct strlist *lsdir(const char *name,
 	return list;
 }
 
-static int slow_copyfile(const char *from, const char *to)
+static int slow_copyfile(const char *from, const char *to, struct nsinfo *nsi)
 {
 	int err = -1;
 	char *line = NULL;
 	size_t n;
-	FILE *from_fp = fopen(from, "r"), *to_fp;
+	FILE *from_fp, *to_fp;
+	struct nscookie nsc;
 
+	nsinfo__mountns_enter(nsi, &nsc);
+	from_fp = fopen(from, "r");
+	nsinfo__mountns_exit(&nsc);
 	if (from_fp == NULL)
 		goto out;
 
@@ -198,15 +202,21 @@ int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size)
 	return size ? -1 : 0;
 }
 
-int copyfile_mode(const char *from, const char *to, mode_t mode)
+static int copyfile_mode_ns(const char *from, const char *to, mode_t mode,
+			    struct nsinfo *nsi)
 {
 	int fromfd, tofd;
 	struct stat st;
-	int err = -1;
+	int err;
 	char *tmp = NULL, *ptr = NULL;
+	struct nscookie nsc;
 
-	if (stat(from, &st))
+	nsinfo__mountns_enter(nsi, &nsc);
+	err = stat(from, &st);
+	nsinfo__mountns_exit(&nsc);
+	if (err)
 		goto out;
+	err = -1;
 
 	/* extra 'x' at the end is to reserve space for '.' */
 	if (asprintf(&tmp, "%s.XXXXXXx", to) < 0) {
@@ -227,11 +237,13 @@ int copyfile_mode(const char *from, const char *to, mode_t mode)
 		goto out_close_to;
 
 	if (st.st_size == 0) { /* /proc? do it slowly... */
-		err = slow_copyfile(from, tmp);
+		err = slow_copyfile(from, tmp, nsi);
 		goto out_close_to;
 	}
 
+	nsinfo__mountns_enter(nsi, &nsc);
 	fromfd = open(from, O_RDONLY);
+	nsinfo__mountns_exit(&nsc);
 	if (fromfd < 0)
 		goto out_close_to;
 
@@ -248,6 +260,16 @@ int copyfile_mode(const char *from, const char *to, mode_t mode)
 	return err;
 }
 
+int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi)
+{
+	return copyfile_mode_ns(from, to, 0755, nsi);
+}
+
+int copyfile_mode(const char *from, const char *to, mode_t mode)
+{
+	return copyfile_mode_ns(from, to, mode, NULL);
+}
+
 int copyfile(const char *from, const char *to)
 {
 	return copyfile_mode(from, to, 0755);
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 1e5fe1d9ec32..062dd20437f7 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -12,6 +12,7 @@
 #include <stdarg.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
+#include "namespaces.h"
 
 /* General helper functions */
 void usage(const char *err) __noreturn;
@@ -33,6 +34,7 @@ struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dire
 bool lsdir_no_dot_filter(const char *name, struct dirent *d);
 int copyfile(const char *from, const char *to);
 int copyfile_mode(const char *from, const char *to, mode_t mode);
+int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi);
 int copyfile_offset(int fromfd, loff_t from_ofs, int tofd, loff_t to_ofs, u64 size);
 
 ssize_t readn(int fd, void *buf, size_t n);
-- 
2.9.4

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


#1691815 — [PATCH 21/86] perf trace beauty fcntl flags: Beautify F_SETFL arg

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-07-19 17:00 +0200
Subject[PATCH 21/86] perf trace beauty fcntl flags: Beautify F_SETFL arg
Message-ID<u4YCe-1x4-5@gated-at.bofh.it>
In reply to#1691722
From: Arnaldo Carvalho de Melo <acme@redhat.com>

Result:

  0.011 (0.001 ms): Chrome_IOThrea/19863 fcntl(fd: 130</dev/shm/.com.google.Chrome.w5UBtZ (deleted)>, cmd: SETFL, arg: RDWR|APPEND|LARGEFILE) = 0

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qgf8ggsq9chnjblxlq954deu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/trace/beauty/fcntl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/trace/beauty/fcntl.c b/tools/perf/trace/beauty/fcntl.c
index 8dcbc30427c9..3456bf4cdb48 100644
--- a/tools/perf/trace/beauty/fcntl.c
+++ b/tools/perf/trace/beauty/fcntl.c
@@ -32,6 +32,8 @@ size_t syscall_arg__scnprintf_fcntl_arg(char *bf, size_t size, struct syscall_ar
 {
 	int cmd = syscall_arg__val(arg, 1);
 
+	if (cmd == F_SETFL)
+		return open__scnprintf_flags(arg->val, bf, size);
 	/*
 	 * We still don't grab the contents of pointers on entry or exit,
 	 * so just print them as hex numbers
-- 
2.9.4

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


#1691818 — [PATCH 24/86] perf trace beauty: Export the fd beautifier for use in more places

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-07-19 17:00 +0200
Subject[PATCH 24/86] perf trace beauty: Export the fd beautifier for use in more places
Message-ID<u4YCe-1x4-11@gated-at.bofh.it>
In reply to#1691722
From: Arnaldo Carvalho de Melo <acme@redhat.com>

Now that the beautifiers are being split into multiple source and object
files, we will need more of them exported, do it for the 'fd' one, will
be used to augment the return of some syscalls that may return an 'fd',
such as fcntl(fd, F_DUPFD).

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-39sosu12hhywyunqf5s74ewf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c       | 8 +-------
 tools/perf/trace/beauty/beauty.h | 3 +++
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index cfa8bf1cca43..65fa0126e939 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -365,11 +365,6 @@ static size_t syscall_arg__scnprintf_strhexarray(char *bf, size_t size,
 #define SCA_STRHEXARRAY syscall_arg__scnprintf_strhexarray
 #endif /* defined(__i386__) || defined(__x86_64__) */
 
-static size_t syscall_arg__scnprintf_fd(char *bf, size_t size,
-					struct syscall_arg *arg);
-
-#define SCA_FD syscall_arg__scnprintf_fd
-
 #ifndef AT_FDCWD
 #define AT_FDCWD	-100
 #endif
@@ -1057,8 +1052,7 @@ static const char *thread__fd_path(struct thread *thread, int fd,
 	return ttrace->paths.table[fd];
 }
 
-static size_t syscall_arg__scnprintf_fd(char *bf, size_t size,
-					struct syscall_arg *arg)
+size_t syscall_arg__scnprintf_fd(char *bf, size_t size, struct syscall_arg *arg)
 {
 	int fd = arg->val;
 	size_t printed = scnprintf(bf, size, "%d", fd);
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h
index b64c4116cdc4..790e8307fc6a 100644
--- a/tools/perf/trace/beauty/beauty.h
+++ b/tools/perf/trace/beauty/beauty.h
@@ -31,6 +31,9 @@ unsigned long syscall_arg__val(struct syscall_arg *arg, u8 idx);
 size_t syscall_arg__scnprintf_strarrays(char *bf, size_t size, struct syscall_arg *arg);
 #define SCA_STRARRAYS syscall_arg__scnprintf_strarrays
 
+size_t syscall_arg__scnprintf_fd(char *bf, size_t size, struct syscall_arg *arg);
+#define SCA_FD syscall_arg__scnprintf_fd
+
 size_t syscall_arg__scnprintf_hex(char *bf, size_t size, struct syscall_arg *arg);
 #define SCA_HEX syscall_arg__scnprintf_hex
 
-- 
2.9.4

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


#1691821 — [PATCH 12/86] tools include uapi asm-generic: Grab a copy of fcntl.h

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-07-19 17:00 +0200
Subject[PATCH 12/86] tools include uapi asm-generic: Grab a copy of fcntl.h
Message-ID<u4YCf-1x4-21@gated-at.bofh.it>
In reply to#1691722
From: Arnaldo Carvalho de Melo <acme@redhat.com>

We'll need defines for beautifying fcntl arguments that are not
available in older distros, these:

  trace/beauty/fcntl.c: In function 'syscall_arg__scnprintf_fcntl_arg':
  trace/beauty/fcntl.c:93: error: 'F_OFD_SETLK' undeclared (first use in this function)
  trace/beauty/fcntl.c:93: error: (Each undeclared identifier is reported only once
  trace/beauty/fcntl.c:93: error: for each function it appears in.)
  trace/beauty/fcntl.c:93: error: 'F_OFD_SETLKW' undeclared (first use in this function)
  trace/beauty/fcntl.c:93: error: 'F_OFD_GETLK' undeclared (first use in this function)
  trace/beauty/fcntl.c:94: error: 'F_GETOWN_EX' undeclared (first use in this function)
  trace/beauty/fcntl.c:94: error: 'F_SETOWN_EX' undeclared (first use in this function)

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-gvlw67a47e9z65jdunj4je5s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/uapi/asm-generic/fcntl.h | 220 +++++++++++++++++++++++++++++++++
 1 file changed, 220 insertions(+)
 create mode 100644 tools/include/uapi/asm-generic/fcntl.h

diff --git a/tools/include/uapi/asm-generic/fcntl.h b/tools/include/uapi/asm-generic/fcntl.h
new file mode 100644
index 000000000000..ac190958c981
--- /dev/null
+++ b/tools/include/uapi/asm-generic/fcntl.h
@@ -0,0 +1,220 @@
+#ifndef _ASM_GENERIC_FCNTL_H
+#define _ASM_GENERIC_FCNTL_H
+
+#include <linux/types.h>
+
+/*
+ * FMODE_EXEC is 0x20
+ * FMODE_NONOTIFY is 0x4000000
+ * These cannot be used by userspace O_* until internal and external open
+ * flags are split.
+ * -Eric Paris
+ */
+
+/*
+ * When introducing new O_* bits, please check its uniqueness in fcntl_init().
+ */
+
+#define O_ACCMODE	00000003
+#define O_RDONLY	00000000
+#define O_WRONLY	00000001
+#define O_RDWR		00000002
+#ifndef O_CREAT
+#define O_CREAT		00000100	/* not fcntl */
+#endif
+#ifndef O_EXCL
+#define O_EXCL		00000200	/* not fcntl */
+#endif
+#ifndef O_NOCTTY
+#define O_NOCTTY	00000400	/* not fcntl */
+#endif
+#ifndef O_TRUNC
+#define O_TRUNC		00001000	/* not fcntl */
+#endif
+#ifndef O_APPEND
+#define O_APPEND	00002000
+#endif
+#ifndef O_NONBLOCK
+#define O_NONBLOCK	00004000
+#endif
+#ifndef O_DSYNC
+#define O_DSYNC		00010000	/* used to be O_SYNC, see below */
+#endif
+#ifndef FASYNC
+#define FASYNC		00020000	/* fcntl, for BSD compatibility */
+#endif
+#ifndef O_DIRECT
+#define O_DIRECT	00040000	/* direct disk access hint */
+#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE	00100000
+#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY	00200000	/* must be a directory */
+#endif
+#ifndef O_NOFOLLOW
+#define O_NOFOLLOW	00400000	/* don't follow links */
+#endif
+#ifndef O_NOATIME
+#define O_NOATIME	01000000
+#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC	02000000	/* set close_on_exec */
+#endif
+
+/*
+ * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
+ * the O_SYNC flag.  We continue to use the existing numerical value
+ * for O_DSYNC semantics now, but using the correct symbolic name for it.
+ * This new value is used to request true Posix O_SYNC semantics.  It is
+ * defined in this strange way to make sure applications compiled against
+ * new headers get at least O_DSYNC semantics on older kernels.
+ *
+ * This has the nice side-effect that we can simply test for O_DSYNC
+ * wherever we do not care if O_DSYNC or O_SYNC is used.
+ *
+ * Note: __O_SYNC must never be used directly.
+ */
+#ifndef O_SYNC
+#define __O_SYNC	04000000
+#define O_SYNC		(__O_SYNC|O_DSYNC)
+#endif
+
+#ifndef O_PATH
+#define O_PATH		010000000
+#endif
+
+#ifndef __O_TMPFILE
+#define __O_TMPFILE	020000000
+#endif
+
+/* a horrid kludge trying to make sure that this will fail on old kernels */
+#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
+#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
+
+#ifndef O_NDELAY
+#define O_NDELAY	O_NONBLOCK
+#endif
+
+#define F_DUPFD		0	/* dup */
+#define F_GETFD		1	/* get close_on_exec */
+#define F_SETFD		2	/* set/clear close_on_exec */
+#define F_GETFL		3	/* get file->f_flags */
+#define F_SETFL		4	/* set file->f_flags */
+#ifndef F_GETLK
+#define F_GETLK		5
+#define F_SETLK		6
+#define F_SETLKW	7
+#endif
+#ifndef F_SETOWN
+#define F_SETOWN	8	/* for sockets. */
+#define F_GETOWN	9	/* for sockets. */
+#endif
+#ifndef F_SETSIG
+#define F_SETSIG	10	/* for sockets. */
+#define F_GETSIG	11	/* for sockets. */
+#endif
+
+#ifndef CONFIG_64BIT
+#ifndef F_GETLK64
+#define F_GETLK64	12	/*  using 'struct flock64' */
+#define F_SETLK64	13
+#define F_SETLKW64	14
+#endif
+#endif
+
+#ifndef F_SETOWN_EX
+#define F_SETOWN_EX	15
+#define F_GETOWN_EX	16
+#endif
+
+#ifndef F_GETOWNER_UIDS
+#define F_GETOWNER_UIDS	17
+#endif
+
+/*
+ * Open File Description Locks
+ *
+ * Usually record locks held by a process are released on *any* close and are
+ * not inherited across a fork().
+ *
+ * These cmd values will set locks that conflict with process-associated
+ * record  locks, but are "owned" by the open file description, not the
+ * process. This means that they are inherited across fork() like BSD (flock)
+ * locks, and they are only released automatically when the last reference to
+ * the the open file against which they were acquired is put.
+ */
+#define F_OFD_GETLK	36
+#define F_OFD_SETLK	37
+#define F_OFD_SETLKW	38
+
+#define F_OWNER_TID	0
+#define F_OWNER_PID	1
+#define F_OWNER_PGRP	2
+
+struct f_owner_ex {
+	int	type;
+	__kernel_pid_t	pid;
+};
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#ifndef F_RDLCK
+#define F_RDLCK		0
+#define F_WRLCK		1
+#define F_UNLCK		2
+#endif
+
+/* for old implementation of bsd flock () */
+#ifndef F_EXLCK
+#define F_EXLCK		4	/* or 3 */
+#define F_SHLCK		8	/* or 4 */
+#endif
+
+/* operations for bsd flock(), also used by the kernel implementation */
+#define LOCK_SH		1	/* shared lock */
+#define LOCK_EX		2	/* exclusive lock */
+#define LOCK_NB		4	/* or'd with one of the above to prevent
+				   blocking */
+#define LOCK_UN		8	/* remove lock */
+
+#define LOCK_MAND	32	/* This is a mandatory flock ... */
+#define LOCK_READ	64	/* which allows concurrent read operations */
+#define LOCK_WRITE	128	/* which allows concurrent write operations */
+#define LOCK_RW		192	/* which allows concurrent read & write ops */
+
+#define F_LINUX_SPECIFIC_BASE	1024
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK
+#ifndef __ARCH_FLOCK_PAD
+#define __ARCH_FLOCK_PAD
+#endif
+
+struct flock {
+	short	l_type;
+	short	l_whence;
+	__kernel_off_t	l_start;
+	__kernel_off_t	l_len;
+	__kernel_pid_t	l_pid;
+	__ARCH_FLOCK_PAD
+};
+#endif
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK64
+#ifndef __ARCH_FLOCK64_PAD
+#define __ARCH_FLOCK64_PAD
+#endif
+
+struct flock64 {
+	short  l_type;
+	short  l_whence;
+	__kernel_loff_t l_start;
+	__kernel_loff_t l_len;
+	__kernel_pid_t  l_pid;
+	__ARCH_FLOCK64_PAD
+};
+#endif
+
+#endif /* _ASM_GENERIC_FCNTL_H */
-- 
2.9.4

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


#1692558

FromIngo Molnar <mingo@kernel.org>
Date2017-07-20 10:40 +0200
Message-ID<u5fa1-4Lf-13@gated-at.bofh.it>
In reply to#1691722
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Unusually big one, please conside pulling, details on the signed tag,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 4b1303d0b01440f224cf81493b7e8e43d9b4965e:
> 
>   perf symbols: Accept zero as the kernel base address (2017-07-12 11:47:05 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.13-20170718
> 
> for you to fetch changes up to b851dd49868e295e18c5d72fc3bad85ff1c444b1:
> 
>   perf report: Show branch type in callchain entry (2017-07-18 23:14:42 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> . Initial support for namespaces, using setns to access files in
>   namespaces, grabbing their build-ids, etc. We still need to work
>   more to deal with namespaces that vanish before we can get the
>   needed data to do analysis, but this should be as good as what is
>   in bcc now (Krister Johansen)
> 
> . Add header record types to pipe-mode, now this command:
> 
>   $ perf record -o - -e cycles sleep 1 | perf report --stdio --header
> 
>   Will show the same as in non-pipe mode, i.e. involving a perf.data
>   file (David Carrillo-Cisneros)
> 
> . Implement a visual marker for fused x86 instructions in the annotate
>   TUI browser, available now in 'perf report', more work needed to have
>   it available as well in 'perf top' (Jin Yao)
> 
>   Further explanation from one of Jin's patches:
> 
>        │   ┌──cmpl   $0x0,argp_program_version_hook
>  81.93 │   ├──je     20
>        │   │  lock   cmpxchg %esi,0x38a9a4(%rip)
>        │   │↓ jne    29
>        │   │↓ jmp    43
>  11.47 │20:└─→cmpxch %esi,0x38a999(%rip)
> 
>   That means the cmpl+je is a fused instruction pair and they should be
>   considered together.
> 
> . Record the branch type and then show statistics and info about
>   in callchain entries (Jin Yao)
> 
>   Example from one of Jin's patches:
> 
>   # perf record -g -j any,save_type
>   # perf report --branch-history --stdio --no-children
> 
>   38.50%  div.c:45                [.] main                    div
>           |
>           ---main div.c:42 (RET CROSS_2M cycles:2)
>              compute_flag div.c:28 (cycles:2)
>              compute_flag div.c:27 (RET CROSS_2M cycles:1)
>              rand rand.c:28 (cycles:1)
>              rand rand.c:28 (RET CROSS_2M cycles:1)
>              __random random.c:298 (cycles:1)
>              __random random.c:297 (COND_BWD CROSS_2M cycles:1)
>              __random random.c:295 (cycles:1)
>              __random random.c:295 (COND_BWD CROSS_2M cycles:1)
>              __random random.c:295 (cycles:1)
>              __random random.c:295 (RET CROSS_2M cycles:9)
> 
> . Beautify the fcntl syscall, which is an interesting one in the sense
>   that infrastructure had to be put in place to change the formatters of
>   some arguments according to the value in a previous one, i.e. cmd
>   dictates how arg and the syscall return will be formatted.
>   (Arnaldo Carvalho de Melo
> 
> Infrastructure:
> 
> . 'perf test attr' fixes (Jiri Olsa)
> 
> Vendor events:
> 
> - Add POWER9 PMU events Sukadev (Bhattiprolu)
> 
> - Support additional POWER8+ PVR in PMU mapfile (Shriya)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (39):
>       perf trace: Remove F_ from some of the fcntl command strings
>       perf trace: Beautify linux specific fcntl commands
>       tools: Update include/uapi/linux/fcntl.h copy from the kernel
>       perf trace beauty: Export the strarrays scnprintf method
>       perf trace: Only build tools/perf/trace/beauty/ when building 'perf trace'
>       perf trace beauty: Mask ignored fcntl 'arg' parameter
>       perf trace beauty: Allow accessing syscall args values in a syscall arg formatter
>       perf trace beauty: Export the "int" and "hex" syscall arg formatters
>       perf trace beauty: Introduce syscall arg beautifier for long integers
>       tools include uapi asm-generic: Grab a copy of fcntl.h
>       perf trace beauty fcntl: Basic 'arg' beautifier
>       perf trace: Beautify new write hint fcntl commands
>       perf beauty open: Detach the syscall_arg agnostic bits from the flags formatter
>       perf trace: Allow syscall_arg beautifiers to set a different return formatter
>       perf trace beauty open flags: Support O_TMPFILE and O_NOFOLLOW
>       perf trace beauty open flags: Do not depend on the system's O_LARGEFILE define
>       perf trace beauty fcntl: Beautify F_GETFL return value
>       perf trace beauty open flags: Move RDRW to the start of the output
>       perf trace beauty fcntl flags: Beautify F_SETFL arg
>       perf trace beauty fcntl: Beautify F_[GS]ETFD arg/return value
>       perf trace beauty: Give syscall return beautifier more context
>       perf trace beauty: Export the fd beautifier for use in more places
>       perf trace beauty fcntl: Augment the return of F_DUPFD(_CLOEXEC)
>       perf trace beauty: Export the pid beautifier for use in more places
>       perf trace beauty fcntl: Beautify F_GETOWN and F_SETOWN
>       tools include uapi x86: Grab a copy of unistd.h
>       tools include uapi x86: Add __NR_setns, if missing
>       tools build: Add test for setns()
>       perf evsel: Allow asking for max precise_ip in new_cycles()
>       perf evlist: Allow asking for max precise_ip in add_default()
>       perf record: Do not ask for precise_ip with --no-samples
>       perf test sdt: Handle realpath() failure
>       perf trace beauty: Export strarray for use in per-object beautifiers
>       perf trace beauty fcntl: Beautify F_GETLEASE and F_SETLEASE arg/return
>       perf trace: Group per syscall arg formatter info into one struct
>       perf trace: Allow syscall arg formatters to request non suppression of zeros
>       perf trace beauty fcntl: Do not suppress 'cmd' when zero, should be DUPFD
>       perf trace beauty fcntl: Beautify the 'arg' for DUPFD
>       perf trace beauty: Simplify syscall return formatting
> 
> David Carrillo-Cisneros (16):
>       perf header: Encapsulate read and swap
>       perf header: Add PROCESS_STR_FUN macro
>       perf header: Fail on write_padded error
>       perf util: Add const modifier to buf in "writen" function
>       perf header: Revamp do_write()
>       perf header: Add struct feat_fd for write
>       perf header: Use struct feat_fd for print
>       perf header: Use struct feat_fd to process header records
>       perf header: Don't pass struct perf_file_section to process_##_feat
>       perf header: Use struct feat_fd in read header records
>       perf header: Make write_pmu_mappings pipe-mode friendly
>       perf header: Add a buffer to struct feat_fd
>       perf header: Change FEAT_OP* macros
>       perf tool: Add show_feature_header to perf_tool
>       perf tools: Add feature header record to pipe-mode
>       perf header: Add event desc to pipe-mode header
> 
> Jin Yao (10):
>       perf annotate: Check for fused instructions
>       perf annotate: Implement visual marker for macro fusion
>       perf report: Enable finding kernel inline functions
>       perf/core: Define the common branch type classification
>       perf/x86/intel: Record branch type
>       perf record: Create a new option save_type in --branch-filter
>       perf report: Refactor the branch info printing code
>       perf util: Create branch.c/.h for common branch functions
>       perf report: Show branch type statistics for stdio mode
>       perf report: Show branch type in callchain entry
> 
> Jiri Olsa (13):
>       perf tests attr: Do not store failed events
>       perf tests attr: Add test_attr__ready function
>       perf tests attr: Make compare_data global
>       perf tests attr: Rename compare_data to data_equal
>       perf tests attr: Add 1s for exclude_kernel and task base bits
>       perf tests attr: Fix record dwarf test
>       perf tests attr: Fix no-delay test
>       perf tests attr: Add proper return values
>       perf tests attr: Fix cpu test disabled term setup
>       perf tests attr: Fix sample_period setup
>       perf tests attr: Fix precise_ip setup
>       perf tests attr: Fix stat sample_type setup
>       perf tests attr: Add optional term
> 
> Krister Johansen (5):
>       perf symbols: Find symbols in different mount namespace
>       perf maps: Lookup maps in both intitial mountns and inner mountns.
>       perf probe: Allow placing uprobes in alternate namespaces.
>       perf buildid-cache: Support binary objects from other namespaces
>       perf buildid-cache: Cache debuginfo
> 
> Shriya (1):
>       perf pmu-events: Support additional POWER8+ PVR in mapfile
> 
> Sukadev Bhattiprolu (2):
>       perf vendor events: Add POWER9 PMU events
>       perf vendor events: Add POWER9 PVRs to mapfile
> 
>  arch/x86/events/intel/lbr.c                        |   52 +-
>  include/uapi/linux/perf_event.h                    |   27 +-
>  tools/arch/x86/include/asm/unistd_32.h             |    3 +
>  tools/arch/x86/include/asm/unistd_64.h             |    3 +
>  tools/arch/x86/include/uapi/asm/unistd.h           |   17 +
>  tools/build/Makefile.feature                       |    3 +-
>  tools/build/feature/Makefile                       |    6 +-
>  tools/build/feature/test-all.c                     |    5 +
>  tools/build/feature/test-setns.c                   |    7 +
>  tools/include/uapi/asm-generic/fcntl.h             |  220 +++++
>  tools/include/uapi/linux/fcntl.h                   |   21 +
>  tools/include/uapi/linux/perf_event.h              |   27 +-
>  tools/perf/Build                                   |    2 +-
>  tools/perf/Documentation/perf-buildid-cache.txt    |    5 +
>  tools/perf/Documentation/perf-probe.txt            |   14 +
>  tools/perf/Documentation/perf-record.txt           |    1 +
>  tools/perf/Documentation/perf.data-file-format.txt |   10 +-
>  tools/perf/Makefile.config                         |    5 +
>  tools/perf/arch/powerpc/util/sym-handling.c        |    2 +-
>  tools/perf/arch/x86/annotate/instructions.c        |   46 +
>  tools/perf/builtin-annotate.c                      |    1 +
>  tools/perf/builtin-buildid-cache.c                 |   54 +-
>  tools/perf/builtin-inject.c                        |    1 +
>  tools/perf/builtin-probe.c                         |   45 +-
>  tools/perf/builtin-record.c                        |    9 +-
>  tools/perf/builtin-report.c                        |   30 +
>  tools/perf/builtin-script.c                        |    4 +
>  tools/perf/builtin-top.c                           |    2 +-
>  tools/perf/builtin-trace.c                         |  602 ++++++------
>  tools/perf/check-headers.sh                        |    1 +
>  tools/perf/perf.h                                  |    1 +
>  tools/perf/pmu-events/arch/powerpc/mapfile.csv     |    4 +
>  .../perf/pmu-events/arch/powerpc/power9/cache.json |  176 ++++
>  .../arch/powerpc/power9/floating-point.json        |   44 +
>  .../pmu-events/arch/powerpc/power9/frontend.json   |  446 +++++++++
>  .../pmu-events/arch/powerpc/power9/marked.json     |  782 +++++++++++++++
>  .../pmu-events/arch/powerpc/power9/memory.json     |  158 +++
>  .../perf/pmu-events/arch/powerpc/power9/other.json |  836 ++++++++++++++++
>  .../pmu-events/arch/powerpc/power9/pipeline.json   |  680 +++++++++++++
>  tools/perf/pmu-events/arch/powerpc/power9/pmc.json |  146 +++
>  .../arch/powerpc/power9/translation.json           |  272 ++++++
>  tools/perf/tests/attr.c                            |   12 +-
>  tools/perf/tests/attr.py                           |   50 +-
>  tools/perf/tests/attr/base-record                  |    6 +-
>  tools/perf/tests/attr/base-stat                    |    4 +-
>  tools/perf/tests/attr/test-record-C0               |    1 +
>  tools/perf/tests/attr/test-record-basic            |    1 +
>  tools/perf/tests/attr/test-record-branch-any       |    2 +-
>  .../perf/tests/attr/test-record-branch-filter-any  |    2 +-
>  .../tests/attr/test-record-branch-filter-any_call  |    2 +-
>  .../tests/attr/test-record-branch-filter-any_ret   |    2 +-
>  tools/perf/tests/attr/test-record-branch-filter-hv |    2 +-
>  .../tests/attr/test-record-branch-filter-ind_call  |    2 +-
>  tools/perf/tests/attr/test-record-branch-filter-k  |    2 +-
>  tools/perf/tests/attr/test-record-branch-filter-u  |    2 +-
>  tools/perf/tests/attr/test-record-count            |    1 +
>  tools/perf/tests/attr/test-record-data             |    3 +-
>  tools/perf/tests/attr/test-record-freq             |    1 +
>  tools/perf/tests/attr/test-record-graph-default    |    1 +
>  tools/perf/tests/attr/test-record-graph-dwarf      |    4 +-
>  tools/perf/tests/attr/test-record-graph-fp         |    1 +
>  tools/perf/tests/attr/test-record-group            |    1 +
>  tools/perf/tests/attr/test-record-group-sampling   |    1 +
>  tools/perf/tests/attr/test-record-group1           |    1 +
>  ...st-record-no-delay => test-record-no-buffering} |    4 +-
>  tools/perf/tests/attr/test-record-no-inherit       |    1 +
>  tools/perf/tests/attr/test-record-no-samples       |    1 +
>  tools/perf/tests/attr/test-record-period           |    1 +
>  tools/perf/tests/attr/test-record-raw              |    2 +-
>  tools/perf/tests/attr/test-stat-C0                 |    4 +-
>  tools/perf/tests/attr/test-stat-default            |    2 +
>  tools/perf/tests/attr/test-stat-detailed-1         |    2 +
>  tools/perf/tests/attr/test-stat-detailed-2         |    3 +
>  tools/perf/tests/attr/test-stat-detailed-3         |    5 +
>  tools/perf/tests/sdt.c                             |    8 +-
>  tools/perf/trace/beauty/Build                      |    1 +
>  tools/perf/trace/beauty/beauty.h                   |   65 ++
>  tools/perf/trace/beauty/fcntl.c                    |  100 ++
>  tools/perf/trace/beauty/open_flags.c               |   29 +-
>  tools/perf/trace/beauty/pid.c                      |    4 +-
>  tools/perf/ui/browser.c                            |   29 +
>  tools/perf/ui/browser.h                            |    2 +
>  tools/perf/ui/browsers/annotate.c                  |   30 +-
>  tools/perf/ui/browsers/hists.c                     |    3 -
>  tools/perf/ui/gtk/annotate.c                       |    2 +-
>  tools/perf/ui/stdio/hist.c                         |    3 -
>  tools/perf/util/Build                              |    5 +
>  tools/perf/util/annotate.c                         |   29 +-
>  tools/perf/util/annotate.h                         |    4 +-
>  tools/perf/util/branch.c                           |  147 +++
>  tools/perf/util/branch.h                           |   24 +
>  tools/perf/util/build-id.c                         |  129 ++-
>  tools/perf/util/build-id.h                         |   16 +-
>  tools/perf/util/callchain.c                        |  134 +--
>  tools/perf/util/callchain.h                        |    5 +-
>  tools/perf/util/dso.c                              |   21 +-
>  tools/perf/util/dso.h                              |    3 +
>  tools/perf/util/event.c                            |    1 +
>  tools/perf/util/event.h                            |   11 +-
>  tools/perf/util/evlist.c                           |    4 +-
>  tools/perf/util/evlist.h                           |    9 +-
>  tools/perf/util/evsel.c                            |   18 +-
>  tools/perf/util/evsel.h                            |    3 +-
>  tools/perf/util/header.c                           | 1015 +++++++++++---------
>  tools/perf/util/header.h                           |   16 +-
>  tools/perf/util/hist.c                             |    5 +-
>  tools/perf/util/machine.c                          |   33 +-
>  tools/perf/util/map.c                              |   23 +-
>  tools/perf/util/map.h                              |    2 +-
>  tools/perf/util/namespaces.c                       |  211 ++++
>  tools/perf/util/namespaces.h                       |   38 +
>  tools/perf/util/parse-branch-options.c             |    1 +
>  tools/perf/util/parse-events.c                     |    2 +-
>  tools/perf/util/probe-event.c                      |   86 +-
>  tools/perf/util/probe-event.h                      |   10 +-
>  tools/perf/util/probe-file.c                       |   19 +-
>  tools/perf/util/probe-file.h                       |    4 +-
>  tools/perf/util/python-ext-sources                 |    1 +
>  tools/perf/util/session.c                          |    4 +
>  tools/perf/util/setns.c                            |    8 +
>  tools/perf/util/symbol.c                           |   92 +-
>  tools/perf/util/thread.c                           |    3 +
>  tools/perf/util/thread.h                           |    1 +
>  tools/perf/util/tool.h                             |   10 +-
>  tools/perf/util/util.c                             |   40 +-
>  tools/perf/util/util.h                             |    8 +-
>  126 files changed, 6339 insertions(+), 1031 deletions(-)
>  create mode 100644 tools/arch/x86/include/uapi/asm/unistd.h
>  create mode 100644 tools/build/feature/test-setns.c
>  create mode 100644 tools/include/uapi/asm-generic/fcntl.h
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/cache.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/floating-point.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/frontend.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/marked.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/memory.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/other.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/pipeline.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/pmc.json
>  create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/translation.json
>  rename tools/perf/tests/attr/{test-record-no-delay => test-record-no-buffering} (61%)
>  create mode 100644 tools/perf/trace/beauty/fcntl.c
>  create mode 100644 tools/perf/util/branch.c
>  create mode 100644 tools/perf/util/branch.h
>  create mode 100644 tools/perf/util/setns.c

Pulled, thanks a lot Arnaldo!

	Ingo

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | linux.kernel


csiph-web