Commit graph

128 commits

Author SHA1 Message Date
Krzysztof Chruscinski 1d9e5ee108 logging: Refactoring 'in place' mode to reduce memory footprint
Changed 'in place' mode to bypass logger system and directly
call active backends. With this approach memory footprint of
the logger can be significantly reduced in terms of RAM and ROM.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-29 17:24:37 +01:00
Krzysztof Chruscinski 8cdca11620 logging: Replace custom macros with generic ones from util.h
Some of macros initially created in the logger has been moved
to util.h. This commit replaces custom macros with the one
from util.h

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-24 08:40:01 -05:00
Flavio Ceolin f342019986 log: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Krzysztof Chruscinski a7568e4a6a logging: Handle dropped messages in log_output
Extended log_output interface to handle dropped
messages. Log_output is printing a message containing
number of dropped messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-18 13:42:41 +01:00
Krzysztof Chruscinski 0899a6c0b7 logging: severity-wise filtering of function name prefix presence
Extended logger configuration to allow function name prefix for
messages with certain severity levels. By default only debug
messages are prefixed with function name.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-13 14:21:25 +01:00
Flavio Ceolin aabd8e7fa0 logging: Simplify function to get number of log backends
As we subtracting pointers of the same type, it is not necessary cast
it to u8_t. This simplify and avoid some MISRA-C violations, e.g rule
11.8.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-11 14:37:10 -08:00
Anas Nashif 513aa64873 doc: group logging and deprecate SYS_LOG_*
Group logging APIs and deprecate SYS_LOG_*

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-10 20:38:09 -05:00
Anas Nashif 4810d6e64d doc: logging: fix doxygen references
Fix references in doxygen comments and enable util.h which has
documentation for references macros in log_core.h

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-10 20:38:09 -05:00
Jukka Rissanen 44a9bb6abe logging: Add network backend
Allow logging subsystem to send the logging messages to outside
system. This backend implements RFC 5424 (syslog protocol) and
RFC 5426 (syslog over UDP).

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-04 15:55:53 -05:00
Krzysztof Chruscinski e781daacbf logging: Clean up in log_backend.h (asserts and doxygen)
Cleaning up doxygen comments. Replacing assert() with __ASSERT_NO_MSG.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-03 14:22:42 -08:00
Krzysztof Chruscinski a211c42a29 logging: Add dropped messages notification to backends
Extended backend interface to allow notifying backend
that log messages has been dropped due to insufficient
internal buffer size. Notification contains number of
log messages dropped since last notification. It
is optional for a backend to implement handler.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-03 14:22:42 -08:00
Alexander Polleti 97b7a0adb0 logging: reorder designated initializers in __LOG macro
As C++ does not support designated initializers, including this file
in a c++ file caused a compilation error.
gcc allows them if they are ordered as the members appear in the
struct definition

I tested it with an application using mqtt and ethernet.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-11-27 16:21:04 -08:00
Krzysztof Chruscinski e85986e153 logging: refactor log_filter_set to set existing log level
Modified log_filter_set function to limit level if requested
level is not compiled in. Additionally, extended function to
return actually set level. Removed redundant code from log_cmds.

Change fixes shell log backend initialization which was setting
log levels without taking into account compiled in limits.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-20 08:43:34 -05:00
Alexander Polleti fb4cb3a878 c++: convert implicit conversion to explicit ones in header files
c++ does not allow implicit conversions and setting -fpermissive just
causes a huge load of warnings to appear and hides real errors.

This commit converts those implicit conversions to c-style explicit
conversions.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-11-16 15:18:36 -05:00
Krzysztof Chruscinski 6a960e7d17 logging: Fix LOG_LEVEL dependency on log.h include
Refactoring of LOG_MODULE_REGISTER (commit 88648699) introduced
regression: fixed ordering of LOG_LEVEL definition and log.h
include.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-15 16:31:08 -05:00
Krzysztof Chruscinski f75d11adb2 logging: Handle nios2 global pointer register issue
Nios2 is trying to use global pointer register to access variables
smaller than 8 bytes. GPR range is limited to 64 bytes and apparently
does not handle well variables placed in custom sections.

Current workaround is to increase logger structures (const and dynamic)
size (+8 bytes for dynamic, +4 bytes for constant). Then GPR is not
used and application can be linked. The downside is increase of memory
usage:
- ROM: <num_of_log_modules>*4 bytes
- RAM: <num_of_log_modules>*8 bytes (if runtime filtering is enabled)

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Krzysztof Chruscinski 5e346812ac logging: Refactor LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros
Changed LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros to take log
level as optional parameter. LOG_MODULE_DECLARE can now also be used
in static inline functions in headers. Added LOG_LEVEL_SET macro
which is used when instance logging API is used to indicate maximal
log level compiled into the file.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Krzysztof Chruscinski c036d2f4dd logging: Add compile time error on 64 bit platforms
Logger is designed with assumption that address fit in 32 bits.
Added explicit compilation error on 64 bit platforms.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-06 18:24:22 +01:00
Krzysztof Chruscinski 62d011549a logging: Support for up to 15 arguments in log message
Extended support in the log_core and log_output to 15 arguments
which is the hard limitation of log message format.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-02 12:22:01 -04:00
Anas Nashif 5c16be8813 logging: deprecate SYS_LOG_ macros
print a deprecation message when using deprecated SYS_LOG macros.
Everything needs to move to the new logger interface.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-31 10:11:14 -04:00
Krzysztof Chruscinski 9f7e25ad22 logging: Fix possible out-of-bound access in log_output
Coverity issue #187067

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-30 15:29:28 +01:00
Krzysztof Chruscinski 5d28fcd689 logging: Add optional function name prefix
Extended logger to support optional log message prepending with
function name.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-24 11:14:26 +01:00
Krzysztof Chruscinski c696e68bb9 logging: Added support for 10 arguments in log message
Extended supported number of arguments in log message. Support for
messages consisting of more than 2 chunks had to be added. So far
messages could consist of one chunk (up to 3 args) or two chunks
(2 args in first chunk and 7 in second chunk). Once 2+ chunks
support is added number of arguments is techinically limited to
15 (4 bit field). log_core and log_output extended to suppor 10
arguments.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-24 11:14:26 +01:00
Carles Cufi 322647129f subsys: logging: Add CR/LF handling flags
Add 2 new flags to control the output of newlines by the logger output
module. By default the logger adds both CR and LF, and with these 2 new
flags it is now possible to request LF only or no newlines at all.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-18 17:53:11 -04:00
Krzysztof Chruscinski 5f6070e2f7 logging: Add autostart option to LOG_BACKEND_DEFINE
Extended macro to accept flag indicating if given backend must be
initialized and enabled when log subsystem starts. Typically, simple
backends will have autostart flag set. More complex may require
explicit enabling (e.g. shell over BLE can only be enabled when
BLE connection is established).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-11 13:29:50 +03:00
Jukka Rissanen 65477b7391 logging: Make log_strdup() parameter const
The string parameter needs to be const as otherwise calling this
function using a const string pointer will lead to a warning.
Besides the function does not modify the parameter so should be
const anyway.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-03 13:05:49 +03:00
Krzysztof Chruscinski a15438e8f5 logging: add mechanism for handling transient strings
Extending logger to support logging transient strings (with %s).
With dedicated call (log_strdup), string is duplicated to a buffer
from internal logger pool. Logger implicitly manages the pool.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Mark Ruvald Pedersen d67096da05 portability: Avoid void* arithmetics which is a GNU extension
Under GNU C, sizeof(void) = 1. This commit merely makes it explicit u8.

Pointer arithmetics over void types is:
 * A GNU C extension
 * Not supported by Clang
 * Illegal across all ISO C standards

