PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

function profiling on 64bit machine

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
rjaekel



Joined: 09 Dec 2009
Posts: 3

PostPosted: Fri Dec 11, 2009 8:26 am    Post subject: function profiling on 64bit machine Reply with quote

Hi all,

I'm trying to implement my own version of the function instrumenter on a 64bit Linux machine to insert calls of the ___rouent function to the user code, which is provided by the -Mprof=func compiler option.
On my particular machine a function call of

void ___rouent64( struct s1* p )

gets inserted, but the delivered structure by the compiler is not generated as usual and causes a segmentation fault. I do not observe this behaviour at a
32bit machine via a ___rouent(...) call. I've tested versions PGI 8.0.1 and 7.1.3.

Could it be that the structur is somehow different (not an empty pointer)?

Any ideas how to track this down?

Thanks in advance!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Fri Dec 11, 2009 10:43 am    Post subject: Reply with quote

Hi rjaekel,

To have the compiler call your own profiling routines, you'll want to compile with the "-Minstrument" flag. It's the same as -Mprof=func, except instead of calling rouent, it calls the user defined functions "__cyg_profile_func_enter" and "__cyg_profile_func_exit".

Code:
void __cyg_profile_func_enter (void *this_fn, void *call_site);
void __cyg_profile_func_exit (void *this_fn, void *call_site);


"this_fn" is a pointer to the start of the current function and "call_site" is the address from which it was called.

Hope this helps,
Mat
Back to top
View user's profile
rjaekel



Joined: 09 Dec 2009
Posts: 3

PostPosted: Mon Dec 14, 2009 1:55 am    Post subject: Reply with quote

Hi Mat,

your completely right for, the version 9 of the PGI compiler uses the underlaying GNU way of function instrumentation, but not previous versions.
I've already implemented a version for the new compiler version, but I need an implementation for the older versions as well, which include different function calls. As I said earlier, the 32bit version is doing exactly what it sould, but not the 64bit version.

Thanks

Rene
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Mon Dec 14, 2009 10:39 am    Post subject: Reply with quote

Hi Rene,

If it helps, "-Minstrument" was added as of 8.0-2.

For "___rouent64", we actually using a non-standard ABI which makes it difficult for users to overload this function. It is possible, but requires you to write a wrapper in assembly. I'll see if can find my code from a few years ago. Of course, this would not be recommended nor supported.

- Mat
Back to top
View user's profile
rjaekel



Joined: 09 Dec 2009
Posts: 3

PostPosted: Tue Dec 15, 2009 7:28 am    Post subject: Reply with quote

Hi Mat

Quote:

If it helps, "-Minstrument" was added as of 8.0-2.


thanks for the info, thats sufficient for my purpose.


Thanks again


Rene
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group