From: Rick K. <rk...@nc...> - 2006-03-17 13:53:54
|
Ryszard, Thank you for the very complete description of the issue - it's very helpful. I'll skip ahead to this portion of your message and comment, perhaps this will help to learn what might be going on: > Maybe this information could help. During profiling other small programs, I saw the different behaviour between the application which is dynamically linked with share libraries, and between one which uses the dynamic loading of shared libraries. It is worth to mention, that both applications run the same time. During running the application with the dymamic loading the only 11 samples are collected, compared to 381998 for the dynamically linked application. Below there are two small parts of reports from profiling two applications which take advantage of the same library: When you mention dynamic loading, I'm assuming you mean loading the library at runtime through some mechanism like dlopen(). If I understand properly what you're saying, I think your observation/guess is correct. PerfSuite's profiling mechanism works like this: the region(s) of program addresses to which samples are attributed are determined at application startup. The currently-loaded modules are scanned and profiling buffers are allocated for use in sample collection. Any module that is not present in the load map at that time is not included in the profile, as the addresses associated with it do not have a corresponding slot in the buffers that were created earlier. One thing that may help in this situation is to arrange for the libraries to be loaded at startup, which should be possible by including the .so of interest in the LD_PRELOAD environment variable before you do your run. That should cause the library to be included earlier on in the process and then picked up when the profiling buffers are allocated. PerfSuite should preserve existing LD_PRELOAD settings that are in effect when psrun starts the measurement. There is a section within the PerfSuite BUGS file (included with the distribution) that also attempts to describe this issue and workarounds, however it has changed (been expanded) a bit since the 0.6.1 release, so the information in your copy may not cover it as much as more recent versions. I hope this helps, please advise if this is not addressing the issue. Rick |