Donny9 commented on PR #6685:
URL: https://github.com/apache/incubator-nuttx/pull/6685#issuecomment-1193978412

   > > If we use another option to enable the pid track, the code will become 
more complex, because user can enable backtrace, but disable pid.
   > 
   > I don't think this is a real problem.
   > 
   > You can do it like this:
   > 
   > ```
   > 
   > config MM_OWNERSHIP
   >    bool "Owner tracking"
   >    default n
   >    ---help---
   >            Enables ownership tracking in heap allocations.
   > 
   > config MM_BACKTRACE
   >    bool "Backtrace"
   >    default n
   >    depends on MM_OWNERSHIP && DEBUG_MM
   >    ---help---
   >            Enables backtrace printing.
   > ```
   > 
   > The dependencies are resolved by Kconfig. The code is much cleaner, I 
believe, and the features are enabled in _compile_ time.
   
   If using different config to enable pid and backtrace, we need to divide a 
lot of conditional macros for procfs and memdump functions in 
file:fs/procfs/fs_procfsmeminfo.c,fs/procfs/fs_procfsproc.c,mm/mm_heap/mm_memdump.c,
 that is, we need to replace #if CONFIG_MM_BACKTRACE >= 0 in this PR with two 
conditions, it is complicated.


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to