linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/10] perf/urgent fixes
@ 2016-05-12 20:03 Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 01/10] perf tools: Use readdir() instead of deprecated readdir_r() Arnaldo Carvalho de Melo
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andy Lutomirski, David Ahern, Jiri Olsa, Kees Cook,
	Linus Torvalds, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
	Steven Rostedt, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, test built on:

alldeps-fedora-rawhide: Ok
alldeps-ubuntu-14.04: Ok
alldeps-ubuntu-16.04: Ok
alldeps-fedora-20: Ok
alldeps-ubuntu-12.04: Ok
minimal-debian-experimental-x-mips64: Ok
minimal-debian-experimental-x-mips64el: Ok
minimal-debian-experimental-x-mipsel: Ok
minimal-ubuntu-x-arm: Ok
minimal-ubuntu-x-arm64: Ok
minimal-ubuntu-x-ppc64: Ok
minimal-ubuntu-x-ppc64el: Ok
alldeps-debian: Ok
alldeps-mageia: Ok
alldeps-rhel7: Ok
alldeps-centos: Ok
alldeps-opensuse: Ok

- Arnaldo

The following changes since commit 9f448cd3cbcec8995935e60b27802ae56aac8cc0:

  perf/core: Disable the event on a truncated AUX record (2016-05-12 14:46:11 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-20160512

for you to fetch changes up to 42ef8a78c1f49f53f29f0f3a6f9a5bcbc653233e:

  perf stat: Fallback to user only counters when perf_event_paranoid > 1 (2016-05-12 16:25:18 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Fallback to usermode only counters when perf_event_paranoid > 1, which
  is the case now (Arnaldo Carvalho de Melo)

- Do not reassign parg after collapse_tree() in libtraceevent, which
  may cause tool crashes (Steven Rostedt)

Build fixes:

- Fix the build on Fedora Rawhide, where readdir_r() is deprecated and
  also wrt -Werror=unused-const-variable= + x86_32_regoffset_table on
  !x86_64 (Arnaldo Carvalho de Melo)

- Fix the build on Ubuntu 12.04.5, where dwarf_getlocations() isn't
  available, i.e. libdw-dev < 0.157 (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (9):
      perf tools: Use readdir() instead of deprecated readdir_r()
      perf script: Use readdir() instead of deprecated readdir_r()
      perf thread_map: Use readdir() instead of deprecated readdir_r()
      perf tools: Use readdir() instead of deprecated readdir_r()
      perf dwarf: Guard !x86_64 definitions under #ifdef else clause
      perf probe: Check if dwarf_getlocations() is available
      perf evsel: Improve EPERM error handling in open_strerror()
      perf evsel: Handle EACCESS + perf_event_paranoid=2 in fallback()
      perf stat: Fallback to user only counters when perf_event_paranoid > 1

Steven Rostedt (1):
      tools lib traceevent: Do not reassign parg after collapse_tree()

 tools/build/Makefile.feature                  |  2 +
 tools/build/feature/Makefile                  |  4 ++
 tools/build/feature/test-all.c                |  5 ++
 tools/build/feature/test-dwarf_getlocations.c | 12 +++++
 tools/lib/traceevent/parse-filter.c           |  4 +-
 tools/perf/arch/x86/util/dwarf-regs.c         |  8 +--
 tools/perf/builtin-script.c                   | 70 +++++++++++++--------------
 tools/perf/builtin-stat.c                     |  7 ++-
 tools/perf/config/Makefile                    |  6 +++
 tools/perf/util/dwarf-aux.c                   |  9 ++++
 tools/perf/util/event.c                       | 12 ++---
 tools/perf/util/evsel.c                       | 23 ++++++++-
 tools/perf/util/parse-events.c                | 60 +++++++++++------------
 tools/perf/util/thread_map.c                  |  8 +--
 14 files changed, 145 insertions(+), 85 deletions(-)
 create mode 100644 tools/build/feature/test-dwarf_getlocations.c

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

* [PATCH 01/10] perf tools: Use readdir() instead of deprecated readdir_r()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 02/10] perf script: " Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The readdir() function is thread safe as long as just one thread uses a
DIR, which is the case when synthesizing events for pre-existing threads
by traversing /proc, so, to avoid breaking the build with glibc-2.23.90
(upcoming 2.24), use it instead of readdir_r().

See: http://man7.org/linux/man-pages/man3/readdir.3.html

"However, in modern implementations (including the glibc implementation),
concurrent calls to readdir() that specify different directory streams
are thread-safe.  In cases where multiple threads must read from the
same directory stream, using readdir() with external synchronization is
still preferable to the use of the deprecated readdir_r(3) function."

Noticed while building on a Fedora Rawhide docker container.

   CC       /tmp/build/perf/util/event.o
  util/event.c: In function '__event__synthesize_thread':
  util/event.c:466:2: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
    while (!readdir_r(tasks, &dirent, &next) && next) {
    ^~~~~
  In file included from /usr/include/features.h:368:0,
                   from /usr/include/stdint.h:25,
                   from /usr/lib/gcc/x86_64-redhat-linux/6.0.0/include/stdint.h:9,
                   from /git/linux/tools/include/linux/types.h:6,
                   from util/event.c:1:
  /usr/include/dirent.h:189:12: note: declared here

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-i1vj7nyjp2p750rirxgrfd3c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index dad55d04ffdd..edcf4ed4e99c 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -433,7 +433,7 @@ static int __event__synthesize_thread(union perf_event *comm_event,
 {
 	char filename[PATH_MAX];
 	DIR *tasks;
-	struct dirent dirent, *next;
+	struct dirent *dirent;
 	pid_t tgid, ppid;
 	int rc = 0;
 
@@ -462,11 +462,11 @@ static int __event__synthesize_thread(union perf_event *comm_event,
 		return 0;
 	}
 
-	while (!readdir_r(tasks, &dirent, &next) && next) {
+	while ((dirent = readdir(tasks)) != NULL) {
 		char *end;
 		pid_t _pid;
 
-		_pid = strtol(dirent.d_name, &end, 10);
+		_pid = strtol(dirent->d_name, &end, 10);
 		if (*end)
 			continue;
 
@@ -575,7 +575,7 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
 {
 	DIR *proc;
 	char proc_path[PATH_MAX];
-	struct dirent dirent, *next;
+	struct dirent *dirent;
 	union perf_event *comm_event, *mmap_event, *fork_event;
 	int err = -1;
 
@@ -600,9 +600,9 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
 	if (proc == NULL)
 		goto out_free_fork;
 
-	while (!readdir_r(proc, &dirent, &next) && next) {
+	while ((dirent = readdir(proc)) != NULL) {
 		char *end;
-		pid_t pid = strtol(dirent.d_name, &end, 10);
+		pid_t pid = strtol(dirent->d_name, &end, 10);
 
 		if (*end) /* only interested in proper numerical dirents */
 			continue;
-- 
2.5.5

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

* [PATCH 02/10] perf script: Use readdir() instead of deprecated readdir_r()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 01/10] perf tools: Use readdir() instead of deprecated readdir_r() Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 03/10] perf thread_map: " Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The readdir() function is thread safe as long as just one thread uses a
DIR, which is the case in 'perf script', so, to avoid breaking the build
with glibc-2.23.90 (upcoming 2.24), use it instead of readdir_r().

See: http://man7.org/linux/man-pages/man3/readdir.3.html

"However, in modern implementations (including the glibc implementation),
concurrent calls to readdir() that specify different directory streams
are thread-safe.  In cases where multiple threads must read from the
same directory stream, using readdir() with external synchronization is
still preferable to the use of the deprecated readdir_r(3) function."

Noticed while building on a Fedora Rawhide docker container.

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-mt3xz7n2hl49ni2vx7kuq74g@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c | 70 ++++++++++++++++++++++-----------------------
 1 file changed, 34 insertions(+), 36 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 3770c3dffe5e..52826696c852 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1415,21 +1415,19 @@ static int is_directory(const char *base_path, const struct dirent *dent)
 	return S_ISDIR(st.st_mode);
 }
 
-#define for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next)\
-	while (!readdir_r(scripts_dir, &lang_dirent, &lang_next) &&	\
-	       lang_next)						\
-		if ((lang_dirent.d_type == DT_DIR ||			\
-		     (lang_dirent.d_type == DT_UNKNOWN &&		\
-		      is_directory(scripts_path, &lang_dirent))) &&	\
-		    (strcmp(lang_dirent.d_name, ".")) &&		\
-		    (strcmp(lang_dirent.d_name, "..")))
-
-#define for_each_script(lang_path, lang_dir, script_dirent, script_next)\
-	while (!readdir_r(lang_dir, &script_dirent, &script_next) &&	\
-	       script_next)						\
-		if (script_dirent.d_type != DT_DIR &&			\
-		    (script_dirent.d_type != DT_UNKNOWN ||		\
-		     !is_directory(lang_path, &script_dirent)))
+#define for_each_lang(scripts_path, scripts_dir, lang_dirent)		\
+	while ((lang_dirent = readdir(scripts_dir)) != NULL)		\
+		if ((lang_dirent->d_type == DT_DIR ||			\
+		     (lang_dirent->d_type == DT_UNKNOWN &&		\
+		      is_directory(scripts_path, lang_dirent))) &&	\
+		    (strcmp(lang_dirent->d_name, ".")) &&		\
+		    (strcmp(lang_dirent->d_name, "..")))
+
+#define for_each_script(lang_path, lang_dir, script_dirent)		\
+	while ((script_dirent = readdir(lang_dir)) != NULL)		\
+		if (script_dirent->d_type != DT_DIR &&			\
+		    (script_dirent->d_type != DT_UNKNOWN ||		\
+		     !is_directory(lang_path, script_dirent)))
 
 
 #define RECORD_SUFFIX			"-record"
@@ -1575,7 +1573,7 @@ static int list_available_scripts(const struct option *opt __maybe_unused,
 				  const char *s __maybe_unused,
 				  int unset __maybe_unused)
 {
-	struct dirent *script_next, *lang_next, script_dirent, lang_dirent;
+	struct dirent *script_dirent, *lang_dirent;
 	char scripts_path[MAXPATHLEN];
 	DIR *scripts_dir, *lang_dir;
 	char script_path[MAXPATHLEN];
@@ -1590,19 +1588,19 @@ static int list_available_scripts(const struct option *opt __maybe_unused,
 	if (!scripts_dir)
 		return -1;
 
-	for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next) {
+	for_each_lang(scripts_path, scripts_dir, lang_dirent) {
 		snprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
-			 lang_dirent.d_name);
+			 lang_dirent->d_name);
 		lang_dir = opendir(lang_path);
 		if (!lang_dir)
 			continue;
 
-		for_each_script(lang_path, lang_dir, script_dirent, script_next) {
-			script_root = get_script_root(&script_dirent, REPORT_SUFFIX);
+		for_each_script(lang_path, lang_dir, script_dirent) {
+			script_root = get_script_root(script_dirent, REPORT_SUFFIX);
 			if (script_root) {
 				desc = script_desc__findnew(script_root);
 				snprintf(script_path, MAXPATHLEN, "%s/%s",
-					 lang_path, script_dirent.d_name);
+					 lang_path, script_dirent->d_name);
 				read_script_info(desc, script_path);
 				free(script_root);
 			}
@@ -1690,7 +1688,7 @@ static int check_ev_match(char *dir_name, char *scriptname,
  */
 int find_scripts(char **scripts_array, char **scripts_path_array)
 {
-	struct dirent *script_next, *lang_next, script_dirent, lang_dirent;
+	struct dirent *script_dirent, *lang_dirent;
 	char scripts_path[MAXPATHLEN], lang_path[MAXPATHLEN];
 	DIR *scripts_dir, *lang_dir;
 	struct perf_session *session;
@@ -1713,9 +1711,9 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 		return -1;
 	}
 
-	for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next) {
+	for_each_lang(scripts_path, scripts_dir, lang_dirent) {
 		snprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
-			 lang_dirent.d_name);
+			 lang_dirent->d_name);
 #ifdef NO_LIBPERL
 		if (strstr(lang_path, "perl"))
 			continue;
@@ -1729,16 +1727,16 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 		if (!lang_dir)
 			continue;
 
-		for_each_script(lang_path, lang_dir, script_dirent, script_next) {
+		for_each_script(lang_path, lang_dir, script_dirent) {
 			/* Skip those real time scripts: xxxtop.p[yl] */
-			if (strstr(script_dirent.d_name, "top."))
+			if (strstr(script_dirent->d_name, "top."))
 				continue;
 			sprintf(scripts_path_array[i], "%s/%s", lang_path,
-				script_dirent.d_name);
-			temp = strchr(script_dirent.d_name, '.');
+				script_dirent->d_name);
+			temp = strchr(script_dirent->d_name, '.');
 			snprintf(scripts_array[i],
-				(temp - script_dirent.d_name) + 1,
-				"%s", script_dirent.d_name);
+				(temp - script_dirent->d_name) + 1,
+				"%s", script_dirent->d_name);
 
 			if (check_ev_match(lang_path,
 					scripts_array[i], session))
@@ -1756,7 +1754,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
 
 static char *get_script_path(const char *script_root, const char *suffix)
 {
-	struct dirent *script_next, *lang_next, script_dirent, lang_dirent;
+	struct dirent *script_dirent, *lang_dirent;
 	char scripts_path[MAXPATHLEN];
 	char script_path[MAXPATHLEN];
 	DIR *scripts_dir, *lang_dir;
@@ -1769,21 +1767,21 @@ static char *get_script_path(const char *script_root, const char *suffix)
 	if (!scripts_dir)
 		return NULL;
 
-	for_each_lang(scripts_path, scripts_dir, lang_dirent, lang_next) {
+	for_each_lang(scripts_path, scripts_dir, lang_dirent) {
 		snprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
-			 lang_dirent.d_name);
+			 lang_dirent->d_name);
 		lang_dir = opendir(lang_path);
 		if (!lang_dir)
 			continue;
 
-		for_each_script(lang_path, lang_dir, script_dirent, script_next) {
-			__script_root = get_script_root(&script_dirent, suffix);
+		for_each_script(lang_path, lang_dir, script_dirent) {
+			__script_root = get_script_root(script_dirent, suffix);
 			if (__script_root && !strcmp(script_root, __script_root)) {
 				free(__script_root);
 				closedir(lang_dir);
 				closedir(scripts_dir);
 				snprintf(script_path, MAXPATHLEN, "%s/%s",
-					 lang_path, script_dirent.d_name);
+					 lang_path, script_dirent->d_name);
 				return strdup(script_path);
 			}
 			free(__script_root);
-- 
2.5.5

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

* [PATCH 03/10] perf thread_map: Use readdir() instead of deprecated readdir_r()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 01/10] perf tools: Use readdir() instead of deprecated readdir_r() Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 02/10] perf script: " Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 04/10] perf tools: " Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The readdir() function is thread safe as long as just one thread uses a
DIR, which is the case in thread_map, so, to avoid breaking the build
with glibc-2.23.90 (upcoming 2.24), use it instead of readdir_r().

See: http://man7.org/linux/man-pages/man3/readdir.3.html

"However, in modern implementations (including the glibc implementation),
concurrent calls to readdir() that specify different directory streams
are thread-safe.  In cases where multiple threads must read from the
same directory stream, using readdir() with external synchronization is
still preferable to the use of the deprecated readdir_r(3) function."

Noticed while building on a Fedora Rawhide docker container.

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-del8h2a0f40z75j4r42l96l0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/thread_map.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index 08afc6909953..267112b4e3db 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -94,7 +94,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
 	DIR *proc;
 	int max_threads = 32, items, i;
 	char path[256];
-	struct dirent dirent, *next, **namelist = NULL;
+	struct dirent *dirent, **namelist = NULL;
 	struct thread_map *threads = thread_map__alloc(max_threads);
 
 	if (threads == NULL)
@@ -107,16 +107,16 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
 	threads->nr = 0;
 	atomic_set(&threads->refcnt, 1);
 
-	while (!readdir_r(proc, &dirent, &next) && next) {
+	while ((dirent = readdir(proc)) != NULL) {
 		char *end;
 		bool grow = false;
 		struct stat st;
-		pid_t pid = strtol(dirent.d_name, &end, 10);
+		pid_t pid = strtol(dirent->d_name, &end, 10);
 
 		if (*end) /* only interested in proper numerical dirents */
 			continue;
 
-		snprintf(path, sizeof(path), "/proc/%s", dirent.d_name);
+		snprintf(path, sizeof(path), "/proc/%s", dirent->d_name);
 
 		if (stat(path, &st) != 0)
 			continue;
-- 
2.5.5

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

* [PATCH 04/10] perf tools: Use readdir() instead of deprecated readdir_r()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 03/10] perf thread_map: " Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 05/10] perf dwarf: Guard !x86_64 definitions under #ifdef else clause Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The readdir() function is thread safe as long as just one thread uses a
DIR, which is the case when parsing tracepoint event definitions, to
avoid breaking the build with glibc-2.23.90 (upcoming 2.24), use it
instead of readdir_r().

See: http://man7.org/linux/man-pages/man3/readdir.3.html

"However, in modern implementations (including the glibc implementation),
concurrent calls to readdir() that specify different directory streams
are thread-safe.  In cases where multiple threads must read from the
same directory stream, using readdir() with external synchronization is
still preferable to the use of the deprecated readdir_r(3) function."

Noticed while building on a Fedora Rawhide docker container.

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-wddn49r6bz6wq4ee3dxbl7lo@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c | 60 +++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 4c19d5e79d8c..bcbc983d4b12 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -138,11 +138,11 @@ struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = {
 #define PERF_EVENT_TYPE(config)		__PERF_EVENT_FIELD(config, TYPE)
 #define PERF_EVENT_ID(config)		__PERF_EVENT_FIELD(config, EVENT)
 
-#define for_each_subsystem(sys_dir, sys_dirent, sys_next)	       \
-	while (!readdir_r(sys_dir, &sys_dirent, &sys_next) && sys_next)	       \
-	if (sys_dirent.d_type == DT_DIR &&				       \
-	   (strcmp(sys_dirent.d_name, ".")) &&				       \
-	   (strcmp(sys_dirent.d_name, "..")))
+#define for_each_subsystem(sys_dir, sys_dirent)			\
+	while ((sys_dirent = readdir(sys_dir)) != NULL)		\
+		if (sys_dirent->d_type == DT_DIR &&		\
+		    (strcmp(sys_dirent->d_name, ".")) &&	\
+		    (strcmp(sys_dirent->d_name, "..")))
 
 static int tp_event_has_id(struct dirent *sys_dir, struct dirent *evt_dir)
 {
@@ -159,12 +159,12 @@ static int tp_event_has_id(struct dirent *sys_dir, struct dirent *evt_dir)
 	return 0;
 }
 
-#define for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next)	       \
-	while (!readdir_r(evt_dir, &evt_dirent, &evt_next) && evt_next)        \
-	if (evt_dirent.d_type == DT_DIR &&				       \
-	   (strcmp(evt_dirent.d_name, ".")) &&				       \
-	   (strcmp(evt_dirent.d_name, "..")) &&				       \
-	   (!tp_event_has_id(&sys_dirent, &evt_dirent)))
+#define for_each_event(sys_dirent, evt_dir, evt_dirent)		\
+	while ((evt_dirent = readdir(evt_dir)) != NULL)		\
+		if (evt_dirent->d_type == DT_DIR &&		\
+		    (strcmp(evt_dirent->d_name, ".")) &&	\
+		    (strcmp(evt_dirent->d_name, "..")) &&	\
+		    (!tp_event_has_id(sys_dirent, evt_dirent)))
 
 #define MAX_EVENT_LENGTH 512
 
@@ -173,7 +173,7 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
 {
 	struct tracepoint_path *path = NULL;
 	DIR *sys_dir, *evt_dir;
-	struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
+	struct dirent *sys_dirent, *evt_dirent;
 	char id_buf[24];
 	int fd;
 	u64 id;
@@ -184,18 +184,18 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
 	if (!sys_dir)
 		return NULL;
 
-	for_each_subsystem(sys_dir, sys_dirent, sys_next) {
+	for_each_subsystem(sys_dir, sys_dirent) {
 
 		snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
-			 sys_dirent.d_name);
+			 sys_dirent->d_name);
 		evt_dir = opendir(dir_path);
 		if (!evt_dir)
 			continue;
 
-		for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
+		for_each_event(sys_dirent, evt_dir, evt_dirent) {
 
 			snprintf(evt_path, MAXPATHLEN, "%s/%s/id", dir_path,
-				 evt_dirent.d_name);
+				 evt_dirent->d_name);
 			fd = open(evt_path, O_RDONLY);
 			if (fd < 0)
 				continue;
@@ -220,9 +220,9 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
 					free(path);
 					return NULL;
 				}
-				strncpy(path->system, sys_dirent.d_name,
+				strncpy(path->system, sys_dirent->d_name,
 					MAX_EVENT_LENGTH);
-				strncpy(path->name, evt_dirent.d_name,
+				strncpy(path->name, evt_dirent->d_name,
 					MAX_EVENT_LENGTH);
 				return path;
 			}
@@ -1812,7 +1812,7 @@ void print_tracepoint_events(const char *subsys_glob, const char *event_glob,
 			     bool name_only)
 {
 	DIR *sys_dir, *evt_dir;
-	struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
+	struct dirent *sys_dirent, *evt_dirent;
 	char evt_path[MAXPATHLEN];
 	char dir_path[MAXPATHLEN];
 	char **evt_list = NULL;
@@ -1830,20 +1830,20 @@ restart:
 			goto out_close_sys_dir;
 	}
 
-	for_each_subsystem(sys_dir, sys_dirent, sys_next) {
+	for_each_subsystem(sys_dir, sys_dirent) {
 		if (subsys_glob != NULL &&
-		    !strglobmatch(sys_dirent.d_name, subsys_glob))
+		    !strglobmatch(sys_dirent->d_name, subsys_glob))
 			continue;
 
 		snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
-			 sys_dirent.d_name);
+			 sys_dirent->d_name);
 		evt_dir = opendir(dir_path);
 		if (!evt_dir)
 			continue;
 
-		for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
+		for_each_event(sys_dirent, evt_dir, evt_dirent) {
 			if (event_glob != NULL &&
-			    !strglobmatch(evt_dirent.d_name, event_glob))
+			    !strglobmatch(evt_dirent->d_name, event_glob))
 				continue;
 
 			if (!evt_num_known) {
@@ -1852,7 +1852,7 @@ restart:
 			}
 
 			snprintf(evt_path, MAXPATHLEN, "%s:%s",
-				 sys_dirent.d_name, evt_dirent.d_name);
+				 sys_dirent->d_name, evt_dirent->d_name);
 
 			evt_list[evt_i] = strdup(evt_path);
 			if (evt_list[evt_i] == NULL)
@@ -1905,7 +1905,7 @@ out_close_sys_dir:
 int is_valid_tracepoint(const char *event_string)
 {
 	DIR *sys_dir, *evt_dir;
-	struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
+	struct dirent *sys_dirent, *evt_dirent;
 	char evt_path[MAXPATHLEN];
 	char dir_path[MAXPATHLEN];
 
@@ -1913,17 +1913,17 @@ int is_valid_tracepoint(const char *event_string)
 	if (!sys_dir)
 		return 0;
 
-	for_each_subsystem(sys_dir, sys_dirent, sys_next) {
+	for_each_subsystem(sys_dir, sys_dirent) {
 
 		snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
-			 sys_dirent.d_name);
+			 sys_dirent->d_name);
 		evt_dir = opendir(dir_path);
 		if (!evt_dir)
 			continue;
 
-		for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
+		for_each_event(sys_dirent, evt_dir, evt_dirent) {
 			snprintf(evt_path, MAXPATHLEN, "%s:%s",
-				 sys_dirent.d_name, evt_dirent.d_name);
+				 sys_dirent->d_name, evt_dirent->d_name);
 			if (!strcmp(evt_path, event_string)) {
 				closedir(evt_dir);
 				closedir(sys_dir);
-- 
2.5.5

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

* [PATCH 05/10] perf dwarf: Guard !x86_64 definitions under #ifdef else clause
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 04/10] perf tools: " Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-13  2:14   ` Masami Hiramatsu
  2016-05-12 20:03 ` [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

To fix the build on Fedora Rawhide (gcc 6.0.0 20160311 (Red Hat 6.0.0-0.17):

    CC       /tmp/build/perf/arch/x86/util/dwarf-regs.o
  arch/x86/util/dwarf-regs.c:66:36: error: 'x86_32_regoffset_table' defined but not used [-Werror=unused-const-variable=]
   static const struct pt_regs_offset x86_32_regoffset_table[] = {
                                      ^~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

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-fghuksc1u8ln82bof4lwcj0o@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/dwarf-regs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/x86/util/dwarf-regs.c b/tools/perf/arch/x86/util/dwarf-regs.c
index 9223c164e545..1f86ee8fb831 100644
--- a/tools/perf/arch/x86/util/dwarf-regs.c
+++ b/tools/perf/arch/x86/util/dwarf-regs.c
@@ -63,6 +63,8 @@ struct pt_regs_offset {
 # define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)}
 #endif
 
+/* TODO: switching by dwarf address size */
+#ifndef __x86_64__
 static const struct pt_regs_offset x86_32_regoffset_table[] = {
 	REG_OFFSET_NAME_32("%ax",	eax),
 	REG_OFFSET_NAME_32("%cx",	ecx),
@@ -75,6 +77,8 @@ static const struct pt_regs_offset x86_32_regoffset_table[] = {
 	REG_OFFSET_END,
 };
 
+#define regoffset_table x86_32_regoffset_table
+#else
 static const struct pt_regs_offset x86_64_regoffset_table[] = {
 	REG_OFFSET_NAME_64("%ax",	rax),
 	REG_OFFSET_NAME_64("%dx",	rdx),
@@ -95,11 +99,7 @@ static const struct pt_regs_offset x86_64_regoffset_table[] = {
 	REG_OFFSET_END,
 };
 
-/* TODO: switching by dwarf address size */
-#ifdef __x86_64__
 #define regoffset_table x86_64_regoffset_table
-#else
-#define regoffset_table x86_32_regoffset_table
 #endif
 
 /* Minus 1 for the ending REG_OFFSET_END */
-- 
2.5.5

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

* [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 05/10] perf dwarf: Guard !x86_64 definitions under #ifdef else clause Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-13  2:38   ` Masami Hiramatsu
  2016-05-12 20:03 ` [PATCH 07/10] tools lib traceevent: Do not reassign parg after collapse_tree() Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Vinson Lee, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

If not, tell the user that:

  config/Makefile:273: Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157

And return -ENOTSUPP in die_get_var_range(), failing features that
need it, like the one pointed out above.

This fixes the build on older systems, such as Ubuntu 12.04.5.

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: Vinson Lee <vlee@freedesktop.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-9l7luqkq4gfnx7vrklkq4obs@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature                  |  2 ++
 tools/build/feature/Makefile                  |  4 ++++
 tools/build/feature/test-all.c                |  5 +++++
 tools/build/feature/test-dwarf_getlocations.c | 12 ++++++++++++
 tools/perf/config/Makefile                    |  6 ++++++
 tools/perf/util/dwarf-aux.c                   |  9 +++++++++
 6 files changed, 38 insertions(+)
 create mode 100644 tools/build/feature/test-dwarf_getlocations.c

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 6b7707270aa3..9f878619077a 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -30,6 +30,7 @@ endef
 FEATURE_TESTS_BASIC :=			\
 	backtrace			\
 	dwarf				\
+	dwarf_getlocations		\
 	fortify-source			\
 	sync-compare-and-swap		\
 	glibc				\
@@ -78,6 +79,7 @@ endif
 
 FEATURE_DISPLAY ?=			\
 	dwarf				\
+	dwarf_getlocations		\
 	glibc				\
 	gtk2				\
 	libaudit			\
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index c5f4c417428d..4ae94dbfdab9 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -3,6 +3,7 @@ FILES=					\
 	test-backtrace.bin		\
 	test-bionic.bin			\
 	test-dwarf.bin			\
+	test-dwarf_getlocations.bin	\
 	test-fortify-source.bin		\
 	test-sync-compare-and-swap.bin	\
 	test-glibc.bin			\
@@ -82,6 +83,9 @@ endif
 $(OUTPUT)test-dwarf.bin:
 	$(BUILD) $(DWARFLIBS)
 
+$(OUTPUT)test-dwarf_getlocations.bin:
+	$(BUILD) $(DWARFLIBS)
+
 $(OUTPUT)test-libelf-mmap.bin:
 	$(BUILD) -lelf
 
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index e499a36c1e4a..a282e8cb84f3 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -41,6 +41,10 @@
 # include "test-dwarf.c"
 #undef main
 
+#define main main_test_dwarf_getlocations
+# include "test-dwarf_getlocations.c"
+#undef main
+
 #define main main_test_libelf_getphdrnum
 # include "test-libelf-getphdrnum.c"
 #undef main
@@ -143,6 +147,7 @@ int main(int argc, char *argv[])
 	main_test_libelf_mmap();
 	main_test_glibc();
 	main_test_dwarf();
+	main_test_dwarf_getlocations();
 	main_test_libelf_getphdrnum();
 	main_test_libunwind();
 	main_test_libaudit();
diff --git a/tools/build/feature/test-dwarf_getlocations.c b/tools/build/feature/test-dwarf_getlocations.c
new file mode 100644
index 000000000000..70162699dd43
--- /dev/null
+++ b/tools/build/feature/test-dwarf_getlocations.c
@@ -0,0 +1,12 @@
+#include <stdlib.h>
+#include <elfutils/libdw.h>
+
+int main(void)
+{
+	Dwarf_Addr base, start, end;
+	Dwarf_Attribute attr;
+	Dwarf_Op *op;
+        size_t nops;
+	ptrdiff_t offset = 0;
+        return (int)dwarf_getlocations(&attr, offset, &base, &start, &end, &op, &nops);
+}
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f7d7f5a1cad5..6f8f6430f2bf 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -268,6 +268,12 @@ else
     ifneq ($(feature-dwarf), 1)
       msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
       NO_DWARF := 1
+    else
+      ifneq ($(feature-dwarf_getlocations), 1)
+        msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
+      else
+        CFLAGS += -DHAVE_DWARF_GETLOCATIONS
+      endif # dwarf_getlocations
     endif # Dwarf support
   endif # libelf support
 endif # NO_LIBELF
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 577e600c8eb1..aea189b41cc8 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -959,6 +959,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf)
 	return 0;
 }
 
+#ifdef HAVE_DWARF_GETLOCATIONS
 /**
  * die_get_var_innermost_scope - Get innermost scope range of given variable DIE
  * @sp_die: a subprogram DIE
@@ -1080,3 +1081,11 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf)
 
 	return ret;
 }
+#else
+int die_get_var_range(Dwarf_Die *sp_die __maybe_unused,
+		      Dwarf_Die *vr_die __maybe_unused,
+		      struct strbuf *buf __maybe_unused)
+{
+	return -ENOTSUP;
+}
+#endif
-- 
2.5.5

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

* [PATCH 07/10] tools lib traceevent: Do not reassign parg after collapse_tree()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 08/10] perf evsel: Improve EPERM error handling in open_strerror() Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Steven Rostedt, stable, #, 3.14+, Arnaldo Carvalho de Melo

From: Steven Rostedt <rostedt@goodmis.org>

At the end of process_filter(), collapse_tree() was changed to update
the parg parameter, but the reassignment after the call wasn't removed.

What happens is that the "current_op" gets modified and freed and parg
is assigned to the new allocated argument. But after the call to
collapse_tree(), parg is assigned again to the just freed "current_op",
and this causes the tool to crash.

The current_op variable must also be assigned to NULL in case of error,
otherwise it will cause it to be free()ed twice.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: stable@vger.kernel.org # 3.14+
Fixes: 42d6194d133c ("tools lib traceevent: Refactor process_filter()")
Link: http://lkml.kernel.org/r/20160511150936.678c18a1@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/parse-filter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 0144b3d1bb77..88cccea3ca99 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1164,11 +1164,11 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 		current_op = current_exp;
 
 	ret = collapse_tree(current_op, parg, error_str);
+	/* collapse_tree() may free current_op, and updates parg accordingly */
+	current_op = NULL;
 	if (ret < 0)
 		goto fail;
 
-	*parg = current_op;
-
 	free(token);
 	return 0;
 
-- 
2.5.5

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

* [PATCH 08/10] perf evsel: Improve EPERM error handling in open_strerror()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 07/10] tools lib traceevent: Do not reassign parg after collapse_tree() Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 09/10] perf evsel: Handle EACCESS + perf_event_paranoid=2 in fallback() Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andy Lutomirski, David Ahern, Jiri Olsa, Kees Cook,
	Linus Torvalds, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
	Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

We were showing a hardcoded default value for the kernel.perf_event_paranoid
sysctl, now that it became more paranoid (1 -> 2 [1]), this would need to be
updated, instead show the current value:

  [acme@jouet linux]$ perf record ls
  Error:
  You may not have permission to collect stats.

  Consider tweaking /proc/sys/kernel/perf_event_paranoid,
  which controls use of the performance events system by
  unprivileged users (without CAP_SYS_ADMIN).

  The current value is 2:

    -1: Allow use of (almost) all events by all users
  >= 0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
  >= 1: Disallow CPU event access by users without CAP_SYS_ADMIN
  >= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN
  [acme@jouet linux]$

[1] 0161028b7c8a ("perf/core: Change the default paranoia level to 2")

Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-0gc4rdpg8d025r5not8s8028@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 738ce226002b..a5f339d447cc 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2382,12 +2382,13 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
 		 "Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n"
 		 "which controls use of the performance events system by\n"
 		 "unprivileged users (without CAP_SYS_ADMIN).\n\n"
-		 "The default value is 1:\n\n"
+		 "The current value is %d:\n\n"
 		 "  -1: Allow use of (almost) all events by all users\n"
 		 ">= 0: Disallow raw tracepoint access by users without CAP_IOC_LOCK\n"
 		 ">= 1: Disallow CPU event access by users without CAP_SYS_ADMIN\n"
 		 ">= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN",
-				 target->system_wide ? "system-wide " : "");
+				 target->system_wide ? "system-wide " : "",
+				 perf_event_paranoid());
 	case ENOENT:
 		return scnprintf(msg, size, "The %s event is not supported.",
 				 perf_evsel__name(evsel));
-- 
2.5.5

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

* [PATCH 09/10] perf evsel: Handle EACCESS + perf_event_paranoid=2 in fallback()
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 08/10] perf evsel: Improve EPERM error handling in open_strerror() Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-12 20:03 ` [PATCH 10/10] perf stat: Fallback to user only counters when perf_event_paranoid > 1 Arnaldo Carvalho de Melo
  2016-05-13  5:36 ` [GIT PULL 00/10] perf/urgent fixes Ingo Molnar
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andy Lutomirski, David Ahern, Jiri Olsa, Kees Cook,
	Linus Torvalds, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
	Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Now with the default for the kernel.perf_event_paranoid sysctl being 2 [1]
we need to fall back to :u, i.e. to set perf_event_attr.exclude_kernel
to 1.

Before:

  [acme@jouet linux]$ perf record usleep 1
  Error:
  You may not have permission to collect stats.

  Consider tweaking /proc/sys/kernel/perf_event_paranoid,
  which controls use of the performance events system by
  unprivileged users (without CAP_SYS_ADMIN).

  The current value is 2:

    -1: Allow use of (almost) all events by all users
  >= 0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
  >= 1: Disallow CPU event access by users without CAP_SYS_ADMIN
  >= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN
  [acme@jouet linux]$

After:

  [acme@jouet linux]$ perf record usleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.016 MB perf.data (7 samples) ]
  [acme@jouet linux]$ perf evlist
  cycles:u
  [acme@jouet linux]$ perf evlist -v
  cycles:u: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, disabled: 1, inherit: 1, exclude_kernel: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1
  [acme@jouet linux]$

And if the user turns on verbose mode, an explanation will appear:

  [acme@jouet linux]$ perf record -v usleep 1
  Warning:
  kernel.perf_event_paranoid=2, trying to fall back to excluding kernel samples
  mmap size 528384B
  [ perf record: Woken up 1 times to write data ]
  Looking at the vmlinux_path (8 entries long)
  Using /lib/modules/4.6.0-rc7+/build/vmlinux for symbols
  [ perf record: Captured and wrote 0.016 MB perf.data (7 samples) ]
  [acme@jouet linux]$

[1] 0161028b7c8a ("perf/core: Change the default paranoia level to 2")

Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-b20jmx4dxt5hpaa9t2rroi0o@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index a5f339d447cc..645dc1828836 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2345,6 +2345,8 @@ out:
 bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
 			  char *msg, size_t msgsize)
 {
+	int paranoid;
+
 	if ((err == ENOENT || err == ENXIO || err == ENODEV) &&
 	    evsel->attr.type   == PERF_TYPE_HARDWARE &&
 	    evsel->attr.config == PERF_COUNT_HW_CPU_CYCLES) {
@@ -2364,6 +2366,22 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
 
 		zfree(&evsel->name);
 		return true;
+	} else if (err == EACCES && !evsel->attr.exclude_kernel &&
+		   (paranoid = perf_event_paranoid()) > 1) {
+		const char *name = perf_evsel__name(evsel);
+		char *new_name;
+
+		if (asprintf(&new_name, "%s%su", name, strchr(name, ':') ? "" : ":") < 0)
+			return false;
+
+		if (evsel->name)
+			free(evsel->name);
+		evsel->name = new_name;
+		scnprintf(msg, msgsize,
+"kernel.perf_event_paranoid=%d, trying to fall back to excluding kernel samples", paranoid);
+		evsel->attr.exclude_kernel = 1;
+
+		return true;
 	}
 
 	return false;
-- 
2.5.5

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

* [PATCH 10/10] perf stat: Fallback to user only counters when perf_event_paranoid > 1
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 09/10] perf evsel: Handle EACCESS + perf_event_paranoid=2 in fallback() Arnaldo Carvalho de Melo
@ 2016-05-12 20:03 ` Arnaldo Carvalho de Melo
  2016-05-13  5:36 ` [GIT PULL 00/10] perf/urgent fixes Ingo Molnar
  10 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-12 20:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andy Lutomirski, David Ahern, Jiri Olsa, Kees Cook,
	Linus Torvalds, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
	Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

After 0161028b7c8a ("perf/core: Change the default paranoia level to 2")
'perf stat' fails for users without CAP_SYS_ADMIN, so just use
'perf_evsel__fallback()' to have the same behaviour as 'perf record',
i.e. set perf_event_attr.exclude_kernel to 1.

Now:

  [acme@jouet linux]$ perf stat usleep 1

   Performance counter stats for 'usleep 1':

          0.352536      task-clock:u (msec)  #   0.423 CPUs utilized
                 0      context-switches:u   #   0.000 K/sec
                 0      cpu-migrations:u     #   0.000 K/sec
                49      page-faults:u        #   0.139 M/sec
           309,407      cycles:u             #   0.878 GHz
           243,791      instructions:u       #   0.79  insn per cycle
            49,622      branches:u           # 140.757 M/sec
             3,884      branch-misses:u      #   7.83% of all branches

       0.000834174 seconds time elapsed

  [acme@jouet linux]$

Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-b20jmx4dxt5hpaa9t2rroi0o@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 1f19f2f999c8..307e8a1a003c 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -528,6 +528,7 @@ static int __run_perf_stat(int argc, const char **argv)
 		perf_evlist__set_leader(evsel_list);
 
 	evlist__for_each(evsel_list, counter) {
+try_again:
 		if (create_perf_stat_counter(counter) < 0) {
 			/*
 			 * PPC returns ENXIO for HW counters until 2.6.37
@@ -544,7 +545,11 @@ static int __run_perf_stat(int argc, const char **argv)
 				if ((counter->leader != counter) ||
 				    !(counter->leader->nr_members > 1))
 					continue;
-			}
+			} else if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) {
+                                if (verbose)
+                                        ui__warning("%s\n", msg);
+                                goto try_again;
+                        }
 
 			perf_evsel__open_strerror(counter, &target,
 						  errno, msg, sizeof(msg));
-- 
2.5.5

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

* Re: [PATCH 05/10] perf dwarf: Guard !x86_64 definitions under #ifdef else clause
  2016-05-12 20:03 ` [PATCH 05/10] perf dwarf: Guard !x86_64 definitions under #ifdef else clause Arnaldo Carvalho de Melo
@ 2016-05-13  2:14   ` Masami Hiramatsu
  0 siblings, 0 replies; 21+ messages in thread
From: Masami Hiramatsu @ 2016-05-13  2:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
	Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan

On Thu, 12 May 2016 17:03:50 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> To fix the build on Fedora Rawhide (gcc 6.0.0 20160311 (Red Hat 6.0.0-0.17):
> 
>     CC       /tmp/build/perf/arch/x86/util/dwarf-regs.o
>   arch/x86/util/dwarf-regs.c:66:36: error: 'x86_32_regoffset_table' defined but not used [-Werror=unused-const-variable=]
>    static const struct pt_regs_offset x86_32_regoffset_table[] = {
>                                       ^~~~~~~~~~~~~~~~~~~~~~
>   cc1: all warnings being treated as errors

Looks good to me too.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> 
> 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-fghuksc1u8ln82bof4lwcj0o@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/perf/arch/x86/util/dwarf-regs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/arch/x86/util/dwarf-regs.c b/tools/perf/arch/x86/util/dwarf-regs.c
> index 9223c164e545..1f86ee8fb831 100644
> --- a/tools/perf/arch/x86/util/dwarf-regs.c
> +++ b/tools/perf/arch/x86/util/dwarf-regs.c
> @@ -63,6 +63,8 @@ struct pt_regs_offset {
>  # define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)}
>  #endif
>  
> +/* TODO: switching by dwarf address size */
> +#ifndef __x86_64__
>  static const struct pt_regs_offset x86_32_regoffset_table[] = {
>  	REG_OFFSET_NAME_32("%ax",	eax),
>  	REG_OFFSET_NAME_32("%cx",	ecx),
> @@ -75,6 +77,8 @@ static const struct pt_regs_offset x86_32_regoffset_table[] = {
>  	REG_OFFSET_END,
>  };
>  
> +#define regoffset_table x86_32_regoffset_table
> +#else
>  static const struct pt_regs_offset x86_64_regoffset_table[] = {
>  	REG_OFFSET_NAME_64("%ax",	rax),
>  	REG_OFFSET_NAME_64("%dx",	rdx),
> @@ -95,11 +99,7 @@ static const struct pt_regs_offset x86_64_regoffset_table[] = {
>  	REG_OFFSET_END,
>  };
>  
> -/* TODO: switching by dwarf address size */
> -#ifdef __x86_64__
>  #define regoffset_table x86_64_regoffset_table
> -#else
> -#define regoffset_table x86_32_regoffset_table
>  #endif
>  
>  /* Minus 1 for the ending REG_OFFSET_END */
> -- 
> 2.5.5
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

* Re: [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available
  2016-05-12 20:03 ` [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available Arnaldo Carvalho de Melo
@ 2016-05-13  2:38   ` Masami Hiramatsu
  2016-05-13 11:47     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 21+ messages in thread
From: Masami Hiramatsu @ 2016-05-13  2:38 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
	Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Vinson Lee,
	Wang Nan

On Thu, 12 May 2016 17:03:51 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> If not, tell the user that:
> 
>   config/Makefile:273: Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157
> 
> And return -ENOTSUPP in die_get_var_range(), failing features that
> need it, like the one pointed out above.
> 
> This fixes the build on older systems, such as Ubuntu 12.04.5.
> 

Hmm, would we better to use similar technique for dwarf_cfi_addrframe?
the commit 7752f1b096e1
("perf probe: Don't compile CFI related code if elfutils is old")
uses _ELFUTILS_PREREQ() macro for checking the elfutils version directly.

Anyway, this looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

> 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: Vinson Lee <vlee@freedesktop.org>
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: http://lkml.kernel.org/n/tip-9l7luqkq4gfnx7vrklkq4obs@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/build/Makefile.feature                  |  2 ++
>  tools/build/feature/Makefile                  |  4 ++++
>  tools/build/feature/test-all.c                |  5 +++++
>  tools/build/feature/test-dwarf_getlocations.c | 12 ++++++++++++
>  tools/perf/config/Makefile                    |  6 ++++++
>  tools/perf/util/dwarf-aux.c                   |  9 +++++++++
>  6 files changed, 38 insertions(+)
>  create mode 100644 tools/build/feature/test-dwarf_getlocations.c
> 
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 6b7707270aa3..9f878619077a 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -30,6 +30,7 @@ endef
>  FEATURE_TESTS_BASIC :=			\
>  	backtrace			\
>  	dwarf				\
> +	dwarf_getlocations		\
>  	fortify-source			\
>  	sync-compare-and-swap		\
>  	glibc				\
> @@ -78,6 +79,7 @@ endif
>  
>  FEATURE_DISPLAY ?=			\
>  	dwarf				\
> +	dwarf_getlocations		\
>  	glibc				\
>  	gtk2				\
>  	libaudit			\
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index c5f4c417428d..4ae94dbfdab9 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -3,6 +3,7 @@ FILES=					\
>  	test-backtrace.bin		\
>  	test-bionic.bin			\
>  	test-dwarf.bin			\
> +	test-dwarf_getlocations.bin	\
>  	test-fortify-source.bin		\
>  	test-sync-compare-and-swap.bin	\
>  	test-glibc.bin			\
> @@ -82,6 +83,9 @@ endif
>  $(OUTPUT)test-dwarf.bin:
>  	$(BUILD) $(DWARFLIBS)
>  
> +$(OUTPUT)test-dwarf_getlocations.bin:
> +	$(BUILD) $(DWARFLIBS)
> +
>  $(OUTPUT)test-libelf-mmap.bin:
>  	$(BUILD) -lelf
>  
> diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
> index e499a36c1e4a..a282e8cb84f3 100644
> --- a/tools/build/feature/test-all.c
> +++ b/tools/build/feature/test-all.c
> @@ -41,6 +41,10 @@
>  # include "test-dwarf.c"
>  #undef main
>  
> +#define main main_test_dwarf_getlocations
> +# include "test-dwarf_getlocations.c"
> +#undef main
> +
>  #define main main_test_libelf_getphdrnum
>  # include "test-libelf-getphdrnum.c"
>  #undef main
> @@ -143,6 +147,7 @@ int main(int argc, char *argv[])
>  	main_test_libelf_mmap();
>  	main_test_glibc();
>  	main_test_dwarf();
> +	main_test_dwarf_getlocations();
>  	main_test_libelf_getphdrnum();
>  	main_test_libunwind();
>  	main_test_libaudit();
> diff --git a/tools/build/feature/test-dwarf_getlocations.c b/tools/build/feature/test-dwarf_getlocations.c
> new file mode 100644
> index 000000000000..70162699dd43
> --- /dev/null
> +++ b/tools/build/feature/test-dwarf_getlocations.c
> @@ -0,0 +1,12 @@
> +#include <stdlib.h>
> +#include <elfutils/libdw.h>
> +
> +int main(void)
> +{
> +	Dwarf_Addr base, start, end;
> +	Dwarf_Attribute attr;
> +	Dwarf_Op *op;
> +        size_t nops;
> +	ptrdiff_t offset = 0;
> +        return (int)dwarf_getlocations(&attr, offset, &base, &start, &end, &op, &nops);
> +}
> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> index f7d7f5a1cad5..6f8f6430f2bf 100644
> --- a/tools/perf/config/Makefile
> +++ b/tools/perf/config/Makefile
> @@ -268,6 +268,12 @@ else
>      ifneq ($(feature-dwarf), 1)
>        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
>        NO_DWARF := 1
> +    else
> +      ifneq ($(feature-dwarf_getlocations), 1)
> +        msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
> +      else
> +        CFLAGS += -DHAVE_DWARF_GETLOCATIONS
> +      endif # dwarf_getlocations
>      endif # Dwarf support
>    endif # libelf support
>  endif # NO_LIBELF
> diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
> index 577e600c8eb1..aea189b41cc8 100644
> --- a/tools/perf/util/dwarf-aux.c
> +++ b/tools/perf/util/dwarf-aux.c
> @@ -959,6 +959,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf)
>  	return 0;
>  }
>  
> +#ifdef HAVE_DWARF_GETLOCATIONS
>  /**
>   * die_get_var_innermost_scope - Get innermost scope range of given variable DIE
>   * @sp_die: a subprogram DIE
> @@ -1080,3 +1081,11 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf)
>  
>  	return ret;
>  }
> +#else
> +int die_get_var_range(Dwarf_Die *sp_die __maybe_unused,
> +		      Dwarf_Die *vr_die __maybe_unused,
> +		      struct strbuf *buf __maybe_unused)
> +{
> +	return -ENOTSUP;
> +}
> +#endif
> -- 
> 2.5.5
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

* Re: [GIT PULL 00/10] perf/urgent fixes
  2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2016-05-12 20:03 ` [PATCH 10/10] perf stat: Fallback to user only counters when perf_event_paranoid > 1 Arnaldo Carvalho de Melo
@ 2016-05-13  5:36 ` Ingo Molnar
  10 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2016-05-13  5:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andy Lutomirski, David Ahern,
	Jiri Olsa, Kees Cook, Linus Torvalds, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, Steven Rostedt, Vinson Lee,
	Wang Nan, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling, test built on:
> 
> alldeps-fedora-rawhide: Ok
> alldeps-ubuntu-14.04: Ok
> alldeps-ubuntu-16.04: Ok
> alldeps-fedora-20: Ok
> alldeps-ubuntu-12.04: Ok
> minimal-debian-experimental-x-mips64: Ok
> minimal-debian-experimental-x-mips64el: Ok
> minimal-debian-experimental-x-mipsel: Ok
> minimal-ubuntu-x-arm: Ok
> minimal-ubuntu-x-arm64: Ok
> minimal-ubuntu-x-ppc64: Ok
> minimal-ubuntu-x-ppc64el: Ok
> alldeps-debian: Ok
> alldeps-mageia: Ok
> alldeps-rhel7: Ok
> alldeps-centos: Ok
> alldeps-opensuse: Ok
> 
> - Arnaldo
> 
> The following changes since commit 9f448cd3cbcec8995935e60b27802ae56aac8cc0:
> 
>   perf/core: Disable the event on a truncated AUX record (2016-05-12 14:46:11 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-20160512
> 
> for you to fetch changes up to 42ef8a78c1f49f53f29f0f3a6f9a5bcbc653233e:
> 
>   perf stat: Fallback to user only counters when perf_event_paranoid > 1 (2016-05-12 16:25:18 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> User visible:
> 
> - Fallback to usermode only counters when perf_event_paranoid > 1, which
>   is the case now (Arnaldo Carvalho de Melo)
> 
> - Do not reassign parg after collapse_tree() in libtraceevent, which
>   may cause tool crashes (Steven Rostedt)
> 
> Build fixes:
> 
> - Fix the build on Fedora Rawhide, where readdir_r() is deprecated and
>   also wrt -Werror=unused-const-variable= + x86_32_regoffset_table on
>   !x86_64 (Arnaldo Carvalho de Melo)
> 
> - Fix the build on Ubuntu 12.04.5, where dwarf_getlocations() isn't
>   available, i.e. libdw-dev < 0.157 (Arnaldo Carvalho de Melo)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (9):
>       perf tools: Use readdir() instead of deprecated readdir_r()
>       perf script: Use readdir() instead of deprecated readdir_r()
>       perf thread_map: Use readdir() instead of deprecated readdir_r()
>       perf tools: Use readdir() instead of deprecated readdir_r()
>       perf dwarf: Guard !x86_64 definitions under #ifdef else clause
>       perf probe: Check if dwarf_getlocations() is available
>       perf evsel: Improve EPERM error handling in open_strerror()
>       perf evsel: Handle EACCESS + perf_event_paranoid=2 in fallback()
>       perf stat: Fallback to user only counters when perf_event_paranoid > 1
> 
> Steven Rostedt (1):
>       tools lib traceevent: Do not reassign parg after collapse_tree()
> 
>  tools/build/Makefile.feature                  |  2 +
>  tools/build/feature/Makefile                  |  4 ++
>  tools/build/feature/test-all.c                |  5 ++
>  tools/build/feature/test-dwarf_getlocations.c | 12 +++++
>  tools/lib/traceevent/parse-filter.c           |  4 +-
>  tools/perf/arch/x86/util/dwarf-regs.c         |  8 +--
>  tools/perf/builtin-script.c                   | 70 +++++++++++++--------------
>  tools/perf/builtin-stat.c                     |  7 ++-
>  tools/perf/config/Makefile                    |  6 +++
>  tools/perf/util/dwarf-aux.c                   |  9 ++++
>  tools/perf/util/event.c                       | 12 ++---
>  tools/perf/util/evsel.c                       | 23 ++++++++-
>  tools/perf/util/parse-events.c                | 60 +++++++++++------------
>  tools/perf/util/thread_map.c                  |  8 +--
>  14 files changed, 145 insertions(+), 85 deletions(-)
>  create mode 100644 tools/build/feature/test-dwarf_getlocations.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available
  2016-05-13  2:38   ` Masami Hiramatsu
@ 2016-05-13 11:47     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-13 11:47 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
	Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Vinson Lee,
	Wang Nan

Em Fri, May 13, 2016 at 11:38:52AM +0900, Masami Hiramatsu escreveu:
> On Thu, 12 May 2016 17:03:51 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> > 
> > If not, tell the user that:
> > 
> >   config/Makefile:273: Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157
> > 
> > And return -ENOTSUPP in die_get_var_range(), failing features that
> > need it, like the one pointed out above.
> > 
> > This fixes the build on older systems, such as Ubuntu 12.04.5.
> > 
> 
> Hmm, would we better to use similar technique for dwarf_cfi_addrframe?
> the commit 7752f1b096e1
> ("perf probe: Don't compile CFI related code if elfutils is old")
> uses _ELFUTILS_PREREQ() macro for checking the elfutils version directly.

I'll take a look at this.
 
> Anyway, this looks good to me.
> 
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks for verifying this and the other one!

- Arnaldo
 
> > 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: Vinson Lee <vlee@freedesktop.org>
> > Cc: Wang Nan <wangnan0@huawei.com>
> > Link: http://lkml.kernel.org/n/tip-9l7luqkq4gfnx7vrklkq4obs@git.kernel.org
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > ---
> >  tools/build/Makefile.feature                  |  2 ++
> >  tools/build/feature/Makefile                  |  4 ++++
> >  tools/build/feature/test-all.c                |  5 +++++
> >  tools/build/feature/test-dwarf_getlocations.c | 12 ++++++++++++
> >  tools/perf/config/Makefile                    |  6 ++++++
> >  tools/perf/util/dwarf-aux.c                   |  9 +++++++++
> >  6 files changed, 38 insertions(+)
> >  create mode 100644 tools/build/feature/test-dwarf_getlocations.c
> > 
> > diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> > index 6b7707270aa3..9f878619077a 100644
> > --- a/tools/build/Makefile.feature
> > +++ b/tools/build/Makefile.feature
> > @@ -30,6 +30,7 @@ endef
> >  FEATURE_TESTS_BASIC :=			\
> >  	backtrace			\
> >  	dwarf				\
> > +	dwarf_getlocations		\
> >  	fortify-source			\
> >  	sync-compare-and-swap		\
> >  	glibc				\
> > @@ -78,6 +79,7 @@ endif
> >  
> >  FEATURE_DISPLAY ?=			\
> >  	dwarf				\
> > +	dwarf_getlocations		\
> >  	glibc				\
> >  	gtk2				\
> >  	libaudit			\
> > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> > index c5f4c417428d..4ae94dbfdab9 100644
> > --- a/tools/build/feature/Makefile
> > +++ b/tools/build/feature/Makefile
> > @@ -3,6 +3,7 @@ FILES=					\
> >  	test-backtrace.bin		\
> >  	test-bionic.bin			\
> >  	test-dwarf.bin			\
> > +	test-dwarf_getlocations.bin	\
> >  	test-fortify-source.bin		\
> >  	test-sync-compare-and-swap.bin	\
> >  	test-glibc.bin			\
> > @@ -82,6 +83,9 @@ endif
> >  $(OUTPUT)test-dwarf.bin:
> >  	$(BUILD) $(DWARFLIBS)
> >  
> > +$(OUTPUT)test-dwarf_getlocations.bin:
> > +	$(BUILD) $(DWARFLIBS)
> > +
> >  $(OUTPUT)test-libelf-mmap.bin:
> >  	$(BUILD) -lelf
> >  
> > diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
> > index e499a36c1e4a..a282e8cb84f3 100644
> > --- a/tools/build/feature/test-all.c
> > +++ b/tools/build/feature/test-all.c
> > @@ -41,6 +41,10 @@
> >  # include "test-dwarf.c"
> >  #undef main
> >  
> > +#define main main_test_dwarf_getlocations
> > +# include "test-dwarf_getlocations.c"
> > +#undef main
> > +
> >  #define main main_test_libelf_getphdrnum
> >  # include "test-libelf-getphdrnum.c"
> >  #undef main
> > @@ -143,6 +147,7 @@ int main(int argc, char *argv[])
> >  	main_test_libelf_mmap();
> >  	main_test_glibc();
> >  	main_test_dwarf();
> > +	main_test_dwarf_getlocations();
> >  	main_test_libelf_getphdrnum();
> >  	main_test_libunwind();
> >  	main_test_libaudit();
> > diff --git a/tools/build/feature/test-dwarf_getlocations.c b/tools/build/feature/test-dwarf_getlocations.c
> > new file mode 100644
> > index 000000000000..70162699dd43
> > --- /dev/null
> > +++ b/tools/build/feature/test-dwarf_getlocations.c
> > @@ -0,0 +1,12 @@
> > +#include <stdlib.h>
> > +#include <elfutils/libdw.h>
> > +
> > +int main(void)
> > +{
> > +	Dwarf_Addr base, start, end;
> > +	Dwarf_Attribute attr;
> > +	Dwarf_Op *op;
> > +        size_t nops;
> > +	ptrdiff_t offset = 0;
> > +        return (int)dwarf_getlocations(&attr, offset, &base, &start, &end, &op, &nops);
> > +}
> > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> > index f7d7f5a1cad5..6f8f6430f2bf 100644
> > --- a/tools/perf/config/Makefile
> > +++ b/tools/perf/config/Makefile
> > @@ -268,6 +268,12 @@ else
> >      ifneq ($(feature-dwarf), 1)
> >        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
> >        NO_DWARF := 1
> > +    else
> > +      ifneq ($(feature-dwarf_getlocations), 1)
> > +        msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
> > +      else
> > +        CFLAGS += -DHAVE_DWARF_GETLOCATIONS
> > +      endif # dwarf_getlocations
> >      endif # Dwarf support
> >    endif # libelf support
> >  endif # NO_LIBELF
> > diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
> > index 577e600c8eb1..aea189b41cc8 100644
> > --- a/tools/perf/util/dwarf-aux.c
> > +++ b/tools/perf/util/dwarf-aux.c
> > @@ -959,6 +959,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf)
> >  	return 0;
> >  }
> >  
> > +#ifdef HAVE_DWARF_GETLOCATIONS
> >  /**
> >   * die_get_var_innermost_scope - Get innermost scope range of given variable DIE
> >   * @sp_die: a subprogram DIE
> > @@ -1080,3 +1081,11 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf)
> >  
> >  	return ret;
> >  }
> > +#else
> > +int die_get_var_range(Dwarf_Die *sp_die __maybe_unused,
> > +		      Dwarf_Die *vr_die __maybe_unused,
> > +		      struct strbuf *buf __maybe_unused)
> > +{
> > +	return -ENOTSUP;
> > +}
> > +#endif
> > -- 
> > 2.5.5
> > 
> 
> 
> -- 
> Masami Hiramatsu <mhiramat@kernel.org>

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

* Re: [GIT PULL 00/10] perf/urgent fixes
  2018-02-05 19:56 Arnaldo Carvalho de Melo
@ 2018-02-05 21:28 ` Ingo Molnar
  0 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2018-02-05 21:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Christian Borntraeger, Dave Hansen, David Ahern, David Woodhouse,
	Fenghua Yu, Hendrik Brueckner, Jiri Olsa, Juri Lelli, Kan Liang,
	Maciej S . Szmigiero, Namhyung Kim, Paolo Bonzini,
	Paul Mackerras, Peter Zijlstra, Radim Krčmář,
	Ravi Bangoria, Stephane Eranian, Takashi Iwai, Thomas Gleixner,
	Thomas Richter, Wang Nan


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 72906f38934a49faf4d2d38ea9ae32adcf7d5d0c:
> 
>   Merge branch 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (2018-01-30 13:04:50 -0800)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-4.16-20180205
> 
> for you to fetch changes up to 2fe2230d4183d2c311bbb7b426491ac486216a16:
> 
>   perf tools: Add trace/beauty/generated/ into .gitignore (2018-02-05 13:58:02 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> - 'period' and 'freq' handling fixes for 'perf record', also
>   related: add Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS
>   in the x86 perf kernel driver (Jiri Olsa)
> 
> - Fix 'perf trace -i perf.data' callgraph handling (Ravi Bangoria)
> 
> - Synchronize tooling headers for asound, s390 and powerpc KVM,
>   sched and x86 features (Arnaldo Carvalho de Melo)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (5):
>       tools headers: Synchronize sound/asound.h
>       tooling headers: Synchronize updated s390 kvm UAPI headers
>       tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h
>       tools headers: Synchronize uapi/linux/sched.h
>       tools headers: Synchoronize x86 features UAPI headers
> 
> Jiri Olsa (3):
>       perf evsel: Fix period/freq terms setup
>       perf record: Fix period option handling
>       x86/events/intel/ds: Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS
> 
> Ravi Bangoria (2):
>       perf trace: Fix call-graph output
>       perf tools: Add trace/beauty/generated/ into .gitignore
> 
>  arch/x86/events/perf_event.h                   |  3 ++-
>  tools/arch/powerpc/include/uapi/asm/kvm.h      | 25 +++++++++++++++++++++++++
>  tools/arch/s390/include/uapi/asm/kvm.h         |  5 ++++-
>  tools/arch/x86/include/asm/cpufeatures.h       | 24 ++++++++++++++++++++----
>  tools/arch/x86/include/asm/disabled-features.h |  3 ++-
>  tools/arch/x86/include/asm/required-features.h |  3 ++-
>  tools/include/uapi/linux/kvm.h                 |  4 ++++
>  tools/include/uapi/linux/sched.h               |  5 +++++
>  tools/include/uapi/sound/asound.h              |  9 +++++++++
>  tools/perf/.gitignore                          |  1 +
>  tools/perf/builtin-record.c                    |  3 ++-
>  tools/perf/builtin-trace.c                     |  5 ++++-
>  tools/perf/perf.h                              |  1 +
>  tools/perf/util/evsel.c                        | 13 ++++++++++---
>  14 files changed, 91 insertions(+), 13 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/10] perf/urgent fixes
@ 2018-02-05 19:56 Arnaldo Carvalho de Melo
  2018-02-05 21:28 ` Ingo Molnar
  0 siblings, 1 reply; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-02-05 19:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Christian Borntraeger, Dave Hansen, David Ahern, David Woodhouse,
	Fenghua Yu, Hendrik Brueckner, Jiri Olsa, Juri Lelli, Kan Liang,
	Maciej S . Szmigiero, Namhyung Kim, Paolo Bonzini,
	Paul Mackerras, Peter Zijlstra, Radim Krčmář,
	Ravi Bangoria, Stephane Eranian, Takashi Iwai, Thomas Gleixner,
	Thomas Richter, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit 72906f38934a49faf4d2d38ea9ae32adcf7d5d0c:

  Merge branch 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (2018-01-30 13:04:50 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-4.16-20180205

for you to fetch changes up to 2fe2230d4183d2c311bbb7b426491ac486216a16:

  perf tools: Add trace/beauty/generated/ into .gitignore (2018-02-05 13:58:02 -0300)

----------------------------------------------------------------
perf/urgent fixes:

- 'period' and 'freq' handling fixes for 'perf record', also
  related: add Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS
  in the x86 perf kernel driver (Jiri Olsa)

- Fix 'perf trace -i perf.data' callgraph handling (Ravi Bangoria)

- Synchronize tooling headers for asound, s390 and powerpc KVM,
  sched and x86 features (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (5):
      tools headers: Synchronize sound/asound.h
      tooling headers: Synchronize updated s390 kvm UAPI headers
      tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h
      tools headers: Synchronize uapi/linux/sched.h
      tools headers: Synchoronize x86 features UAPI headers

Jiri Olsa (3):
      perf evsel: Fix period/freq terms setup
      perf record: Fix period option handling
      x86/events/intel/ds: Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS

Ravi Bangoria (2):
      perf trace: Fix call-graph output
      perf tools: Add trace/beauty/generated/ into .gitignore

 arch/x86/events/perf_event.h                   |  3 ++-
 tools/arch/powerpc/include/uapi/asm/kvm.h      | 25 +++++++++++++++++++++++++
 tools/arch/s390/include/uapi/asm/kvm.h         |  5 ++++-
 tools/arch/x86/include/asm/cpufeatures.h       | 24 ++++++++++++++++++++----
 tools/arch/x86/include/asm/disabled-features.h |  3 ++-
 tools/arch/x86/include/asm/required-features.h |  3 ++-
 tools/include/uapi/linux/kvm.h                 |  4 ++++
 tools/include/uapi/linux/sched.h               |  5 +++++
 tools/include/uapi/sound/asound.h              |  9 +++++++++
 tools/perf/.gitignore                          |  1 +
 tools/perf/builtin-record.c                    |  3 ++-
 tools/perf/builtin-trace.c                     |  5 ++++-
 tools/perf/perf.h                              |  1 +
 tools/perf/util/evsel.c                        | 13 ++++++++++---
 14 files changed, 91 insertions(+), 13 deletions(-)

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support.  Where clang is available, it is also used to build
perf with/without libelf.

The objtool and samples/bpf/ builds are disabled now that I'm switching from
using the sources in a local volume to fetching them from a http server to
build it inside the container, to make it easier to build in a container cluster.
Those will come back later.

Several are cross builds, the ones with -x-ARCH and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.

The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.

Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.

  # dm
   1 alpine:3.4                    : Ok   gcc (Alpine 5.3.0) 5.3.0
   2 alpine:3.5                    : Ok   gcc (Alpine 6.2.1) 6.2.1 20160822
   3 alpine:3.6                    : Ok   gcc (Alpine 6.3.0) 6.3.0
   4 alpine:edge                   : Ok   gcc (Alpine 6.4.0) 6.4.0
   5 amazonlinux:1                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
   6 amazonlinux:2                 : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
   7 android-ndk:r12b-arm          : Ok   arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
   8 android-ndk:r15c-arm          : Ok   arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
   9 centos:5                      : Ok   gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
  10 centos:6                      : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
  11 centos:7                      : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
  12 debian:7                      : Ok   gcc (Debian 4.7.2-5) 4.7.2
  13 debian:8                      : Ok   gcc (Debian 4.9.2-10) 4.9.2
  14 debian:9                      : Ok   gcc (Debian 6.3.0-18) 6.3.0 20170516
  15 debian:experimental           : Ok   gcc (Debian 7.2.0-17) 7.2.1 20171205
  16 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
  17 debian:experimental-x-mips    : Ok   mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
  18 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc (Debian 7.2.0-11) 7.2.0
  19 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
  20 fedora:20                     : Ok   gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
  21 fedora:21                     : Ok   gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
  22 fedora:22                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  23 fedora:23                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  24 fedora:24                     : Ok   gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  25 fedora:24-x-ARC-uClibc        : Ok   arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
  26 fedora:25                     : Ok   gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
  27 fedora:26                     : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
  28 fedora:27                     : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
  29 fedora:rawhide                : Ok   gcc (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1)
  30 gentoo-stage3-amd64:latest    : Ok   gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0
  31 mageia:5                      : Ok   gcc (GCC) 4.9.2
  32 mageia:6                      : Ok   gcc (Mageia 5.4.0-5.mga6) 5.4.0
  33 opensuse:42.1                 : Ok   gcc (SUSE Linux) 4.8.5
  34 opensuse:42.2                 : Ok   gcc (SUSE Linux) 4.8.5
  35 opensuse:42.3                 : Ok   gcc (SUSE Linux) 4.8.5
  36 opensuse:tumbleweed           : Ok   gcc (SUSE Linux) 7.3.0
  37 oraclelinux:6                 : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
  38 oraclelinux:7                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
  39 ubuntu:12.04.5                : Ok   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  40 ubuntu:14.04.4                : Ok   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  41 ubuntu:14.04.4-x-linaro-arm64 : Ok   aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404
  42 ubuntu:15.04                  : Ok   gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
  43 ubuntu:16.04                  : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
  44 ubuntu:16.04-x-arm            : Ok   arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  45 ubuntu:16.04-x-arm64          : Ok   aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  46 ubuntu:16.04-x-powerpc        : Ok   powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  47 ubuntu:16.04-x-powerpc64      : Ok   powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
  48 ubuntu:16.04-x-powerpc64el    : Ok   powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  49 ubuntu:16.04-x-s390           : Ok   s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  50 ubuntu:16.10                  : Ok   gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
  51 ubuntu:17.04                  : Ok   gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
  52 ubuntu:17.10                  : Ok   gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
  53 ubuntu:18.04                  : Ok   gcc (Ubuntu 7.2.0-16ubuntu1) 7.2.0

  # uname -a
  Linux jouet 4.15.0-rc9+ #7 SMP Mon Jan 22 18:16:36 -03 2018 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms                       : Ok
   2: Detect openat syscall event                           : Ok
   3: Detect openat syscall event on all cpus               : Ok
   4: Read samples using the mmap interface                 : Ok
   5: Test data source output                               : Ok
   6: Parse event definition strings                        : Ok
   7: Simple expression parser                              : Ok
   8: PERF_RECORD_* events & perf_sample fields             : Ok
   9: Parse perf pmu format                                 : Ok
  10: DSO data read                                         : Ok
  11: DSO data cache                                        : Ok
  12: DSO data reopen                                       : Ok
  13: Roundtrip evsel->name                                 : Ok
  14: Parse sched tracepoints fields                        : Ok
  15: syscalls:sys_enter_openat event fields                : Ok
  16: Setup struct perf_event_attr                          : Ok
  17: Match and link multiple hists                         : Ok
  18: 'import perf' in python                               : Ok
  19: Breakpoint overflow signal handler                    : Ok
  20: Breakpoint overflow sampling                          : Ok
  21: Number of exit events of a simple workload            : Ok
  22: Software clock events period values                   : Ok
  23: Object code reading                                   : Ok
  24: Sample parsing                                        : Ok
  25: Use a dummy software event to keep tracking           : Ok
  26: Parse with no sample_id_all bit set                   : Ok
  27: Filter hist entries                                   : Ok
  28: Lookup mmap thread                                    : Ok
  29: Share thread mg                                       : Ok
  30: Sort output of hist entries                           : Ok
  31: Cumulate child hist entries                           : Ok
  32: Track with sched_switch                               : Ok
  33: Filter fds with revents mask in a fdarray             : Ok
  34: Add fd to a fdarray, making it autogrow               : Ok
  35: kmod_path__parse                                      : Ok
  36: Thread map                                            : Ok
  37: LLVM search and compile                               :
  37.1: Basic BPF llvm compile                              : Ok
  37.2: kbuild searching                                    : Ok
  37.3: Compile source for BPF prologue generation          : Ok
  37.4: Compile source for BPF relocation                   : Ok
  38: Session topology                                      : Ok
  39: BPF filter                                            :
  39.1: Basic BPF filtering                                 : Ok
  39.2: BPF pinning                                         : Ok
  39.3: BPF prologue generation                             : Ok
  39.4: BPF relocation checker                              : Ok
  40: Synthesize thread map                                 : Ok
  41: Remove thread map                                     : Ok
  42: Synthesize cpu map                                    : Ok
  43: Synthesize stat config                                : Ok
  44: Synthesize stat                                       : Ok
  45: Synthesize stat round                                 : Ok
  46: Synthesize attr update                                : Ok
  47: Event times                                           : Ok
  48: Read backward ring buffer                             : Ok
  49: Print cpu map                                         : Ok
  50: Probe SDT events                                      : Ok
  51: is_printable_array                                    : Ok
  52: Print bitmap                                          : Ok
  53: perf hooks                                            : Ok
  54: builtin clang support                                 : Skip (not compiled in)
  55: unit_number__scnprintf                                : Ok
  56: x86 rdpmc                                             : Ok
  57: Convert perf time to TSC                              : Ok
  58: DWARF unwind                                          : Ok
  59: x86 instruction decoder - new instructions            : Ok
  60: Use vfs_getname probe to get syscall args filenames   : Ok
  61: probe libc's inet_pton & backtrace it with ping       : Ok
  62: Check open filename arg using perf trace + vfs_getname: Ok
  63: Add vfs_getname probe to get syscall args filenames   : Ok
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/perf/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
            make_no_libaudit_O: make NO_LIBAUDIT=1
            make_no_demangle_O: make NO_DEMANGLE=1
                 make_static_O: make LDFLAGS=-static
         make_install_prefix_O: make install prefix=/tmp/krava
                make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
                   make_help_O: make help
         make_with_clangllvm_O: make LIBCLANGLLVM=1
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
                    make_doc_O: make doc
           make_no_libunwind_O: make NO_LIBUNWIND=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
              make_no_libelf_O: make NO_LIBELF=1
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
             make_util_map_o_O: make util/map.o
                make_install_O: make install
             make_no_libperl_O: make NO_LIBPERL=1
            make_install_bin_O: make install-bin
                 make_perf_o_O: make perf.o
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
               make_no_slang_O: make NO_SLANG=1
             make_no_libnuma_O: make NO_LIBNUMA=1
            make_no_auxtrace_O: make NO_AUXTRACE=1
           make_no_libpython_O: make NO_LIBPYTHON=1
                make_no_newt_O: make NO_NEWT=1
              make_clean_all_O: make clean all
              make_no_libbpf_O: make NO_LIBBPF=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
           make_no_backtrace_O: make NO_BACKTRACE=1
                  make_debug_O: make DEBUG=1
                   make_tags_O: make tags
       make_util_pmu_bison_o_O: make util/pmu-bison.o
                   make_pure_O: make
                make_no_gtk2_O: make NO_GTK2=1
  OK
  make: Leaving directory '/home/acme/git/perf/tools/perf'
  $

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

* Re: [GIT PULL 00/10] perf/urgent fixes
  2015-01-16 21:22 Arnaldo Carvalho de Melo
@ 2015-01-17 10:06 ` Ingo Molnar
  0 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2015-01-17 10:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexey Brodkin, Borislav Petkov,
	Cody P Schafer, David Ahern, Don Zickus, Frederic Weisbecker,
	Jan Beulich, Jiri Olsa, Li Zefan, Masami Hiramatsu,
	Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu,
	Vineet Gupta, Wang Nan, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 33636732dcd7cc738a5913bb730d663c6b03c8fb:
> 
>   perf/x86/intel: Fix bug for "cycles:p" and "cycles:pp" on SLM (2015-01-16 09:06:59 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
> 
> for you to fetch changes up to 6bcf9c1ff3ec22fd81eba336737d9865476509b1:
> 
>   perf tools powerpc: Use dwfl_report_elf() instead of offline. (2015-01-16 17:49:30 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> User visible:
> 
> - Fix segfault when using both the map symtab viewer and annotation
>   in the TUI (Namhyung Kim).
> 
> Developer stuff:
> 
> - uClibc build fixes (Alexey Brodkin, Vineet Gupta).
> 
> - bitops/hweight were moved from tools/perf/ too tools/include, move
>   some leftovers (Arnaldo Carvalho de Melo)
> 
> - Fix dwarf unwind x86_64 build error (Namhyung Kim)
> 
> - Fix __machine__findnew_thread() error path (Namhyung Kim)
> 
> - Propagate error code when write(2) failed in 'perf probe' (Namhyung Kim)
> 
> - Use dwfl_report_elf() instead of offline in powerpc bits to
>   properly handle non prelinked DSOs (Sukadev Bhattiprolu).
> 
> - Fix dwarf unwind using libunwind in 'perf test' (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Alexey Brodkin (1):
>       perf tools: Fix statfs.f_type data type mismatch build error with uclibc
> 
> Arnaldo Carvalho de Melo (1):
>       tools: Remove bitops/hweight usage of bits in tools/perf
> 
> Namhyung Kim (4):
>       perf probe: Propagate error code when write(2) failed
>       perf tools: Fix building error in x86_64 when dwarf unwind is on
>       perf machine: Fix __machine__findnew_thread() error path
>       perf tools: Fix segfault for symbol annotation on TUI
> 
> Sukadev Bhattiprolu (1):
>       perf tools powerpc: Use dwfl_report_elf() instead of offline.
> 
> Vineet Gupta (2):
>       perf tools: Elide strlcpy warning with uclibc
>       perf tools: Avoid build splat for syscall numbers with uclibc
> 
> Wang Nan (1):
>       perf test: Fix dwarf unwind using libunwind.
> 
>  tools/include/asm-generic/bitops.h                |  2 ++
>  tools/include/asm-generic/bitops/arch_hweight.h   |  1 +
>  tools/include/asm-generic/bitops/const_hweight.h  |  1 +
>  tools/include/asm-generic/bitops/hweight.h        |  7 +++++
>  tools/include/linux/bitops.h                      |  7 ++++-
>  tools/lib/api/fs/debugfs.c                        |  2 +-
>  tools/lib/api/fs/fs.c                             |  2 +-
>  tools/perf/MANIFEST                               |  6 ++++
>  tools/perf/Makefile.perf                          | 11 +++++--
>  tools/perf/arch/powerpc/util/skip-callchain-idx.c | 19 +++++++-----
>  tools/perf/bench/sched-pipe.c                     |  2 +-
>  tools/perf/builtin-top.c                          |  1 -
>  tools/perf/config/Makefile                        |  2 +-
>  tools/perf/config/Makefile.arch                   | 26 ++++++++--------
>  tools/perf/perf-sys.h                             |  1 -
>  tools/perf/tests/dwarf-unwind.c                   | 36 +++++++++++++++++++++--
>  tools/perf/util/annotate.h                        |  8 +----
>  tools/perf/util/cache.h                           |  2 ++
>  tools/perf/util/hweight.c                         | 31 -------------------
>  tools/perf/util/include/asm/hweight.h             |  8 -----
>  tools/perf/util/machine.c                         |  4 ++-
>  tools/perf/util/probe-event.c                     |  4 ++-
>  tools/perf/util/python-ext-sources                |  2 +-
>  tools/perf/util/unwind-libunwind.c                | 28 +++++++++++++++++-
>  24 files changed, 131 insertions(+), 82 deletions(-)
>  create mode 100644 tools/include/asm-generic/bitops/arch_hweight.h
>  create mode 100644 tools/include/asm-generic/bitops/const_hweight.h
>  create mode 100644 tools/include/asm-generic/bitops/hweight.h
>  delete mode 100644 tools/perf/util/hweight.c
>  delete mode 100644 tools/perf/util/include/asm/hweight.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/10] perf/urgent fixes
@ 2015-01-16 21:22 Arnaldo Carvalho de Melo
  2015-01-17 10:06 ` Ingo Molnar
  0 siblings, 1 reply; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-01-16 21:22 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexey Brodkin, Borislav Petkov, Cody P Schafer, David Ahern,
	Don Zickus, Frederic Weisbecker, Jan Beulich, Jiri Olsa,
	Li Zefan, Masami Hiramatsu, Michael Ellerman, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu, Vineet Gupta, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 33636732dcd7cc738a5913bb730d663c6b03c8fb:

  perf/x86/intel: Fix bug for "cycles:p" and "cycles:pp" on SLM (2015-01-16 09:06:59 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to 6bcf9c1ff3ec22fd81eba336737d9865476509b1:

  perf tools powerpc: Use dwfl_report_elf() instead of offline. (2015-01-16 17:49:30 -0300)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

- Fix segfault when using both the map symtab viewer and annotation
  in the TUI (Namhyung Kim).

Developer stuff:

- uClibc build fixes (Alexey Brodkin, Vineet Gupta).

- bitops/hweight were moved from tools/perf/ too tools/include, move
  some leftovers (Arnaldo Carvalho de Melo)

- Fix dwarf unwind x86_64 build error (Namhyung Kim)

- Fix __machine__findnew_thread() error path (Namhyung Kim)

- Propagate error code when write(2) failed in 'perf probe' (Namhyung Kim)

- Use dwfl_report_elf() instead of offline in powerpc bits to
  properly handle non prelinked DSOs (Sukadev Bhattiprolu).

- Fix dwarf unwind using libunwind in 'perf test' (Wang Nan)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Alexey Brodkin (1):
      perf tools: Fix statfs.f_type data type mismatch build error with uclibc

Arnaldo Carvalho de Melo (1):
      tools: Remove bitops/hweight usage of bits in tools/perf

Namhyung Kim (4):
      perf probe: Propagate error code when write(2) failed
      perf tools: Fix building error in x86_64 when dwarf unwind is on
      perf machine: Fix __machine__findnew_thread() error path
      perf tools: Fix segfault for symbol annotation on TUI

Sukadev Bhattiprolu (1):
      perf tools powerpc: Use dwfl_report_elf() instead of offline.

Vineet Gupta (2):
      perf tools: Elide strlcpy warning with uclibc
      perf tools: Avoid build splat for syscall numbers with uclibc

Wang Nan (1):
      perf test: Fix dwarf unwind using libunwind.

 tools/include/asm-generic/bitops.h                |  2 ++
 tools/include/asm-generic/bitops/arch_hweight.h   |  1 +
 tools/include/asm-generic/bitops/const_hweight.h  |  1 +
 tools/include/asm-generic/bitops/hweight.h        |  7 +++++
 tools/include/linux/bitops.h                      |  7 ++++-
 tools/lib/api/fs/debugfs.c                        |  2 +-
 tools/lib/api/fs/fs.c                             |  2 +-
 tools/perf/MANIFEST                               |  6 ++++
 tools/perf/Makefile.perf                          | 11 +++++--
 tools/perf/arch/powerpc/util/skip-callchain-idx.c | 19 +++++++-----
 tools/perf/bench/sched-pipe.c                     |  2 +-
 tools/perf/builtin-top.c                          |  1 -
 tools/perf/config/Makefile                        |  2 +-
 tools/perf/config/Makefile.arch                   | 26 ++++++++--------
 tools/perf/perf-sys.h                             |  1 -
 tools/perf/tests/dwarf-unwind.c                   | 36 +++++++++++++++++++++--
 tools/perf/util/annotate.h                        |  8 +----
 tools/perf/util/cache.h                           |  2 ++
 tools/perf/util/hweight.c                         | 31 -------------------
 tools/perf/util/include/asm/hweight.h             |  8 -----
 tools/perf/util/machine.c                         |  4 ++-
 tools/perf/util/probe-event.c                     |  4 ++-
 tools/perf/util/python-ext-sources                |  2 +-
 tools/perf/util/unwind-libunwind.c                | 28 +++++++++++++++++-
 24 files changed, 131 insertions(+), 82 deletions(-)
 create mode 100644 tools/include/asm-generic/bitops/arch_hweight.h
 create mode 100644 tools/include/asm-generic/bitops/const_hweight.h
 create mode 100644 tools/include/asm-generic/bitops/hweight.h
 delete mode 100644 tools/perf/util/hweight.c
 delete mode 100644 tools/perf/util/include/asm/hweight.h

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

* Re: [GIT PULL 00/10] perf/urgent fixes
  2014-10-29 12:56 Arnaldo Carvalho de Melo
@ 2014-10-30  6:34 ` Ingo Molnar
  0 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2014-10-30  6:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Andi Kleen, Arun Sharma, Corey Ashford,
	David Ahern, Frederic Weisbecker, Hemant Kumar, Jean Pihet,
	Jiri Olsa, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Srikar Dronamraju, Wang Nan,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 1776b10627e486dd431fe72d8d47e5a865cf65d1:
> 
>   perf/x86/intel: Revert incomplete and undocumented Broadwell client support (2014-10-29 11:07:58 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
> 
> for you to fetch changes up to 4cdcc33db2f0455f297b4e14e434ba311ec5ca06:
> 
>   perf probe: Trivial typo fix for --demangle (2014-10-29 10:30:18 -0200)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> User visible:
> 
> * Fix report -F (abort, in_tx, mispredict, etc) segfaults for sample.data files
>   without branch info (Jiri Olsa)
> 
> * Add patch that should have went in a previous patchkit to use global cache
>   provided by libunwind (Namhyung Kim)
> 
> * Make CPUINFO_PROC an array to support different kernels, problem
>   detected when the information reported via /proc/cpuinfo changed on ARM (Wang Nan)
> 
> * 'perf probe' --demangle typo fix and a new --quiet option (Masami Hiramatsu)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Jiri Olsa (7):
>       perf tools: Fix report -F abort for data without branch info
>       perf tools: Fix report -F in_tx for data without branch info
>       perf tools: Fix report -F mispredict for data without branch info
>       perf tools: Fix report -F symbol_to for data without branch info
>       perf tools: Fix report -F symbol_from for data without branch info
>       perf tools: Fix report -F dso_to for data without branch info
>       perf tools: Fix report -F dso_from for data without branch info
> 
> Masami Hiramatsu (1):
>       perf probe: Trivial typo fix for --demangle
> 
> Namhyung Kim (1):
>       perf callchain: Use global caching provided by libunwind
> 
> Wang Nan (1):
>       perf tools: Make CPUINFO_PROC an array to support different kernel versions
> 
>  tools/perf/builtin-probe.c         |   2 +-
>  tools/perf/perf-sys.h              |  30 +++++------
>  tools/perf/util/header.c           |  27 +++++++---
>  tools/perf/util/sort.c             | 102 +++++++++++++++++++++++++++----------
>  tools/perf/util/thread.c           |   3 ++
>  tools/perf/util/unwind-libunwind.c |  12 +++++
>  tools/perf/util/unwind.h           |   3 ++
>  7 files changed, 131 insertions(+), 48 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/10] perf/urgent fixes
@ 2014-10-29 12:56 Arnaldo Carvalho de Melo
  2014-10-30  6:34 ` Ingo Molnar
  0 siblings, 1 reply; 21+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-10-29 12:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen, Arun Sharma,
	Corey Ashford, David Ahern, Frederic Weisbecker, Hemant Kumar,
	Jean Pihet, Jiri Olsa, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Srikar Dronamraju, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 1776b10627e486dd431fe72d8d47e5a865cf65d1:

  perf/x86/intel: Revert incomplete and undocumented Broadwell client support (2014-10-29 11:07:58 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to 4cdcc33db2f0455f297b4e14e434ba311ec5ca06:

  perf probe: Trivial typo fix for --demangle (2014-10-29 10:30:18 -0200)

----------------------------------------------------------------
perf/urgent fixes:

User visible:

* Fix report -F (abort, in_tx, mispredict, etc) segfaults for sample.data files
  without branch info (Jiri Olsa)

* Add patch that should have went in a previous patchkit to use global cache
  provided by libunwind (Namhyung Kim)

* Make CPUINFO_PROC an array to support different kernels, problem
  detected when the information reported via /proc/cpuinfo changed on ARM (Wang Nan)

* 'perf probe' --demangle typo fix and a new --quiet option (Masami Hiramatsu)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Jiri Olsa (7):
      perf tools: Fix report -F abort for data without branch info
      perf tools: Fix report -F in_tx for data without branch info
      perf tools: Fix report -F mispredict for data without branch info
      perf tools: Fix report -F symbol_to for data without branch info
      perf tools: Fix report -F symbol_from for data without branch info
      perf tools: Fix report -F dso_to for data without branch info
      perf tools: Fix report -F dso_from for data without branch info

Masami Hiramatsu (1):
      perf probe: Trivial typo fix for --demangle

Namhyung Kim (1):
      perf callchain: Use global caching provided by libunwind

Wang Nan (1):
      perf tools: Make CPUINFO_PROC an array to support different kernel versions

 tools/perf/builtin-probe.c         |   2 +-
 tools/perf/perf-sys.h              |  30 +++++------
 tools/perf/util/header.c           |  27 +++++++---
 tools/perf/util/sort.c             | 102 +++++++++++++++++++++++++++----------
 tools/perf/util/thread.c           |   3 ++
 tools/perf/util/unwind-libunwind.c |  12 +++++
 tools/perf/util/unwind.h           |   3 ++
 7 files changed, 131 insertions(+), 48 deletions(-)

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

end of thread, other threads:[~2018-02-05 21:28 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-12 20:03 [GIT PULL 00/10] perf/urgent fixes Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 01/10] perf tools: Use readdir() instead of deprecated readdir_r() Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 02/10] perf script: " Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 03/10] perf thread_map: " Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 04/10] perf tools: " Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 05/10] perf dwarf: Guard !x86_64 definitions under #ifdef else clause Arnaldo Carvalho de Melo
2016-05-13  2:14   ` Masami Hiramatsu
2016-05-12 20:03 ` [PATCH 06/10] perf probe: Check if dwarf_getlocations() is available Arnaldo Carvalho de Melo
2016-05-13  2:38   ` Masami Hiramatsu
2016-05-13 11:47     ` Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 07/10] tools lib traceevent: Do not reassign parg after collapse_tree() Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 08/10] perf evsel: Improve EPERM error handling in open_strerror() Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 09/10] perf evsel: Handle EACCESS + perf_event_paranoid=2 in fallback() Arnaldo Carvalho de Melo
2016-05-12 20:03 ` [PATCH 10/10] perf stat: Fallback to user only counters when perf_event_paranoid > 1 Arnaldo Carvalho de Melo
2016-05-13  5:36 ` [GIT PULL 00/10] perf/urgent fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2018-02-05 19:56 Arnaldo Carvalho de Melo
2018-02-05 21:28 ` Ingo Molnar
2015-01-16 21:22 Arnaldo Carvalho de Melo
2015-01-17 10:06 ` Ingo Molnar
2014-10-29 12:56 Arnaldo Carvalho de Melo
2014-10-30  6:34 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).