Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to trace a dynamic lib #1926

Open
realHarvey opened this issue May 19, 2024 · 5 comments
Open

how to trace a dynamic lib #1926

realHarvey opened this issue May 19, 2024 · 5 comments

Comments

@realHarvey
Copy link

I'm trying to trace my plugin of global planner in move_base in ROS,I compile my plugin to libsample.so. But uftrace record libsample.so return nothing to me "WARN: cannot open record data: uftrace.data: No data available"

@honggyukim
Copy link
Collaborator

Hi @realHarvey,

uftrace record libsample.so return nothing to me "WARN: cannot open record data: uftrace.data: No data available"

That's expected. You cannot run libsample.so itself so uftrace record libsample.so cannot be executed. You should run an executable binary instead.

If the target binary is named as a.out and it has a link to libsample.so, then you will be able to see the trace of libsample.so. But please make sure if the a.out is also compiled with one of tracable option such as -pg.

@realHarvey
Copy link
Author

Thanks for your reply @honggyukim

I have tried to record the executable file uftrace record ./devel/move_base and it runs totally fine, I got a flame-graph. But still I cannot see those function name of libsample in the flame

In both my navigation pack(include move_base) and libsample workspace, I added add_compile_options(-pg) in CMakeLists.txt

@namhyung
Copy link
Owner

Please make sure you library (libsample) has the function (mcount) and your program (move_base) loads the library properly.

@realHarvey
Copy link
Author

I can see it works properly in RVIZ

@namhyung
Copy link
Owner

Are you sure your program loaded the libsample you compiled with -pg? I suspect it might load another one in the library load path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants