This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcov can't collect data when process is executed by systemctl start but it can when executed by ./process


On 2017-07-31 22:51 -0400, Xiaoli Feng wrote:
>   Thanks Xi Ruoyao so much. I have a question. Is *.gcda file only created when 
> process exit? I did a test. Ran the process. Keep it running. Then check if *.gcda
> is generated. And it did acturally. So if it is started by systemd. And keep running.
> I think it will generate *.gcda. But it doesn't. I check the namespaces of two processes.
> They are the same.

According to man page gcov(1):

  The data in the .gcda files is saved immediately before the program exits.

And I wrote a simple program looping forever, compiled it with gcc --coverage.  The
generated executable only creates .gcda file when it exits.
-- 
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]