Re: [PATCHv2 00/14] perf diff: Factor diff command

From: Arnaldo Carvalho de Melo
Date: Wed Oct 03 2012 - 09:48:06 EST


Em Tue, Oct 02, 2012 at 06:30:02PM +0200, Andi Kleen escreveu:
> The other problem I ran into is that perf archive doesn't seem to work very
> well with kernels, so it's hard to move profiles from different kernels
> around to diff them (e.g. for a performance regression) One way around this
> would be options to diff to specify the vmlinux etc. manually

Can you describe more precisely what is not working well with 'archive'
and build ids?

When you do a 'perf record', at the end of the session, it traverses the
samples looking for DSOs with hits, and then stashes a copy (or a
hardlink, if possible) of these DSOs in your ~/.cache/, keyed by its
build id.

Later, when you do a perf archive, it will look again at your perf.data
files, look again for DSOs with hits and pass them on a tar command
line, you transfer those tarballs to your analysis machine and it should
just work.

To debug you may follow some of these steps:

[root@sandy linux]# perf record -a usleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.447 MB perf.data (~19534 samples) ]
[root@sandy linux]# perf buildid-list
62b97af6897371571caef35fd5ae88e29bde5e89 [kernel.kallsyms]
[root@sandy linux]# ls -la ~/.debug/.build-id/62/b97af6897371571caef35fd5ae88e29bde5e89
lrwxrwxrwx. 1 root root 64 Oct 3 10:41 /root/.debug/.build-id/62/b97af6897371571caef35fd5ae88e29bde5e89 -> ../../[kernel.kallsyms]/62b97af6897371571caef35fd5ae88e29bde5e89
[root@sandy linux]# perf buildid-list --hell
Error: unknown option `hell'

usage: perf buildid-list [<options>]

-H, --with-hits Show only DSOs with hits
-i, --input <file> input file name
-f, --force don't complain, do it
-k, --kernel Show current kernel build id
-v, --verbose be more verbose

[root@sandy linux]# perf buildid-list -k
62b97af6897371571caef35fd5ae88e29bde5e89
[root@sandy linux]# perf archive
Now please run:

$ tar xvf perf.data.tar.bz2 -C ~/.debug

wherever you need to run 'perf report' on.
[root@sandy linux]# tar tvf perf.data.tar.bz2
lrwxrwxrwx root/root 0 2012-10-03 10:41 .build-id/62/b97af6897371571caef35fd5ae88e29bde5e89 -> ../../[kernel.kallsyms]/62b97af6897371571caef35fd5ae88e29bde5e89
-rw-r--r-- root/root 4115683 2012-10-03 10:41 [kernel.kallsyms]/62b97af6897371571caef35fd5ae88e29bde5e89
[root@sandy linux]#

[root@sandy linux]# sha256sum /root/.debug/.build-id/62/b97af6897371571caef35fd5ae88e29bde5e89 /proc/kallsyms
43724edebe7f144d43a8664e237fa14df96bb79943002f1f17f45379a16418bf /root/.debug/.build-id/62/b97af6897371571caef35fd5ae88e29bde5e89
43724edebe7f144d43a8664e237fa14df96bb79943002f1f17f45379a16418bf /proc/kallsyms
[root@sandy linux]#

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/