----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44379/#review129245 -----------------------------------------------------------
src/linux/perf.cpp (line 346) <https://reviews.apache.org/r/44379/#comment192695> Hi, @fan.du. I believe @bmahler would like to elaborate more details here. Just my idea, feel free to correct it because I am not a native speaker. ``` // NOTE: perf statistics csv output format for cgroups could possibly be one // of the following formats: // * value,event,cgroup (since 2.6.38) // * value,unit,event,cgroup (since Linux kernel 3.14) // * value,unit,event,cgroup,running,ratio (since Linux kernel 4.1) // Howerver, we could not match them exactly by check Linux kernel version // because Linux distributions backport the related patches without change // kernel version number. So we match the `perf stat` output by token size // here. if (tokens.size() == 3) { return Sample({tokens[0], internal::normalize(tokens[1]), tokens[2]}); } else if ((tokens.size() == 4) || (tokens.size() == 6)) { return Sample({tokens[0], internal::normalize(tokens[2]), tokens[3]}); } ``` - haosdent huang On April 11, 2016, 7:01 a.m., fan du wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/44379/ > ----------------------------------------------------------- > > (Updated April 11, 2016, 7:01 a.m.) > > > Review request for mesos and Ben Mahler. > > > Bugs: MESOS-4705 > https://issues.apache.org/jira/browse/MESOS-4705 > > > Repository: mesos > > > Description > ------- > > Use tokens size to parse perf stat format. > > Co-authored with haosdent. > > > Diffs > ----- > > src/linux/perf.cpp 749e676aaf2ce639dd976f2b23e323300c6114c5 > > Diff: https://reviews.apache.org/r/44379/diff/ > > > Testing > ------- > > 1. {Found and Test} with Serenity, ema filter could get perf event statistics > correctly as expected. > 2. ./bin/mesos-tests.sh --gtest_filter=PerfEventIsolatorTest* > --log_dir=/tmp/mesos/ > > > Thanks, > > fan du > >
