Kcachegrind cannot open callgrind file

I use callgrind to profile a small piece of code. Callgrind output files are well generated, their contents look fine, but I cannot open them with kcachegrind: I get the following error message:

Failed to open the file "callgrind.out.4953". Check it out, and you have sufficient rights to read it.

I have all the permissions on the files and directories in which they are located, but with the same problem. In addition, it works well with another project, in a different folder in the same workspace. I also clarify that in both cases the processes terminate correctly.

+5
source share
1 answer

I recently told the kcachegrind developer a problem with exactly the same symptoms. The problem is triggered when callgrind is used with a very long command line. This has been fixed in future versions of valgrind / callgrind and kcachegrind. Find below the commit log for the valgrind side. Waiting for new releases of valgrind and kcachegrind, if your problem is also due to the command line being too long, you can simply edit the file and truncate the cmd: line. If your problem is not cmd line length, then I think you will need to use callgrind_annotate (if this work) or continue researching why kcachegrind finds your file problematic.

Author: weidendo Date: Tue 10 Jan 20:21:21 2017 New Edition: 16196

Log: Add a format marker to the files to be called up.

KCachegrind currently uses a quick format definition before actually downloading the file and checking the line starting with "events:" in the first 2kB for this. This is obviously fragile, as Philip's internal error message shows: Callgrind has a "cmd:" line with a command line in front of the "events" line. If it is very long, detection and the file does not load at all.

While KCachegrind would not have to check this quick format, all this is useful if several input format filters are supported at some point to automatically select the correct filter.

In addition, for the "file" command for file managers and desktop environments, having a unique way of determining the file format is important.

It is not too late to fix this problem for the callgrind format.

+5
source

Source: https://habr.com/ru/post/1262633/


All Articles