See also: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-09-28 07:57:28 +05:30
Flavio Ceolin ea716bf023 kernel: Explicitly comparing pointer with NULL
MISRA-C rule: 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin 6fdc56d286 kernel: Using boolean types for boolean constants
Make boolean expressions use boolean types.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Krzysztof Chruscinski 87d177a6fb logging: allow mulitple log_panic calls
Ensure that only first log_panic() sends panic signal to backends

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-27 13:11:26 +05:30
Yannis Damigos ab8d0c4f9d include/logging: Avoid subtraction on void pointers
Avoid subtraction on void pointers.
void* pointer arithmetic is not allowed by C standard and also C++.
If you include "logging/log.h" into a C++ application it fails to
build.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-09-27 11:21:51 +05:30
Krzysztof Chruscinski 2cc6d0c9c2 logging: Add option to suppress timestamp printing in log_output
Added flag in log_output module to add timestamp when message is
formatted to a string. Updated existing backends.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-26 15:01:38 +02:00
Krzysztof Chruscinski 07da32aae5 logging: Add option to suppress level printing in log_output
Added flag in log_output module to add severity level when message is
formatted to a string. Updated existing backends.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-26 15:01:38 +02:00
Krzysztof Chruscinski ba01a3952f logging: Add shell commands
Added commands for getting current status and controlling which log
messages are forwared to available backends.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Krzysztof Chruscinski 9666e46f16 logging: fix undeclared __log_current_const_data_get
Fix compilation failure when LOG_MODULE_DECLARE is used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 08:38:35 -04:00
Andrei Emeltchenko 8fc5fd55de logger: Simplify UART backend initialization
Move definition to sources of UART backend.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-18 14:56:10 +02:00
Andrei Emeltchenko 94bae6a462 logger: Move native_posix_backend definition
Move definition to appropriate place removing ugly defines.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-18 14:56:10 +02:00
Andrei Emeltchenko 6162caf787 logger: Add init() api and simplify init and activate
Simplify logger initialization process using already existing loops.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-18 14:56:10 +02:00
Andrei Emeltchenko e65ee6870e logger: Add native backend for native_posix
Add backend to be used in native_posix arch.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-18 14:56:10 +02:00
Flavio Ceolin 67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Krzysztof Chruscinski 1fbea945f4 logging: Refactor log_output module
Module refactored: splitted data into read-only part and control block,
adding macro for creating log_output instance

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-14 15:05:50 +02:00
Kumar Gala 4fede8dd0b log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-11 13:25:55 -05:00
Anas Nashif a9f32d66cf tracing: remove stray event_logger code
Remove obsolete kernel event logger code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-05 16:05:08 -04:00
David B. Kinder 7b548c42ee doc: fix misspellings in API documentation
Fix misspellings in doxygen API comments missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-28 13:58:22 -04:00
Anas Nashif a2248782a2 kernel: event_logger: remove kernel_event_logger
Move to more generic tracing hooks that can be implemented in different
ways and do not interfere with the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Kumar Gala ebc3ce3a0e Revert "log: make name param explicit"
This reverts commit 2cb17a0332.  It
doesn't handle the dynamic logging case and thus breaks things.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-08-15 11:19:46 -05:00
Kumar Gala 2cb17a0332 log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-08-15 09:41:02 -05:00
Krzysztof Chruscinski 3c63d05dfc logging: Add metadata to hexdump
Extended hexdump API with a raw string attached to the data.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-08-14 07:14:34 -07:00
Marti Bolivar df8d4e96ef logging: fix multi-file module support
The documentation says a module can be split up over multiple files,
but there's no good way to do that. In the file with the
LOG_MODULE_REGISTER() call, the definitions of the module's state
variables serve as declarations that LOG_DBG(), etc. can use. But in
other files making up the module, no such declarations are available,
and the macro expansion bombs out spectacularly and confusingly.

Fix this by adding a LOG_MODULE_DECLARE() macro which other files in
the module can use to declare the internal state used by the log
module, so that LOG_DBG() etc. work properly.

