-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: detect more perf data file types in directory #677
Conversation
From the commit and PR title I've thought this to be about "open all perf.data/.perfparser files in the given directory"... Not sure about perf.old.data... what do you think about moving it at least after perf.data.perfparser or take both out of that check and list dir directory for any files starting with "perf.data" or ending on ".perfparser"? |
right, I changed the title so it is less misleading.
The intend of this feature is to emulate |
Opening the newest one would make it unlikely to load perf.old.data - but yes, I'd find it very nice if specifying the directory just takes the newest file per our file open- re Lines 287 to 294 in e6ce4c4
Those are more files and currently there's no list dir, order by timestamp - can you please inspect adding this in this PR? |
I agree with Simon, remove the |
4bcf805
to
cbab6da
Compare
done |
Currently `hotspot dir` only opens perf.data files. This patch extends this to perf.data, perf.data.old and perf.data.perfparser files.
cbab6da
to
aac8c8f
Compare
I just noticed, that this should not be merged, until #678 is merged. That PR makes opening compressed files much easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the commit summary still says "perf.data.old" (I still suggest to actually do as the function name findPerfDataFiles
- not search for a list of 2 fixed entries but to search for perf*.data perf.data.* *.perfparser *.perfparser.*
, ordered by date (newest first).
if (QFile::exists(perfDataFile) && window) { | ||
window->openFile(perfDataFile); | ||
const auto perfDataFiles = findPerfDataFiles(); | ||
for (const auto& perfDataFile : perfDataFiles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perf report
opens only a single file and I have lots of perf files in my directories...
I suggest to add either an optional integer limit or boolean newestFileOnly
attribute to that function and use it here and above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the loop breaks after the first opened file, so this is fine as-is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory this means that the caller may collect lots of file entries, just to drop all of those later.
That's not of a big issue currently as findPerfDataFiles()
does not match our file open window (which I think it should, I'm creating a new issue to track it).
if (QFile::exists(perfDataFile) && window) { | ||
window->openFile(perfDataFile); | ||
const auto perfDataFiles = findPerfDataFiles(); | ||
for (const auto& perfDataFile : perfDataFiles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the loop breaks after the first opened file, so this is fine as-is
Currently
hotspot dir
only opens perf.data files. This patch extends this to perf.data, perf.data.old and perf.data.perfparser files.