All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/5] perf/urgent fixes
@ 2015-11-11 21:56 Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 1/5] perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore Arnaldo Carvalho de Melo
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-11 21:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, David Ahern, Jiri Olsa, Kan Liang,
	Masami Hiramatsu, Michael Petlan, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, pi3orama, Wang Nan, Yunlong Song, Zefan Li,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit b71b437eedaed985062492565d9d421d975ae845:

  perf: Fix inherited events vs. tracepoint filters (2015-11-09 16:13:11 +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 5602ea09c19e85557f2b4d30be1d6ba349b7a038:

  tools include: Add compiler.h to list.h (2015-11-11 18:41:33 -0300)

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

User visible:

- Add missing newlines to some pr_err() calls (Arnaldo Carvalho de Melo)

- Print full source file paths when using
  'perf annotate --print-line --full-paths' (Michael Petlan)

- Fix 'perf probe -d' when just one out of uprobes and kprobes is
  enabled (Wang Nan)

Developer stuff:

- Add compiler.h to list.h to fix 'make perf-tar-src-pkg' generated
  tarballs, i.e. out of tree building (Arnaldo Carvalho de Melo)

- Add the llvm-src-base.c and llvm-src-kbuild.c files, generated by the
  'perf test' LLVM entries, when running it in-tree, to .gitignore (Yunlong Song)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf session: Add missing newlines to some pr_err() calls
      tools include: Add compiler.h to list.h

Michael Petlan (1):
      perf annotate: Support full source file paths for srcline fix

Wang Nan (1):
      perf probe: Verify parameters in two functions

Yunlong Song (1):
      perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore

 tools/include/linux/list.h   | 1 +
 tools/perf/tests/.gitignore  | 2 ++
 tools/perf/util/annotate.c   | 1 +
 tools/perf/util/probe-file.c | 6 ++++++
 tools/perf/util/session.c    | 8 ++++----
 5 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 tools/perf/tests/.gitignore

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

* [PATCH 1/5] perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore
  2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2015-11-11 21:56 ` Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 2/5] perf annotate: Support full source file paths for srcline fix Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-11 21:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Yunlong Song, Adrian Hunter, Alexei Starovoitov,
	David Ahern, Jiri Olsa, Kan Liang, Masami Hiramatsu,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Wang Nan,
	Arnaldo Carvalho de Melo

From: Yunlong Song <yunlong.song@huawei.com>

Commit b31de018a6284a25e0fdfeb028e724f8417ec3b1 ("perf test: Enhance the
LLVM test: update basic BPF test program") dynamically creates file
llvm-src-base.c during the perf building.

Similarly, the commit 7af3f3d55b80cce40ad94b6b8e173dccedaf25e6 ("perf
test: Enhance the LLVM tests: add kbuild test") dynamically creates file
llvm-src-kbuild.c during the perf building. Add them to .gitignore.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: b31de018a628 ("perf test: Enhance the LLVM test: update basic BPF test program")
Fixes: 7af3f3d55b80 ("perf test: Enhance the LLVM tests: add kbuild test")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/.gitignore | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 tools/perf/tests/.gitignore

diff --git a/tools/perf/tests/.gitignore b/tools/perf/tests/.gitignore
new file mode 100644
index 000000000000..489fc9ffbcb0
--- /dev/null
+++ b/tools/perf/tests/.gitignore
@@ -0,0 +1,2 @@
+llvm-src-base.c
+llvm-src-kbuild.c
-- 
2.1.0


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

* [PATCH 2/5] perf annotate: Support full source file paths for srcline fix
  2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 1/5] perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore Arnaldo Carvalho de Melo
@ 2015-11-11 21:56 ` Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 3/5] perf session: Add missing newlines to some pr_err() calls Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-11 21:56 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Michael Petlan, Arnaldo Carvalho de Melo

From: Michael Petlan <mpetlan@redhat.com>

The --full-paths option did not show the full source file paths in the 'perf
annotate' tool, because the value of the option was not propagated into the
related functions.

With this patch the value of the --full-paths option is known to the function
that composes the srcline string, so it prints the full path when necessary.

Committer Note:

This affects annotate when the --print-line option is used:

  # perf annotate -h 2>&1 | grep print-line
      -l, --print-line      print matching source lines (may be slow)

Looking just at the lines that should be affected by this change:

Before:

  # perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
     94.44 atomic64_64.h:114
      5.56 file_table.c:265
   file_table.c:265    5.56 :	  ffffffff81219a00:       callq  ffffffff81769360 <__fentry__>
   atomic64_64.h:114   94.44 :	  ffffffff81219a05:       lock decq 0x38(%rdi)

