[lttng-dev] get function names with lttng-ust-cyg-profile

Liu, Changcheng changcheng.liu at intel.com
Tue Jun 23 21:41:41 EDT 2020


On 12:52 Tue 23 Jun, Christophe Bédard wrote:
>    Hi,
> 
>      Babeltrace is doing exactly what it should as far as I know.
> 
>    yes, but babeltrace can provide the information if:
>    * ip and vpid contexts are enabled (for userspace), e.g.
> 
>    $ lttng add-context --userspace --type=ip --type=vpid
> 
>    * LTTng state dump events are enabled, e.g.
> 
>    $ lttng enable-event --userspace 'lttng_ust_statedump:*'
Thanks Christophe. I works now that the function entry name could be got
after 1) add ip&vpid context 2) enable state dump

Do you know how to print the call site function_name/offset?
For example:
            11     getchar();
            12
            13     x = add3(x);
Currently, it only shows call_site address instead of function name with offset.

func_entry: { cpu_id = 2 }, { ip = 0x55CFA4F5C1EE, debug_info = { bin = "instrument+0x11ee", func = "main+0", src = "instrument.c:7" }, vpid = 8523 }, { addr = 0x55CFA4F5C1EE, call_site = 0x7F27C4B1E0B3 }
func_entry: { cpu_id = 1 }, { ip = 0x55CFA4F5C1A9, debug_info = { bin = "instrument+0x11a9", func = "add3+0", src = "instrument.c:3" }, vpid = 8523 }, { addr = 0x55CFA4F5C1A9, call_site = 0x55CFA4F5C237 }
func_exit: { cpu_id = 1 }, { ip = 0x55CFA4F5C1A9, debug_info = { bin = "instrument+0x11a9", func = "add3+0", src = "instrument.c:3" }, vpid = 8523 }, { addr = 0x55CFA4F5C1A9, call_site = 0x55CFA4F5C237 }
func_exit: { cpu_id = 1 }, { ip = 0x55CFA4F5C1EE, debug_info = { bin = "instrument+0x11ee", func = "main+0", src = "instrument.c:7" }, vpid = 8523 }, { addr = 0x55CFA4F5C1EE, call_site = 0x7F27C4B1E0B3 }

B.R.
Changcheng
> 
>    see this (from bt2 but it also applies to
>    bt1): [1]https://babeltrace.org/docs/v2.0/man7/babeltrace2-filter.lttng
>    -utils.debug-info.7/#doc-lttng-prereq
>    Note that the Python bindings for babeltrace don't provide/expose this
>    debug info.
>    Christophe


More information about the lttng-dev mailing list