NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Ctprof

From Texas Instruments Wiki
Jump to: navigation, search


Introduction to ctprof[edit]

Bandwidth in MB/S of L2_0 and L2_1 from an ARM example application

For TI devices that support profiling capabilities, the ctprof utility makes using these capabilities significantly easier through a simple use-case based command line utility. Designed with efficiency in mind, the user simply needs to select the connection method, the device, the profile use-case and use-case options on the command line. Ctprof takes care of making the connection, setup of the selected use-case within the target, collection of the trace data, and formatting of the trace data. Data can be formatted for display by CCS (tdf files), as a csv file, or for display with gnuplot (see example gnuplot display left).

Designed as a host command line utility, ctprof supports different methods to communicate with a target depending on the environment. If the target is running Linux, a server (ctprof_srv) that runs on the target device's ARM core can provide Ethernet communications to the host's client (ctprof) utility. For bare-metal applications an XDS may be used to provide communications with the target.

See the History section below for communication methods supported, target devices supported, and target environment requirements per release.








History[edit]

Release 1.0[edit]

The first release of ctprof provides the following support:

  • Supports devices TMS320TCI6614 and TMS320TCI6612
  • The ctprof utility is only available for a Linux host with this release
  • The Linux server application (ctprof_srv) utilizes TCP/IP sockets to communicate with the host utility (ctprof). A pre-built version of ctprof is delivered with the SC-MCSDK 2.2.0 release (pending) or the source can be cloned from a git repository(see the Installation section)
  • Requires Emupack 5.1.275.0
  • System level bus profiling use cases for TCI6614 and TCI6612 slave modules with a CP Tracer module
  • No XDS support

Installation[edit]

ctprof is delivered with an Emupack. See one of the following two Emupack sections for your specific situation (Emupack installation with CCS or independent of CCS).

If gnuplot is to be used with ctprof, it must be installed separately. ctprof generates a gnuplot command file that is based on the on the gnuplot's 4.2 patchlevel 6 release, so it should be compatible with gnuplot versions newer than 4.6. If you use the "-f gnuplot -o output_file" option with ctprof, ctprof will generate a output_file.gnuplot_cmd and output_file.gnuplot_csv files that can be viewed on any system with "gnuplot output_file.gnuplot_cmd".

ctprof_srv and ctprof_ex (example application) are delivered pre-built with the SC_MCSDK 2.2.0 release or it can be built from source. For building from source see the server installation section.

Emupack Installation with CCS[edit]

If you have CCS installed then simply use the built-in "Help->Install New Software" mechanism from within CCS. If the version of the Emupack you need is not provided by this method then you can download the Emupack from Emupack Packages. Please follow the instructions at Emupack CCS Installation

Emupack Installation independent of CCS[edit]

If you are installing the emupack independent of CCS you can download an Emupack from Emupack Packages. Please follow the installation instructions at Emupack Independent Installation.

For installation on a Linux machine that does not already have CCS installed, see Linux Host Support for notes on supported versions of Linux hosts and versions we would expect to work, but do not officially support.

Helpful tips image.jpg

Useful Tip

If you install the Emupack with root privileges (not required) it will automatically instal the ctprof man page at /usr/share/man/man1. If you do not have root privileges then the man page will not be installed, but the install_ctprofman.sh script will be included in ccs_base\emulation\analysis\bin\. This script can be used by root to install the man page.

Helpful tips image.jpg

Useful Tip

The Emupack installation will not update your PATH environment variable. You must add the following directory to your path manually or cd to this location and execute "./ctprof":

/install_dir/ccsv5/ccs_base/emulation/analysis/bin

gnuplot Installation[edit]

For Ubuntu "sudo apt-get install gnuplot" will work. The minimum gnuplot reviosn required is 4.2 patchlevel 6. For the later versions of gnuplot or for building from source see the gnuplot download site.

Server Installation[edit]

If you are not using the pre-built rootfs from the SC_MCSDK 2.2.0 release, ctprof_srv can be built from source. These following instructions assume you have the CROSS_COMPILE environment variable set to the compiler that is compatible with the target's Linux run-time environment. It also requires a TCP connection to the target. From your Linux host:

  1. git clone git@git.ti.com:ctprof_srv/ctprof_srv.git (This will clone the ctprof_srv repository).
  2. cd ctprof_srv/server
  3. make all arm DESTDIR=~/tmp (see the makefile for other build options)
  4. scp ~/tmp/ctprof_srv root@x.x.x.x:/usr/bin

The ctprof_srv project contains ctprof_sync.sh, which is a script that will sync ctprof_srv's state with the execution of your application. From your Linux host:

  1. cd ctprof_srv
  2. chmod 755 ctprof_sync.sh
  3. scp ctprof_sync.sh root@x.x.x.x:/usr/bin

