All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for perf user stack dump in powerpc
@ 2016-04-28  9:31 Chandan Kumar
  2016-04-28  9:31 ` [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Chandan Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Chandan Kumar @ 2016-04-28  9:31 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: acme, mpe, jolsa, anju, maddy, naveen.n.rao, hemant, Chandan Kumar

This patch set enables perf user stack dump on powerpc

Example with "ls" command as user program
./perf record --call-graph=dwarf,8192 ls

./perf script
---------8< -----
..
...
perf 12549 75938.934539:       1771 cycles:ppp: 
                  210d90 .perf_event_exec (/boot/vmlinux)
                  34b914 .load_elf_binary (/boot/vmlinux)
                  2dcabc .search_binary_handler (/boot/vmlinux)
                  2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
                  2ddcd8 .sys_execve (/boot/vmlinux)
                   19258 system_call (/boot/vmlinux)

perf 12549 75938.934549:       8415 cycles:ppp: 
                  207a88 .perf_event_aux_ctx (/boot/vmlinux)
                       0 [unknown] ([unknown])
                  214ab8 .perf_event_comm (/boot/vmlinux)
                  2dcfb8 .__set_task_comm (/boot/vmlinux)
                  2ddb44 .setup_new_exec (/boot/vmlinux)
                  34b914 .load_elf_binary (/boot/vmlinux)
                  2dcabc .search_binary_handler (/boot/vmlinux)
                  2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
                  2ddcd8 .sys_execve (/boot/vmlinux)
                   19258 system_call (/boot/vmlinux)

ls 12549 75938.934562:      33745 cycles:ppp: 
                   ee570 .task_work_add (/boot/vmlinux)
                       0 [unknown] ([unknown])
                  2ce380 .filp_close (/boot/vmlinux)
                  2fc464 .do_close_on_exec (/boot/vmlinux)
                  2ddbd8 .setup_new_exec (/boot/vmlinux)
                  34b914 .load_elf_binary (/boot/vmlinux)
                  2dcabc .search_binary_handler (/boot/vmlinux)
                  2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
                  2ddcd8 .sys_execve (/boot/vmlinux)
                   19258 system_call (/boot/vmlinux)

ls 12549 75938.934587:     116078 cycles:ppp: 
                   6ff94 .__clear_user (/boot/vmlinux)
                  944400 .padzero ([kernel.vmlinux].text.unlikely)
                  34bd28 .load_elf_binary (/boot/vmlinux)
                  2dcabc .search_binary_handler (/boot/vmlinux)
                  2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
                  2ddcd8 .sys_execve (/boot/vmlinux)
                   19258 system_call (/boot/vmlinux)
...
..
----- 8< -----

Chandan Kumar (2):
  powerpc: Add HAVE_PERF_USER_STACK_DUMP support
  powerpc/perf: Add support for unwinding perf-stackdump

Naveen N. Rao (1):
  perf tools: Fix perf regs mask generation

 .../features/perf/perf-regs/arch-support.txt       |  2 +-
 .../features/perf/perf-stackdump/arch-support.txt  |  2 +-
 arch/powerpc/Kconfig                               |  1 +
 tools/perf/arch/powerpc/util/Build                 |  1 +
 tools/perf/arch/powerpc/util/unwind-libunwind.c    | 96 ++++++++++++++++++++++
 tools/perf/config/Makefile                         |  1 +
 tools/perf/util/perf_regs.c                        |  8 +-
 7 files changed, 105 insertions(+), 6 deletions(-)
 create mode 100644 tools/perf/arch/powerpc/util/unwind-libunwind.c

-- 
1.9.3

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

* [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support
  2016-04-28  9:31 [PATCH 0/3] Add support for perf user stack dump in powerpc Chandan Kumar
@ 2016-04-28  9:31 ` Chandan Kumar
  2016-05-08  3:59   ` [1/3] " Michael Ellerman
  2016-04-28  9:31 ` [PATCH 2/3] powerpc/perf: Add support for unwinding perf-stackdump Chandan Kumar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Chandan Kumar @ 2016-04-28  9:31 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: acme, mpe, jolsa, anju, maddy, naveen.n.rao, hemant, Chandan Kumar

