Skip to content

Commit 31cc503

Browse files
committed
doc: update IDE coverage support statement for LLVM/Clang gcov format
Update profiling documentation to reflect that Nuclei Studio IDE now supports both GCC and LLVM/Clang gcov format coverage visualization(tested). Previously the documentation incorrectly stated LLVM/Clang format was not supported in the IDE. Signed-off-by: Huaqi Fang <578567190@qq.com>
1 parent b2d7584 commit 31cc503

4 files changed

Lines changed: 23 additions & 17 deletions

File tree

Components/profiling/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ This profiling component now supports both **GCC** and **LLVM/Clang** toolchains
4646
> - For LLVM/Clang-compiled code: use `llvm-cov gcov` to parse coverage information
4747
>
4848
> **Nuclei Studio IDE Coverage Support:**
49-
> - The IDE currently supports GCC gcov format coverage data visualization
50-
> - **LLVM/Clang gcov format is NOT yet supported in Nuclei Studio IDE**
51-
> - For LLVM/Clang coverage analysis, you must use the command-line tool:
49+
> - Nuclei Studio IDE supports both GCC and LLVM/Clang gcov format coverage data visualization
50+
> - For command-line analysis, use the corresponding gcov tool for your toolchain:
5251
> ```bash
52+
> # For GCC toolchain
53+
> riscv64-unknown-elf-gcov <your-compiled-file>.gcda
54+
>
55+
> # For LLVM/Clang toolchain
5356
> llvm-cov gcov <your-compiled-file>.gcda
5457
> ```
55-
> - GCC coverage data can still be viewed directly in the IDE's Coverage view
5658
5759
In this directory, we provide utils source code to do profiling and coverage using gcov and gprof
5860
technology.

doc/source/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ This is release version of ``0.9.0`` of Nuclei SDK, which is still under develop
8989
- Update :ref:`design_app_demo_profiling` to demonstrate the usage of ``APPDIRS`` variable for application-specific compilation flags.
9090
- Update :ref:`design_app_demo_profiling` documentation to include command-line usage instructions for profiling and code coverage, GCC version compatibility notes, and recommended lcov-based workflow.
9191
- Update :ref:`design_app_demo_profiling` Makefile to add local documentation reference comments pointing to ``doc/source/design/app.rst#demo_profiling`` and ``Components/profiling/README.md``
92+
- Fix documentation to correctly state that Nuclei Studio IDE supports both GCC and LLVM/Clang gcov format coverage visualization
9293
- Remove ``nuclei_cache`` npk configuration from ``demo_cache``, ``demo_cidu``, ``demo_ecc``, ``demo_pma``, ``demo_smpcc``, and ``smphello`` applications ``npk.yml`` since it is now deprecated
9394
- Add ``get_cpu_feature`` in ``cpuinfo`` to list CPU features for the future hardware ci testing.
9495

@@ -171,7 +172,7 @@ This is release version of ``0.9.0`` of Nuclei SDK, which is still under develop
171172
- Update the expected output of ``cpuinfo`` in ``app.rst``
172173
- Update documentation about n100 with eclic is now supported in Nuclei SDK
173174
- Add ``demo_smpcc`` and ``demo_ecc`` application documentation in ``app.rst``
174-
- Update :ref:`design_app_demo_profiling` documentation in ``app.rst`` with detailed GCC and LLVM/Clang toolchain-specific instructions for profiling and coverage analysis, IDE limitations for LLVM/Clang gcov format, and command-line workflows using ``lcov``
175+
- Update :ref:`design_app_demo_profiling` documentation in ``app.rst`` with detailed GCC and LLVM/Clang toolchain-specific instructions for profiling and coverage analysis, and command-line workflows using ``lcov``
175176
- Add warning note in :ref:`develop_buildsystem_var_semihost` about heap and stack collision risk when using semihosting with ``malloc``, due to newlib semihost ``_sbrk`` implementation assumes unlimited heap size
176177

177178
* Tools

