You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by James Peach <jp...@apache.org> on 2017/01/06 01:17:28 UTC
Review Request 55241: Stop using os::system to validate perf event
names.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/
-----------------------------------------------------------
Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
Bugs: MESOS-6862
https://issues.apache.org/jira/browse/MESOS-6862
Repository: mesos
Description
-------
Stop using os::system to validate perf event names.
Diffs
-----
src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
Diff: https://reviews.apache.org/r/55241/diff/
Testing
-------
`sudo make check` (Fedora 25)
Thanks,
James Peach
Re: Review Request 55241: Stop using os::system to validate perf
event names.
Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/
-----------------------------------------------------------
(Updated Jan. 17, 2017, 10:05 p.m.)
Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
Changes
-------
Rebase.
Bugs: MESOS-6862
https://issues.apache.org/jira/browse/MESOS-6862
Repository: mesos
Description
-------
Stop using os::system to validate perf event names.
Diffs (updated)
-----
src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
Diff: https://reviews.apache.org/r/55241/diff/
Testing
-------
`sudo make check` (Fedora 25)
Thanks,
James Peach
Re: Review Request 55241: Stop using os::system to validate perf
event names.
Posted by Jiang Yan Xu <ya...@jxu.me>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/#review161616
-----------------------------------------------------------
Ship it!
Ship It!
- Jiang Yan Xu
On Jan. 13, 2017, 3:11 p.m., James Peach wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55241/
> -----------------------------------------------------------
>
> (Updated Jan. 13, 2017, 3:11 p.m.)
>
>
> Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
>
>
> Bugs: MESOS-6862
> https://issues.apache.org/jira/browse/MESOS-6862
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Stop using os::system to validate perf event names.
>
>
> Diffs
> -----
>
> src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
>
> Diff: https://reviews.apache.org/r/55241/diff/
>
>
> Testing
> -------
>
> `sudo make check` (Fedora 25)
>
>
> Thanks,
>
> James Peach
>
>
Re: Review Request 55241: Stop using os::system to validate perf
event names.
Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/
-----------------------------------------------------------
(Updated Jan. 13, 2017, 11:11 p.m.)
Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
Changes
-------
Rebased.
Bugs: MESOS-6862
https://issues.apache.org/jira/browse/MESOS-6862
Repository: mesos
Description
-------
Stop using os::system to validate perf event names.
Diffs (updated)
-----
src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
Diff: https://reviews.apache.org/r/55241/diff/
Testing
-------
`sudo make check` (Fedora 25)
Thanks,
James Peach
Re: Review Request 55241: Stop using os::system to validate perf
event names.
Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/
-----------------------------------------------------------
(Updated Jan. 12, 2017, 12:28 a.m.)
Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
Changes
-------
Rebase and address review feedback.
Bugs: MESOS-6862
https://issues.apache.org/jira/browse/MESOS-6862
Repository: mesos
Description
-------
Stop using os::system to validate perf event names.
Diffs (updated)
-----
src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
Diff: https://reviews.apache.org/r/55241/diff/
Testing
-------
`sudo make check` (Fedora 25)
Thanks,
James Peach
Re: Review Request 55241: Stop using os::system to validate perf
event names.
Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/#review161257
-----------------------------------------------------------
src/linux/perf.cpp (line 327)
<https://reviews.apache.org/r/55241/#comment232493>
It adds `true` to the commandline like the original code does. The `perf` commands generally need a subcommand to execute.
src/linux/perf.cpp (lines 329 - 341)
<https://reviews.apache.org/r/55241/#comment232501>
I expect that the original author didn't use the `Perf` because they didn't want to capture the output. But I don't see why your suggestion wouldn't work.
If it weren't for the redirection I would have just replaced this with `spawn`.
src/linux/perf.cpp (line 333)
<https://reviews.apache.org/r/55241/#comment232494>
The original code only redirected `stderr` so I've preserved that here.
- James Peach
On Jan. 6, 2017, 1:17 a.m., James Peach wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55241/
> -----------------------------------------------------------
>
> (Updated Jan. 6, 2017, 1:17 a.m.)
>
>
> Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
>
>
> Bugs: MESOS-6862
> https://issues.apache.org/jira/browse/MESOS-6862
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Stop using os::system to validate perf event names.
>
>
> Diffs
> -----
>
> src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
>
> Diff: https://reviews.apache.org/r/55241/diff/
>
>
> Testing
> -------
>
> `sudo make check` (Fedora 25)
>
>
> Thanks,
>
> James Peach
>
>
Re: Review Request 55241: Stop using os::system to validate perf
event names.
Posted by Jiang Yan Xu <ya...@jxu.me>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55241/#review161194
-----------------------------------------------------------
It's worth noting that the perf events are specified via agent flags so no unprivileged / remote user input is involved but I guess the goal is to eliminate all instances of `os::system()` (at least the ones with any non-static commands)? Are the reviews in this JIRA combined achieving that?
src/linux/perf.cpp (line 320)
<https://reviews.apache.org/r/55241/#comment232432>
s/{ "perf", "stat", "--log-fd", "2" }/{"perf", "stat", "--log-fd", "2"}/
src/linux/perf.cpp (line 327)
<https://reviews.apache.org/r/55241/#comment232433>
What does `true` do in here?
src/linux/perf.cpp (lines 329 - 341)
<https://reviews.apache.org/r/55241/#comment232434>
I am not sure how much I like the `internal::Perf` abtraction but it's there and other similar calls in this file use it so we might as well just do:
```
internal::Perf* perf = new internal::Perf(argv);
Future<string> output = perf->output();
spawn(perf, true);
output.await();
// The output being ready means the the command is successful and the events are valid.
return output.isReady();
```
src/linux/perf.cpp (line 333)
<https://reviews.apache.org/r/55241/#comment232435>
I guess we don't need to see stdout?
- Jiang Yan Xu
On Jan. 5, 2017, 5:17 p.m., James Peach wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55241/
> -----------------------------------------------------------
>
> (Updated Jan. 5, 2017, 5:17 p.m.)
>
>
> Review request for mesos, Benjamin Mahler, Greg Mann, and Jiang Yan Xu.
>
>
> Bugs: MESOS-6862
> https://issues.apache.org/jira/browse/MESOS-6862
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Stop using os::system to validate perf event names.
>
>
> Diffs
> -----
>
> src/linux/perf.cpp aa31982eb5358b7eafa7035f4358a88d3854755f
>
> Diff: https://reviews.apache.org/r/55241/diff/
>
>
> Testing
> -------
>
> `sudo make check` (Fedora 25)
>
>
> Thanks,
>
> James Peach
>
>