With perf regs support enabled for powerpc, the support for obtaining
perf user stack dump is already enabled.
This patch declares the support for same and also updates documentation
to mark the support for perf-regs and perf-stackdump.

Signed-off-by: Chandan Kumar <chandan.kumar@linux.vnet.ibm.com>
---
 Documentation/features/perf/perf-regs/arch-support.txt      | 2 +-
 Documentation/features/perf/perf-stackdump/arch-support.txt | 2 +-
 arch/powerpc/Kconfig                                        | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/features/perf/perf-regs/arch-support.txt b/Documentation/features/perf/perf-regs/arch-support.txt
index e2b4a78..f179b1f 100644
--- a/Documentation/features/perf/perf-regs/arch-support.txt
+++ b/Documentation/features/perf/perf-regs/arch-support.txt
@@ -27,7 +27,7 @@
     |       nios2: | TODO |
     |    openrisc: | TODO |
     |      parisc: | TODO |
-    |     powerpc: | TODO |
+    |     powerpc: |  ok  |
     |        s390: | TODO |
     |       score: | TODO |
     |          sh: | TODO |
diff --git a/Documentation/features/perf/perf-stackdump/arch-support.txt b/Documentation/features/perf/perf-stackdump/arch-support.txt
index 3dc24b0..85777c5 100644
--- a/Documentation/features/perf/perf-stackdump/arch-support.txt
+++ b/Documentation/features/perf/perf-stackdump/arch-support.txt
@@ -27,7 +27,7 @@
     |       nios2: | TODO |
     |    openrisc: | TODO |
     |      parisc: | TODO |
-    |     powerpc: | TODO |
+    |     powerpc: |  ok  |
     |        s390: | TODO |
     |       score: | TODO |
     |          sh: | TODO |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b14966d..a630ac2 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -117,6 +117,7 @@ config PPC
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_REGS
+	select HAVE_PERF_USER_STACK_DUMP
 	select HAVE_REGS_AND_STACK_ACCESS_API
 	select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64
 	select ARCH_WANT_IPC_PARSE_VERSION
-- 
1.9.3

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

