Commit graph

67 commits

Author SHA1 Message Date
Keith Packard 97f8b8b6ee scripts/footprint: Avoid fpdiff failure when data changes lots
Bounds check the array access in case the input data changes so that the
number of entries in the 'children' array is not the same. The tool output
with this change isn't terribly useful, but at least it doesn't crash.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-01-10 20:50:51 -05:00
Carles Cufi 9cf07bbdb5 bluetooth: Rename rpmsg HCI driver and sample to ipc
The existing driver and sample:

- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg

are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.

I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-11-02 08:32:20 +02:00
Benjamin Cabé d8d5bdfdfa footprint: ci: ehl_crb board has been renamed.
Following PR #61471, ehl_crb board is now intel_ehl_crb.
Update the footprint test plan accordingly.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 10:28:18 +02:00
Benjamin Cabé ef0fd13090 scripts: size_report: fix encoding issue
Force default stdout encoding to utf-8 as otherwise ram_report/rom_report
may fail to render (ex. in CLion IDE built-in terminal).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-24 11:53:17 +01:00
Christian Marx 6a20f4b013 scripts: size_report: Fix ram_report and rom_report with anytree 2.9.0
The anytree package has introduced a breaking change in version 2.9.0 by
adding a 'size' property to the NodeMixin class. Since the TreeNode class
in size_report derives from NodeMixin and defines an attribute with the
same name, an AttributeError is raised when generating reports.
With this change, the attributes of the TreeNode class are prefixed with
an underscore to resolve the name collision and to prevent future name
collisions.

Fixes #60213.

Signed-off-by: Christian Marx <c.marx@vega.com>
2023-08-16 18:36:13 -04:00
Emil Gydesen cab52d23c4 footprint: Add BT TMAP broadcast samples
Add the BT Telephony and Media Audio Profile broadcast samples.
These reflect devices that control telephone and media audio
of LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-21 10:55:03 +00:00
Emil Gydesen 8fdb0fb1ca footprint: Add BT TMAP samples
Add the BT Telephony and Media Audio Profile samples.
These reflect devices that control telephone and media audio
of LE Audio.

The central is typically a more resourceful device, and the
peripheral a resource-constrained device.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-17 13:20:54 +00:00
Carles Cufi d2fff07b4a scripts: size_report: Use default encoding to process filenames
The linker generates an .elf file wth encoded strings containing
filenames. If those filenames contain non-ASCII characters we need to
know which encoding was used by the linker to store those filenames. Use
the system's preferred encoding for that purpose.

Fixes #55148.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-06-02 15:44:36 -04:00
Carles Cufi 462dc9746b scripts: footprint: Fix size_report on freestanding apps
os.path.commonpath() throws a ValueError exception when paths in the
list provided share nothing in common (like for example two Windows
paths on different drive letters). Handle that special case properly
instead of letting the exception propagate up.

Fixes #51549.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-05-30 15:00:52 -04:00
Benjamin Cabé b00c63e764 footprint: ci: Remove audio SOF samples
Removes audio SOF samples from footprint test plan as they no longer
live in-tree

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-03-02 11:46:54 -05:00
Jamie McCrae ec7044437e treewide: Disable automatic argparse argument shortening
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-26 20:12:36 +09:00
Emil Gydesen 08c5a826e9 footprint: Update conf files for nrf5340_cpunet rpmsg
Update the configuration files for the footprint
tracking for the nrf5340dk_nrf5340_cpunet iso-broadcast
and iso-receive, after the files were recently renamed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-11 08:46:46 +00:00
Mariusz Skamra 8bbd2e1488 footprint: Add unicast_audio_{server, client} samples to tracking
Add a Bluetooth unicast audio samples to track their footprint.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-11-09 09:40:01 +00:00
Emil Gydesen 4c7c36cae8 footprint: Remove bt_hap_ha for nrf52840dk
Remove the tracking of that sample as it does not build due
to missing BT ISO support.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-07 10:09:25 +00:00
Emil Gydesen 174c74206e footprint: Add bt_hci_rpmsg with ISO for the nRF5340 netcore
Add footprint tracking of the samples/bluetooth/hci_rpmsg
sample for the nRF5340 with ISO broadcast and ISO receive respectively.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-09-02 11:08:31 +00:00
Emil Gydesen 6cc8b57bc5 footprint: Add bt_hci_rpmsg for the nRF5340 netcore
Add footprint tracking of the samples/bluetooth/hci_rpmsg
sample for the nRF5340. This is a BT controller-only build
for the nRF5340 with minimum features.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-08-31 10:41:32 +02:00
Emil Gydesen 5cff937b3a footprint: Add Hearing Access Hearing Aid BT Audio sample
Add the hearing aid sample to the footprint tracking for the
nrf52840dk_nrf52840 and nrf5340dk_nrf5340_cpuapp.

