HPCToolkit / libmonitor

HPCToolkit performance tools: libmonitor - a substrate for monitoring tools
Other
21 stars 10 forks source link

Is it possible to support the applications that may preload with 32-bit and 64-bit shared library #1

Open wurongxin opened 7 years ago

wurongxin commented 7 years ago

I have tried libmonitor to monitor the building process of some open source android apps. The building process may mix with 32-bit and 64-bit processes during the building. It seems that, if I provide libmonitor.so, it cannot work in such cases. Do you have any solution for this? Or is it possible to provide the support for such case? Thanks very much. Look forward to your reply.

pmucci commented 7 years ago

You need to simply build both 32 and 64 bit versions of libmonitor. If you have integrated your tooling code inside libmonitor, then you will have to implement a sharing mechanism. It’s easiest if you dump the data to FS and then aggregate at the end, which should be bitness-agnostic.

Philip J. Mucci Minimal Metrics LLC Ph: +1.415.841.3577 | +46(0)72.172.2581 Fax: +1.415.689.3976
www.minimalmetrics.com http://www.minimalmetrics.com/

On Dec 21, 2016, at 4:27 PM, wurongxin notifications@github.com wrote:

I have tried libmonitor to monitor the building process of some open source android apps. The building process may mix with 32-bit and 64-bit processes during the building. It seems that, if I provide libmonitor.so, it cannot work in such cases. Do you have any solution for this? Or is it possible to provide the support for such case? Thanks very much. Look forward to your reply.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HPCToolkit/libmonitor/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AMUJEIhE7Sx6AVLpaFO9K_61WeWV4Jvlks5rKUVigaJpZM4LTD-G.

wurongxin commented 7 years ago

Dear Prof. Philip, Thanks for your reply. I missed your email due to my gmail moves it to spam. Sorry for my late reply. BTW, may I ask a simple question about the implementation details. In fork.c file, monitor_copy_environ(char * const oldenv[]) function will ignore the LD_PRELOAD environment variable. I wonder, why we need to do so? Except the libmonitor.so, there may be some other shared libraries that have been set before the execution. Will it cause problems? Thanks very much. Look forward to your reply.

Best Regards, Yours

Wu Rongxin

Software Engineering Group Department of Computer Science and Engineering School of Engineering The Hong Kong University of Science and Technology

On Thu, Dec 22, 2016 at 10:03 PM, Philip Mucci notifications@github.com wrote:

You need to simply build both 32 and 64 bit versions of libmonitor. If you have integrated your tooling code inside libmonitor, then you will have to implement a sharing mechanism. It’s easiest if you dump the data to FS and then aggregate at the end, which should be bitness-agnostic.

Philip J. Mucci Minimal Metrics LLC Ph: +1.415.841.3577 <(415)%20841-3577> | +46(0)72.172.2581 <+46%2072%20172%2025%2081> Fax: +1.415.689.3976 <(415)%20689-3976> www.minimalmetrics.com http://www.minimalmetrics.com/

On Dec 21, 2016, at 4:27 PM, wurongxin notifications@github.com wrote:

I have tried libmonitor to monitor the building process of some open source android apps. The building process may mix with 32-bit and 64-bit processes during the building. It seems that, if I provide libmonitor.so, it cannot work in such cases. Do you have any solution for this? Or is it possible to provide the support for such case? Thanks very much. Look forward to your reply.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ HPCToolkit/libmonitor/issues/1, or mute the thread https://github.com/ notifications/unsubscribe-auth/AMUJEIhE7Sx6AVLpaFO9K_ 61WeWV4Jvlks5rKUVigaJpZM4LTD-G.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HPCToolkit/libmonitor/issues/1#issuecomment-268805589, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUEIMXUf9qzJa98SEm3-T7SYAfxctwks5rKoMWgaJpZM4LTD-G .

pmucci commented 7 years ago

HI Wu,

Mark K can answer this more directly, but there are situations when we need to IGNORE the LD_PRELOAD. For example, if a tool wants to spawn off some additional processes that we don’t want monitored, we need to skip LD_PRELOAD. You’ll notice that the implementations of fork/exec as visible from the user application, DO copy LD_PRELOAD so you won’t have to worry.

Hope this helps.

Philip J. Mucci Minimal Metrics LLC Ph: +1.415.841.3577 | +46(0)72.172.2581 Fax: +1.415.689.3976
www.minimalmetrics.com http://www.minimalmetrics.com/

On Jan 7, 2017, at 12:37 PM, wurongxin notifications@github.com wrote:

Dear Prof. Philip, Thanks for your reply. I missed your email due to my gmail moves it to spam. Sorry for my late reply. BTW, may I ask a simple question about the implementation details. In fork.c file, monitor_copy_environ(char * const oldenv[]) function will ignore the LD_PRELOAD environment variable. I wonder, why we need to do so? Except the libmonitor.so, there may be some other shared libraries that have been set before the execution. Will it cause problems? Thanks very much. Look forward to your reply.

Best Regards, Yours

Wu Rongxin

Software Engineering Group Department of Computer Science and Engineering School of Engineering The Hong Kong University of Science and Technology

On Thu, Dec 22, 2016 at 10:03 PM, Philip Mucci notifications@github.com wrote:

You need to simply build both 32 and 64 bit versions of libmonitor. If you have integrated your tooling code inside libmonitor, then you will have to implement a sharing mechanism. It’s easiest if you dump the data to FS and then aggregate at the end, which should be bitness-agnostic.

Philip J. Mucci Minimal Metrics LLC Ph: +1.415.841.3577 <(415)%20841-3577> | +46(0)72.172.2581 <+46%2072%20172%2025%2081> Fax: +1.415.689.3976 <(415)%20689-3976> www.minimalmetrics.com http://www.minimalmetrics.com/

On Dec 21, 2016, at 4:27 PM, wurongxin notifications@github.com wrote:

I have tried libmonitor to monitor the building process of some open source android apps. The building process may mix with 32-bit and 64-bit processes during the building. It seems that, if I provide libmonitor.so, it cannot work in such cases. Do you have any solution for this? Or is it possible to provide the support for such case? Thanks very much. Look forward to your reply.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ HPCToolkit/libmonitor/issues/1, or mute the thread https://github.com/ notifications/unsubscribe-auth/AMUJEIhE7Sx6AVLpaFO9K_ 61WeWV4Jvlks5rKUVigaJpZM4LTD-G.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HPCToolkit/libmonitor/issues/1#issuecomment-268805589, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUEIMXUf9qzJa98SEm3-T7SYAfxctwks5rKoMWgaJpZM4LTD-G .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HPCToolkit/libmonitor/issues/1#issuecomment-271078538, or mute the thread https://github.com/notifications/unsubscribe-auth/AMUJED4ghAD_R-OAsNdqIsCW648F1Q5qks5rP3kRgaJpZM4LTD-G.