Keep the documentation up to date.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-08-02 19:18:05 +02:00
Anas Nashif 66111d7d3d logging: use BUILD_ASSERT_MSG instead of _Static_assert
_Static_assert is not supported with all toolchains, use macro instead
which can handle _Static_assert not being defined.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-27 09:19:57 -04:00
Krzysztof Chruscinski fa90fdc42c logging: Macro argument evaluated when enabled
When log macro is disabled then its arguments should not be evaluated.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-23 10:29:23 -04:00
Krzysztof Chruscinski 7fe2c3b14f logging: Fix static log filtering
LOG_MODULE_REGISTER() was missing setting compiled-in log level
which was evaluated when message was filtered if runtime filtering
was disabled. As the outcome logs were not printed when runtime
filtering was disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-20 11:26:58 -04:00
Krzysztof Chruscinski c12fa740a2 logging: Remove log.h including in headers limitation
Added macro trick which evaluates macro when used and not
when header file is included. After this change order of
defining LOG_LEVEL and including log.h is no longer fixed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-19 10:05:00 -04:00
Krzysztof Chruscinski 927c1470da logging: Internal logger headers cleanup
Moved declarations and macros which are used in log_core from
log_instance.h to log_core.h. Moved log level defines from
log.h to log_instance.h because log.h is not recommended to
be included in headers (contrary to log_instance.h).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-19 10:05:00 -04:00
Krzysztof Chruscinski 46db70ac4c doc: subsys: logging: internal thread and thread wake up
Documenting new logger features: waking up processing thread
and internal logger processing thread.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-16 11:12:16 -04:00
Krzysztof Chruscinski 1ba542c352 logging: Logger to wake up logs processing thread
Added configurable threshold of number of buffered log messages
on which log wakes up thread which processes buffered logs. Thread
ID is provided during logger initialization. Feature is optional
and can be disabled by setting CONFIG_LOG_PROCESS_TRIGGER_THR to 0.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-16 11:12:16 -04:00
Krzysztof Chruscinski 6b01c89935 logging: Add log initialization to system startup
Log API can be used before user can explicitly initialize the logger.
In order to ensure that logger core is ready to buffer log messages
it must be initialize as early as possible. Initialization does not
include initialization of default backend since driver may not be
ready and backend is needed only when log messages are processed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-14 08:32:44 -04:00
Krzysztof Chruscinski 77b44df86a logging: Ensure constant side effects of log API
When log API is used it should give the same side effect when enabled
or disabled e.g. LOG_INF(%d,cnt++) should always increment cnt.
Before this change cnt would be incremented twice when log enabled
and never incremented when log was disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-11 10:56:36 -04:00
Krzysztof Chruscinski 67d6987324 logging: Fix fail when log locally disabled
When log is locally disabled then structures associated with the module
are not created. Logger API macros were evaluating those structues even
when log was disabled for given module. That resulted in compilation
error. Macros has been improved to not touch those structures when
log is disabled for given module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-11 10:31:59 -04:00
Jukka Rissanen 5cac62387a logging: Avoid compile warning because of wrong type
The macro parameters need to be protected by (), otherwise it
is possible to get this kind of warning

   include/logging/log_core.h:214:6: note: expected
     ‘u32_t {aka unsigned int}’ but argument is of type ‘char *’
     void log_3(const char *str,

This can happen for example if the macro parameter is not plain
variable. Example:

  NET_DBG("Route %p nexthop %s", route,
         nexthop ? net_sprint_ipv6_addr(nexthop) : "<unknown>");

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-09 11:17:14 -04:00
Jukka Rissanen 4aaeaaaf2e logging: Provide 8 and 9 parameter logging macros
It is quite reasonable to provide logging macros that can have
8 or 9 parameters.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-09 11:16:49 -04:00
Krzysztof Chruscinski 5ea5b8d35f doc: subsys: logging: Add documentation for new logger
Documentation for new logger subsystem.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-06 19:18:19 -04:00
Krzysztof Chruściński bbeef4155c logging: subsystem major redesign
Adding new implementation of logging subsystem. New features
includes: support for multiple backends, improving performance
by deferring log processing to the known context, adding
timestamps and logs filtering options (compile time, runtime,
module level, instance level). Console backend added as the
example backend.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-29 10:16:45 +02:00
Savinay Dharmappa 31a4e1ccf4 subsys: kernel_event_logger: change kernel event values
Each bit of "_sys_k_event_logger_mask" corresponds to a
kernel event type. Hence KERNEL_EVENT_TYPE values should be
power of 2. Previous implementation was not adhering
to it ,because of which "sys_k_must_log_event" and
"sys_k_event_logger_set_mask" had unintended effects when
used to mask certain kernel events.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-02-23 07:29:29 -05:00
Ramakrishna Pallala cf2fb622e3 include: logging: clean up of sys_log.h
Remove unused macro IS_SYS_LOG_ACTIVE.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-09 10:11:52 -05:00
Anas Nashif e2122cbf89 lib: move ring_buffer from misc/ to lib/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-15 20:02:01 -05:00
Anas Nashif 780324b8ed cleanup: rename fiber/task -> thread
We still have many places talking about tasks and threads, replace those
with thread terminology.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-30 18:41:15 -04:00
David B. Kinder fc5f2b3832 doc: spelling check doxygen comments include/
fix misspellings found in doxygen comments used for API docs

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-02 22:21:37 -04:00
Leandro Pereira ffe74b45fa kernel: Add thread events to kernel event logger
This adds a new event type to the kernel event logger that tracks
thread-related events: being added to the ready queue, pending a
thread, and exiting a thread.

It's the only event type that contains "subevents" and thus has a
non-void parameter in their respective _sys_k_event_logger_*()
function.  Luckily, as isn't the case with other events (such as IRQs
and thread switching), these functions are called from
platform-agnostic places, so there's no need to worry about changing
the assembly guts.

