[opensuse-programming] using performance counters?
Hello I'm trying to optimize some assembler code for which I'm measuring runtime over a <slice of data>. Is there any easy (in C or assembler ) access to counters for pipeline stalls and cache misses available? At some point I'd also like to look at context switches, although I'm not sure how I might affect those. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On 03/19/2011 02:21 PM, Per Jessen wrote:
I'm trying to optimize some assembler code for which I'm measuring runtime over a <slice of data>. Is there any easy (in C or assembler ) access to counters for pipeline stalls and cache misses available? At some point I'd also like to look at context switches, although I'm not sure how I might affect those.
Valgrind can give you some of what you want. I've also used Intel's Vtune. The Linux Trace Toolkit may also be useful. But, I think for things like pipeline stalls you would need one of the profiling tools. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix PGP key id: 537C5846 PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB CA3B 4607 4319 537C 5846
On Sun, Mar 20, 2011 at 09:34:24AM -0400, Jerry Feldman wrote:
On 03/19/2011 02:21 PM, Per Jessen wrote:
I'm trying to optimize some assembler code for which I'm measuring runtime over a <slice of data>. Is there any easy (in C or assembler ) access to counters for pipeline stalls and cache misses available? At some point I'd also like to look at context switches, although I'm not sure how I might affect those.
Valgrind can give you some of what you want. I've also used Intel's Vtune. The Linux Trace Toolkit may also be useful. But, I think for things like pipeline stalls you would need one of the profiling tools.
oprofile is also at this kind of lowlevel. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Marcus Meissner wrote:
On Sun, Mar 20, 2011 at 09:34:24AM -0400, Jerry Feldman wrote:
On 03/19/2011 02:21 PM, Per Jessen wrote:
I'm trying to optimize some assembler code for which I'm measuring runtime over a <slice of data>. Is there any easy (in C or assembler ) access to counters for pipeline stalls and cache misses available? At some point I'd also like to look at context switches, although I'm not sure how I might affect those.
Valgrind can give you some of what you want. I've also used Intel's Vtune. The Linux Trace Toolkit may also be useful. But, I think for things like pipeline stalls you would need one of the profiling tools.
oprofile is also at this kind of lowlevel.
Thanks, I'll have to take a closer look. I had sort of hoped to be able to something like this: a=readcounter() <run my code> b=readcounter() b-a = number of events (stalls, context switch, cache miss etc). /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
* Per Jessen (per@computer.org) [20110322 16:49]:
Thanks, I'll have to take a closer look. I had sort of hoped to be able to something like this:
Have a look at the papi package, online at http://icl.cs.utk.edu/papi/ Looks like it could be what you're searching. Philipp -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Philipp Thomas wrote:
* Per Jessen (per@computer.org) [20110322 16:49]:
Thanks, I'll have to take a closer look. I had sort of hoped to be able to something like this:
Have a look at the papi package, online at http://icl.cs.utk.edu/papi/ Looks like it could be what you're searching.
That looks pretty good, yes. Thanks for finding that for me. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On Wed, 06 Apr 2011 16:23:10 +0200, Per Jessen <per@computer.org> wrote:
That looks pretty good, yes. Thanks for finding that for me.
I didn't find it, I knew of it :) I had been given the task to package PAPI for SLES one or two years ago as it had been requested by partners. Up till then I didn't know of it either. As a direct result you now have papi in a reasonably recent version in devel:libraries:c_c++/papi ready to be installed and used and shortly also with all man pages as I had overlooked that papi has man pages but you have to install them explicitely with a Makefile other than the normal one. Philipp -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Philipp Thomas wrote:
On Wed, 06 Apr 2011 16:23:10 +0200, Per Jessen <per@computer.org> wrote:
That looks pretty good, yes. Thanks for finding that for me.
I didn't find it, I knew of it :) I had been given the task to package PAPI for SLES one or two years ago as it had been requested by partners. Up till then I didn't know of it either.
As a direct result you now have papi in a reasonably recent version in devel:libraries:c_c++/papi ready to be installed and used and shortly also with all man pages as I had overlooked that papi has man pages but you have to install them explicitely with a Makefile other than the normal one.
I built 4.1.2 from source, and the man pages got installed automagically. I guess there's not much chance of finding anyone here actually using PAPI? I think I my code is working except for PAPI_read() returning "Not supported by substrate". /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On Thu, 07 Apr 2011 10:22:34 +0200, Per Jessen <per@computer.org> wrote:
I guess there's not much chance of finding anyone here actually using PAPI? I think I my code is working except for PAPI_read() returning "Not supported by substrate".
There is a PAPI mailing list where I'm sure you'll get help. Subscription is http://lists.eecs.utk.edu/mailman/listinfo/ptools-perfapi and there is a web forum at http://icl.cs.utk.edu/papi/forum/. Philipp -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Philipp Thomas wrote:
On Thu, 07 Apr 2011 10:22:34 +0200, Per Jessen <per@computer.org> wrote:
I guess there's not much chance of finding anyone here actually using PAPI? I think I my code is working except for PAPI_read() returning "Not supported by substrate".
There is a PAPI mailing list where I'm sure you'll get help. Subscription is http://lists.eecs.utk.edu/mailman/listinfo/ptools-perfapi and there is a web forum at http://icl.cs.utk.edu/papi/forum/.
Yeah, I've already subscribed, just waiting for the moderator to approve. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Per Jessen wrote:
I guess there's not much chance of finding anyone here actually using PAPI? I think I my code is working except for PAPI_read() returning "Not supported by substrate".
Well, it looks as if papi isn't quite working on Pentium4 CPUs - the testcases after the build more or less fail. I asked on the mailing list, where it was suggested I use a perfctr patched kernel. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
On 03/20/2011 05:47 PM, Marcus Meissner wrote:
On Sun, Mar 20, 2011 at 09:34:24AM -0400, Jerry Feldman wrote:
On 03/19/2011 02:21 PM, Per Jessen wrote:
I'm trying to optimize some assembler code for which I'm measuring runtime over a<slice of data>. Is there any easy (in C or assembler ) access to counters for pipeline stalls and cache misses available? At some point I'd also like to look at context switches, although I'm not sure how I might affect those.
Valgrind can give you some of what you want. I've also used Intel's Vtune. The Linux Trace Toolkit may also be useful. But, I think for things like pipeline stalls you would need one of the profiling tools.
oprofile is also at this kind of lowlevel.
Thanks for the hint to oprofile. Looks interessting. oprofile requires the uncompressed image of the running kernel to work: vmlinux Does anybody know how to get a such an image on opensuse? -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
Volker Poplawski wrote:
On 03/20/2011 05:47 PM, Marcus Meissner wrote:
On Sun, Mar 20, 2011 at 09:34:24AM -0400, Jerry Feldman wrote:
On 03/19/2011 02:21 PM, Per Jessen wrote:
I'm trying to optimize some assembler code for which I'm measuring runtime over a<slice of data>. Is there any easy (in C or assembler ) access to counters for pipeline stalls and cache misses available? At some point I'd also like to look at context switches, although I'm not sure how I might affect those.
Valgrind can give you some of what you want. I've also used Intel's Vtune. The Linux Trace Toolkit may also be useful. But, I think for things like pipeline stalls you would need one of the profiling tools.
oprofile is also at this kind of lowlevel.
Thanks for the hint to oprofile. Looks interessting.
oprofile requires the uncompressed image of the running kernel to work: vmlinux
Does anybody know how to get a such an image on opensuse?
I think you'll get by building the kernel with "make bzImage". I haven't tried it though. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org
participants (6)
-
Jerry Feldman
-
Marcus Meissner
-
Per Jessen
-
Philipp Thomas
-
Philipp Thomas
-
Volker Poplawski