Maybe. It depends.
The Mono Project has a library called Cecil, which you can get here:
http://mono-project.com/Cecil
However, it controlled code that you cannot invoke when profiling. You may have several options:
- Use IPC. You can create a new process by rewriting with cecil in the process, and then transfer the bytes back to your profiler using named pipes.
- CECIL port in C ++. Code distributed under the MIT / X11 license so you can do this without sharing your changes.
- Just write your own stuff from scratch.
# 1 is challenging. Your profiler will have more moving parts than it really needs. In addition, IPC is a set of additional overhead.
# 2 will take a long time. Given that Cecil is still only in version 0.6, it may not be worth the time to do this, instead of writing your own implementation.
# 3 will give you the maximum degree of control and will probably be the most productive. However, this will require significantly more effort than # 1.
Scott Wisniewski
source share