Why do you think you need to write a new profiler?
What are you trying to do that perf (or oprofile) can't do?
I'm not trying to do perf or any other application profiler unable to do.Basically, my application executes 'program code' which are not owned by the same application.
For E.G:
Below is the brief process flow :
Assuming X as Linux process and Y is the program code of Y process (either a Linux process nor elf executable)
- Launch the X process (execute the main program)
- X process will parse the program code file (Y) to get some GB's of instructions and will store in its own memory (X).
- X will then branch/jump into the start point of Y process instruction (program code).
By referring the above flow, an existing profiler(s) will be able to capture only the Linux process (X) owned symbolic links and instruction execution and not capturing the program code (PPC instructions) which is loaded during run time.
Why does it matter that your application has self-modifying code?
For generic profiler, it doesn't matter in terms of code is self modified or originally compiled one. But by referring the above explained flow the tracking/profile code is Y program code and not the one owned by Linux process. In this case, my application needs to have one self profiler to assess the program code (loaded @ run time) by X process.
As for reading cache *contents* rather than just determining the miss rate, that can't be done from software. You'll need to use an external debugger for that.
External debugger referred in above statement is just a USB TAP or something else need to purchase ?