After:

  # perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
     94.44 /home/git/linux/arch/x86/include/asm/atomic64_64.h:114
      5.56 /home/git/linux/fs/file_table.c:265
   /home/git/linux/fs/file_table.c:265    5.56 :	  ffffffff81219a00:       callq  ffffffff81769360 <__fentry__>
   /home/git/linux/arch/x86/include/asm/atomic64_64.h:114   94.44 :	  ffffffff81219a05:       lock decq 0x38(%rdi)
  #

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://permalink.gmane.org/gmane.linux.kernel.perf.user/2365
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index f2974da0185a..1dd1949b0e79 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1620,6 +1620,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
 	len = symbol__size(sym);
 
 	if (print_lines) {
+		srcline_full_filename = full_paths;
 		symbol__get_source_line(sym, map, evsel, &source_line, len);
 		print_summary(&source_line, dso->long_name);
 	}
-- 
2.1.0


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

* [PATCH 3/5] perf session: Add missing newlines to some pr_err() calls
  2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 1/5] perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 2/5] perf annotate: Support full source file paths for srcline fix Arnaldo Carvalho de Melo
@ 2015-11-11 21:56 ` Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 4/5] perf probe: Verify parameters in two functions Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-11 21:56 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>

Before:

  [acme@zoo linux]$ perf evlist
  WARNING: The perf.data file's data size field is 0 which is unexpected.
  Was the 'perf record' command properly terminated?
  non matching sample_type[acme@zoo linux]$

After:

  [acme@zoo linux]$ perf evlist
  WARNING: The perf.data file's data size field is 0 which is unexpected.
  Was the 'perf record' command properly terminated?
  non matching sample_type
  [acme@zoo linux]$

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

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 428149bc64d2..c35ffdd360fe 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -29,7 +29,7 @@ static int perf_session__open(struct perf_session *session)
 	struct perf_data_file *file = session->file;
 
 	if (perf_session__read_header(session) < 0) {
-		pr_err("incompatible file format (rerun with -v to learn more)");
+		pr_err("incompatible file format (rerun with -v to learn more)\n");
 		return -1;
 	}
 
@@ -37,17 +37,17 @@ static int perf_session__open(struct perf_session *session)
 		return 0;
 
 	if (!perf_evlist__valid_sample_type(session->evlist)) {
-		pr_err("non matching sample_type");
+		pr_err("non matching sample_type\n");
 		return -1;
 	}
 
 	if (!perf_evlist__valid_sample_id_all(session->evlist)) {
-		pr_err("non matching sample_id_all");
+		pr_err("non matching sample_id_all\n");
 		return -1;
 	}
 
 	if (!perf_evlist__valid_read_format(session->evlist)) {
-		pr_err("non matching read_format");
+		pr_err("non matching read_format\n");
 		return -1;
 	}
 
-- 
2.1.0


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

* [PATCH 4/5] perf probe: Verify parameters in two functions
  2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2015-11-11 21:56 ` [PATCH 3/5] perf session: Add missing newlines to some pr_err() calls Arnaldo Carvalho de Melo
@ 2015-11-11 21:56 ` Arnaldo Carvalho de Melo
  2015-11-11 21:56 ` [PATCH 5/5] tools include: Add compiler.h to list.h Arnaldo Carvalho de Melo
  2015-11-12  6:38 ` [GIT PULL 0/5] perf/urgent fixes Ingo Molnar
  5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-11 21:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Jiri Olsa, Namhyung Kim, Zefan Li,
	pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

On kernel with only one out of CONFIG_KPROBE_EVENTS and
CONFIG_UPROBE_EVENTS enabled, 'perf probe -d' causes a segfault because
perf_del_probe_events() calls probe_file__get_events() with a negative
fd.

This patch fixes it by adding parameter validation at the entry of
probe_file__get_events() and probe_file__get_rawlist(). Since they are
both non-static public functions (in .h file), parameter verifying is
required.

v1 -> v2: Verify fd at the head of probe_file__get_rawlist() instead of
          checking at call site (suggested by Masami and Arnaldo at [1,2]).

[1] http://lkml.kernel.org/r/50399556C9727B4D88A595C8584AAB37526048E3@GSjpTKYDCembx32.service.hitachi.net
[2] http://lkml.kernel.org/r/20151105155830.GV13236@kernel.org

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1446803415-83382-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-file.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 89dbeb92c68e..e3b3b92e4458 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -138,6 +138,9 @@ struct strlist *probe_file__get_rawlist(int fd)
 	char *p;
 	struct strlist *sl;
 
+	if (fd < 0)
+		return NULL;
+
 	sl = strlist__new(NULL, NULL);
 
 	fp = fdopen(dup(fd), "r");
@@ -271,6 +274,9 @@ int probe_file__get_events(int fd, struct strfilter *filter,
 	const char *p;
 	int ret = -ENOENT;
 
+	if (!plist)
+		return -EINVAL;
+
 	namelist = __probe_file__get_namelist(fd, true);
 	if (!namelist)
 		return -ENOENT;
-- 
2.1.0


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

* [PATCH 5/5] tools include: Add compiler.h to list.h
  2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2015-11-11 21:56 ` [PATCH 4/5] perf probe: Verify parameters in two functions Arnaldo Carvalho de Melo