The ctprof_srv project also contains example_app. The example_app program provides a simple set of ctprof_srv synchronization functions that allow for precise data collection. Assuming the CROSS_COMPILE environment variable is set to an appropriate compiler, from your host Linux machine:

  1. cd ctprof_srv/example_app
  2. make all arm DESTDIR=~/tmp (see the makefile for other build options)
  3. scp ~/tmp/ctprof_ex root@x.x.x.x:/usr/bin

References[edit]

See the ctprof User's Guide for details on commands and options.

For general information on the CP Tracers and use cases supported by ctprof and CCS see CP Tracer Details.

Examples[edit]

Note: these examples assume you have Linux running on your target and you know its IP address.

TCI6614 DSP L2 Profile Example - using ctprof_sync.sh[edit]

The ctprof_ex will perform a simple zero memory test over the first 64K of each DSP's L2 space. To profile the accesses from the ARM to the DSP's L2 memory, simply use the ctprof_sync.sh script with the following steps:

1. From the target console start ctprof_srv and ctprof_ex using ctprof_sync.sh script:
root@tci6614-evm:~# ctprof_sync.sh ctprof_ex
ctprof_srv:Waiting for client to connect
ctprof_srv:Client command port connected
ctprof_srv:Client etb service port connected
2. From the client execute the ctprof command:
ctprof --connect server:x.x.x.x --device tci6614 --duration 60 --sample-rate .2 --format gnuplot bw l2_0 l2_1 l2_2 l2_3 -o l2
3. On the target console:
ctprof_srv:Opening pipe for writing. Waiting on pipe to be open for reading.
ctprof_srv:pipe open for reading
execute:./ctprof_ex
ctprof_srv:Recording started
ctprof_ex:Test Iterations left 1
ctprof_ex:Testing 65536 words of Corepac L2_0
ctprof_ex:Corepac L2_0 had 0 failures
ctprof_ex:Testing 65536 words of Corepac L2_1
ctprof_ex:Corepac L2_1 had 0 failures
ctprof_ex:Testing 65536 words of Corepac L2_2
ctprof_ex:Corepac L2_2 had 0 failures
ctprof_ex:Testing 65536 words of Corepac L2_3
ctprof_ex:Corepac L2_3 had 0 failures
ctprof_ex:Exiting
ctprof_srv:Recording stopped
ctprof_sync exiting
4. On the host the following gnuplot window will be opened:
Bandwidth in MB/S of ARM writes to DSP L2's














5. Hitting "return" in the client console will terminate gnuplot
Helpful tips image.jpg

Useful Tip

You can also filter on an address range and on access direction (read or writes). See Ctprof Users Guide for details.

TCI6614 DSP L2 Profile Example - using ctprof_srv with pipes[edit]

This option provide precise control over when ctprof_srv collects profile data by providing synchronization of the server state with the application. This option requires integration of the ctprof_utility.c/.h files with your application. See the ctprof_ex.c source for an example. The ctprof_srv User's Guide also has details on ctprof_srv pipe operation.

To try this option with ctprof_ex use the following steps:

1. On the target start ctprof_srv in pipe mode:
root@tci6614-evm:~# ctprof_srv -P &
ctprof_srv:Waiting for client to connect
2. On the target start the ctprof_ex in pipe mode:
root@tci6614-evm:~# ctprof_ex -P &
3. From the host start the client operation (note that for this case --op-mode is set to "signal" to utilize the server pipe) :
./ctprof --connect server:x.x.x.x --device tci6614 --op-mode signal --sample-rate .2 --format gnuplot bw l2_0 l2_1 l2_2 l2_3 -o l2
4. On the target console the
root@tci6614-evm:~# ctprof_srv:Client command port connected
ctprof_srv:Client etb service port connected
ctprof_srv:Opening pipe for writing. Waiting on pipe to be open for reading.
ctprof_srv:pipe open for reading
ctprof_ex:Test Iterations left 1
ctprof_ex:Testing 65536 words of Corepac L2_0
ctprof_srv:Recording started
ctprof_ex:Corepac L2_0 had 0 failures
ctprof_ex:Testing 65536 words of Corepac L2_1
ctprof_ex:Corepac L2_1 had 0 failures
ctprof_srv:Recording stopped
ctprof_ex:Testing 65536 words of Corepac L2_2
ctprof_ex:Corepac L2_2 had 0 failures
ctprof_ex:Testing 65536 words of Corepac L2_3
ctprof_ex:Corepac L2_3 had 0 failures
ctprof_ex:Exiting


5. On the host the following gnuplot window will be opened. Note that ctprof_ex terminated profile data collection after L2_1 was tested:
Bandwidth in MB/S of ARM writes to DSP L2's
















6. Hitting "return" in the client console will terminate gnuplot and cause ctproif_srv to print on it's console:
ctprof_srv:Waiting for client to connect
7. If you would like to rerun ctprof_ex and the ctprof (client) profile session, you may rerun starting at step 2.
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Ctprof here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Ctprof here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Ctprof here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Ctprof here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Ctprof here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Ctprof here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Ctprof here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Ctprof here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Ctprof here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity