xiaoxiang781216 commented on code in PR #14740:
URL: https://github.com/apache/nuttx/pull/14740#discussion_r1838077395
##########
arch/sim/Kconfig:
##########
@@ -90,9 +90,9 @@ config SIM_UBSAN_DUMMY
---help---
Keep SIM_UBSAN compile time but disable runtime actions.
-config SIM_GPROF
+config SIM_PROFILE
bool "Enable gprof"
- depends on !SCHED_GPROF
+ depends on !PROFILE_MINI
Review Comment:
```suggestion
depends on PROFILE_NONE
```
##########
libs/libbuiltin/Kconfig:
##########
@@ -35,6 +35,30 @@ config COVERAGE_COMPILER_RT
select LIB_COMPILER_RT
default n
+config PROFILE_MINI
Review Comment:
add choice with PROFILE_MINI and PROFILE_NONE
##########
libs/libbuiltin/libgcc/profile.c:
##########
@@ -0,0 +1,584 @@
+/****************************************************************************
+ * libs/libbuiltin/libgcc/profile.c
Review Comment:
remove the original source file
##########
libs/libbuiltin/libgcc/CMakeLists.txt:
##########
@@ -0,0 +1,24 @@
+#
##############################################################################
+# libs/libbuiltin/libgcc/CMakeLists.txt
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may
not
+# use this file except in compliance with the License. You may obtain a copy
of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+#
##############################################################################
+
+if(CONFIG_PROFILE_MINI)
+ nuttx_add_system_library(libgprof)
+ target_sources(libgprof PRIVATE gprof/profile_monitor.c)
Review Comment:
```suggestion
target_sources(libgprof PRIVATE profile.c)
```
##########
libs/libbuiltin/Kconfig:
##########
@@ -35,6 +35,30 @@ config COVERAGE_COMPILER_RT
select LIB_COMPILER_RT
default n
+config PROFILE_MINI
+ bool "Enable gprof profiling"
+ select LIB_BUILTIN
+ default n
+ ---help---
+ Enable gprof profiling support. This will cause the compiler to
+ generate additional code to support profiling. This will also
+ cause the linker to include the gmon.out file in the final
+ executable.
+ Add the "-pg" parameter to the Makefile when compiling to obtain
+ the function call graph of the specified module. If you do this,
+ please enable "CONFIG_FRAME_POINTER"
+
+config PROFILE_ALL
+ bool "Enable gprof call graph for all modules"
+ depends on FRAME_POINTER
+ depends on PROFILE_MINI
Review Comment:
```suggestion
depends on FRAME_POINTER && !PROFILE_NONE
```
##########
arch/sim/src/Makefile:
##########
@@ -144,7 +144,7 @@ ifeq ($(CONFIG_SCHED_GCOV),y)
STDLIBS += -lgcov
endif
-ifeq ($(CONFIG_SIM_GPROF),y)
+ifeq ($(CONFIG_SIM_PROFILE),y)
Review Comment:
or with CONFIG_PROFILE_ALL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]