@ 2015-11-11 21:56 ` Arnaldo Carvalho de Melo
  2015-11-12  6:38 ` [GIT PULL 0/5] perf/urgent fixes Ingo Molnar
  5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-11 21:56 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>

list.h needs WRITE_ONCE() since 7f5f873c6a07 ("rculist: Use WRITE_ONCE()
when deleting from reader-visible list") add it before including the
kernel's list.h file.

This fixes builds of 'make perf-tar-src-pkg' perf tool tarball builds,
i.e. out of tree builds.

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

diff --git a/tools/include/linux/list.h b/tools/include/linux/list.h
index 76b014c96893..a017f1595676 100644
--- a/tools/include/linux/list.h
+++ b/tools/include/linux/list.h
@@ -1,3 +1,4 @@
+#include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 
-- 
2.1.0


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

* Re: [GIT PULL 0/5] perf/urgent fixes
  2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2015-11-11 21:56 ` [PATCH 5/5] tools include: Add compiler.h to list.h Arnaldo Carvalho de Melo
@ 2015-11-12  6:38 ` Ingo Molnar
  5 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2015-11-12  6:38 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, David Ahern,
	Jiri Olsa, Kan Liang, Masami Hiramatsu, Michael Petlan,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Wang Nan,
	Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit b71b437eedaed985062492565d9d421d975ae845:
> 
>   perf: Fix inherited events vs. tracepoint filters (2015-11-09 16:13:11 +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 5602ea09c19e85557f2b4d30be1d6ba349b7a038:
> 
>   tools include: Add compiler.h to list.h (2015-11-11 18:41:33 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> User visible:
> 
> - Add missing newlines to some pr_err() calls (Arnaldo Carvalho de Melo)
> 
> - Print full source file paths when using
>   'perf annotate --print-line --full-paths' (Michael Petlan)
> 
> - Fix 'perf probe -d' when just one out of uprobes and kprobes is
>   enabled (Wang Nan)
> 
> Developer stuff:
> 
> - Add compiler.h to list.h to fix 'make perf-tar-src-pkg' generated
>   tarballs, i.e. out of tree building (Arnaldo Carvalho de Melo)
> 
> - Add the llvm-src-base.c and llvm-src-kbuild.c files, generated by the
>   'perf test' LLVM entries, when running it in-tree, to .gitignore (Yunlong Song)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf session: Add missing newlines to some pr_err() calls
>       tools include: Add compiler.h to list.h
> 
> Michael Petlan (1):
>       perf annotate: Support full source file paths for srcline fix
> 
> Wang Nan (1):
>       perf probe: Verify parameters in two functions
> 
> Yunlong Song (1):
>       perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore
> 
>  tools/include/linux/list.h   | 1 +
>  tools/perf/tests/.gitignore  | 2 ++
>  tools/perf/util/annotate.c   | 1 +
>  tools/perf/util/probe-file.c | 6 ++++++
>  tools/perf/util/session.c    | 8 ++++----
>  5 files changed, 14 insertions(+), 4 deletions(-)
>  create mode 100644 tools/perf/tests/.gitignore

Pulled, thanks a lot Arnaldo!

	Ingo

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

end of thread, other threads:[~2015-11-12  6:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 21:56 [GIT PULL 0/5] perf/urgent fixes Arnaldo Carvalho de Melo
2015-11-11 21:56 ` [PATCH 1/5] perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore Arnaldo Carvalho de Melo
2015-11-11 21:56 ` [PATCH 2/5] perf annotate: Support full source file paths for srcline fix Arnaldo Carvalho de Melo
2015-11-11 21:56 ` [PATCH 3/5] perf session: Add missing newlines to some pr_err() calls Arnaldo Carvalho de Melo
2015-11-11 21:56 ` [PATCH 4/5] perf probe: Verify parameters in two functions Arnaldo Carvalho de Melo
2015-11-11 21:56 ` [PATCH 5/5] tools include: Add compiler.h to list.h Arnaldo Carvalho de Melo
2015-11-12  6:38 ` [GIT PULL 0/5] perf/urgent fixes Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.