* [PATCH 2/3] powerpc/perf: Add support for unwinding perf-stackdump
  2016-04-28  9:31 [PATCH 0/3] Add support for perf user stack dump in powerpc Chandan Kumar
  2016-04-28  9:31 ` [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Chandan Kumar
@ 2016-04-28  9:31 ` Chandan Kumar
  2016-05-08  3:59   ` [2/3] " Michael Ellerman
  2016-04-28  9:31 ` [PATCH 3/3] perf tools: Fix perf regs mask generation Chandan Kumar
  2016-04-28 14:23 ` [PATCH 0/3] Add support for perf user stack dump in powerpc Naveen N. Rao
  3 siblings, 1 reply; 11+ messages in thread
From: Chandan Kumar @ 2016-04-28  9:31 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: acme, mpe, jolsa, anju, maddy, naveen.n.rao, hemant, Chandan Kumar

Adds support for unwinding user stack dump by linking with libunwind.

Signed-off-by: Chandan Kumar <chandan.kumar@linux.vnet.ibm.com>
---
 tools/perf/arch/powerpc/util/Build              |  1 +
 tools/perf/arch/powerpc/util/unwind-libunwind.c | 96 +++++++++++++++++++++++++
 tools/perf/config/Makefile                      |  1 +
 3 files changed, 98 insertions(+)
 create mode 100644 tools/perf/arch/powerpc/util/unwind-libunwind.c

diff --git a/tools/perf/arch/powerpc/util/Build b/tools/perf/arch/powerpc/util/Build
index 9ee3350..90ad64b 100644
--- a/tools/perf/arch/powerpc/util/Build
+++ b/tools/perf/arch/powerpc/util/Build
@@ -5,3 +5,4 @@ libperf-y += perf_regs.o
 
 libperf-$(CONFIG_DWARF) += dwarf-regs.o
 libperf-$(CONFIG_DWARF) += skip-callchain-idx.o
+libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
diff --git a/tools/perf/arch/powerpc/util/unwind-libunwind.c b/tools/perf/arch/powerpc/util/unwind-libunwind.c
new file mode 100644
index 0000000..9e15f92
--- /dev/null
+++ b/tools/perf/arch/powerpc/util/unwind-libunwind.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2016 Chandan Kumar, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <errno.h>
+#include <libunwind.h>
+#include <asm/perf_regs.h>
+#include "../../util/unwind.h"
+#include "../../util/debug.h"
+
+int libunwind__arch_reg_id(int regnum)
+{
+	switch (regnum) {
+	case UNW_PPC64_R0:
+		return PERF_REG_POWERPC_R0;
+	case UNW_PPC64_R1:
+		return PERF_REG_POWERPC_R1;
+	case UNW_PPC64_R2:
+		return PERF_REG_POWERPC_R2;
+	case UNW_PPC64_R3:
+		return PERF_REG_POWERPC_R3;
+	case UNW_PPC64_R4:
+		return PERF_REG_POWERPC_R4;
+	case UNW_PPC64_R5:
+		return PERF_REG_POWERPC_R5;
+	case UNW_PPC64_R6:
+		return PERF_REG_POWERPC_R6;
+	case UNW_PPC64_R7:
+		return PERF_REG_POWERPC_R7;
+	case UNW_PPC64_R8:
+		return PERF_REG_POWERPC_R8;
+	case UNW_PPC64_R9:
+		return PERF_REG_POWERPC_R9;
+	case UNW_PPC64_R10:
+		return PERF_REG_POWERPC_R10;
+	case UNW_PPC64_R11:
+		return PERF_REG_POWERPC_R11;
+	case UNW_PPC64_R12:
+		return PERF_REG_POWERPC_R12;
+	case UNW_PPC64_R13:
+		return PERF_REG_POWERPC_R13;
+	case UNW_PPC64_R14:
+		return PERF_REG_POWERPC_R14;
+	case UNW_PPC64_R15:
+		return PERF_REG_POWERPC_R15;
+	case UNW_PPC64_R16:
+		return PERF_REG_POWERPC_R16;
+	case UNW_PPC64_R17:
+		return PERF_REG_POWERPC_R17;
+	case UNW_PPC64_R18:
+		return PERF_REG_POWERPC_R18;
+	case UNW_PPC64_R19:
+		return PERF_REG_POWERPC_R19;
+	case UNW_PPC64_R20:
+		return PERF_REG_POWERPC_R20;
+	case UNW_PPC64_R21:
+		return PERF_REG_POWERPC_R21;
+	case UNW_PPC64_R22:
+		return PERF_REG_POWERPC_R22;
+	case UNW_PPC64_R23:
+		return PERF_REG_POWERPC_R23;
+	case UNW_PPC64_R24:
+		return PERF_REG_POWERPC_R24;
+	case UNW_PPC64_R25:
+		return PERF_REG_POWERPC_R25;
+	case UNW_PPC64_R26:
+		return PERF_REG_POWERPC_R26;
+	case UNW_PPC64_R27:
+		return PERF_REG_POWERPC_R27;
+	case UNW_PPC64_R28:
+		return PERF_REG_POWERPC_R28;
+	case UNW_PPC64_R29:
+		return PERF_REG_POWERPC_R29;
+	case UNW_PPC64_R30:
+		return PERF_REG_POWERPC_R30;
+	case UNW_PPC64_R31:
+		return PERF_REG_POWERPC_R31;
+	case UNW_PPC64_LR:
+		return PERF_REG_POWERPC_LINK;
+	case UNW_PPC64_CTR:
+		return PERF_REG_POWERPC_CTR;
+	case UNW_PPC64_XER:
+		return PERF_REG_POWERPC_XER;
+	case UNW_PPC64_NIP:
+		return PERF_REG_POWERPC_NIP;
+	default:
+		pr_err("unwind: invalid reg id %d\n", regnum);
+		return -EINVAL;
+	}
+	return -EINVAL;
+}
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index eda1cfb..220536c 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -26,6 +26,7 @@ NO_PERF_REGS := 1
 # Additional ARCH settings for ppc
 ifeq ($(ARCH),powerpc)
   NO_PERF_REGS := 0
+  LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
 endif
 
 # Additional ARCH settings for x86
-- 
1.9.3

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

* [PATCH 3/3] perf tools: Fix perf regs mask generation
  2016-04-28  9:31 [PATCH 0/3] Add support for perf user stack dump in powerpc Chandan Kumar
  2016-04-28  9:31 ` [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Chandan Kumar
  2016-04-28  9:31 ` [PATCH 2/3] powerpc/perf: Add support for unwinding perf-stackdump Chandan Kumar
@ 2016-04-28  9:31 ` Chandan Kumar
  2016-05-08  3:59   ` [3/3] " Michael Ellerman
  2016-04-28 14:23 ` [PATCH 0/3] Add support for perf user stack dump in powerpc Naveen N. Rao
  3 siblings, 1 reply; 11+ messages in thread
From: Chandan Kumar @ 2016-04-28  9:31 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: acme, mpe, jolsa, anju, maddy, naveen.n.rao, hemant

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>

On some architectures (powerpc in particular), the number of registers
exceeds what can be represented in an integer bitmask. Ensure we
generate the proper bitmask on such platforms.

Fixes: 71ad0f5e4 ("perf tools: Support for DWARF CFI unwinding on post
processing")

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 tools/perf/util/perf_regs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
index 6b8eb13..c4023f2 100644
--- a/tools/perf/util/perf_regs.c
+++ b/tools/perf/util/perf_regs.c
@@ -12,18 +12,18 @@ int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
 	int i, idx = 0;
 	u64 mask = regs->mask;
 
-	if (regs->cache_mask & (1 << id))
+	if (regs->cache_mask & (1ULL << id))
 		goto out;
 
-	if (!(mask & (1 << id)))
+	if (!(mask & (1ULL << id)))
 		return -EINVAL;
 
 	for (i = 0; i < id; i++) {
-		if (mask & (1 << i))
+		if (mask & (1ULL << i))
 			idx++;
 	}
 
-	regs->cache_mask |= (1 << id);
+	regs->cache_mask |= (1ULL << id);
 	regs->cache_regs[id] = regs->regs[idx];
 
 out:
-- 
1.9.3

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

* Re: [PATCH 0/3] Add support for perf user stack dump in powerpc
  2016-04-28  9:31 [PATCH 0/3] Add support for perf user stack dump in powerpc Chandan Kumar
                   ` (2 preceding siblings ...)
  2016-04-28  9:31 ` [PATCH 3/3] perf tools: Fix perf regs mask generation Chandan Kumar
@ 2016-04-28 14:23 ` Naveen N. Rao
  2016-04-28 15:29   ` Arnaldo Carvalho de Melo
  3 siblings, 1 reply; 11+ messages in thread
From: Naveen N. Rao @ 2016-04-28 14:23 UTC (permalink / raw)
  To: Chandan Kumar
  Cc: linux-kernel, linuxppc-dev, maddy, acme, hemant, anju, jolsa

On 2016/04/28 03:01PM, Chandan Kumar wrote:
> This patch set enables perf user stack dump on powerpc

For this patch-set:
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

I suppose that implies my testing, but nonetheless:
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

> 
> Example with "ls" command as user program
> ./perf record --call-graph=dwarf,8192 ls
> 
> ./perf script
> ---------8< -----
> ..
> ...
> perf 12549 75938.934539:       1771 cycles:ppp: 
>                   210d90 .perf_event_exec (/boot/vmlinux)
>                   34b914 .load_elf_binary (/boot/vmlinux)
>                   2dcabc .search_binary_handler (/boot/vmlinux)
>                   2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
>                   2ddcd8 .sys_execve (/boot/vmlinux)
>                    19258 system_call (/boot/vmlinux)

To expand on this, with upstream libunwind 
(git://git.sv.gnu.org/libunwind.git) and with debuginfo installed:

# ./perf record -e cycles -g --call-graph dwarf -- find . -iname
'*linux*'
 ./tests/vmlinux-kallsyms.c
./tests/vmlinux-kallsyms.o
./tests/.vmlinux-kallsyms.o.cmd
./util/include/linux
[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.371 MB perf.data (45 samples) ]
# ./perf script
<snip>
find 23858 167788.657182:     881967 cycles: 
                  8e758c _cond_resched (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
                  3f83bc selinux_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
                  3ee254 security_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
                  3063a4 vfs_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
                  306530 vfs_fstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
                  306c60 sys_newfstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
                   19210 system_call (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
            3fffa31829a8 __fxstatat64 (/usr/lib64/libc-2.17.so)
                10025ac8 fts_stat.isra.2 (/usr/bin/find)
                10027c04 fts_read (/usr/bin/find)
                10003e18 find (/usr/bin/find)
                100035ec main (/usr/bin/find)
            3fffa30a4580 generic_start_main.isra.0 (/usr/lib64/libc-2.17.so)
            3fffa30a4774 __libc_start_main (/usr/lib64/libc-2.17.so)

<snip>


Arnaldo, Michael,
Can we take this through powerpc/next as well since this pretty much 
rides on the recent perf regs work?

- Naveen

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

* Re: [PATCH 0/3] Add support for perf user stack dump in powerpc
  2016-04-28 14:23 ` [PATCH 0/3] Add support for perf user stack dump in powerpc Naveen N. Rao
@ 2016-04-28 15:29   ` Arnaldo Carvalho de Melo
  2016-04-28 16:14     ` Naveen N. Rao
  0 siblings, 1 reply; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-28 15:29 UTC (permalink / raw)
  To: Naveen N. Rao
  Cc: Chandan Kumar, linux-kernel, linuxppc-dev, maddy, hemant, anju, jolsa

Em Thu, Apr 28, 2016 at 07:53:41PM +0530, Naveen N. Rao escreveu:
> On 2016/04/28 03:01PM, Chandan Kumar wrote:
> > This patch set enables perf user stack dump on powerpc
> 
> For this patch-set:
> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> 
> I suppose that implies my testing, but nonetheless:
> Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> 
> > 
> > Example with "ls" command as user program
> > ./perf record --call-graph=dwarf,8192 ls
> > 
> > ./perf script
> > ---------8< -----
> > ..
> > ...
> > perf 12549 75938.934539:       1771 cycles:ppp: 
> >                   210d90 .perf_event_exec (/boot/vmlinux)
> >                   34b914 .load_elf_binary (/boot/vmlinux)
> >                   2dcabc .search_binary_handler (/boot/vmlinux)
> >                   2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
> >                   2ddcd8 .sys_execve (/boot/vmlinux)
> >                    19258 system_call (/boot/vmlinux)
> 
> To expand on this, with upstream libunwind 
> (git://git.sv.gnu.org/libunwind.git) and with debuginfo installed:
> 
> # ./perf record -e cycles -g --call-graph dwarf -- find . -iname
> '*linux*'
>  ./tests/vmlinux-kallsyms.c
> ./tests/vmlinux-kallsyms.o
> ./tests/.vmlinux-kallsyms.o.cmd
> ./util/include/linux
> [ perf record: Woken up 2 times to write data ]
> [ perf record: Captured and wrote 0.371 MB perf.data (45 samples) ]
> # ./perf script
> <snip>
> find 23858 167788.657182:     881967 cycles: 
>                   8e758c _cond_resched (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>                   3f83bc selinux_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>                   3ee254 security_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>                   3063a4 vfs_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>                   306530 vfs_fstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>                   306c60 sys_newfstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>                    19210 system_call (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
>             3fffa31829a8 __fxstatat64 (/usr/lib64/libc-2.17.so)
>                 10025ac8 fts_stat.isra.2 (/usr/bin/find)
>                 10027c04 fts_read (/usr/bin/find)
>                 10003e18 find (/usr/bin/find)
>                 100035ec main (/usr/bin/find)
>             3fffa30a4580 generic_start_main.isra.0 (/usr/lib64/libc-2.17.so)
>             3fffa30a4774 __libc_start_main (/usr/lib64/libc-2.17.so)
> 
> <snip>
> 
> 
> Arnaldo, Michael,
> Can we take this through powerpc/next as well since this pretty much 
> rides on the recent perf regs work?

I haven't tested with the bits that touch the common code, have you? But
I think it should be harmless and overall this patchset looks fine, so,
if you, just in case, have tested this on a x86_64 machine and all seems
well, i.e. perf test, perf record/report with a perf-probe generated
event, to exercise this stuff, then:

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

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

* Re: [PATCH 0/3] Add support for perf user stack dump in powerpc
  2016-04-28 15:29   ` Arnaldo Carvalho de Melo
@ 2016-04-28 16:14     ` Naveen N. Rao
  2016-04-28 16:31       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 11+ messages in thread
From: Naveen N. Rao @ 2016-04-28 16:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Chandan Kumar, linux-kernel, linuxppc-dev, maddy, hemant, anju, jolsa

On 2016/04/28 12:29PM, Arnaldo Carvalho de Melo wrote:
> Em Thu, Apr 28, 2016 at 07:53:41PM +0530, Naveen N. Rao escreveu:
> > On 2016/04/28 03:01PM, Chandan Kumar wrote:
> > > This patch set enables perf user stack dump on powerpc
> > 
> > For this patch-set:
> > Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> > 
> > I suppose that implies my testing, but nonetheless:
> > Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> > 
> > > 
> > > Example with "ls" command as user program
> > > ./perf record --call-graph=dwarf,8192 ls
> > > 
> > > ./perf script
> > > ---------8< -----
> > > ..
> > > ...
> > > perf 12549 75938.934539:       1771 cycles:ppp: 
> > >                   210d90 .perf_event_exec (/boot/vmlinux)
> > >                   34b914 .load_elf_binary (/boot/vmlinux)
> > >                   2dcabc .search_binary_handler (/boot/vmlinux)
> > >                   2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
> > >                   2ddcd8 .sys_execve (/boot/vmlinux)
> > >                    19258 system_call (/boot/vmlinux)
> > 
> > To expand on this, with upstream libunwind 
> > (git://git.sv.gnu.org/libunwind.git) and with debuginfo installed:
> > 
> > # ./perf record -e cycles -g --call-graph dwarf -- find . -iname
> > '*linux*'
> >  ./tests/vmlinux-kallsyms.c
> > ./tests/vmlinux-kallsyms.o
> > ./tests/.vmlinux-kallsyms.o.cmd
> > ./util/include/linux
> > [ perf record: Woken up 2 times to write data ]
> > [ perf record: Captured and wrote 0.371 MB perf.data (45 samples) ]
> > # ./perf script
> > <snip>
> > find 23858 167788.657182:     881967 cycles: 
> >                   8e758c _cond_resched (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >                   3f83bc selinux_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >                   3ee254 security_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >                   3063a4 vfs_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >                   306530 vfs_fstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >                   306c60 sys_newfstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >                    19210 system_call (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> >             3fffa31829a8 __fxstatat64 (/usr/lib64/libc-2.17.so)
> >                 10025ac8 fts_stat.isra.2 (/usr/bin/find)
> >                 10027c04 fts_read (/usr/bin/find)
> >                 10003e18 find (/usr/bin/find)
> >                 100035ec main (/usr/bin/find)
> >             3fffa30a4580 generic_start_main.isra.0 (/usr/lib64/libc-2.17.so)
> >             3fffa30a4774 __libc_start_main (/usr/lib64/libc-2.17.so)
> > 
> > <snip>
> > 
> > 
> > Arnaldo, Michael,
> > Can we take this through powerpc/next as well since this pretty much 
> > rides on the recent perf regs work?
> 
> I haven't tested with the bits that touch the common code, have you? But
> I think it should be harmless and overall this patchset looks fine, so,
> if you, just in case, have tested this on a x86_64 machine and all seems
> well, i.e. perf test, perf record/report with a perf-probe generated
> event, to exercise this stuff, then:

Yes, I processed a perf.data file that had the user stackdump unwound 
with libunwind with/without patch 3 and the output matches. And:

# ./perf test 46
46: Test dwarf unwind                                        : Ok

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

Thanks.
- Naveen

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

* Re: [PATCH 0/3] Add support for perf user stack dump in powerpc
  2016-04-28 16:14     ` Naveen N. Rao
@ 2016-04-28 16:31       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-28 16:31 UTC (permalink / raw)
  To: Naveen N. Rao
  Cc: Chandan Kumar, linux-kernel, linuxppc-dev, maddy, hemant, anju, jolsa

Em Thu, Apr 28, 2016 at 09:44:29PM +0530, Naveen N. Rao escreveu:
> On 2016/04/28 12:29PM, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Apr 28, 2016 at 07:53:41PM +0530, Naveen N. Rao escreveu:
> > > On 2016/04/28 03:01PM, Chandan Kumar wrote:
> > > > This patch set enables perf user stack dump on powerpc
> > > 
> > > For this patch-set:
> > > Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> > > 
> > > I suppose that implies my testing, but nonetheless:
> > > Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> > > 
> > > > 
> > > > Example with "ls" command as user program
> > > > ./perf record --call-graph=dwarf,8192 ls
> > > > 
> > > > ./perf script
> > > > ---------8< -----
> > > > ..
> > > > ...
> > > > perf 12549 75938.934539:       1771 cycles:ppp: 
> > > >                   210d90 .perf_event_exec (/boot/vmlinux)
> > > >                   34b914 .load_elf_binary (/boot/vmlinux)
> > > >                   2dcabc .search_binary_handler (/boot/vmlinux)
> > > >                   2dd6f0 .do_execveat_common.isra.28 (/boot/vmlinux)
> > > >                   2ddcd8 .sys_execve (/boot/vmlinux)
> > > >                    19258 system_call (/boot/vmlinux)
> > > 
> > > To expand on this, with upstream libunwind 
> > > (git://git.sv.gnu.org/libunwind.git) and with debuginfo installed:
> > > 
> > > # ./perf record -e cycles -g --call-graph dwarf -- find . -iname
> > > '*linux*'
> > >  ./tests/vmlinux-kallsyms.c
> > > ./tests/vmlinux-kallsyms.o
> > > ./tests/.vmlinux-kallsyms.o.cmd
> > > ./util/include/linux
> > > [ perf record: Woken up 2 times to write data ]
> > > [ perf record: Captured and wrote 0.371 MB perf.data (45 samples) ]
> > > # ./perf script
> > > <snip>
> > > find 23858 167788.657182:     881967 cycles: 
> > >                   8e758c _cond_resched (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >                   3f83bc selinux_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >                   3ee254 security_inode_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >                   3063a4 vfs_getattr (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >                   306530 vfs_fstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >                   306c60 sys_newfstatat (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >                    19210 system_call (/lib/modules/4.6.0-rc3-nnr+/build/vmlinux)
> > >             3fffa31829a8 __fxstatat64 (/usr/lib64/libc-2.17.so)
> > >                 10025ac8 fts_stat.isra.2 (/usr/bin/find)
> > >                 10027c04 fts_read (/usr/bin/find)
> > >                 10003e18 find (/usr/bin/find)
> > >                 100035ec main (/usr/bin/find)
> > >             3fffa30a4580 generic_start_main.isra.0 (/usr/lib64/libc-2.17.so)
> > >             3fffa30a4774 __libc_start_main (/usr/lib64/libc-2.17.so)
> > > 
> > > <snip>
> > > 
> > > 
> > > Arnaldo, Michael,
> > > Can we take this through powerpc/next as well since this pretty much 
> > > rides on the recent perf regs work?
> > 
> > I haven't tested with the bits that touch the common code, have you? But
> > I think it should be harmless and overall this patchset looks fine, so,
> > if you, just in case, have tested this on a x86_64 machine and all seems
> > well, i.e. perf test, perf record/report with a perf-probe generated
> > event, to exercise this stuff, then:
> 
> Yes, I processed a perf.data file that had the user stackdump unwound 
> with libunwind with/without patch 3 and the output matches. And:
> 
> # ./perf test 46
> 46: Test dwarf unwind                                        : Ok

Ok then,
 
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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

* Re: [1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support
  2016-04-28  9:31 ` [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Chandan Kumar
@ 2016-05-08  3:59   ` Michael Ellerman
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2016-05-08  3:59 UTC (permalink / raw)
  To: Chandan Kumar, linux-kernel, linuxppc-dev
  Cc: maddy, Chandan Kumar, acme, hemant, anju, naveen.n.rao, jolsa

On Thu, 2016-28-04 at 09:31:08 UTC, Chandan Kumar wrote:
> With perf regs support enabled for powerpc, the support for obtaining
> perf user stack dump is already enabled.
> This patch declares the support for same and also updates documentation
> to mark the support for perf-regs and perf-stackdump.
> 
> Signed-off-by: Chandan Kumar <chandan.kumar@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/08c1f9ec28d2d156aca29f7752

cheers

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

* Re: [2/3] powerpc/perf: Add support for unwinding perf-stackdump
  2016-04-28  9:31 ` [PATCH 2/3] powerpc/perf: Add support for unwinding perf-stackdump Chandan Kumar
@ 2016-05-08  3:59   ` Michael Ellerman
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2016-05-08  3:59 UTC (permalink / raw)
  To: Chandan Kumar, linux-kernel, linuxppc-dev
  Cc: maddy, Chandan Kumar, acme, hemant, anju, naveen.n.rao, jolsa

On Thu, 2016-28-04 at 09:31:09 UTC, Chandan Kumar wrote:
> Adds support for unwinding user stack dump by linking with libunwind.
> 
> Signed-off-by: Chandan Kumar <chandan.kumar@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/7b87053070496576725b2be81b

cheers

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

* Re: [3/3] perf tools: Fix perf regs mask generation
  2016-04-28  9:31 ` [PATCH 3/3] perf tools: Fix perf regs mask generation Chandan Kumar
@ 2016-05-08  3:59   ` Michael Ellerman
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2016-05-08  3:59 UTC (permalink / raw)
  To: Chandan Kumar, linux-kernel, linuxppc-dev
  Cc: maddy, acme, hemant, anju, naveen.n.rao, jolsa

On Thu, 2016-28-04 at 09:31:10 UTC, Chandan Kumar wrote:
> From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
> 
> On some architectures (powerpc in particular), the number of registers
> exceeds what can be represented in an integer bitmask. Ensure we
> generate the proper bitmask on such platforms.
> 
> Fixes: 71ad0f5e4 ("perf tools: Support for DWARF CFI unwinding on post
> processing")
> 
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/826dccfd238c3eeac379f5f637

cheers

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

end of thread, other threads:[~2016-05-08  3:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28  9:31 [PATCH 0/3] Add support for perf user stack dump in powerpc Chandan Kumar
2016-04-28  9:31 ` [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Chandan Kumar
2016-05-08  3:59   ` [1/3] " Michael Ellerman
2016-04-28  9:31 ` [PATCH 2/3] powerpc/perf: Add support for unwinding perf-stackdump Chandan Kumar
2016-05-08  3:59   ` [2/3] " Michael Ellerman
2016-04-28  9:31 ` [PATCH 3/3] perf tools: Fix perf regs mask generation Chandan Kumar
2016-05-08  3:59   ` [3/3] " Michael Ellerman
2016-04-28 14:23 ` [PATCH 0/3] Add support for perf user stack dump in powerpc Naveen N. Rao
2016-04-28 15:29   ` Arnaldo Carvalho de Melo
2016-04-28 16:14     ` Naveen N. Rao
2016-04-28 16:31       ` Arnaldo Carvalho de Melo

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.