3.3.1. Setup

Those are a lot of steps and a lot of details, but fortunately Yocto includes a script called 'crosstap' that will take care of those details, allowing you to simply execute a systemtap script on the remote target, with arguments if necessary.

In order to do this from a remote host, however, you need to have access to the build for the image you booted. The 'crosstap' script provides details on how to do this if you run the script on the host without having done a build:

Note

SystemTap, which uses 'crosstap', assumes you can establish an ssh connection to the remote target. Please refer to the crosstap wiki page for details on verifying ssh connections at https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap. Also, the ability to ssh into the target system is not enabled by default in *-minimal images.

     $ crosstap root@192.168.1.88 trace_open.stp

     Error: No target kernel build found.
     Did you forget to create a local build of your image?

     'crosstap' requires a local sdk build of the target system
     (or a build that includes 'tools-profile') in order to build
     kernel modules that can probe the target system.

     Practically speaking, that means you need to do the following:
      - If you're running a pre-built image, download the release
        and/or BSP tarballs used to build the image.
      - If you're working from git sources, just clone the metadata
        and BSP layers needed to build the image you'll be booting.
      - Make sure you're properly set up to build a new image (see
        the BSP README and/or the widely available basic documentation
        that discusses how to build images).
      - Build an -sdk version of the image e.g.:
          $ bitbake core-image-sato-sdk
      OR
      - Build a non-sdk image but include the profiling tools:
          [ edit local.conf and add 'tools-profile' to the end of
            the EXTRA_IMAGE_FEATURES variable ]
          $ bitbake core-image-sato

     Once you've build the image on the host system, you're ready to
     boot it (or the equivalent pre-built image) and use 'crosstap'
     to probe it (you need to source the environment as usual first):

        $ source oe-init-build-env
        $ cd ~/my/systemtap/scripts
        $ crosstap root@192.168.1.xxx myscript.stp
            

So essentially what you need to do is build an SDK image or image with 'tools-profile' as detailed in the "General Setup" section of this manual, and boot the resulting target image.

Note

If you have a build directory containing multiple machines, you need to have the MACHINE you're connecting to selected in local.conf, and the kernel in that machine's build directory must match the kernel on the booted system exactly, or you'll get the above 'crosstap' message when you try to invoke a script.