Template:Glsdk sdg creatinglinuximage

Creating your own Linux kernel image
The pre-built Linux kernel image (zImage) provided with in the SDK installation folder is compiled with a default configuration. You may want to change this configuration for your application, or even alter the kernel source itself. This section shows you how to recompile the Linux kernel provided with the SDK, and shows you how to boot it instead of the default Linux kernel image.

1. If you haven't already done so, follow the instructions in to setup your build environment.

2. Recompile the kernel provided with the SDK by executing the following:

host $ cd ${INSTALL_DIR} host $ make linux_clean host $ make linux host $ make linux_install

3. You will need a way for the boot loader (u-boot) to be able to reach your new zImage. Copy the new zImage that is generated in arch/arm/boot/ directory to the rootfs/boot folder.

4. Copy the exported Linux kernel modules from the EXEC_DIR to the /lib/modules directory to the root file system

Using the statistics collector (bandwidth application)
NOTE! Support for SoC performance monitoring tool is available only upto K4.4 releases. Check the release notes to see if this feature is available on the Processor SDK Linux Automotive release you are using.

The default filesystem includes a utility to determine the bandwidth statistics of each initiator in the J6 SoC.

This section will give an overview of how the user can use this effectively.

Target side
The tool is called glsdkstatcoll and is present under the /usr/bin folder. This tool requires a config file as an input which is also part of the filesystem

Copy the sample config file into your working directory:

target # cp /etc/glsdkstatcoll/*. target # glsdkstatcoll -h

There are two levels of configuration that the tool allows:
 * 1) Configuration of the interval and the total time can be controlled via config.ini
 * 2) The list of initiators can be configured using the initiators.cfg file.

Note that both these files have to be present under the current directory.

After configuration, the user can launch the tool as below:

target # glsdkstatcoll -f config.ini

The tool will run for the specified duration in seconds "TOTAL_TIME" in config.ini and will sample every "INTERVSAL_US" microseconds.

The results from this tool will be available in statcollector.csv

target # ls -al statcollector.csv

Host side
To visualize this data, first install matplotlib:

host # sudo apt-get install python-matplotlib host # git clone git://git.ti.com/glsdk/example-applications.git host # cd example-applications/bandwidth-tool/host

Since the analysis of the data will be done over many iterations, the user has been provided with a config file in which some basic configuration can be done.

host # vi configstat.ini # Set the IP Address of the target and also the directory where the statcollector.csv was generated

Once the above setup is completed, the data can be visualized as below:

host # python statcoll_plot.py

This will tool will do the following:
 * 1) Fetch the file from the target
 * 2) Figure out all the initiators that did not have any traffic and exclude them from the plot.
 * 3) Plot the total traffic from EMIF1_SYS and EMIF2_SYS ports
 * 4) Display the peak, average and average(active) traffic on the various ports.
 * 5) Note that if the INTERVAL_US is other than 30000 microseconds, user will have to edit the statcoll_plot.py

If the target does not have the Ethernet capabilities, then the file can be fetched and the same tool can be run like below:

host # python statcoll_plot.py -f

There are some further enhancements planned, they will be posted in the git place holder.