* get function names with lttng-ust-cyg-profile @ 2020-06-23 14:37 Liu, Changcheng via lttng-dev 2020-06-23 14:37 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev 0 siblings, 2 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-23 14:37 UTC (permalink / raw) To: lttng-dev; +Cc: changcheng.liu Hi all, I'm trying to use lttng-ust-cyg-profile to trace program. Does anyone know how to get function names and offset through lttng-ust-cyg-profile? In below example, the babeltrace could only get the function entry/exit value. 1. Source program: instrument.c 1 #include <stdio.h> 2 3 int add3(int val) { 4 return val + 3; 5 } 6 7 int main(int argc, char **argv) { 8 int x = 4; 9 10 puts("Press Enter to continue..."); 11 getchar(); 12 13 x = add3(x); 14 15 return 0; 16 } 2. build source code: $ gcc -g -finstrument-functions instrument.c -o instrument 3. run program: $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so ./instrument 4. start trace process: trace@trace:~/cc$ sudo lttng create instrument Session instrument created. Traces will be output to /root/lttng-traces/instrument-20200623-222917 trace@trace:~/cc$ sudo lttng enable-channel user_func_trace --userspace UST channel user_func_trace enabled for session instrument trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_entry --channel user_func_trace UST event lttng_ust_cyg_profile:func_entry created in channel user_func_trace trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_exit --channel user_func_trace UST event lttng_ust_cyg_profile:func_exit created in channel user_func_trace trace@trace:~/cc$ sudo lttng start Tracing started for session instrument trace@trace:~/cc$ sudo lttng destroy Destroying session instrument.. Session instrument destroyed trace@trace:~/cc$ sudo babeltrace /root/lttng-traces/instrument-20200623-222917 [22:29:55.388607059] (+?.?????????) trace lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388612293] (+0.000005234) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388613215] (+0.000000922) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01EE, call_site = 0x7FE40BD5C0B3 } B.R. Changcheng ^ permalink raw reply [flat|nested] 16+ messages in thread
* [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-23 14:37 get function names with lttng-ust-cyg-profile Liu, Changcheng via lttng-dev @ 2020-06-23 14:37 ` Liu, Changcheng via lttng-dev 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev 1 sibling, 0 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-23 14:37 UTC (permalink / raw) To: lttng-dev; +Cc: changcheng.liu Hi all, I'm trying to use lttng-ust-cyg-profile to trace program. Does anyone know how to get function names and offset through lttng-ust-cyg-profile? In below example, the babeltrace could only get the function entry/exit value. 1. Source program: instrument.c 1 #include <stdio.h> 2 3 int add3(int val) { 4 return val + 3; 5 } 6 7 int main(int argc, char **argv) { 8 int x = 4; 9 10 puts("Press Enter to continue..."); 11 getchar(); 12 13 x = add3(x); 14 15 return 0; 16 } 2. build source code: $ gcc -g -finstrument-functions instrument.c -o instrument 3. run program: $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so ./instrument 4. start trace process: trace@trace:~/cc$ sudo lttng create instrument Session instrument created. Traces will be output to /root/lttng-traces/instrument-20200623-222917 trace@trace:~/cc$ sudo lttng enable-channel user_func_trace --userspace UST channel user_func_trace enabled for session instrument trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_entry --channel user_func_trace UST event lttng_ust_cyg_profile:func_entry created in channel user_func_trace trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_exit --channel user_func_trace UST event lttng_ust_cyg_profile:func_exit created in channel user_func_trace trace@trace:~/cc$ sudo lttng start Tracing started for session instrument trace@trace:~/cc$ sudo lttng destroy Destroying session instrument.. Session instrument destroyed trace@trace:~/cc$ sudo babeltrace /root/lttng-traces/instrument-20200623-222917 [22:29:55.388607059] (+?.?????????) trace lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388612293] (+0.000005234) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388613215] (+0.000000922) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01EE, call_site = 0x7FE40BD5C0B3 } B.R. Changcheng _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-23 14:37 get function names with lttng-ust-cyg-profile Liu, Changcheng via lttng-dev 2020-06-23 14:37 ` [lttng-dev] " Liu, Changcheng via lttng-dev @ 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev 2020-06-23 15:12 ` [lttng-dev] " Matthew Khouzam via lttng-dev 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 1 sibling, 2 replies; 16+ messages in thread From: Matthew Khouzam via lttng-dev @ 2020-06-23 15:12 UTC (permalink / raw) To: lttng-dev, Liu, Changcheng [-- Attachment #1.1: Type: text/plain, Size: 3458 bytes --] Hi, You have the pointers that are traced. Babeltrace is doing exactly what it should as far as I know. You could use the command 'nm' to get your symbols and look them up. I am sure Babeltrace can do this from a python level. You could also use a GUI based trace viewer to get the information. Hope that helps. Matthew ________________________________ From: lttng-dev <lttng-dev-bounces@lists.lttng.org> on behalf of Liu, Changcheng via lttng-dev <lttng-dev@lists.lttng.org> Sent: Tuesday, June 23, 2020 10:37 AM To: lttng-dev@lists.lttng.org <lttng-dev@lists.lttng.org> Cc: changcheng.liu@intel.com <changcheng.liu@intel.com> Subject: [lttng-dev] get function names with lttng-ust-cyg-profile Hi all, I'm trying to use lttng-ust-cyg-profile to trace program. Does anyone know how to get function names and offset through lttng-ust-cyg-profile? In below example, the babeltrace could only get the function entry/exit value. 1. Source program: instrument.c 1 #include <stdio.h> 2 3 int add3(int val) { 4 return val + 3; 5 } 6 7 int main(int argc, char **argv) { 8 int x = 4; 9 10 puts("Press Enter to continue..."); 11 getchar(); 12 13 x = add3(x); 14 15 return 0; 16 } 2. build source code: $ gcc -g -finstrument-functions instrument.c -o instrument 3. run program: $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so ./instrument 4. start trace process: trace@trace:~/cc$ sudo lttng create instrument Session instrument created. Traces will be output to /root/lttng-traces/instrument-20200623-222917 trace@trace:~/cc$ sudo lttng enable-channel user_func_trace --userspace UST channel user_func_trace enabled for session instrument trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_entry --channel user_func_trace UST event lttng_ust_cyg_profile:func_entry created in channel user_func_trace trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_exit --channel user_func_trace UST event lttng_ust_cyg_profile:func_exit created in channel user_func_trace trace@trace:~/cc$ sudo lttng start Tracing started for session instrument trace@trace:~/cc$ sudo lttng destroy Destroying session instrument.. Session instrument destroyed trace@trace:~/cc$ sudo babeltrace /root/lttng-traces/instrument-20200623-222917 [22:29:55.388607059] (+?.?????????) trace lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388612293] (+0.000005234) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388613215] (+0.000000922) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01EE, call_site = 0x7FE40BD5C0B3 } B.R. Changcheng _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://protect2.fireeye.com/v1/url?k=98478753-c6e73d3d-9847c7c8-869a14f4b08c-41638b2508ab85dd&q=1&e=703483a0-63a9-4269-ac8e-c1fc5a57edad&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev [-- Attachment #1.2: Type: text/html, Size: 7014 bytes --] [-- Attachment #2: Type: text/plain, Size: 156 bytes --] _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev @ 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 1 sibling, 0 replies; 16+ messages in thread From: Matthew Khouzam via lttng-dev @ 2020-06-23 15:12 UTC (permalink / raw) To: lttng-dev, Liu, Changcheng [-- Attachment #1.1: Type: text/plain, Size: 3458 bytes --] Hi, You have the pointers that are traced. Babeltrace is doing exactly what it should as far as I know. You could use the command 'nm' to get your symbols and look them up. I am sure Babeltrace can do this from a python level. You could also use a GUI based trace viewer to get the information. Hope that helps. Matthew ________________________________ From: lttng-dev <lttng-dev-bounces@lists.lttng.org> on behalf of Liu, Changcheng via lttng-dev <lttng-dev@lists.lttng.org> Sent: Tuesday, June 23, 2020 10:37 AM To: lttng-dev@lists.lttng.org <lttng-dev@lists.lttng.org> Cc: changcheng.liu@intel.com <changcheng.liu@intel.com> Subject: [lttng-dev] get function names with lttng-ust-cyg-profile Hi all, I'm trying to use lttng-ust-cyg-profile to trace program. Does anyone know how to get function names and offset through lttng-ust-cyg-profile? In below example, the babeltrace could only get the function entry/exit value. 1. Source program: instrument.c 1 #include <stdio.h> 2 3 int add3(int val) { 4 return val + 3; 5 } 6 7 int main(int argc, char **argv) { 8 int x = 4; 9 10 puts("Press Enter to continue..."); 11 getchar(); 12 13 x = add3(x); 14 15 return 0; 16 } 2. build source code: $ gcc -g -finstrument-functions instrument.c -o instrument 3. run program: $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so ./instrument 4. start trace process: trace@trace:~/cc$ sudo lttng create instrument Session instrument created. Traces will be output to /root/lttng-traces/instrument-20200623-222917 trace@trace:~/cc$ sudo lttng enable-channel user_func_trace --userspace UST channel user_func_trace enabled for session instrument trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_entry --channel user_func_trace UST event lttng_ust_cyg_profile:func_entry created in channel user_func_trace trace@trace:~/cc$ sudo lttng enable-event --userspace lttng_ust_cyg_profile:func_exit --channel user_func_trace UST event lttng_ust_cyg_profile:func_exit created in channel user_func_trace trace@trace:~/cc$ sudo lttng start Tracing started for session instrument trace@trace:~/cc$ sudo lttng destroy Destroying session instrument.. Session instrument destroyed trace@trace:~/cc$ sudo babeltrace /root/lttng-traces/instrument-20200623-222917 [22:29:55.388607059] (+?.?????????) trace lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388612293] (+0.000005234) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01A9, call_site = 0x5625C88B0237 } [22:29:55.388613215] (+0.000000922) trace lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01EE, call_site = 0x7FE40BD5C0B3 } B.R. Changcheng _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://protect2.fireeye.com/v1/url?k=98478753-c6e73d3d-9847c7c8-869a14f4b08c-41638b2508ab85dd&q=1&e=703483a0-63a9-4269-ac8e-c1fc5a57edad&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev [-- Attachment #1.2: Type: text/html, Size: 7014 bytes --] [-- Attachment #2: Type: text/plain, Size: 156 bytes --] _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev 2020-06-23 15:12 ` [lttng-dev] " Matthew Khouzam via lttng-dev @ 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 2020-06-23 16:52 ` [lttng-dev] " Christophe Bédard via lttng-dev ` (2 more replies) 1 sibling, 3 replies; 16+ messages in thread From: Christophe Bédard via lttng-dev @ 2020-06-23 16:52 UTC (permalink / raw) To: Matthew Khouzam; +Cc: lttng-dev, Liu, Changcheng [-- Attachment #1.1: Type: text/plain, Size: 4419 bytes --] 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:*' see this (from bt2 but it also applies to bt1): 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 On Tue, 23 Jun 2020 at 11:12, Matthew Khouzam via lttng-dev < lttng-dev@lists.lttng.org> wrote: > Hi, > > You have the pointers that are traced. Babeltrace is doing exactly what it > should as far as I know. > > You could use the command 'nm' to get your symbols and look them up. I am > sure Babeltrace can do this from a python level. You could also use a GUI > based trace viewer to get the information. > > Hope that helps. > Matthew > ------------------------------ > *From:* lttng-dev <lttng-dev-bounces@lists.lttng.org> on behalf of Liu, > Changcheng via lttng-dev <lttng-dev@lists.lttng.org> > *Sent:* Tuesday, June 23, 2020 10:37 AM > *To:* lttng-dev@lists.lttng.org <lttng-dev@lists.lttng.org> > *Cc:* changcheng.liu@intel.com <changcheng.liu@intel.com> > *Subject:* [lttng-dev] get function names with lttng-ust-cyg-profile > > Hi all, > I'm trying to use lttng-ust-cyg-profile to trace program. > Does anyone know how to get function names and offset through > lttng-ust-cyg-profile? > > In below example, the babeltrace could only get the function entry/exit > value. > 1. Source program: instrument.c > 1 #include <stdio.h> > 2 > 3 int add3(int val) { > 4 return val + 3; > 5 } > 6 > 7 int main(int argc, char **argv) { > 8 int x = 4; > 9 > 10 puts("Press Enter to continue..."); > 11 getchar(); > 12 > 13 x = add3(x); > 14 > 15 return 0; > 16 } > > 2. build source code: > $ gcc -g -finstrument-functions instrument.c -o instrument > > 3. run program: > $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so > ./instrument > > 4. start trace process: > trace@trace:~/cc$ sudo lttng create instrument > Session instrument created. > Traces will be output to > /root/lttng-traces/instrument-20200623-222917 > > trace@trace:~/cc$ sudo lttng enable-channel user_func_trace > --userspace > UST channel user_func_trace enabled for session instrument > > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_entry --channel user_func_trace > UST event lttng_ust_cyg_profile:func_entry created in channel > user_func_trace > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_exit --channel user_func_trace > UST event lttng_ust_cyg_profile:func_exit created in channel > user_func_trace > > trace@trace:~/cc$ sudo lttng start > Tracing started for session instrument > > trace@trace:~/cc$ sudo lttng destroy > Destroying session instrument.. > Session instrument destroyed > > trace@trace:~/cc$ sudo babeltrace > /root/lttng-traces/instrument-20200623-222917 > [22:29:55.388607059] (+?.?????????) trace > lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = 0x5625C88B01A9, > call_site = 0x5625C88B0237 } > [22:29:55.388612293] (+0.000005234) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01A9, > call_site = 0x5625C88B0237 } > [22:29:55.388613215] (+0.000000922) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01EE, > call_site = 0x7FE40BD5C0B3 } > > B.R. > Changcheng > _______________________________________________ > lttng-dev mailing list > lttng-dev@lists.lttng.org > > https://protect2.fireeye.com/v1/url?k=98478753-c6e73d3d-9847c7c8-869a14f4b08c-41638b2508ab85dd&q=1&e=703483a0-63a9-4269-ac8e-c1fc5a57edad&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev > _______________________________________________ > lttng-dev mailing list > lttng-dev@lists.lttng.org > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > [-- Attachment #1.2: Type: text/html, Size: 8118 bytes --] [-- Attachment #2: Type: text/plain, Size: 156 bytes --] _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-23 16:52 ` Christophe Bédard via lttng-dev @ 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 2020-06-24 1:10 ` Liu, Changcheng via lttng-dev 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev 2 siblings, 0 replies; 16+ messages in thread From: Christophe Bédard via lttng-dev @ 2020-06-23 16:52 UTC (permalink / raw) To: Matthew Khouzam; +Cc: lttng-dev, Liu, Changcheng [-- Attachment #1.1: Type: text/plain, Size: 4419 bytes --] 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:*' see this (from bt2 but it also applies to bt1): 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 On Tue, 23 Jun 2020 at 11:12, Matthew Khouzam via lttng-dev < lttng-dev@lists.lttng.org> wrote: > Hi, > > You have the pointers that are traced. Babeltrace is doing exactly what it > should as far as I know. > > You could use the command 'nm' to get your symbols and look them up. I am > sure Babeltrace can do this from a python level. You could also use a GUI > based trace viewer to get the information. > > Hope that helps. > Matthew > ------------------------------ > *From:* lttng-dev <lttng-dev-bounces@lists.lttng.org> on behalf of Liu, > Changcheng via lttng-dev <lttng-dev@lists.lttng.org> > *Sent:* Tuesday, June 23, 2020 10:37 AM > *To:* lttng-dev@lists.lttng.org <lttng-dev@lists.lttng.org> > *Cc:* changcheng.liu@intel.com <changcheng.liu@intel.com> > *Subject:* [lttng-dev] get function names with lttng-ust-cyg-profile > > Hi all, > I'm trying to use lttng-ust-cyg-profile to trace program. > Does anyone know how to get function names and offset through > lttng-ust-cyg-profile? > > In below example, the babeltrace could only get the function entry/exit > value. > 1. Source program: instrument.c > 1 #include <stdio.h> > 2 > 3 int add3(int val) { > 4 return val + 3; > 5 } > 6 > 7 int main(int argc, char **argv) { > 8 int x = 4; > 9 > 10 puts("Press Enter to continue..."); > 11 getchar(); > 12 > 13 x = add3(x); > 14 > 15 return 0; > 16 } > > 2. build source code: > $ gcc -g -finstrument-functions instrument.c -o instrument > > 3. run program: > $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so > ./instrument > > 4. start trace process: > trace@trace:~/cc$ sudo lttng create instrument > Session instrument created. > Traces will be output to > /root/lttng-traces/instrument-20200623-222917 > > trace@trace:~/cc$ sudo lttng enable-channel user_func_trace > --userspace > UST channel user_func_trace enabled for session instrument > > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_entry --channel user_func_trace > UST event lttng_ust_cyg_profile:func_entry created in channel > user_func_trace > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_exit --channel user_func_trace > UST event lttng_ust_cyg_profile:func_exit created in channel > user_func_trace > > trace@trace:~/cc$ sudo lttng start > Tracing started for session instrument > > trace@trace:~/cc$ sudo lttng destroy > Destroying session instrument.. > Session instrument destroyed > > trace@trace:~/cc$ sudo babeltrace > /root/lttng-traces/instrument-20200623-222917 > [22:29:55.388607059] (+?.?????????) trace > lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = 0x5625C88B01A9, > call_site = 0x5625C88B0237 } > [22:29:55.388612293] (+0.000005234) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01A9, > call_site = 0x5625C88B0237 } > [22:29:55.388613215] (+0.000000922) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = 0x5625C88B01EE, > call_site = 0x7FE40BD5C0B3 } > > B.R. > Changcheng > _______________________________________________ > lttng-dev mailing list > lttng-dev@lists.lttng.org > > https://protect2.fireeye.com/v1/url?k=98478753-c6e73d3d-9847c7c8-869a14f4b08c-41638b2508ab85dd&q=1&e=703483a0-63a9-4269-ac8e-c1fc5a57edad&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev > _______________________________________________ > lttng-dev mailing list > lttng-dev@lists.lttng.org > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > [-- Attachment #1.2: Type: text/html, Size: 8118 bytes --] [-- Attachment #2: Type: text/plain, Size: 156 bytes --] _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 2020-06-23 16:52 ` [lttng-dev] " Christophe Bédard via lttng-dev @ 2020-06-24 1:10 ` Liu, Changcheng via lttng-dev 2020-06-24 1:10 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev 2 siblings, 1 reply; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-24 1:10 UTC (permalink / raw) To: Christophe Bédard, matthew.khouzam; +Cc: lttng-dev > You could use the command 'nm' to get your symbols and look them up. I > am sure Babeltrace can do this from a python level. You could also use > a GUI based trace viewer to get the information. nm only shows the linked address, but the traced address are the loaded address in memory. So, they're different. For example: trace@trace:~/cc$ nm instrument | grep 'add3\|main' 00000000000011a9 T add3 00000000000011ee T main @Christophe: Do you mean that babeltrace2 can help get the function name and call site offset? B.R. Changcheng 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:*' > > 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 > On Tue, 23 Jun 2020 at 11:12, Matthew Khouzam via lttng-dev > <[2]lttng-dev@lists.lttng.org> wrote: > > Hi, > You have the pointers that are traced. Babeltrace is doing exactly what > it should as far as I know. > You could use the command 'nm' to get your symbols and look them up. I > am sure Babeltrace can do this from a python level. You could also use > a GUI based trace viewer to get the information. > Hope that helps. > Matthew > __________________________________________________________________ > > From: lttng-dev <[3]lttng-dev-bounces@lists.lttng.org> on behalf of > Liu, Changcheng via lttng-dev <[4]lttng-dev@lists.lttng.org> > Sent: Tuesday, June 23, 2020 10:37 AM > To: [5]lttng-dev@lists.lttng.org <[6]lttng-dev@lists.lttng.org> > Cc: [7]changcheng.liu@intel.com <[8]changcheng.liu@intel.com> > Subject: [lttng-dev] get function names with lttng-ust-cyg-profile > > Hi all, > I'm trying to use lttng-ust-cyg-profile to trace program. > Does anyone know how to get function names and offset through > lttng-ust-cyg-profile? > In below example, the babeltrace could only get the function > entry/exit value. > 1. Source program: instrument.c > 1 #include <stdio.h> > 2 > 3 int add3(int val) { > 4 return val + 3; > 5 } > 6 > 7 int main(int argc, char **argv) { > 8 int x = 4; > 9 > 10 puts("Press Enter to continue..."); > 11 getchar(); > 12 > 13 x = add3(x); > 14 > 15 return 0; > 16 } > 2. build source code: > $ gcc -g -finstrument-functions instrument.c -o instrument > 3. run program: > $ > LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so > ./instrument > 4. start trace process: > trace@trace:~/cc$ sudo lttng create instrument > Session instrument created. > Traces will be output to > /root/lttng-traces/instrument-20200623-222917 > trace@trace:~/cc$ sudo lttng enable-channel user_func_trace > --userspace > UST channel user_func_trace enabled for session instrument > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_entry --channel user_func_trace > UST event lttng_ust_cyg_profile:func_entry created in channel > user_func_trace > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_exit --channel user_func_trace > UST event lttng_ust_cyg_profile:func_exit created in channel > user_func_trace > trace@trace:~/cc$ sudo lttng start > Tracing started for session instrument > trace@trace:~/cc$ sudo lttng destroy > Destroying session instrument.. > Session instrument destroyed > trace@trace:~/cc$ sudo babeltrace > /root/lttng-traces/instrument-20200623-222917 > [22:29:55.388607059] (+?.?????????) trace > lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = > 0x5625C88B01A9, call_site = 0x5625C88B0237 } > [22:29:55.388612293] (+0.000005234) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = > 0x5625C88B01A9, call_site = 0x5625C88B0237 } > [22:29:55.388613215] (+0.000000922) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = > 0x5625C88B01EE, call_site = 0x7FE40BD5C0B3 } > B.R. > Changcheng _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-24 1:10 ` Liu, Changcheng via lttng-dev @ 2020-06-24 1:10 ` Liu, Changcheng via lttng-dev 0 siblings, 0 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-24 1:10 UTC (permalink / raw) To: Christophe Bédard, matthew.khouzam; +Cc: lttng-dev > You could use the command 'nm' to get your symbols and look them up. I > am sure Babeltrace can do this from a python level. You could also use > a GUI based trace viewer to get the information. nm only shows the linked address, but the traced address are the loaded address in memory. So, they're different. For example: trace@trace:~/cc$ nm instrument | grep 'add3\|main' 00000000000011a9 T add3 00000000000011ee T main @Christophe: Do you mean that babeltrace2 can help get the function name and call site offset? B.R. Changcheng 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:*' > > 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 > On Tue, 23 Jun 2020 at 11:12, Matthew Khouzam via lttng-dev > <[2]lttng-dev@lists.lttng.org> wrote: > > Hi, > You have the pointers that are traced. Babeltrace is doing exactly what > it should as far as I know. > You could use the command 'nm' to get your symbols and look them up. I > am sure Babeltrace can do this from a python level. You could also use > a GUI based trace viewer to get the information. > Hope that helps. > Matthew > __________________________________________________________________ > > From: lttng-dev <[3]lttng-dev-bounces@lists.lttng.org> on behalf of > Liu, Changcheng via lttng-dev <[4]lttng-dev@lists.lttng.org> > Sent: Tuesday, June 23, 2020 10:37 AM > To: [5]lttng-dev@lists.lttng.org <[6]lttng-dev@lists.lttng.org> > Cc: [7]changcheng.liu@intel.com <[8]changcheng.liu@intel.com> > Subject: [lttng-dev] get function names with lttng-ust-cyg-profile > > Hi all, > I'm trying to use lttng-ust-cyg-profile to trace program. > Does anyone know how to get function names and offset through > lttng-ust-cyg-profile? > In below example, the babeltrace could only get the function > entry/exit value. > 1. Source program: instrument.c > 1 #include <stdio.h> > 2 > 3 int add3(int val) { > 4 return val + 3; > 5 } > 6 > 7 int main(int argc, char **argv) { > 8 int x = 4; > 9 > 10 puts("Press Enter to continue..."); > 11 getchar(); > 12 > 13 x = add3(x); > 14 > 15 return 0; > 16 } > 2. build source code: > $ gcc -g -finstrument-functions instrument.c -o instrument > 3. run program: > $ > LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so > ./instrument > 4. start trace process: > trace@trace:~/cc$ sudo lttng create instrument > Session instrument created. > Traces will be output to > /root/lttng-traces/instrument-20200623-222917 > trace@trace:~/cc$ sudo lttng enable-channel user_func_trace > --userspace > UST channel user_func_trace enabled for session instrument > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_entry --channel user_func_trace > UST event lttng_ust_cyg_profile:func_entry created in channel > user_func_trace > trace@trace:~/cc$ sudo lttng enable-event --userspace > lttng_ust_cyg_profile:func_exit --channel user_func_trace > UST event lttng_ust_cyg_profile:func_exit created in channel > user_func_trace > trace@trace:~/cc$ sudo lttng start > Tracing started for session instrument > trace@trace:~/cc$ sudo lttng destroy > Destroying session instrument.. > Session instrument destroyed > trace@trace:~/cc$ sudo babeltrace > /root/lttng-traces/instrument-20200623-222917 > [22:29:55.388607059] (+?.?????????) trace > lttng_ust_cyg_profile:func_entry: { cpu_id = 2 }, { addr = > 0x5625C88B01A9, call_site = 0x5625C88B0237 } > [22:29:55.388612293] (+0.000005234) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = > 0x5625C88B01A9, call_site = 0x5625C88B0237 } > [22:29:55.388613215] (+0.000000922) trace > lttng_ust_cyg_profile:func_exit: { cpu_id = 2 }, { addr = > 0x5625C88B01EE, call_site = 0x7FE40BD5C0B3 } > B.R. > Changcheng _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 2020-06-23 16:52 ` [lttng-dev] " Christophe Bédard via lttng-dev 2020-06-24 1:10 ` Liu, Changcheng via lttng-dev @ 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev 2020-06-24 1:41 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-26 14:19 ` Christophe Bédard via lttng-dev 2 siblings, 2 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-24 1:41 UTC (permalink / raw) To: Christophe Bédard; +Cc: lttng-dev, changcheng.liu 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 _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev @ 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev 2020-06-26 14:19 ` Christophe Bédard via lttng-dev 1 sibling, 0 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-24 1:41 UTC (permalink / raw) To: Christophe Bédard; +Cc: lttng-dev, changcheng.liu 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 _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev 2020-06-24 1:41 ` [lttng-dev] " Liu, Changcheng via lttng-dev @ 2020-06-26 14:19 ` Christophe Bédard via lttng-dev 2020-06-26 14:19 ` [lttng-dev] " Christophe Bédard via lttng-dev 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev 1 sibling, 2 replies; 16+ messages in thread From: Christophe Bédard via lttng-dev @ 2020-06-26 14:19 UTC (permalink / raw) To: Liu, Changcheng; +Cc: lttng-dev [-- Attachment #1.1: Type: text/plain, Size: 1412 bytes --] Hi, On Tue, 23 Jun 2020 at 21:45, Liu, Changcheng <changcheng.liu@intel.com> wrote: > 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 } > Maybe I'm missing something, but isn't it right here? E.g. debug_info = { bin = "instrument+0x11ee", func = "main+0", src = > "instrument.c:7" } > Otherwise, I don't think babeltrace can provide any more information. Christophe [-- Attachment #1.2: Type: text/html, Size: 2163 bytes --] [-- Attachment #2: Type: text/plain, Size: 156 bytes --] _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-26 14:19 ` Christophe Bédard via lttng-dev @ 2020-06-26 14:19 ` Christophe Bédard via lttng-dev 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev 1 sibling, 0 replies; 16+ messages in thread From: Christophe Bédard via lttng-dev @ 2020-06-26 14:19 UTC (permalink / raw) To: Liu, Changcheng; +Cc: lttng-dev [-- Attachment #1.1: Type: text/plain, Size: 1412 bytes --] Hi, On Tue, 23 Jun 2020 at 21:45, Liu, Changcheng <changcheng.liu@intel.com> wrote: > 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 } > Maybe I'm missing something, but isn't it right here? E.g. debug_info = { bin = "instrument+0x11ee", func = "main+0", src = > "instrument.c:7" } > Otherwise, I don't think babeltrace can provide any more information. Christophe [-- Attachment #1.2: Type: text/html, Size: 2163 bytes --] [-- Attachment #2: Type: text/plain, Size: 156 bytes --] _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-26 14:19 ` Christophe Bédard via lttng-dev 2020-06-26 14:19 ` [lttng-dev] " Christophe Bédard via lttng-dev @ 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev 2020-06-26 14:22 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-27 2:38 ` Liu, Changcheng via lttng-dev 1 sibling, 2 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-26 14:22 UTC (permalink / raw) To: Christophe Bédard; +Cc: lttng-dev On 10:19 Fri 26 Jun, Christophe Bédard wrote: > Hi, > On Tue, 23 Jun 2020 at 21:45, Liu, Changcheng > <[1]changcheng.liu@intel.com> wrote: > > 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 } > > Maybe I'm missing something, but isn't it right here? E.g. I'm also curious about the output here. "main+0" the function name "main" is right, but the offset "+0" isn't right. I've run it for several times, it always shows like the above output. So, two questions here: 1. How to show the rigth offset? 2. How to show call_site in "func/offset" format? > > debug_info = { bin = "instrument+0x11ee", func = "main+0", src = > "instrument.c:7" } > > Otherwise, I don't think babeltrace can provide any more information. > Christophe > > References > > 1. mailto:changcheng.liu@intel.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev @ 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev 2020-06-27 2:38 ` Liu, Changcheng via lttng-dev 1 sibling, 0 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-26 14:22 UTC (permalink / raw) To: Christophe Bédard; +Cc: lttng-dev On 10:19 Fri 26 Jun, Christophe Bédard wrote: > Hi, > On Tue, 23 Jun 2020 at 21:45, Liu, Changcheng > <[1]changcheng.liu@intel.com> wrote: > > 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 } > > Maybe I'm missing something, but isn't it right here? E.g. I'm also curious about the output here. "main+0" the function name "main" is right, but the offset "+0" isn't right. I've run it for several times, it always shows like the above output. So, two questions here: 1. How to show the rigth offset? 2. How to show call_site in "func/offset" format? > > debug_info = { bin = "instrument+0x11ee", func = "main+0", src = > "instrument.c:7" } > > Otherwise, I don't think babeltrace can provide any more information. > Christophe > > References > > 1. mailto:changcheng.liu@intel.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: get function names with lttng-ust-cyg-profile 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev 2020-06-26 14:22 ` [lttng-dev] " Liu, Changcheng via lttng-dev @ 2020-06-27 2:38 ` Liu, Changcheng via lttng-dev 2020-06-27 2:38 ` [lttng-dev] " Liu, Changcheng via lttng-dev 1 sibling, 1 reply; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-27 2:38 UTC (permalink / raw) To: Christophe Bédard, mathieu.desnoyers; +Cc: lttng-dev Hi Christophe, I've checked lots of examples about func_entry/exit. It seems all the address are the linked address. However, my result shows that they're the loaded running address. Do you have some suggestions to check it further? B.R. Changcheng On 22:22 Fri 26 Jun, Liu, Changcheng wrote: > On 10:19 Fri 26 Jun, Christophe Bédard wrote: > > Hi, > > On Tue, 23 Jun 2020 at 21:45, Liu, Changcheng > > <[1]changcheng.liu@intel.com> wrote: > > > > 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 } > > > > Maybe I'm missing something, but isn't it right here? E.g. > I'm also curious about the output here. "main+0" the function name > "main" is right, but the offset "+0" isn't right. > I've run it for several times, it always shows like the above > output. > So, two questions here: > 1. How to show the rigth offset? > 2. How to show call_site in "func/offset" format? > > > > debug_info = { bin = "instrument+0x11ee", func = "main+0", src = > > "instrument.c:7" } > > > > Otherwise, I don't think babeltrace can provide any more information. > > Christophe > > > > References > > > > 1. mailto:changcheng.liu@intel.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [lttng-dev] get function names with lttng-ust-cyg-profile 2020-06-27 2:38 ` Liu, Changcheng via lttng-dev @ 2020-06-27 2:38 ` Liu, Changcheng via lttng-dev 0 siblings, 0 replies; 16+ messages in thread From: Liu, Changcheng via lttng-dev @ 2020-06-27 2:38 UTC (permalink / raw) To: Christophe Bédard, mathieu.desnoyers; +Cc: lttng-dev Hi Christophe, I've checked lots of examples about func_entry/exit. It seems all the address are the linked address. However, my result shows that they're the loaded running address. Do you have some suggestions to check it further? B.R. Changcheng On 22:22 Fri 26 Jun, Liu, Changcheng wrote: > On 10:19 Fri 26 Jun, Christophe Bédard wrote: > > Hi, > > On Tue, 23 Jun 2020 at 21:45, Liu, Changcheng > > <[1]changcheng.liu@intel.com> wrote: > > > > 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 } > > > > Maybe I'm missing something, but isn't it right here? E.g. > I'm also curious about the output here. "main+0" the function name > "main" is right, but the offset "+0" isn't right. > I've run it for several times, it always shows like the above > output. > So, two questions here: > 1. How to show the rigth offset? > 2. How to show call_site in "func/offset" format? > > > > debug_info = { bin = "instrument+0x11ee", func = "main+0", src = > > "instrument.c:7" } > > > > Otherwise, I don't think babeltrace can provide any more information. > > Christophe > > > > References > > > > 1. mailto:changcheng.liu@intel.com _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2020-06-27 2:42 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-06-23 14:37 get function names with lttng-ust-cyg-profile Liu, Changcheng via lttng-dev 2020-06-23 14:37 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-23 15:12 ` Matthew Khouzam via lttng-dev 2020-06-23 15:12 ` [lttng-dev] " Matthew Khouzam via lttng-dev 2020-06-23 16:52 ` Christophe Bédard via lttng-dev 2020-06-23 16:52 ` [lttng-dev] " Christophe Bédard via lttng-dev 2020-06-24 1:10 ` Liu, Changcheng via lttng-dev 2020-06-24 1:10 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-24 1:41 ` Liu, Changcheng via lttng-dev 2020-06-24 1:41 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-26 14:19 ` Christophe Bédard via lttng-dev 2020-06-26 14:19 ` [lttng-dev] " Christophe Bédard via lttng-dev 2020-06-26 14:22 ` Liu, Changcheng via lttng-dev 2020-06-26 14:22 ` [lttng-dev] " Liu, Changcheng via lttng-dev 2020-06-27 2:38 ` Liu, Changcheng via lttng-dev 2020-06-27 2:38 ` [lttng-dev] " Liu, Changcheng via lttng-dev
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).