Robert,

Patch was applied.
Thanks.

On Thu, Apr 10, 2008 at 11:00 AM, Robert Richter <[EMAIL PROTECTED]> wrote:
> The recent sys_base implementation breaks some code that uses only
>  native syscalls without initalizing the library with
>  pfm_initialize(). This code adds a sys_base check and initializes
>  sys_base if necessary before the syscall.
>
>  Signed-off-by: Robert Richter <[EMAIL PROTECTED]>
>  ---
>   lib/pfmlib_os_linux.c |   33 +++++++++++++++++++++------------
>   1 files changed, 21 insertions(+), 12 deletions(-)
>
>  diff --git a/lib/pfmlib_os_linux.c b/lib/pfmlib_os_linux.c
>  index 22b038b..1726602 100644
>  --- a/lib/pfmlib_os_linux.c
>  +++ b/lib/pfmlib_os_linux.c
>  @@ -35,21 +35,30 @@
>   #include <perfmon/pfmlib.h>
>   #include "pfmlib_priv.h"
>
>  -#define PFM_pfm_create_context         (sys_base+0)
>  -#define PFM_pfm_write_pmcs             (sys_base+1)
>  -#define PFM_pfm_write_pmds             (sys_base+2)
>  -#define PFM_pfm_read_pmds              (sys_base+3)
>  -#define PFM_pfm_load_context           (sys_base+4)
>  -#define PFM_pfm_start                  (sys_base+5)
>  -#define PFM_pfm_stop                   (sys_base+6)
>  -#define PFM_pfm_restart                        (sys_base+7)
>  -#define PFM_pfm_create_evtsets         (sys_base+8)
>  -#define PFM_pfm_getinfo_evtsets                (sys_base+9)
>  -#define PFM_pfm_delete_evtsets         (sys_base+10)
>  -#define PFM_pfm_unload_context         (sys_base+11)
>  +#define PFM_pfm_create_context         (_sys_base()+0)
>  +#define PFM_pfm_write_pmcs             (_sys_base()+1)
>  +#define PFM_pfm_write_pmds             (_sys_base()+2)
>  +#define PFM_pfm_read_pmds              (_sys_base()+3)
>  +#define PFM_pfm_load_context           (_sys_base()+4)
>  +#define PFM_pfm_start                  (_sys_base()+5)
>  +#define PFM_pfm_stop                   (_sys_base()+6)
>  +#define PFM_pfm_restart                        (_sys_base()+7)
>  +#define PFM_pfm_create_evtsets         (_sys_base()+8)
>  +#define PFM_pfm_getinfo_evtsets                (_sys_base()+9)
>  +#define PFM_pfm_delete_evtsets         (_sys_base()+10)
>  +#define PFM_pfm_unload_context         (_sys_base()+11)
>
>   static int sys_base; /* syscall base */
>
>  +void pfm_init_syscalls(void);
>  +
>  +static int _sys_base()
>  +{
>  +       if (!sys_base)
>  +               pfm_init_syscalls();
>  +       return sys_base;
>  +}
>  +
>   /*
>   * helper function to retrieve one value from /proc/cpuinfo
>   * for internal libpfm use only
>  --
>  1.5.3.7
>
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to