You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/12/22 10:01:50 UTC

[GitHub] [incubator-nuttx] anchao commented on pull request #2574: libs/libc/dumpbuffer: dump buffer enhancement

anchao commented on pull request #2574:
URL: https://github.com/apache/incubator-nuttx/pull/2574#issuecomment-749458345


   > @anchao since this buffer dumping is used on some of the small targets for debugging I am a little worried about what this does to the code size. Do you think we can keep `lib_dumpbuffer` minimal?
   > 
   > It also seemed like a strange API contract that giving a fd of -1 would call syslog, I see why you did that, but I think it might be best to not to expose that, even if that is in in an internal static function.
   
   Yes, it seems that the feature of dumping file descriptors increases the code size on some platforms,
   I removed the dump file changes and retained the multiple buffers support, from the perspective of code size, 72 bytes increased compared to the original version on the x86_64(GCC 9.0.0):
   
   
   ```
   $ size nuttx_modify
      text	   data	    bss	    dec	    hex	filename
    258575	   1240	   4480	 264295	  40867	nuttx
   $ size nuttx_origin 
      text	   data	    bss	    dec	    hex	filename
    258503	   1240	   4480	 264223	  4081f	/home/archer/nuttx_origin
   
   $ bloaty -d symbols nuttx_modify -- ~/nuttx_origin
       FILE SIZE        VM SIZE    
    --------------  -------------- 
     [NEW]    +724  [NEW]    +684    lib_dumpvbuffer
     +0.0%    +423  [ = ]       0    [section .debug_info]
     +0.1%    +360  [ = ]       0    [section .debug_line]
     +0.1%    +242  [ = ]       0    [section .debug_abbrev]
     +0.2%     +89  [ = ]       0    [section .debug_str]
     [NEW]     +50  [NEW]     +16    tick.3837
     +0.2%     +48  [ = ]       0    [section .debug_aranges]
     [NEW]     +42  [NEW]      +8    tick.3381
     [NEW]     +41  [NEW]      +1    initialized.3771
     [NEW]     +41  [NEW]      +5    labels.3989
     +0.2%     +24  [ = ]       0    [section .symtab]
     +0.3%     +18  [ = ]       0    [section .strtab]
     -4.2%      -9  -4.2%      -9    [section .text]
     [DEL]     -41  [DEL]      -1    initialized.3756
     [DEL]     -41  [DEL]      -5    labels.3974
     [DEL]     -42  [DEL]      -8    tick.3366
     [DEL]     -50  [DEL]     -16    tick.3833
     -2.7%     -68  [ = ]       0    [Unmapped]
    -77.5%    -603 -81.6%    -603    lib_dumpbuffer
     +0.1% +1.22Ki  +0.0%     +72    TOTAL
   ```
   
   I don't know if this seems acceptable?


----------------------------------------------------------------
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.

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