Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system: support gcov output to stdout #2859

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

Gary-Hobson
Copy link
Contributor

@Gary-Hobson Gary-Hobson commented Nov 18, 2024

Summary

system: support gcov output to stdout

For detailed description, please refer to apache/nuttx#14838

Impact

Testing

qemu

@nuttxpr
Copy link

nuttxpr commented Nov 18, 2024

[Experimental Bot, please feedback here]

No, this PR does not fully meet the NuttX requirements as described. While it provides a link to a more detailed description, the PR summary itself lacks crucial information. It doesn't explain why this change is necessary, how it works, or what functional part of the code is changed within the PR description itself. Relying solely on an external link is discouraged.

The Impact section is entirely empty. This is a significant omission. At a minimum, it needs to address all the listed points, even if the answer is "NO" for most.

The Testing section is also insufficient. It simply states "qemu." It needs to specify the host operating system, compiler details, the specific qemu target architecture/board/configuration, and, crucially, the actual testing logs before and after the change. Simply stating "qemu" offers no evidence of testing efficacy.

Therefore, to meet the requirements, the PR needs to:

  1. Expand the Summary: Explain the rationale for supporting gcov output to stdout, describe the code changes made to achieve this (e.g., which files were modified and how), and explicitly state the functional area affected (e.g., system/build system/debugging tools). While linking to the full PR is helpful, the core information should be present within the description itself.

  2. Complete the Impact section: Address each point, even if the answer is "NO." Justify each answer. For example, if there's no user impact, explain why.

  3. Provide detailed testing information: Specify the build host OS, CPU, compiler (including version), the target architecture, board, and configuration used with qemu. Most importantly, include the actual before and after testing logs demonstrating the change's effect.

@cederom
Copy link

cederom commented Nov 18, 2024

Build errors come from dependency on apache/nuttx#14838 (review) right?

system/gcov/Kconfig Show resolved Hide resolved
system/gcov/gcov.c Show resolved Hide resolved
system/gcov/gcov.c Outdated Show resolved Hide resolved
@Gary-Hobson
Copy link
Contributor Author

Build errors come from dependency on apache/nuttx#14838 (review) right?

This is because the sim environment does not support __gcov_info_to_gcda, which causes compilation errors. It has been fixed.

@cederom
Copy link

cederom commented Nov 21, 2024

@cederom: Build errors come from dependency on apache/nuttx#14838 (review) right?

@Gary-Hobson: This is because the sim environment does not support __gcov_info_to_gcda, which causes compilation errors. It has been fixed.

Hmm.. is it possible to make it work also on Sim? That sounds like a perfect candidate for experimentation because no real hardware is involved it can be build on any available build host and it could be part of CI..? :-)

system/gcov/gcov.c Outdated Show resolved Hide resolved
system/gcov/gcov.c Outdated Show resolved Hide resolved
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
@Gary-Hobson
Copy link
Contributor Author

Hmm.. is it possible to make it work also on Sim? That sounds like a perfect candidate for experimentation because no real hardware is involved it can be build on any available build host and it could be part of CI..? :-)

In fact, it is easier to use the tools provided by the toolchain in the sim.
This mini version is to solve the problem of using it on some devices without storage media.

You can view the code coverage report directly in the simulator by following the steps below

./tools/configure.sh sim:nsh
make -j

+CONFIG_COVERAGE_ALL=y
+CONFIG_COVERAGE_TOOLCHAIN=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_SYSTEM_GCOV=y

bash> ./nuttx/nuttx
nsh>  gcov -d /tmp   #  "/"  can be any existing path
bash> ./nuttx/gcov.sh gcov-13
bash> microsoft-edge ./gcov/result/index.html

These two different methods will output the same result
image

Copy link

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Gary-Hobson this is great utility! :-)

Could you please also update documentation in a free moment? Descrption of what this tool does, what are the use cases, and examples would be perfect to have.. for not it is empty https://nuttx.apache.org/docs/latest/applications/system/gcov/index.html :-)

@xiaoxiang781216 xiaoxiang781216 merged commit 7fb7e21 into apache:master Nov 22, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants