Results 1 to 7 of 7

Thread: Profiling with gprof or saturn on Mac OS X

  1. #1
    Join Date
    Apr 2010
    Posts
    24

    Profiling with gprof or saturn on Mac OS X

    I am struggling to find out the performance statics for the Fortran program. Finding this thing was not the problem when I was using compiler and linker option with gprof. But now I am facing problem with this thing because this is not compatible with the Intel Mac OS x 10.5.5. So I want to know this problem is only faced by me or there are others who is facing similar problem. If possible any related to solution for the problem that I am facing.

  2. #2
    Join Date
    Mar 2010
    Posts
    2,041

    Re: Profiling with gprof or saturn on Mac OS X

    I will agree that the documentation on several alternatives for gprof has been confusing. It ought to work when the -pg option is used throughout (at least from the main program down through the functions you want to profile), including the link step, same as gcc. There are alternate spellings for -pg, but as far as I know, -p is a valid alternate only for Intel compilers on Itanium.

  3. #3
    Join Date
    Mar 2010
    Posts
    3,107

    Re: Profiling with gprof or saturn on Mac OS X

    Thanks for this advice. I tried gprof once again with -pg (build and link), but the problem remains the same as with the -p option: The function call statistics are correctly reported but the time remains empty. Here is an excerpt of the output of gpgrof:
    % cumulative self self total
    time seconds seconds calls ms/call ms/call name
    0.0 0.00 0.00 125803621 0.00 0.00 _pdf1d_lib_mp_ran1_ [105]
    0.0 0.00 0.00 98312192 0.00 0.00 _pdf1d_lib_mp_gasdev_ [106]
    0.0 0.00 0.00 98304000 0.00 0.00 _pdf1d_lib_mp_sde_integrator_ [107]
    0.0 0.00 0.00 594051 0.00 0.00 _pdf1d_lib_mp_ranw_ [108]
    0.0 0.00 0.00 19000 0.00 0.00 _stopwatch_ [109]
    The time columns remain zero but should report values larger than seconds.

  4. #4
    Join Date
    Apr 2010
    Posts
    82

    Re: Profiling with gprof or saturn on Mac OS X

    Which tool you use profiling in mac? Under Linux, there are many but no port Mac. There's everything you need with the Apple development tools, and most tools are accessible directly via Xcode: Run menu / Start with Performance Tool. If you can provide me some more information related to these things then I will be in a better position to provide you specific answer.

  5. #5
    Join Date
    Apr 2010
    Posts
    24

    Re: Profiling with gprof or saturn on Mac OS X

    I actually saw the performance tools but it seems fairly hermetic. I find no doc: / I think that saturn agrees and walks like gprof but impossible to get it working. You would have an example? What are the compiler options and link to add? Otherwise, for gprof, I need to have a binary "universal". I understand that is a universal application executable ppc and intel. I compiled a test.cpp to the line

    g + +-O-pg-isysroot / Developer/SDKs/MacOSX10.4u.sdk-arch i386-mmacosx-version-min = 10.4-arch ppc test.cpp

    On execution, I am creating a file gmon.out instrumentation. By cons, making "gprof a.out" I have the error line

    gprof: file: a.out Does not Contain the host Architecture

    Have an idea on what does that mean? Yet by "file a.out" I have

    a.out: Mach-O universal binary with 2 architectures a.out (for architecture i386): Mach-O executable i386 a.out (for architecture ppc): Mach-O executable ppc

    I will be waiting for the related reply.

  6. #6
    Join Date
    Nov 2009
    Posts
    82

    Re: Profiling with gprof or saturn on Mac OS X

    LIPO uses (1), lipo-info path / to / binary, gprof does that very partially in osx, NM (1) for symbols, OToole (1) for L-links otool path / to / binary and of course if you're in leopard Seb you are tired "?) To analyze the syntax gere not c + + but that will come universal means clustering FAT, it's universal slang Apple (exists since Matusalem) if you want to know more option read one of my makefile a little hacking and MacOS gcc internals and how the profiling tools for Apple

    Code:
    / / # Include bridge_saturn.c <stdio.h> stdlib.h void __attribute__ ((__no_instrument_function__)) __cyg_profile_func_enter (void * f, void * c) (fprintf (stderr, "Enter function% p,% p caller \ n ", f, c);) void __attribute__ ((__no_instrument_function__)) __cyg_profile_func_exit (void * f, void * c) (printf (stderr,"% p Exit function, caller% p \ n ", f, c); )
    
    gcc-c-o bridge_saturn.c bridge_saturn.o
    
    realpath.c tatouille 
    / * EOF * /
    
    gcc-Wall-o realpath realpath.c \ bridge_saturn.o-framework CoreServices-lSaturn-finstrument-functions
    
    . / Realpath / Enter function 0x1dcf, caller 0x1c0e Enter 0x1c3a function, caller 0x1e16 0x1c3a Exit function, caller 0x1e16 / Exit function 0x1dcf, caller 0x1c0e
    You could create your stub like this
    
    / * Extern void __cyg_profile_func_enter (void * f, void * c); extern void __cyg_profile_func_exit (void * f, void * c) void _cyg_profile_func_enter (void * f, void * c) (__cyg_profile_func_enter (& f, & c);) void _cyg_profile_func_exit (void * f, void * c) (__cyg_profile_func_exit (& f, & c);) * /

  7. #7
    Join Date
    Apr 2010
    Posts
    24

    Re: Profiling with gprof or saturn on Mac OS X

    Thanks for the reply that all you have given for solving the problem that I was facing. Now this thing is working fine without any problem. Currently I am not having any issue related to this thing but in future if face any problem I will be coming to visit this thing forum for help . Once again thanks for the help.

Similar Threads

  1. Replies: 8
    Last Post: 09-11-2011, 09:56 AM
  2. Dowload Sega Saturn Emulators , Plugins
    By ADELIO in forum Operating Systems
    Replies: 3
    Last Post: 11-08-2009, 10:16 AM
  3. Download Sega Saturn Bios
    By Gagnesh in forum Operating Systems
    Replies: 3
    Last Post: 07-08-2009, 10:47 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,727,931.20875 seconds with 17 queries