-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add flag to skip execution of workload #15
Conversation
Currently the `-c` option does not (reliably) support execution of pinpoint without a workload. It is still useful to get data from pinpoint without a workload - especially if just getting the raw data of a powermeter is the goal.
sampler.start(std::max(-settings::before, std::chrono::milliseconds(0))); | ||
waitpid(workload, NULL, 0); | ||
std::promise<void>().get_future().wait(); // waits forever |
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.
This is not optimal in my opinion, but I think waiting forever here is needed due to the program design.
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.
Alternatively, we could use the syscall pause(): https://man7.org/linux/man-pages/man2/pause.2.html it seems - if we can rely on that syscall existing.
@@ -133,7 +139,7 @@ void readProgArgs(int argc, char *argv[]) | |||
} | |||
} | |||
|
|||
if (!(optind < argc)) { | |||
if (!(optind < argc) || no_workload_flag) { |
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.
I hope that this doesn't cause any buggy behavior.
exit(1); | ||
} | ||
|
||
if (!workload_and_args && !(no_workload_flag && continuous_print_flag)) { |
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.
I think this error message needs to be improved. I needed quite some time to understand what this means. This should hint at the -h option at least.
My approach to this was calling |
Yes, that’s an option probably. But it also feels hacky. I‘d prefer not to fork a process if it’s not needed. As context: We are using our fork of pinpoint to get data from power meters in our application (https://github.com/nsg-ethz/autopower/blob/956049c2fef02fe1763eb596110164ac253092c1/client/client.cc#L225) and write the measurements into a database. There are multiple small changes (Build for Raspberry Pi, printing measurement samples to stdout reverting parts of 84c59ab) with this being one of the earliest ones. Should I open an issue on those changes? |
Opened #16 for tracking some changes related to the |
To let you know, we build on GitHub actions for Raspberry Pies: https://github.com/nsg-ethz/pinpoint/blob/ci/addARMBuild/.github/workflows/main.yaml I don't think it's worth a PR - unless you'd like to have one. |
I got around to look at your changes, and got what you are up to asa your advisor just showed me what setup you build on top of it. Amazing stuff. Looking forward to your publications. |
Thanks also from our side for developing pinpoint! Greetings from Zürich. |
Currently the
-c
option does not (reliably) support execution of pinpoint without a workload. It is still useful to get data from pinpoint without a workload - especially if just getting the raw data of a power-meter is the goal like in a project I am working on. This PR introduces a-n
flag to skip the need of a workload.pinpoint -c -e CPU -
was initially used to execute without a workload. However, I think this is a bug and not really a supported feature. Moreover, this command does not reliably run forever: Sometimes it terminates immediately which I think is due to a race condition related to not having a valid workload.Alternatively, the
-c
command could be updated to have different semantics if no workload is given.This change needs an entry in the README file, but #13 should probably be merged first.