Arun Sharma | 20 Mar 23:54 2008
Picon

[perfmon2] [PATCH] python bindings

Hi Stephane,

Here's an initial version of my python bindings patch.

The patch depends on perfmon.h and pfmlib.h being SWIG interface files, as well as header files.
It'd be nice to make sure that the python subdirectory builds ok when those files are updated.

 -Arun

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
stephane eranian | 21 Mar 09:34 2008

Re: [perfmon2] On measuring loads and stores for Pentium 4

Arun,

As far as I know, pfmon does not support tagging. Yet I believe there
is some tagging support
in libpfm. Take a look at libpfm/lib/pfmlib_pentium4.c. Dan, cc'ed
here provided the tagging
code, so he may be able to help you.

On Tue, Mar 18, 2008 at 10:02 PM, Arun Nair <arun.nair <at> mail.utexas.edu> wrote:
> Hi All,
> I'm trying to measure total number of load and store uops retired on a
> pentium 4 machine using pfmon. There is an event called UOPS_TYPE:TAGLOADS
> that I guess can be used to measure the number of loads, provided they are
> tagged first, using a "front-end tagging mechanism". I am not sure how to do
> this in pfmon. Could you please advise?
>
> If there's a more straightforward way of doing this, please let me know.
>
> Thanks and regards,
> Arun Nair
>
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
>  perfmon2-devel mailing list
>  perfmon2-devel <at> lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Arun Sharma | 21 Mar 20:32 2008
Picon

Re: [perfmon2] [PATCH] python bindings

Hi Stephane,

The attached patch converts libpfm errors into python exceptions.
Please review.

 -Arun

On Thu, Mar 20, 2008 at 3:54 PM, Arun Sharma <aruns <at> google.com> wrote:
Hi Stephane,

Here's an initial version of my python bindings patch.

The patch depends on perfmon.h and pfmlib.h being SWIG interface files, as well as header files.
It'd be nice to make sure that the python subdirectory builds ok when those files are updated.

 -Arun


Attachment (pfm-err-t.patch): text/x-patch, 10 KiB
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
stephane eranian | 21 Mar 22:19 2008

Re: [perfmon2] [PATCH] python bindings

Arun,

Not all functions are syscalls here. only the first 12. The others are
just library
calls.

Is the pfm_err_t  trick, what  they use for the other syscalls?

On Fri, Mar 21, 2008 at 8:32 PM, Arun Sharma <aruns <at> google.com> wrote:
> Hi Stephane,
>
> The attached patch converts libpfm errors into python exceptions.
> Please review.
>
>  -Arun
>
>
>
> On Thu, Mar 20, 2008 at 3:54 PM, Arun Sharma <aruns <at> google.com> wrote:
>
> > Hi Stephane,
> >
> > Here's an initial version of my python bindings patch.
> >
> > The patch depends on perfmon.h and pfmlib.h being SWIG interface files, as
> well as header files.
> > It'd be nice to make sure that the python subdirectory builds ok when
> those files are updated.
> >
> >  -Arun
> >
> >
>
>
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
>  perfmon2-devel mailing list
>  perfmon2-devel <at> lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Arun Sharma | 21 Mar 22:45 2008
Picon

Re: [perfmon2] [PATCH] python bindings

On Fri, Mar 21, 2008 at 2:19 PM, stephane eranian <eranian <at> googlemail.com> wrote:

Arun,

Not all functions are syscalls here. only the first 12. The others are
just library
calls.

SWIG doesn't know if they're system calls are not. It just needs to be able to tell whether the function succeeded or not.


Is the pfm_err_t  trick, what  they use for the other syscalls?
 
I think most of the wrappers in python base libraries are hand written C (not SWIG generated C).

http://docs.python.org/ext/intro.html

Using typemaps and typedefs is also fairly common. The other method is %exception:

http://www.swig.org/Doc1.3/Python.html#Python_nn44

But we'd have to write one exception block per function.

Also, my earlier patch breaks self.py and sys.py. This incremental patch should fix it.

 -Arun


Attachment (pfm-err-t2.patch): text/x-patch, 2419 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
Arun Sharma | 21 Mar 22:56 2008
Picon

Re: [perfmon2] [PATCH] python bindings

On Fri, Mar 21, 2008 at 2:45 PM, Arun Sharma <aruns <at> google.com> wrote:

On Fri, Mar 21, 2008 at 2:19 PM, stephane eranian <eranian <at> googlemail.com> wrote:
Arun,

Not all functions are syscalls here. only the first 12. The others are
just library
calls.

SWIG doesn't know if they're system calls are not. It just needs to be able to tell whether the function succeeded or not.

For some functions, I think both os_err_t and pfm_err_t work fine. But since they're system calls, it might be better to use os_err_t. Please let me know if that's what you meant.

 -Arun

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
stephane eranian | 21 Mar 22:58 2008

Re: [perfmon2] [PATCH] python bindings

Arun,

