home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / misc / 4245 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  2.6 KB

  1. Path: sparky!uunet!sun-barr!olivea!charnel!rat!usc!zaphod.mps.ohio-state.edu!ub!galileo.cc.rochester.edu!rochester!rocksanne!leisner
  2. From: leisner@wrc.xerox.com ( Marty Leisner)
  3. Newsgroups: comp.unix.misc
  4. Subject: Profiling/timing subroutines
  5. Message-ID: <1992Nov18.183231.7281@spectrum.xerox.com>
  6. Date: 18 Nov 92 18:32:31 GMT
  7. Sender: news@spectrum.xerox.com
  8. Reply-To: leisner@eso.mc.xerox.com
  9. Organization: Xerox
  10. Lines: 54
  11. X-Newsreader: TIN [version 1.1 PL7]
  12.  
  13. I'm using SunOS 4.1.2 (with most of the gnu stuff available).
  14.  
  15. I'm not experienced with profiling...I looked a gprof...and the man pages it should tell me
  16. how much time I spend in subroutines.
  17.  
  18. I'm working with a custom board/driver where IOCTLs can take several seconds to execute (the
  19. IOCTLs may take transfer 15Mbytes via DMA).
  20.  
  21. Doing GNUtime -v:
  22. Summary statistics:
  23.         Command being timed: "a.out"
  24.  
  25.         User time (seconds): 4.99
  26.         System time (seconds): 1.26
  27.         Percent of CPU this job got: 64%
  28.         Elapsed (wall clock) time (h:mm:ss or m:ss): 0:09.75
  29.  
  30. Doing gprof a.out gmon.out:
  31. Each sample counts as 0.01 seconds.
  32.   %   cumulative   self              self     total           
  33.  time   seconds   seconds    calls  ms/call  ms/call  name    
  34.  94.60      4.72     4.72        1  4720.39  4990.41  main
  35.   5.21      4.98     0.26        1   260.02   260.02  bzero
  36.   0.20      4.99     0.01        1    10.00    10.00  mmap
  37.   0.00      4.99     0.00        3     0.00     0.00  open
  38.   0.00      4.99     0.00        2     0.00     0.00  ioctl
  39.   0.00      4.99     0.00        2     0.00     0.00  realloc
  40.   0.00      4.99     0.00        2     0.00     0.00  sbrk
  41.   0.00      4.99     0.00        2     0.00     0.00  strlen
  42.   0.00      4.99     0.00        1     0.00     0.00  exit
  43.   0.00      4.99     0.00        1     0.00     0.00  free
  44.   0.00      4.99     0.00        1     0.00     0.00  getpagesize
  45.   0.00      4.99     0.00        1     0.00     0.00  malloc
  46.   0.00      4.99     0.00        1     0.00     0.00  on_exit
  47.   0.00      4.99     0.00        1     0.00     0.00  profil
  48.   0.00      4.99     0.00        1     0.00     0.00  sprintf
  49.  
  50.  %         the percentage of the total running time of the
  51.  
  52.  
  53. My bzero profiled pretty well, by my ioctls are profiled...also, my time for main is just user
  54. time, I want to be able to understand user+sys time, and wall clock time...
  55.  
  56. I also looked at prof...I only see if I develop other routines to do the ioctls I can time
  57. (but this looks kludgey...
  58.  
  59. Is there a good way to do this?
  60.  
  61.  
  62.  
  63. --
  64. marty
  65. leisner.henr801c@xerox.com  leisner@eso.mc.xerox.com
  66. Member of the League for Programming Freedom
  67.