From cd7c36d21ce2d05f07acdcdc8df30bac57d3e8f2 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Fri, 13 Dec 2013 19:10:11 -0500 Subject: [PATCH] lttng: Update Callstack View documentation Add information about the Import Mapping File action, and document the process for LTTng-UST traces. Change-Id: I2db3c7e8021ed99bd7af9cbc7ed6a38fe06233b0 Signed-off-by: Alexandre Montplaisir Reviewed-on: https://git.eclipse.org/r/19845 Reviewed-by: Marc-Andre Laperle IP-Clean: Marc-Andre Laperle Tested-by: Marc-Andre Laperle --- .../doc/User-Guide.mediawiki | 24 ++++++++++++++++++ .../doc/images/import.gif | Bin 0 -> 327 bytes 2 files changed, 24 insertions(+) create mode 100644 org.eclipse.linuxtools.lttng.help/doc/images/import.gif diff --git a/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki b/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki index 7678f36ae1..7b237dc995 100644 --- a/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki +++ b/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki @@ -718,6 +718,30 @@ Double-clicking on a call stack event will zoom the time graph to the selected f Clicking the '''Select Next Event''' or '''Select Previous Event''' or using the left and right arrows will navigate to the next or previous call stack event, and select the function currently at the top of the call stack. +Clicking the '''Import Mapping File''' ([[Image:images/import.gif]]) icon will open a file selection dialog, allowing you to import a text file containing mappings from function addresses to function names. If the callstack provider for the current trace type only provides function addresses, a mapping file will be required to get the function names in the view. See the following sections for an example with LTTng-UST traces. + +=== Using the Callstack View with LTTng-UST traces === + +There is support in the LTTng-UST integration plugin to display the callstack of applications traced with the ''liblttng-ust-cyg-profile.so'' library (see the ''liblttng-ust-cyg-profile'' man page for additional information). To do so, you need to: + +* Recompile your application with "''-g -finstrument-functions''". +* Add the ''vtid'' and ''procname'' contexts to your trace session. See the [[#Adding Contexts to Channels and Events of a Domain | Adding Contexts to Channels and Events of a Domain]] section. Or if using the command-line: +**
lttng add-context -u -t vtid -t procname
+* Preload the ''liblttng-ust-cyg-profile'' library when running your program: +**
LD_PRELOAD=/usr/lib/liblttng-ust-cyg-profile.so ./myprogram
+ +Once you load the resulting trace, making sure it's set to the ''Common Trace Format - LTTng UST Trace'' type, the Callstack View should be populated with the relevant information. However, since GCC's cyg-profile instrumentation only provides function addresses, and not names, an additional step is required to get the function names showing in the view. The following section explains how to do so. + +=== Importing a function name mapping file for LTTng-UST traces === + +If you followed the steps in the previous section, you should have a Callstack View populated with function entries and exits. However, the view will display the function addresses instead of names in the intervals, which are not very useful by themselves. To get the actual function names, you need to: + +* Generate a mapping file from the binary, using: +**
nm myprogram > mapping.txt
+* Click the '''Import Mapping File''' ([[Image:images/import.gif]]) button in the Callstack View, and select the ''mapping.txt'' file that was just created. + +The view should now update to display the function names instead. Make sure the binary used for taking the trace is the one used for this step too (otherwise, there is a good chance of the addresses not being the same). + == Custom Parsers == Custom parser wizards allow the user to define their own parsers for text or XML traces. The user defines how the input should be parsed into internal trace events and identifies the event fields that should be created and displayed. Traces created using a custom parser can be correlated with other built-in traces or traces added by plug-in extension. diff --git a/org.eclipse.linuxtools.lttng.help/doc/images/import.gif b/org.eclipse.linuxtools.lttng.help/doc/images/import.gif new file mode 100644 index 0000000000000000000000000000000000000000..d38085ad9c273000d1c7ef3ea0144de87b776e46 GIT binary patch literal 327 zcmZ?wbhEHb6krfwxXQp_Z$IBYetux?yuh5fA^8gfa_0sYEDX$@8&R?(qGWMI>Eg)J z#W5Aj<7-wY)UHmhUz<|DHmzxW>%y~b3(wBod@a6qb$sorkr;FE?8n*u-Kt|Id9CY|Ns9p&;Tg@WMO1rP-f5pnGNz216#_0i3J`yQvJsm zgg7JQrk+bO_7dTAKGtDoB+_bkXzjJf5992w1-8iStkCP%_Lx#5y6_`@wFT09~= wevLfb(wrPzoISn09c+@45|YAGBqXFHg(kDGv$8VHpTB^88S}Cb7e@wb0E(nwr~m)} literal 0 HcmV?d00001 -- 2.34.1