Bug 388740

Summary: Ordering by timestamp instead of core number
Product: [Developer tools] kcachegrind Reporter: Jean-Michaël Celerier <jeanmichael.celerier>
Component: generalAssignee: Josef Weidendorfer <josef.weidendorfer>
Status: REPORTED ---    
Severity: wishlist CC: jseward
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jean-Michaël Celerier 2018-01-09 16:22:11 UTC
Hello,

I often find myself in the situation where the PID count has cycled back to zero, sometimes multiple times in a profiling session (certainly caused by the thousands of compiling processes being launched). 

Would it be possible to have KCacheGrind order the valgrind core files by last modification date, instead of PID number ? 

Thanks
Comment 1 Julian Seward 2018-08-06 08:13:33 UTC
You can embed the contents of arbitrary environment variables in the filename
by putting "%q{VARNAME}" as part of the --callgrind-out-file= option.  That
might be helpful.
Comment 2 Josef Weidendorfer 2018-10-03 15:59:34 UTC
Interesting suggestion.
For multithreaded code, this time will be the same for multiple files.

Is this about the ordering in the "parts overview"?
Does it help to add a column "Creation time" or similar,
and you could sort the entries by clicking the header?

PS: Julians workaround also sounds good to me.
Comment 3 Jean-Michaël Celerier 2018-10-03 16:21:10 UTC
hi! 
yes, both the workaround and your suggestion look fine (of course, not having to remember to add some argument to the valgrind command line would be better !).

> For multithreaded code, this time will be the same for multiple files.

hmm... then maybe there could be a hierarchy for the ordering : first creation time, then PID ?
Comment 4 Jean-Michaël Celerier 2018-10-03 16:21:59 UTC
(note: I'm entirely willing to implement the feature myself if I'm pointed out roughly where this should happen in the code)
Comment 5 Josef Weidendorfer 2018-10-04 08:02:39 UTC
> hmm... then maybe there could be a hierarchy for the ordering : first creation time, then PID ?

This should be done automatically by the Qt widget...

Adding the column should be easy, by looking at the source of the parts
list in libviews/partview.h/cpp (you can use github.com/KDE/kcachegrind,
and point me to your changes in a repo clone).
For the file date, this must be added as variable to TraceData, and
filled out in libcore/cachegrindloader when reading a file.