Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
110 user(s) are online (94 user(s) are browsing Forums)

Members: 2
Guests: 108

trixie, Joeled, more...

Support us!

Headlines

 
  Register To Post  

Hieronymus, a profiler for developers
Not too shy to talk
Not too shy to talk


See User information
I updated Hieronymus yesterday (birthday release !). It is available here on os4depot.

Hieronymus is a statistical profiler, that means it samples periodically what is running, then it decodes information and find in which functions was spent the CPU time.

It will be useful for big programs to know which parts (functions) to optimize, to see if the time is spent in the program itself or in libraries (and which ones).

It is really easy to use ! Just be sure your program has its symbols and run "Hieronymus duration=10" for example.

I improved the output (factorizing by function names) and added the number of cache misses on G3/G4 (this information is harder to use but at least we get it). I also extended the maximum duration time to a much bigger value.

Here is an example of output :

Hieronymus got 360 samples in 6 seconds.

Report of cache misses :

L1 inst cache misses 2195632
L2 inst cache misses 
72082
L1 data cache misses 
4005281
L2 data cache misses 
381402

Detailed results 
:

count 0207percent 57name dosbox
  Offset 
0x000c4060Count 0026, Function = _ZN7THEOPL315YMF262UpdateOneEiPsi
  Offset 
0x0000b1a4Count 0014, Function = _Z6get_CFv
  Offset 
0x0001a340Count 0071, Function = _Z19CPU_Core_Normal_Runv
  Offset 
0x000937e4Count 0045, Function = _Z9mem_readbj
  Offset 
0x0009532cCount 0020, Function = _Z9mem_readwj
  Offset 
0x00019b90Count = 0008, Function = _Z10EA_16_46_nv
  Offset 
0x000aafc0Count 0006, Function = _ZN22VGA_ChainedVGA_Handler6writebEjj
  Offset 
0x000951b8Count 0001, Function = _Z9mem_readdj
  Offset 
0x0009386cCount 0001, Function = <NOT FOUND>
  
Offset 0x00096fd8Count 0001, Function = _ZN12MixerChannel14AddSamples_s16EjPs
  Offset 
0x00019be4Count 0001, Function = _Z10EA_16_45_nv
  Offset 
0x000189e8Count 0002, Function = _Z8DoString9STRING_OP
  Offset 
0x000195a0Count 0002, Function = _Z10EA_32_04_nv
  Offset 
0x00093848Count 0002, Function = _Z10mem_writebjh
  Offset 
0x0001955cCount 0002, Function = _Z10EA_16_06_nv
  Offset 
0x000ab000Count 0001, Function = _ZN22VGA_LFBChanges_Handler6writewEjj
  Offset 
0x0000b694Count 0002, Function = _Z6get_ZFv
  Offset 
0x00093874Count 0001, Function = _Z10MEM_SetLFBjjP11PageHandler
  Offset 
0x00094c80Count 0001, Function = _Z10mem_writewjt
count 
= 0138, percent 38name Kickstart/kernel
  Offset 
0x00017bb8Count 0001, Function = InternalAddTail
  Offset 
0x0000cf68Count 0127, Function = HAL_TaskPostTerm
  Offset 
0x00014f58Count = 0008, Function = <NOT FOUND>
  
Offset 0x000072bcCount 0002, Function = _impl_Supervisor
count 
0006percent 01name Kickstart/rtg.library
  Offset 
0x00055634Count 0006, Function = <NOT FOUND>
count = 0009, percent 02name Kickstart/timer.device.kmod
  Offset 
0x0000203cCount = 0009, Function = <NOT FOUND>

Summarized results :

Percent Program
   57   
Games:dosbox-0.72/dosbox
   38   
SYS:Kickstart/kernel
    1   
SYS:Kickstart/rtg.library
    2   
SYS:Kickstart/timer.device.kmod


What do we see ?
- DosBox consumes 57% of the CPU time, that confirms what the CPU docky used to show
- Else the kernel is in HAL_TaskPostTerm (I suppose it is related to IDLE)
- In DosBox, heavy functions are : Core_Normal_Run, mem_readb, mem_readw and UpdateOneEiPs (audio), that is the same kind of results that oprofile gives on Linux.
- About cache misses, it would be necessary, to run Hieronymus again and look at the values. By the way, that has less interest until we don't know which functions caused the cache misses ...

Go to top
Re: Hieronymus, a profiler for developers
Home away from home
Home away from home


See User information
@corto
I intend to try it at some point. Would be very useful if you could limit the analysis to just one program though... Also not sure how well it will handle C++ programs (probably not very well).

Author of the PortablE programming language.
Go to top
Re: Hieronymus, a profiler for developers
Just popping in
Just popping in


See User information
@corto

Thanks for your program, I have been missing a profiler for OS4 (well, I have never used one, but I plan to do so sooner or later). After reading your post I have some questions:

- Should I expected an idle task with such a high profiling count in every program?
- Is a view of the functions causing cache misses planned?
- Once we find which functions are the most heavy, is there any way to find which instructions inside them are the most heavy?

And happy birthday btw :)

