christophebedard / tracecompass_ros_testcases

Test cases package for Trace Compass Incubator ROS plugin
GNU General Public License v3.0
0 stars 1 forks source link

[QST]About CFLAGS `-g -O2 -finstrument-functions`. #3

Closed ZhenshengLee closed 3 years ago

ZhenshengLee commented 3 years ago

Hi @christophebedard ,

I am reading this https://github.com/tuxology/tracevizlab/tree/master/labs/201-lttng-userspace-tracing Without instrument-functions, you are not able to see some graphs like flam-chart or flame-graph.

My questions about instrument with ros packages are:

  1. Did you set this flag of instrumentation in your message flow analysis blog?
  2. If I want to see more info, do I need to instrument the ros core packages like ros_comm? or only with my private packages?
  3. If so, is there any performance overhead when compile with -g?

Thanks.

christophebedard commented 3 years ago

Hi @ZhenshengLee!

Without instrument-functions, you are not able to see some graphs like flam-chart or flame-graph.

Indeed.

My questions about instrument with ros packages are:

  1. Did you set this flag of instrumentation in your message flow analysis blog?

No I didn't. The -finstrument-functions option adds functions that all called on each function entry and exit (and LTTng can instrument those functions to trigger tracepoints), so it's used for profiling. I didn't use that for the message flow analysis.

You could enable it, compile ROS, and look at the generated flame graph.

  1. If I want to see more info, do I need to instrument the ros core packages like ros_comm? or only with my private packages?

It simply depends on what kind of additional information you want! Generally though I try to instrument the ROS 1/2 core directly so that all downstream/user packages can benefit from it. Also, sometimes you don't really have a choice because some information is only available internally.

  1. If so, is there any performance overhead when compile with -g?

I'm not sure, but I found this: https://stackoverflow.com/a/39223245