[ 
https://issues.apache.org/jira/browse/MESOS-4705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15227771#comment-15227771
 ] 

Fan Du commented on MESOS-4705:
-------------------------------

[~bmahler] we don't need to know which OS vendor will enhance perf state format 
from whatever 3 or 4 to 6, but we are certain if tokens size if 3, the counter, 
event and cgroup is fetched from tokens[0], if the tokens size if 4 or 6, we 
will use tokens[0] tokens[2] tokens[3] for sure.
{code}
Possible 'perf state' output format on any vanilla kernel or OS vendor kernel.
1. value,event,cgroup
2. value,unit,event,cgroup
3. value,unit,event,cgroup,running,ratio

No one will change the order for any given format above, the older kernel perf 
tool maybe use updated perf format from newer kernel perf tools only.

 if tokens.size = 3
   return tokens[0] tokens[1] tokens[2]

 if tokens.size = 4 or tokens.size = 6
   return tokens[0] tokens[2] tokens[3]
{code}

This is what I proposed before, maybe you overlooked that.

[~haosd...@gmail.com]
btw, IMO, we could leverage kernel built-in perf tool smoothly, why writing 
redundant codes to duplicate the functionality which certainly introducing 
maintaining effort. 

> Slave failed to sample container with perf event
> ------------------------------------------------
>
>                 Key: MESOS-4705
>                 URL: https://issues.apache.org/jira/browse/MESOS-4705
>             Project: Mesos
>          Issue Type: Bug
>          Components: cgroups, isolation
>    Affects Versions: 0.27.1
>            Reporter: Fan Du
>            Assignee: Fan Du
>
> When sampling container with perf event on Centos7 with kernel 
> 3.10.0-123.el7.x86_64, slave complained with below error spew:
> {code}
> E0218 16:32:00.591181  8376 perf_event.cpp:408] Failed to get perf sample: 
> Failed to parse perf sample: Failed to parse perf sample line 
> '25871993253,,cycles,mesos/5f23ffca-87ed-4ff6-84f2-6ec3d4098ab8,10059827422,100.00':
>  Unexpected number of fields
> {code}
> it's caused by the current perf format [assumption | 
> https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob;f=src/linux/perf.cpp;h=1c113a2b3f57877e132bbd65e01fb2f045132128;hb=HEAD#l430]
>  with kernel version below 3.12 
> On 3.10.0-123.el7.x86_64 kernel, the format is with 6 tokens as below:
> value,unit,event,cgroup,running,ratio
> A local modification fixed this error on my test bed, please review this 
> ticket.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to