我正在使用以下设置运行 valgrind
valgrind --tool=memcheck --tool=callgrind --num-callers=20 --track-fds=yes --error-exitcode=1 CMD
:特别是,--track-fds=yes
按需要工作,但是由于 fds 0,1,2 应该是打开的,每次运行都会失败。但是,我不想放弃--track-fds
,因为它确实提供了有意义的信息。那么,是否有一个 valgrind 选项/方法来跟踪不包括 0、1、2 的 fds?
==5872== FILE DESCRIPTORS: 3 open at exit.
==5872== Open file descriptor 2:
==5872== <inherited from parent>
==5872==
==5872== Open file descriptor 1:
==5872== <inherited from parent>
==5872==
==5872== Open file descriptor 0: /dev/pts/0
==5872== <inherited from parent>
==5872==
==5872==
==5872== Events : Ir
==5872== Collected : 3081079256
==5872==
==5872== I refs: 3,081,079,256