Varthall

Go to top
Re: Hieronymus, a profiler for developers
Amigans Defender
Amigans Defender


See User information
@corto

I like the look of this, I'll give it a try later.

Go to top
Re: Hieronymus, a profiler for developers
Home away from home
Home away from home


See User information
@Varthall Quote:
Thanks for your program, I have been missing a profiler for OS4

In theory GCC comes with one, but I had trouble getting it to work on OS4, and so used GCC's one on Windows for profiling my (portable) code.

Author of the PortablE programming language.
Go to top
Re: Hieronymus, a profiler for developers
Amigans Defender
Amigans Defender


See User information
@corto

AH!!! Since gcc profiler doesn't work anymore this is the best thing i could have these days!!! thank you! i have some programs to test
Thank you and happy birthday mate!

i'm really tired...
Go to top
Re: Hieronymus, a profiler for developers
Not too shy to talk
Not too shy to talk


See User information
@ChrisH
- About C++, it does not seem to cause so many problems. Here you have the example of DosBox that is written in C++ (ahem, kind of). The function names are not so nice, though. This is why there is an option in oprofile to "demangle" C++ stuff. I could have a look.
- gcc has a profiler but to use it, it is necessary to compile your program with option -pg and you need gprof. But that way, you can't profile shared libraries ...

@Varthall
- Hum .. I am not sure to understand ... When you run Hieronymus without a big program running, all processes seem to be IDLE (100% or almost in the kernel function HAL_TaskPostTerm. Hieronymus is IDLE except when an exception occur, so it has never happened that the current process was Hieronymus itself.
- A view of the functions that cause cache misses would be great ! But it is not possible at the moment to get the performance monitor interrupts
- If you localize a instruction that has many hits, with its offset, we could get it in the disasm source. Another information I would like to get is the source line but I need to understand and implement the support of the DWARF format (used for debug sections)

@afxgroup
Thanks ! I tested OWB but I had no symbols I tried to see where time is spent when launching the executable, displaying pages, ...

@All : Thanks for wishing me an happy birthday !

And let me know the results of your tests.

Go to top
Re: Hieronymus, a profiler for developers
Home away from home
Home away from home


See User information
@corto

Should it work on a SAM?

Locks up totally here the moment I start it.

Go to top
Re: Hieronymus, a profiler for developers
Amigans Defender
Amigans Defender


See User information
@corto

Hmm, I get no output at all here (SAM440EP).

5.AmigaOS:> Apps:Misc/hieronymus/Hieronymus duration 5
Acquiring data
please wait ...

Hieronymus got 300 samples in 5 seconds.

Detailed results :


Summarized results :

Percent Program
5.AmigaOS
:>

Go to top
Re: Hieronymus, a profiler for developers
Not too shy to talk
Not too shy to talk


See User information
Aaargh !

I see no reasons that will make it fail on Sam ... The only part that is only related to G3/G4 CPUs is the way to count the cache misses but I've just checked and this part is not called if another CPU is detected.

There is one thing I see I could do badly ...

I unfortunately did not test on Sam. I will see what I can do to fix that.

Does it work on Pegasos 2 ?

Go to top
Re: Hieronymus, a profiler for developers
Home away from home
Home away from home


See User information
@corto

When i trying first version on my peg2, it's show me nothing, the same as Chris post. I think for first that 30 seconds are not enough for running any programm and do something with it, so, im in waiting when i can give to profiler binary, and it will works while binary works. Then i can say works it or not on peg2 :)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Hieronymus, a profiler for developers
Just popping in
Just popping in


See User information
@broadblues

I have the same issue - using AOS 4.1 U2 on SAM440 with latest SDK and Hieronymus is part of it. Can somebody confirm it works on SAM systems?

Go to top
Re: Hieronymus, a profiler for developers
Not too shy to talk
Not too shy to talk


See User information
@Alex_C

Unfortunately, I have to say that Hieronymus doesn't work on neither boards (Sam and Pegasos). I identified the problem and filled a bug report and I hoped it would be fixed in the new OS update.
I haven't checked but you did and it still fails

I am sorry about that.

Go to top
Re: Hieronymus, a profiler for developers
Supreme Council
Supreme Council


See User information
@corto

If you could give me some details (via PM) of just how you filed the "bug", perhaps we can work this out...

Simon

Go to top
Re: Hieronymus, a profiler for developers
Just popping in
Just popping in


See User information
@corto

No problem - I just wish it would work someday. I've thought that inclusion of the tool in official release from Hyperion makes it working on all supported architectures. Anyway I hope you will be able to identify the problem and find workaround for it - keep up good work.

Go to top
Re: Hieronymus, a profiler for developers
Not too shy to talk
Not too shy to talk


See User information
@Alex_C

I identified the problem with a small example that reproduces it but I can't fix it by myself ... except if I have access to the OS4 source code of course :)

I hope it will be fixed soon (will we have a new update this summer if the X1000 comes out ?).

Go to top
Re: Hieronymus, a profiler for developers
Just popping in
Just popping in


See User information
@corto

I keep my fingers crossed than .

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project