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


Groups > linux.kernel > #1389942 > unrolled thread

[PATCH 0/3] Add support for perf user stack dump in powerpc

Started byChandan Kumar <chandan.kumar@linux.vnet.ibm.com>
First post2016-04-28 11:40 +0200
Last post2016-04-28 18:40 +0200
Articles 9 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] Add support for perf user stack dump in powerpc Chandan Kumar <chandan.kumar@linux.vnet.ibm.com> - 2016-04-28 11:40 +0200
    [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Chandan Kumar <chandan.kumar@linux.vnet.ibm.com> - 2016-04-28 11:40 +0200
      Re: [1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support Michael Ellerman <mpe@ellerman.id.au> - 2016-05-08 06:10 +0200
    [PATCH 3/3] perf tools: Fix perf regs mask generation Chandan Kumar <chandan.kumar@linux.vnet.ibm.com> - 2016-04-28 11:40 +0200
      Re: [3/3] perf tools: Fix perf regs mask generation Michael Ellerman <mpe@ellerman.id.au> - 2016-05-08 06:00 +0200
    Re: [PATCH 0/3] Add support for perf user stack dump in powerpc "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-04-28 16:30 +0200
      Re: [PATCH 0/3] Add support for perf user stack dump in powerpc Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-04-28 17:40 +0200
        Re: [PATCH 0/3] Add support for perf user stack dump in powerpc "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-04-28 18:20 +0200
          Re: [PATCH 0/3] Add support for perf user stack dump in powerpc Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-04-28 18:40 +0200

#1389942 — [PATCH 0/3] Add support for perf user stack dump in powerpc

FromChandan Kumar <chandan.kumar@linux.vnet.ibm.com>
Date2016-04-28 11:40 +0200
Subject[PATCH 0/3] Add support for perf user stack dump in powerpc
Message-ID<rsQAp-Tg-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1389943 — [PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support

FromChandan Kumar <chandan.kumar@linux.vnet.ibm.com>
Date2016-04-28 11:40 +0200
Subject[PATCH 1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support
Message-ID<rsQAq-Tg-25@gated-at.bofh.it>
In reply to#1389942
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

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


#1396381 — Re: [1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support

FromMichael Ellerman <mpe@ellerman.id.au>
Date2016-05-08 06:10 +0200
SubjectRe: [1/3] powerpc: Add HAVE_PERF_USER_STACK_DUMP support
Message-ID<rwocy-7xQ-1@gated-at.bofh.it>
In reply to#1389943
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

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


#1389944 — [PATCH 3/3] perf tools: Fix perf regs mask generation

FromChandan Kumar <chandan.kumar@linux.vnet.ibm.com>
Date2016-04-28 11:40 +0200
Subject[PATCH 3/3] perf tools: Fix perf regs mask generation
Message-ID<rsQAq-Tg-21@gated-at.bofh.it>
In reply to#1389942
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

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


#1396379 — Re: [3/3] perf tools: Fix perf regs mask generation

FromMichael Ellerman <mpe@ellerman.id.au>
Date2016-05-08 06:00 +0200
SubjectRe: [3/3] perf tools: Fix perf regs mask generation
Message-ID<rwo2R-761-1@gated-at.bofh.it>
In reply to#1389944
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

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


#1390254

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2016-04-28 16:30 +0200
Message-ID<rsV75-4H2-25@gated-at.bofh.it>
In reply to#1389942
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

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


#1390326

FromArnaldo Carvalho de Melo <acme@redhat.com>
Date2016-04-28 17:40 +0200
Message-ID<rsWcO-5NB-25@gated-at.bofh.it>
In reply to#1390254
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>

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


#1390369

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2016-04-28 18:20 +0200
Message-ID<rsWPK-6Ft-11@gated-at.bofh.it>
In reply to#1390326
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

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


#1390376

FromArnaldo Carvalho de Melo <acme@redhat.com>
Date2016-04-28 18:40 +0200
Message-ID<rsX8T-6Ta-13@gated-at.bofh.it>
In reply to#1390369
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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web