Commit Graph

15 Commits

Author SHA1 Message Date
Stephanos Ioannidis 847ff98bb3 scripts: dictionary: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Daniel Leung 2e2c8cc931 scripts: logging/dictionary/sys-t: log module info in collateral
This updates the MIPI Sys-T collateral generation to include log
modules in the XML file. This allows the parser to show where
each log message is coming from.

Note that the addition of Name propety in sys:Client is to clarify
that this collateral is from Zephyr.

Also note he addition of Mask property in syst:Guid is for parser
to match this collateral to any incoming messages, as the module
IDs are encoded in the set bits in the GUID. Without the mask,
the parser will discard any messages with non-zero module IDs.
This is based on the observation of the reference parser,
systprint, where pseudo GUIDs are generated from the module/unit
IDs (origin unit) in the incoming messages for matching with
collaterals.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-09 12:54:53 -05:00
Daniel Leung 0c600d7bff scripts: logging/dictionary: generate MIPI Sys-T collateral
This adds the ability to the dictionary logging database
generation script to output MIPI Sys-T collateral in XML.
This will allow usage of catalog logging under Sys-T, which
is similar to dictionary logging.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung 1c9e89cd5e scripts: logging/dictionary: can specify output format
This changes the script to allow output format to be specified.
Currently, only JSON is support. This will allow supporting
other formats in the future.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung caca548cf9 scripts: logging/dictionary: extract actual strings for db
This changes the database generation to actually extracting
individual strings instead of stuffing the whole binary sections
into the database. This allows the generation script to be
extended to accommodate more output formats.

Note that if CONFIG_LOG2_FMT_SECTION is enabled, the format
strings are in log_strings_sections, and also have associated
debug symbols in DWARF. So there is no need to manually
extract them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung dc6b51a52d scripts: logging/dictionary: fixes pylint warnings
Fixes some easy pylint warnings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung bdf778b196 logging: dictionary: update package processing
With the new structure of the cbpprintf packages, the Python
parser needs to be updated to skip extra bytes before reaching
the string table.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Torsten Rasmussen 91709778a4 cmake: version.h generation performed at build time
Fixes: #39503
Fixes: #40167

This commit moves `BUILD_VERSION` CMake variable from a compile
definition to be a define inside version.h.

Besides the benefit of having related settings grouped in a common
header, it also means that an updated `BUILD_VERSION` value does not
need to trigger re-compilation of all source files.

When using compile definitions, CMake cannot tell whether a given source
files uses the definition or not, and hence all sources must be
recompiled to be sure they are up-to-date.

Placing `BUILD_VERSION` in version.h, the source dependencies ensures
that only source files including `version.h` gets recompiled.

As part of this, version.h generation is moved so that it is now done
at build time.
This means that re-generation of version.h is no longer depending on a
CMake re-run but can have it's own dependency in `.git/index` when git
described is used to obtain `BUILD_VERSION` information.

Generation of logging dictionary database has been updated to support
BUILD_VERSION from header file instead of CMake configure time variable.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-08 07:50:24 -05:00
Antony Pavlov 0369998e61 arch: add MIPS architecture support
MIPS (Microprocessor without Interlocked Pipelined Stages) is a
instruction set architecture (ISA) developed by MIPS Computer
Systems, now MIPS Technologies.

This commit provides MIPS architecture support to Zephyr. It is
compatible with the MIPS32 Release 1 specification.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2022-01-19 13:48:21 -05:00
Daniel Leung 0c32256b00 scripts: logging: include pinned rodata in database
This adds "pinned.rodata" into the string database so
this will work with pinned rodata section.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-18 10:39:21 -05:00
Daniel Leung 9b9001956f logging: dictionary: workaround non-existing strings
When strings are not in the dictionary, the parser would crash.
This works around the issue by indcating an unknown string
as "string@<addr>".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-18 10:39:21 -05:00
Elliot Revell-Nash 78498933f1 scripts: colorize parsed dictionary logging
Print parsed dictionary based logging with color

Signed-off-by: Elliot Revell-Nash <elliot.revell-nash@wdtl.com>
2021-07-16 21:34:06 -04:00
David Leach f5b0f92bb7 scripts: dictionary: rename parser module to avoid name collision
The parser module collides with a module in python called parser.
Doesn't seem to be a problem in Linux but for some reason the
search/include order in Windows causes python to import the wrong
parser. The change is to rename the module to dictionary_parser
to avoid the name space collision.

fixes: #36339

Signed-off-by: David Leach <david.leach@nxp.com>
2021-06-24 04:22:33 -05:00
Daniel Leung a5ab1a7518 logging: add support for dictionary based logging
This adds dictionary based logging support. Dictionary based
logging is binary based where one big difference is that
static strings are stored as pointers instead of the whole
string. This results in reduced space requirements for
storing log messages in certain scenairos.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-28 22:25:42 +02:00