linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/3] perf/urgent fixes
@ 2014-03-10 21:15 Arnaldo Carvalho de Melo
  2014-03-10 21:15 ` [PATCH 1/3] perf trace: Decode architecture-specific signal numbers Arnaldo Carvalho de Melo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-03-10 21:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Albert Strasheim,
	Ben Hutchings, Corey Ashford, David Ahern, Don Zickus,
	Frederic Weisbecker, Ingo Molnar, Jiri Olsa, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, stable, Stephane Eranian,
	Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit af76815a31adc75dd9526230affdd678e65ac59f:

  Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-03-01 10:13:25 +0100)

are available in the git repository at:


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

for you to fetch changes up to fdf57dd052d5cbd415533ae98f4d423286a85220:

  perf machine: Use map as success in ip__resolve_ams (2014-03-10 11:19:36 -0300)

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

. Fix build of 'trace' in some systems due to using some architecture-specific
  signal numbers (Ben Hutchings)

. Stop resolving when finding a map in in ip__resolve_ams, this way at least
  the DSO will be resolved when a symbol isn't (Don Zickus)

. Fix crash in elf_section_by_name when not checking if some section string index
  is valid (Jiri Olsa)

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

----------------------------------------------------------------
Ben Hutchings (1):
      perf trace: Decode architecture-specific signal numbers

Don Zickus (1):
      perf machine: Use map as success in ip__resolve_ams

Jiri Olsa (1):
      perf symbols: Fix crash in elf_section_by_name

 tools/perf/builtin-trace.c   | 10 +++++++++-
 tools/perf/util/machine.c    |  2 +-
 tools/perf/util/symbol-elf.c |  6 +++---
 3 files changed, 13 insertions(+), 5 deletions(-)

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

* [PATCH 1/3] perf trace: Decode architecture-specific signal numbers
  2014-03-10 21:15 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2014-03-10 21:15 ` Arnaldo Carvalho de Melo
  2014-03-10 21:15 ` [PATCH 2/3] perf symbols: Fix crash in elf_section_by_name Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-03-10 21:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Ben Hutchings, Ingo Molnar, Paul Mackerras,
	Peter Zijlstra, stable, Arnaldo Carvalho de Melo

From: Ben Hutchings <ben@decadent.org.uk>

SIGSTKFLT is not defined on alpha, mips or sparc.

SIGEMT and SIGSWI are defined on some architectures and should be
decoded here if so.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: 8bad5b0abfdb ('perf trace: Beautify signal number arg in several syscalls')
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1391648441.3003.101.camel@deadeye.wl.decadent.org.uk
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 6aa6fb6f7bd9..f954c26de231 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -825,7 +825,6 @@ static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscal
 	P_SIGNUM(PIPE);
 	P_SIGNUM(ALRM);
 	P_SIGNUM(TERM);
-	P_SIGNUM(STKFLT);
 	P_SIGNUM(CHLD);
 	P_SIGNUM(CONT);
 	P_SIGNUM(STOP);
@@ -841,6 +840,15 @@ static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscal
 	P_SIGNUM(IO);
 	P_SIGNUM(PWR);
 	P_SIGNUM(SYS);
+#ifdef SIGEMT
+	P_SIGNUM(EMT);
+#endif
+#ifdef SIGSTKFLT
+	P_SIGNUM(STKFLT);
+#endif
+#ifdef SIGSWI
+	P_SIGNUM(SWI);
+#endif
 	default: break;
 	}
 
-- 
1.8.1.4


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

* [PATCH 2/3] perf symbols: Fix crash in elf_section_by_name
  2014-03-10 21:15 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
  2014-03-10 21:15 ` [PATCH 1/3] perf trace: Decode architecture-specific signal numbers Arnaldo Carvalho de Melo
@ 2014-03-10 21:15 ` Arnaldo Carvalho de Melo
  2014-03-10 21:15 ` [PATCH 3/3] perf machine: Use map as success in ip__resolve_ams Arnaldo Carvalho de Melo
  2014-03-11 10:04 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-03-10 21:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Albert Strasheim, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@redhat.com>

Fixing crash in elf_section_by_name function caused by missing section
name in elf binary.

Reported-by: Albert Strasheim <albert@cloudflare.com>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Albert Strasheim <albert@cloudflare.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1393767127-599-1-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol-elf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 3e9f336740fa..516d19fb999b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -151,15 +151,15 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
 
 		gelf_getshdr(sec, shp);
 		str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name);
