zephyr/samples/subsys/logging/kernel_event_logger
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
..
src sample: kernel_event_logger: cleanup headers 2018-01-25 04:45:35 +05:30
CMakeLists.txt cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
prj.conf
README.rst doc: getting_started: Support multi-OS instructions 2018-01-18 16:53:31 -05:00
sample.yaml samples: event_logger: match more lines during sanitycheck 2018-01-25 04:45:35 +05:30

.. _kerneleventlogger_sample:

Kernel Event Logger Sample
################################

Overview
********

A simple application that demonstrates use of kernel event
logger feature. Two threads (A and B) of the same priority
are created and main thread is configured to have low priority,
which reads the events from kernel event logger's buffer and
prints to the console. When thread 'A' gets scheduled it will
sleep for 1 second. Similarly when thread 'B' gets scheduled
it will sleep for 0.5 seconds. When both A and B are sleeping,
the main thread gets scheduled and retrieves the events captured
from kernel event logger's buffer and prints to the console.

Building and Running
********************

This project outputs to the console.  It can be built and executed
on QEMU as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/logging/kernel_event_logger
   :host-os: unix
   :board: qemu_x86
   :goals: run
   :compact:

Sample Output
=============

.. code-block:: console

       tid of context switched thread = 400080 at time = 96538
       tid of context switched thread = 4000c0 at time = 98047
       thread = 400080, is moved to = REDAY_Q , at time = 51019657
       thread = 400040, is moved to = REDAY_Q , at time = 51024998