
This directory contains the new Qt-based version of the KernelShark GUI.


Third Party Software:
------------------------------------------------------------
KernelShark has the following external dependencies:
  Cmake, Json-C, OpenGL/Glut, Qt5Base.

1. In order to install the packages on Ubuntu do the following:
    sudo apt-get install build-essential git cmake libjson-c-dev -y
    sudo apt-get install freeglut3-dev libxmu-dev libxi-dev -y
    sudo apt-get install qtbase5-dev -y

1.1 I you want to be able to generate Doxygen documentation:
    sudo apt-get install graphviz doxygen-gui -y


2. In order to install the packages on Fedora, as root do the following:
    dnf install gcc gcc-c++ git cmake json-c-devel -y
    dnf install freeglut-devel redhat-rpm-config -y
    dnf install qt5-qtbase-devel -y

2.1 I you want to be able to generate Doxygen documentation:
    dnf install graphviz doxygen -y


Building:
------------------------------------------------------------
1. Follow the instructions given in trace-cmd/README and build
the original trace-cmd end traceevent libraries.

2. Building KernelShark:

2.1 There is a simple and expert way to build KernelShark

2.1.1 Option 1 (simple) : build KernelShark as part of trace-cmd

   (from the toplevel git tree)

      make gui

   This will build the necessary parts of trace-cmd needed
   by KernelShark.

2.1.1.1 By default, the installation prefix is "/usr/local". It can be
changed by passing in "prefix" to the build.

   make prefix=/usr gui

2.1.1.2 Use "make clean" if you want to delete all already compiled objects.
This will also clean up all the files created by cmake.

2.1.1.3 KernelShark has multiple build types (See section 2.1.2.3 for more
details. By default, the build type is RelWithDebInfo, which will build
a release candidate with debug information. To change the type, pass in
the option BUILD_TYPE=<type> to the make process.

    make BUILD_TYPE=Debug gui          - for "-g" option
    make BUILD_TYPE=Release gui        - for "-O3" option
    make BUILD_TYPE=RelWithDebInfo gui - for "-g -O2" option (default)
    make BUILD_TYPE=MinSizeRel gui     - for "-Os" option

2.1.2 Option 2 (expert) : standalone build of KernelShark (for hackers only)

   (note, you may need to do a normal make from the toplevel git
    tree before performing the following)

      make
      cd kernel-shark/build
      cmake ../
      make

    This gives you a bit more control as you may easily pass in
    your own cmake options.

2.1.2.1 In order to create a Doxygen documentation add -D_DOXYGEN_DOC=1
as a CMake Command-Line option.

2.1.2.2 By default, installation prefix is "/usr/local". It can be changed using
-D_INSTALL_PREFIX= as a CMake Command-Line option.

2.1.2.3 In addition to the standard CMake build types (Debug, Release,
RelWithDebInfo, MinSizeRel) KernelShark supports a "Package" build type.
By default this build type adds the "-O2" compiler flag. Package maintainers
can chose their own compiler flags by providing the corresponding
CMAKE_XXXX_FLAGS_PACKAGE Command-Line options (see the example below).

-- Note that when built as a "Package" the RPATH-s of the executables are
set directly to _INSTALL_PREFIX/lib/kernelshark/

-- Note that when built as a "Debug" the "Record" dialog will try to use the
version of the trace-cmd executable from the build location. In all other cases
the dialog will derive the absolut path to the trace-cmd executable from
"_INSTALL_PREFIX", hence the dialog will use the installed version.

If no build types is specified, the type will be "RelWithDebInfo".

Examples:

    cmake -D_DOXYGEN_DOC=1 -D_INSTALL_PREFIX=/usr ../

    cmake -DCMAKE_BUILD_TYPE=Package -DCMAKE_C_FLAGS_PACKAGE="-O3 -pedantic"  ../

2.1.2.4 Use the script "cmake_clean.sh" if you want to delete all already
compiled objects and all files generated by CMake.

    cd kernel-shark/build
    ./cmake-clean.sh

3. After building the code "kernel-shark/lib" will contain all libraries
and "kernel-shark/bin" will contain all executables.