This is the first patch in a series adding support for better real-time
profiling of Zephyr applications.

Jira: ZEP-1463
Change-Id: I6d63607ba347f7a9cac3d016fef8f5a0a830e267
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-04-25 02:16:36 +00:00
Kumar Gala cc334c7273 Convert remaining code to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.  This handles the remaining includes and kernel, plus
touching up various points that we skipped because of include
dependancies.  We also convert the PRI printf formatters in the arch
code over to normal formatters.

Jira: ZEP-2051

Change-Id: Iecbb12601a3ee4ea936fd7ddea37788a645b08b0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 11:38:23 -05:00
Anas Nashif 306e15e0a1 kernel: remove legacy kernel support
Change-Id: Iac1e21677d74f81a93cd29d64cce261676ae78a6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-19 15:48:37 +00:00
Andrew Boie 0e7a5fd0c7 kernel_event_logger: add additional function prototypes
These previously had only been invoked from ASM domain.

Change-Id: Ia20caf1b02a4ceee16d964211874c5f798445fe2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-19 20:17:29 +00:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Anas Nashif b52a5450b0 legacy: use k_cycle_get_32 instead of legacy sys_cycle_get_32
Jira: ZEP-1585
Change-Id: Idac4685625f191771b90ce78234d97f5143413f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:34 +00:00
Anas Nashif f6e039062a kernel: remove dependency on CONFIG_NANO_TIMERS/TIMEOUTS
Remove legacy option and use SYS_CLOCK_EXISTS where appropriate.

Change-Id: I3d524ea2776e638683f0196c0cc342359d5d810f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-08 18:09:52 +00:00
Anas Nashif fad7e2dd8d logging: move event_logger to subsys/logging
Jira: ZEP-1337
Change-Id: If1690e19a882cf53caaa3418ccabeb49c783f63d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 14:34:43 -05:00
Anas Nashif a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00:00