-
Notifications
You must be signed in to change notification settings - Fork 256
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
run hotspot without GUI for any command-line only option #549
Conversation
You will need to rebase you change once #550 is landed. It will fix the clazy compaint, but you will need to fix the clang-tidy complaint yourself |
same with your other PRs |
Done. @lievenhey as the origin code was added by you, please review. |
Thanks for the comments, that's all very reasonable (you likely recognize that I'm a C guy...). I've adjusted this (see first commit, works fine) but then recognized that we duplicate part of the parser. After checking the parser only takes the application args from I personally like the result (second commit) - the only down-side is that the parser only uses a I've did several tests including filenames that contain non-ansi characters, all passed (should we add some of those to the integrationtests, like |
I don't like the second patch, can we drop that? I don't think we are should be doing anything too fancy for that purpose. if you are working without a GUI, simply don't use hotspot - just use |
Please reconsider as the second patch mostly moves around existing code and removes existing "fancy double parsing". If you don't want the second commit... just drop a note if you want to cherry-pick it manually (and close this PR) or want this PR to be reduced. |
I don't think it's sound to create the qcommandlineparser before the qapp - a lot of Qt code assumes the qapp to be around already, and all examples do that too, see e.g.: https://doc.qt.io/qt-6/qcommandlineparser.html I'll talk to some colleagues about this, but again - I believe the whole point of this patch is debatable. I'm fine with the first patch since it's so minor. the second one though - it's very subjective, no? it doesn't actually change any behavior, or what am I missing? to me it looks like you are shoehorning a functionality into an app that is simply not very worthwhile to have for me - it just increases code noise for no real gain. why do you insist on using hotspot without a display driver? maybe all you need to do instead is run |
I have to check those options, but the first test did not worked out
The main point is not to use it without a display driver, but to not create a full gui application to directly let it be teared down if there is an issue with the command line arguments detected.
Thank you. In the end I'll have learned something new :-) |
This is with the appimage I guess? Packaging problem - could be solved there.
This is not a reason. Creating a full gui app is cheap and not an issue on its own. Complicating the code just for the sake of it is not acceptable for me.
This is not an explanation: Why is this needed or desired?
Again, why would we care?
My understanding so far is that we only introduced this to allow users to run recording through hotspot when there's no GUI available. Since the patch was easy I was fine with this, but further complicating the code base isn't desired for me - this is a fringe use case. Just copy the
|
That would be super cool, but I don't think that's possible, because we have no command line options for recording. What is possible already is to export a perf.data to .perfparser, using
It is always desired to save cpu cycles. When I "just want the version" I don't desire to get warnings about drivers, platforms or anything and I'd like to see that output "in an instant". If I get an error about some QT settings on start (this aborts the creation of the Q[Core]Application) then I desire to get ... I've pushed without the second commit, just for reference - this was the difference in its output: only commit 1$ DISPLAY=banana ./bin/hotspot -H
qt.qpa.xcb: could not connect to display banana
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted
$ DISPLAY=banana ./bin/hotspot -platform offscreen -H
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-gitpod'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-gitpod'
hotspot: Unknown option 'H'.
$ ./bin/hotspot --version
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-gitpod'
hotspot 1.4.80 with previous commit 2$ DISPLAY=banana ./bin/hotspot -H
hotspot: Unknown option 'H'.
$ DISPLAY=banana ./bin/hotspot -platform offscreen -H
hotspot: Unknown option 'H'.
$ ./bin/hotspot --version
hotspot 1.4.80 |
Sorry, I indeed meant exporting, not recording. And I'm fine with adding the first commit to get version and help output too.
No, this is blatantly false. Saving CPU cycles is only worthwhile when it matters - I doubt you'll manage to measure the difference in time for initializing a QCoreApp or a QApp - especially considering that most users won't ever use these fringe features. The code you want to add here increases maintainability costs as it's more complicated. I'm not going to get this in just to save a few thousand cpu cycles that noone will ever notice.
Exactly.
I'm fine with the behavior of patch #1 only. |
No description provided.