doc/source/design/app.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,9 +1993,10 @@ console when main part code is executed.
19931993
a slight increase in the program's memory footprint compared to its uninstrumented counterpart.
19941994
* Please check ``README.md`` about gcov and gprof support in https://github.com/Nuclei-Software/nuclei-sdk/tree/master/Components/profiling
19951995
* **Toolchain Compatibility**: Both GCC and LLVM/Clang toolchains support ``-pg`` and ``-coverage`` options,
1996-
but they generate **incompatible gcov data formats**. Nuclei Studio IDE currently **only supports
1997-
GCC gcov format coverage visualization**. For detailed toolchain-specific analysis instructions,
1998-
see the IDE configuration steps below and :ref:`demo_profiling_cmdline_usage`.
1996+
but they generate **incompatible gcov data formats**. You must use the corresponding gcov tool for analysis.
1997+
Nuclei Studio IDE supports coverage visualization for both GCC and LLVM/Clang gcov formats.
1998+
For detailed toolchain-specific command-line analysis instructions, see the IDE configuration steps below
1999+
and :ref:`demo_profiling_cmdline_usage`.
19992000

20002001
Import or download Nuclei SDK 0.6.0 or later release NPK in Nuclei Studio, and then create a
20012002
project called ``demo_profiling`` based on ``app-nsdk_demo_profiling`` using
@@ -2017,10 +2018,10 @@ it is the core algorithm of this example, then you just need to do the following
20172018

20182019
.. note::
20192020

2020-
Nuclei Studio IDE currently only supports GCC gcov format coverage visualization.
2021-
If you use LLVM/Clang toolchain (``TOOLCHAIN=nuclei_llvm``), you must analyze coverage data
2022-
using command-line tools (``llvm-cov gcov``) instead of the IDE's Coverage view.
2023-
For IDE coverage visualization, use GCC toolchain (``TOOLCHAIN=nuclei_gnu``).
2021+
Both GCC and LLVM/Clang toolchains are supported for coverage analysis.
2022+
Nuclei Studio IDE supports coverage visualization for both GCC and LLVM/Clang gcov formats.
2023+
For command-line analysis, use the corresponding gcov tool:
2024+
``riscv64-unknown-elf-gcov`` for GCC or ``llvm-cov gcov`` for LLVM/Clang.
20242025
- Open ``main.c``, and find ``TODO`` item, and comment ``gprof_collect(2);`` or ``gcov_collect(2);`` based on
20252026
gprof or gcov you want to collect.
20262027
- If you want to collect gprof data, you also need to modify ``nuclei_sdk/Components/profiling/gprof_stub.c``,
@@ -2178,8 +2179,10 @@ To use the profiling and code coverage features from the command line:
21782179
21792180
- To use the lcov approach, you need to install lcov from: https://github.com/linux-test-project/lcov
21802181
2181-
- **Format Incompatibility**: GCC and LLVM/Clang generate incompatible ``.gcda`` files.
2182-
Always use the corresponding toolchain's gcov tool for analysis.
2182+
- **Toolchain Correspondence**: GCC and LLVM/Clang generate incompatible ``.gcda`` files.
2183+
Always use the corresponding toolchain's gcov tool for command-line analysis:
2184+
``riscv64-unknown-elf-gcov`` for GCC and ``llvm-cov gcov`` for LLVM/Clang.
2185+
Nuclei Studio IDE supports coverage visualization for both formats.
21832186
21842187
21852188
.. _design_app_demo_pmp:

doc/source/develop/buildsystem.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,9 +1211,9 @@ You can easily find the available middleware components in the **<NUCLEI_SDK_ROO
12111211

12121212
Currently we provide the following middlewares:
12131213

1214-
* **profiling**: This middleware is not expected to use in Makefile based build system, you need to use it in
1215-
Nuclei Studio, it is used to provide code coverage via gcov and profiling via gprof, for details, please refer
1216-
to the ``README.md`` in this folder.
1214+
* **profiling**: This middleware can be used both in Nuclei Studio IDE and command-line build system.
1215+
It provides code coverage via gcov and profiling via gprof. For details, please refer to the
1216+
``README.md`` in this folder and :ref:`design_app_demo_profiling`.
12171217

12181218
.. _develop_buildsystem_var_nmsis_lib:
12191219

0 commit comments

Comments
 (0)