> On July 10, 2015, 3:11 a.m., Chi Zhang wrote: > > src/linux/perf.cpp, line 449 > > <https://reviews.apache.org/r/36378/diff/1/?file=1004593#file1004593line449> > > > > Using Try as a function parameter feels a bit non-idiomatic to me, > > though I agree it's less code this way.
In other places I would agree with you, but in this case we should be able to test for os::release returning an error so the Try makes sense. > On July 10, 2015, 3:11 a.m., Chi Zhang wrote: > > src/linux/perf.cpp, lines 476-483 > > <https://reviews.apache.org/r/36378/diff/1/?file=1004593#file1004593line476> > > > > I think using a hashmap as an intermediate type is more flexisible. > > > > Right now, the operation after 'extract' is the same for all versions, > > but we can make it version-dependent too in the future to support e.g. > > unit, running time, etc. Disagree. The Sample struct is local to this file, so it is very easy to change. Using a hashmap introduces the possibility for runtime errors which are caught at compile time this way. > On July 10, 2015, 3:11 a.m., Chi Zhang wrote: > > src/linux/perf.cpp, lines 462-474 > > <https://reviews.apache.org/r/36378/diff/1/?file=1004593#file1004593line462> > > > > This is great abstraction; I agree we should put it into stout. (maybe > > even have os::release just return canonicalized linux version?) I will raise this as a separate ticket. Making os::release return the canonicalized linux version introduces the potential confusion that uname would no longer match os::release. - Paul ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/36378/#review91262 ----------------------------------------------------------- On July 9, 2015, 11:08 p.m., Paul Brett wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/36378/ > ----------------------------------------------------------- > > (Updated July 9, 2015, 11:08 p.m.) > > > Review request for mesos, Ben Mahler, Chi Zhang, Ian Downes, and Cong Wang. > > > Bugs: MESOS-2834 > https://issues.apache.org/jira/browse/MESOS-2834 > > > Repository: mesos > > > Description > ------- > > Refactor Linux Performance monitor to handle changing 'perf stat' output > versions depending on kernel version. > > > Diffs > ----- > > src/linux/perf.cpp 697b75e846a43d4f106ad8f39a18882836d7dc02 > > Diff: https://reviews.apache.org/r/36378/diff/ > > > Testing > ------- > > sudo make check > > > Thanks, > > Paul Brett > >