-		if (!strcmp(name, str)) {
+		if (str && !strcmp(name, str)) {
 			if (idx)
 				*idx = cnt;
-			break;
+			return sec;
 		}
 		++cnt;
 	}
 
-	return sec;
+	return NULL;
 }
 
 #define elf_section__for_each_rel(reldata, pos, pos_mem, idx, nr_entries) \
-- 
1.8.1.4


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

* [PATCH 3/3] perf machine: Use map as success in ip__resolve_ams
  2014-03-10 21:15 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
  2014-03-10 21:15 ` [PATCH 1/3] perf trace: Decode architecture-specific signal numbers Arnaldo Carvalho de Melo
  2014-03-10 21:15 ` [PATCH 2/3] perf symbols: Fix crash in elf_section_by_name Arnaldo Carvalho de Melo
@ 2014-03-10 21:15 ` Arnaldo Carvalho de Melo
  2014-03-11 10:04 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-03-10 21:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Don Zickus, Jiri Olsa, Stephane Eranian,
	Arnaldo Carvalho de Melo

From: Don Zickus <dzickus@redhat.com>

When trying to map a bunch of instruction addresses to their respective
threads, I kept getting a lot of bogus entries [I forget the exact
reason as I patched my code months ago].

Looking through ip__resolve_ams, I noticed the check for

  if (al.sym)

and realized, most times I have an al.map definition but sometimes an
al.sym is undefined.  In the cases where al.sym is undefined, the loop
keeps going even though a valid al.map exists.

Modify this check to use the more reliable al.map.  This fixed my bogus
entries.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1393386227-149412-2-git-send-email-dzickus@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index c872991e0f65..620a1983b76b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1213,7 +1213,7 @@ static void ip__resolve_ams(struct machine *machine, struct thread *thread,
 		 */
 		thread__find_addr_location(thread, machine, m, MAP__FUNCTION,
 				ip, &al);
-		if (al.sym)
+		if (al.map)
 			goto found;
 	}
 found:
-- 
1.8.1.4


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

* Re: [GIT PULL 0/3] perf/urgent fixes
  2014-03-10 21:15 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2014-03-10 21:15 ` [PATCH 3/3] perf machine: Use map as success in ip__resolve_ams Arnaldo Carvalho de Melo
@ 2014-03-11 10:04 ` Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2014-03-11 10:04 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Albert Strasheim,
	Ben Hutchings, Corey Ashford, David Ahern, Don Zickus,
	Frederic Weisbecker, Ingo Molnar, Jiri Olsa, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, stable, Stephane Eranian,
	Arnaldo Carvalho de Melo



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

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit af76815a31adc75dd9526230affdd678e65ac59f:
> 
>   Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-03-01 10:13:25 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
> 
> for you to fetch changes up to fdf57dd052d5cbd415533ae98f4d423286a85220:
> 
>   perf machine: Use map as success in ip__resolve_ams (2014-03-10 11:19:36 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> . Fix build of 'trace' in some systems due to using some architecture-specific
>   signal numbers (Ben Hutchings)
> 
> . Stop resolving when finding a map in in ip__resolve_ams, this way at least
>   the DSO will be resolved when a symbol isn't (Don Zickus)
> 
> . Fix crash in elf_section_by_name when not checking if some section string index
>   is valid (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Ben Hutchings (1):
>       perf trace: Decode architecture-specific signal numbers
> 
> Don Zickus (1):
>       perf machine: Use map as success in ip__resolve_ams
> 
> Jiri Olsa (1):
>       perf symbols: Fix crash in elf_section_by_name
> 
>  tools/perf/builtin-trace.c   | 10 +++++++++-
>  tools/perf/util/machine.c    |  2 +-
>  tools/perf/util/symbol-elf.c |  6 +++---
>  3 files changed, 13 insertions(+), 5 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

end of thread, other threads:[~2014-03-11 10:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 21:15 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2014-03-10 21:15 ` [PATCH 1/3] perf trace: Decode architecture-specific signal numbers Arnaldo Carvalho de Melo
2014-03-10 21:15 ` [PATCH 2/3] perf symbols: Fix crash in elf_section_by_name Arnaldo Carvalho de Melo
2014-03-10 21:15 ` [PATCH 3/3] perf machine: Use map as success in ip__resolve_ams Arnaldo Carvalho de Melo
2014-03-11 10:04 ` [GIT PULL 0/3] perf/urgent fixes 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).