The sample should represent a simple hearing aid implementation,
and is thus a very good candidate for tracking the footprint
of LE Audio in Zephyr.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-08-10 13:08:18 +02:00
Stephanos Ioannidis 2ee02f9dfa scripts: fpdiff: Initialise Colorama during start-up
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
Anas Nashif 88d4299d88 scripts: fpdiff: iterate on namespaces
Iterate on 3 main namespace to avoid collision in identifiers sharing
the same name at the top level when creating the diff.

Fixes #44940

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-24 08:57:55 -07: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
Anas Nashif b8e9b04384 footprint: track audio features on xtensa
Track footprint of ther SOF application on both intel and nxp xtensa
platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-01-05 14:59:01 -05:00
Julien Massot 36f116b47f scripts/arch: remove usage of deprecated LooseVersion
replace with version.parse from packaging module.

prevent this warning message:
DeprecationWarning: The distutils package is deprecated
and slated for removal in Python 3.12. Use setuptools or
check PEP 632 for potential alternatives

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2021-11-19 19:16:11 -05:00
Anas Nashif a5c2a6169b actions: footprint: fix csv formatting
Fix formatting of plan.txt CSV file and make it parseable by script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 11:12:05 -05:00
Carles Cufi 5ba301d449 footprint: Add Bluetooth samples to footprint tracking
Add a few Bluetooth samples to track their footprint as part of the
effort to contain firmware bloat.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-11-10 08:05:21 -05:00
Anas Nashif 82ebf78f95 footprint: add power management application
Add the footprint application with PM enabled for tracking.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-10-29 12:26:36 -04:00
Daniel Leung da9c40a7b8 scripts: footprint: fix print alignment and color
The size percentage was doing "xx.xx%" so 100% would not be
aligned correctly when printed. So add a space for percentage
printing.

Also change the coloring of "(hidden)" node so it would not
have the same color as files or symbols.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-10-07 16:56:20 -04:00
Maureen Helm e433993890 scripts: Track memory footprint for networking samples on frdm_k64f
Extends memory footprint tracking to include echo_client and echo_server
networking samples on the frdm_k64f board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-08-03 07:10:09 -04:00
Anas Nashif dfc259d13c action: footprint tracking
Add action and scripts for footprint tracking.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-21 14:54:30 +03:00
Anas Nashif 302ac4995b size_report: report total and root size correctly
Fix reporting totals.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-21 14:54:30 +03:00
Anas Nashif e230e00677 size_report: generate multiple reports
Generate both ram/rom reports in one call.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-21 14:54:30 +03:00
Anas Nashif eaed951e96 size_report: add --quiet argument
Add a new argument to allow generating json files without printing the
complete diff on the screen.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-21 14:54:30 +03:00
Anas Nashif f026b470d8 scripts: introduce footprint diffing
Very simple script to diff between two ram or rom reports generated by
size_report. When you call call the ram_report or rom_report targets you
end up with a json file in the build directory that can be used as input
for this script.