On Fri, Mar 21, 2008 at 10:45 PM, Arun Sharma <aruns <at> google.com> wrote:
> On Fri, Mar 21, 2008 at 2:19 PM, stephane eranian <eranian <at> googlemail.com>
> wrote:
>
> > Arun,
> >
> > Not all functions are syscalls here. only the first 12. The others are
> > just library
> > calls.
>
> SWIG doesn't know if they're system calls are not. It just needs to be able
> to tell whether the function succeeded or not.
>
>
> >
> > Is the pfm_err_t  trick, what  they use for the other syscalls?
>
> I think most of the wrappers in python base libraries are hand written C
> (not SWIG generated C).
>
> http://docs.python.org/ext/intro.html
>
This one led me to believe we should define a libpfm exception as shown
in the example: if ret != PFMLIB_SUCCES then raise libpfmError.

> Using typemaps and typedefs is also fairly common. The other method is
> %exception:
>
> http://www.swig.org/Doc1.3/Python.html#Python_nn44
>
This one looks easy to do for the syscall calls, only 12 of them.

> But we'd have to write one exception block per function.
>
Yes, no big deal and it would keep the perfmon.h untouched so it would
not confused C/C++ users.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Arun Sharma | 21 Mar 23:11 2008
Picon

Re: [perfmon2] [PATCH] python bindings

On Fri, Mar 21, 2008 at 2:58 PM, stephane eranian <eranian <at> googlemail.com> wrote:


This one looks easy to do for the syscall calls, only 12 of them.

That's 12 syscalls + 29 library calls + future API changes.

> But we'd have to write one exception block per function.
>

Yes, no big deal and it would keep the perfmon.h untouched so it would
not confused C/C++ users.

It's small change and has some self-documenting-code value i.e. we're not just helping SWIG, but also the libpfm user on how to interpret the return value.

 -Arun
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
stephane eranian | 21 Mar 23:24 2008

Re: [perfmon2] [PATCH] Add perfmon_debug kernel parameter for early startup messages

Robert,

Patch has been applied.
Thanks.

On Thu, Mar 6, 2008 at 2:53 PM, Robert Richter <robert.richter <at> amd.com> wrote:
> The patch allows it to enable debug messages in the early startup
>  phase. Before, the recompilation of the Kernel with a modified debug
>  init value was necessary.
>
>  Signed-off-by: Robert Richter <robert.richter <at> amd.com>
>  ---
>   Documentation/kernel-parameters.txt |    3 +++
>   perfmon/perfmon_sysfs.c             |    8 ++++++++
>   2 files changed, 11 insertions(+), 0 deletions(-)
>
>  diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>  index c417877..fc39207 100644
>  --- a/Documentation/kernel-parameters.txt
>  +++ b/Documentation/kernel-parameters.txt
>   <at>  <at>  -1401,6 +1401,9  <at>  <at>  and is between 256 and 4096 characters. It is defined in the file
>                         Format: { 0 | 1 }
>                         See arch/parisc/kernel/pdc_chassis.c
>
>  +       perfmon_debug   [PERFMON] Enables Perfmon debug messages. Needed
>  +                       to see traces of the early startup startup phase.
>  +
>         pf.             [PARIDE]
>                         See Documentation/paride.txt.
>
>  diff --git a/perfmon/perfmon_sysfs.c b/perfmon/perfmon_sysfs.c
>  index 279c6ed..b8d6cca 100644
>  --- a/perfmon/perfmon_sysfs.c
>  +++ b/perfmon/perfmon_sysfs.c
>   <at>  <at>  -277,6 +277,14  <at>  <at>  static ssize_t arg_size_store(void *info, const char *buf, size_t sz)
>         return strnlen(buf, PAGE_SIZE);
>   }
>
>  +static int __init enable_debug(char *str)
>  +{
>  +       pfm_controls.debug = 1;
>  +       PFM_INFO("debug output enabled\n");
>  +       return 1;
>  +}
>  +__setup("perfmon_debug", enable_debug);
>  +
>   /*
>   * /sys/kernel/perfmon attributes
>   */
>  --
>  1.5.3.7
>
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Corey Ashford | 22 Mar 01:29 2008
Picon

Re: [perfmon2] (1) Unable to install pfmon-3.3 on POWER5+ (2) Segmentation fault on P4 in using detailed sampling format

Hi again JK,

I managed to get access to a POWER5+ machine today and was able to build a
kernel and compile libpfm without trouble.  I went back and read your posting
to this mailing list and found that I had misread it.  I thought you
were saying that libpfm didn't compile, but you actually said that pfmon
doesn't compile.

pfmon has not been ported to ppc64 at all yet (unless you count cell as ppc64),
so it's not surprising that it doesn't compile on POWER5+ or any other POWER
machine.

pfmon is on my to-do list also, but it may be several months before it's available.

Meanwhile, I will continue testing perfmon2 on POWER5+ and create whatever patches
it takes to pass the PAPI tests.

Regards,

- Corey

> Hi All
> 
> I am in the process of using perfmon2 on intel P4 as well as IBM POWER5+.
> 
> (1) On POWER5+ I could patch the kernel and also install libpfm.
> While compiling the Pfmon I got error messages saying about many undefined symbols. The config,mk does
not seem to have a case for POWER5+, though it has for Cell.
> 
> (2) On P4 I could successfully install it.  But getting segmentation fault on using detailed sampling
format thru pfmon.
> 
> I am using the 25022008 release which has the following:
> libpfm-3.3
> pfmon-3.3
> perfmon-new-base-080225 (kennel patch)
> 
> Thanks and regard
> JK

--

-- 
Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
503-578-3507
cjashfor <at> us.ibm.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane