How do I profile non-Unity code?

I am currently trying out the Profiler on the Pro version and am having some trouble.

Right now I do a ton of calculations in some (non-native) libraries before my scene loads and I can’t seem to find where in the Profiler all of that info is being profiled, if it is. Of course, when the scene loads, I get all the profile information on a frame-by-frame basis, but I am not really interested in that. And the Profiler only seems to be showing Unity-specific info, as far as I can tell.

Am I missing something in the Profiler options or do I need to take my code out, write a test harness, and profiler it in a normal .NET profiler?

/edit Still no luck. I am attempting to Profile it using a .NET profiler in Windows but am having trouble getting the symbols hooked into the debugger. Perhaps because I generated the EXE in OSX and then moved it to Windows? In any case does the Unity profiler really only profile Unity specific code?

I don’t know what sort of built in options there are for Unity if there are any at all. I would write metrics tools into the non-native code. You should at least be able to see on a deep profile the metrics of functions that wrap your native code.

It sounds like you are just trying to get automated profiling tools to work, what about just adding your own custom metric tracking into your code that can be compiled in or out as needed? You might even be able to write an interface to the data that you can reflect back in a custom unity editor window.