The output shows which symbols insreased and which decreased in size and
also tracked added/remove symbols as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-21 14:54:30 +03:00
Anas Nashif 39354d92bb size_report: give root node a unique identifier
Call the root node 'root', otherwise we end up with two nodes with the
same identifier ':'.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-03 20:46:55 -05:00
Daniel Leung d475f9865b scripts: size_report: add tree node for WORKSPACE
Add a tree node to group files under WORKSPACE so that
they won't be shown with full path. The WORKSPACE is
usually the same as WEST_TOPDIR unless ZEPHYR_WORKSPACE
is defined during build.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-27 15:23:48 +02:00
Daniel Leung c3e8c4e6dc scripts: size_report: add tree node for hidden symbols
The list of symbols only contain visible symbols that can be
obtained through ELF file. There are code and data where
the toolchain never emits symbols for them and thus are not
visible in the list. So add a "(hidden)" node to the tree
to show they are there.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-27 15:23:48 +02:00
Daniel Leung e87c82df51 scripts: size_report: alter how nodes are grouped together
This changes how the tree is generated. Symbols with no paths
are now grouped together instead of scattering throughout
the tree. If paths in ELF file are not all under ZEPHYR_BASE,
it will create additional node groups as 2nd level. This is
useful when not all source files are under ZEPHYR_BASE, and
provides a better indications of where they are.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-27 15:23:48 +02:00
Daniel Leung 3e695ccef9 scripts: size_report: keep full path until inserting into tree
This changes how paths are stored in intermediate structures
so that full paths are stored. This makes it more consistent
with those structures to avoid an issue where some paths are
full paths, some are relateive to ZEPHYR_BASE.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-27 15:23:48 +02:00
Daniel Leung 1e8f6be1fd scripts: size_report: recognize C++ file extensions
This adds some common C++ file extensions so the script
can recognize those as source file, and display them in
different color.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-27 15:23:48 +02:00
Daniel Leung 86cff1a857 scripts: size_report: fix pylint docstrings and import issues
This fixes the issues on import statements identified by pylint.
Also add docstrings for method and classes. Most of them are
already there as comments, so simply move them as docstrings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-27 15:23:48 +02:00
Jingru Wang a3469a0497 script: add ram and rom total size to json file
It's easier and safer to parse json file rather than extract
total size from stdout

Now the .json file has two keys:
{
    "symbols": {
       "children": [
           ...
	],
       "identifier": ":",
       "name": "root",
       "size": 2220
    },
    "total_size": 34272
}

Signed-off-by: Jingru Wang <jingru@synopsys.com>
2021-04-26 14:23:13 -04:00
Detlev Zundel e5f33bd740 scripts: size_report: Add handling of depth argument
The script already accepts a depth parameter to configure the output,
but that parameter was not used at all.  This commit adds the correct
handling by passing it to anytrees RenderTree iterator.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2021-04-14 07:05:58 -04:00
Håkon Øye Amundsen c5c55ee47e scripts: size_report: fix bug where key is used as a dict
When printing the unassigned values the 'sym' variable is
used as a dict from which we try to get the 'name' value.
However, 'symbols['unassigned']' gives a list of keys, so
we get an 'TypeError' when trying to access ['name'] of
a string (the key).

Fix this issue by iterating over the values from
the 'symbols['unassigned']' dict instead.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2021-04-13 07:16:15 -04:00
Kumar Gala 3befd7d45f cleanup: rename sanitycheck references to twister
Cleanup references to sanitycheck that should now be twister.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-14 07:50:52 -06:00
Anas Nashif 5725ed8dd1 twister: fixed pylint issues
Fixed import and unused variable warning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-11 14:13:02 -05:00
Anas Nashif 94f6826d28 sanitycheck: move release data to release/
Move the CSV files with release related data out of the python directory
into scripts/releases, which is more appropriate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-11 14:13:02 -05:00
Carles Cufi f8ad4d5f87 scripts: size_report: Fix colorized output
Colorama needs to be initialized, and for colors to display correctly on
Windows one needs to use the `USES_TERMINAL` option in CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-03 09:54:21 -04:00
Carles Cufi cf2b3596f7 scripts: size_report: Fix reporting on Windows
Certain symbols do not contain a valid path, instead showing
`<built-in>` in the filename attribute. This leads to the resolve() call
failing on Windows, since the `<>` characters are not allowed in
filenames there. Fix this by catching the exception and skipping the
call in that case.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-03 09:54:21 -04:00
Anas Nashif 239d175eff scripts: size_report: fix path prepending
Fixes potential issue on windows.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Anas Nashif ac215a570c size_report: use anytree
Use anytree module to display tree and to allow easy exporting into
json.
Add option to export results into a json file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Daniel Leung ba5f627815 scripts: size_report: rework to use pyelftools...
...instead of GNU binutils to extract DWARF information.
This is now a bit more portable across OS and toolchain.
One bouns is that this nows with on qemu_x86_64.

A few differences are:
() z_mrsh_* which are aliases to handler_no_syscalls() are now
   dropped as they are mapped to the same address, so that they
   are not counted multiple times.
() Static functions and variables with same names should now be
   attributed to the correct source files instead of being
   accumulated into the same symbol of one file (e.g. multiple
   thread_entry() in kernel tests).
() The totals for ROM and RAM are calculated from the
   corresponding sections. Previous script includes the debug
   sections as total ROM size which is not entirely correct.

Fixes #22996

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-16 12:14:22 +02:00