eBPFï¼extended Berkley Packet Filterï¼ã¨ããç¨èªãèè ãåãã¦ã¿ãããã®ã¯ã2015å¹´ããã ã£ããæåã¯ãeBPFããã®åé¢ã®ã¨ããããã±ãããã£ããã£ããã±ãããã£ã«ã¿ãªã³ã°ãæ ãã ãã®ãLinuxã®æ°ãããµãã·ã¹ãã ã§ãããã¨èªèãã¦ãããããããå®éã«ã¯ããã§ã¯ãªãã£ãã
ã·ã¹ãã æ§è½ã®åæã®ããã®æ¹æ³è«ãã¾ã¨ããæ¸ç±Systems Performance 1 ã®èè ã§æåãªBrendan GreggããLinuxã®ãããã¯ã¼ã¯ãµãã·ã¹ãã ã¨ã¯ç¹ã«é¢ä¿ãªãæèã§ãå¤å ¸çãªã·ã¹ãã æ§è½è¨æ¸¬ãã¼ã«ã§ã¯è¨æ¸¬ã§ããªããã¨ãè¨æ¸¬ãããã¼ã«ãä½ã£ã¦ããããã®è¨æ¸¬ãã¼ã«ãeBPFã¨ããæè¡ã«ãã£ã¦å®è£ ããã¦ãããã¨ãç¥ã£ãã¨ãã«ãeBPFã«èå³ããã£ãã®ã ã£ããã¾ããeBPFã¯ãã·ã¹ãã æ§è½ã調ã¹ãç¨é以å¤ã«XDPï¼eXpress Data Pathï¼ã¨å¼ã°ããããã°ã©ããã«ãªãã±ããå¦çæ©æ§ãåãã¦ããã10å¹´è¿ãåã«ãLinuxã«ã¼ãã«ã®ãã±ããå¦çæ©æ§ãæ±ã£ã¦ãããã¨ããã£ã *1ãã¨ãããããèå³ãå¼ãç«ã¦ãããã
ãã®ããã«ã6年以ä¸åããeBPFã«èå³ã¯ãã£ããã®ã®ãå½ææ±ã£ã¦ããã·ã¹ãã ã®Linuxã«ã¼ãã«ãã¼ã¸ã§ã³ã¯ãeBPFããµãã¼ããã¦ããªãã£ããããæ¬æ ¼çã«eBPFãå¦ç¿ãããã¨ã¯ãã¦ããªãã£ãã
ãã®å¾ãä»äºã®å 容ãç 究éçºã«ç§»ããç¹å®ã®ç¾å ´ã«ä¾åããä»äºããªããªã£ããå¶ç¶ã§ã¯ãããã以åããé²ãã¦ããç 究ã®ãããã¿ã¤ãã³ã°ã§ãeBPFã«ããã«ã¼ãã«å ã®ãããã¯ã¼ã¯éä¿¡ããã¬ã¼ã¹ãããã¨ã«ãããä¾åé¢ä¿ããããæ§ç¯ããããã®åºç¤æè¡ãç 究ãããã¨ã«ãªã£ãããã®ãããeBPFããã¡ããå¦ã¶å¿ è¦ããã£ãã®ã ããeBPFã¯æ©è½ãè±å¯ãã¤éçºãæ´»çºãªãããã¾ãeBPFã®åæ©è½ã®ä½ç½®ä»ããæ´å²ãç¥ããã¨ãé£ãããããã«å®éã«eBPFã®ææ°ã®æ©è½ãç¨ãã¦ã¢ããªã±ã¼ã·ã§ã³ãéçºããã¨ãªãã¨ãåèæç®ãåèã³ã¼ããå°ãªãããããªãã®å°é£ãä¼´ã£ãã
ãã®çµé¨ãè¸ã¾ãã¦ããã®è¨äºã§ã¯ãä»å¹´ã®4æã«ã²ã¹ãåºæ¼ããããããã£ã¹ãe34.fm ep2ã®ã¨ãã½ã¼ãããã¨ã«ãeBPFãç¨ããLinuxã«ã¼ãã«ã®ãã¬ã¼ã·ã³ã°æè¡ã®æ¦è¦ã¨ãã¬ã¼ã·ã³ã°ã¢ããªã±ã¼ã·ã§ã³ã®å®è£ ããã»ã¹ãæ´çããããã®è¨äºãeBPFç»å ´ã®åæ©ããeBPFã®åºæ¬è¦ç´ ã¨ãã¼ã«ã®å®è£ ã«è³ãã¾ã§ã®ã¬ã¤ãã©ã¤ã³ã¨ãªãã°å¹¸ãã§ããã
ï¼extended BPFã®æ£å¼ç¥ç§°ã¯BPFã§ããããã以éã§ã¯æ¸ãåããå¿ è¦ããªãéãBPFã¨è¡¨è¨ãããï¼
- BPFã¨ã¯ãªã«ã
- ãã¬ã¼ã·ã³ã°ã«ãããBPFã®ä½ç½®ä»ã
- BPFãã¬ã¼ã·ã³ã°ã®æè¡è¦ç´
- BPFãã¬ã¼ã·ã³ã°ã®æ´å²
- BPFãã¬ã¼ã·ã³ã°ã®ããã°ã©ãã³ã°
- ã¾ã¨ã
- ãã¨ãã
- åèæç®
BPFã¨ã¯ãªã«ã
Brendan Greggè "BPF Performance Tools"2*2ã«ããã¨ãBPFã¨ã¯ã«ã¼ãã«ã®ããã°ã©ãããªãã£ãé«ããããã®æ±ç¨å®è¡ã¨ã³ã¸ã³ãæãã BPFã¯ãå¤ç¨®å¤æ§ãªã«ã¼ãã«ãã¢ããªã±ã¼ã·ã§ã³ã®ã¤ãã³ãã«å¯¾ãã¦ãããããã°ã©ã ãå®è¡ããæ¹æ³ãæä¾ããããã®å®è¡æ¹æ³ã¯ãã¦ã§ããã©ã¦ã¶ä¸ã§çºç«ããã¤ãã³ããå¥æ©ã«JavaScriptã®ã³ã¼ããå¼ã°ããæ¹å¼ã¨é¡ä¼¼ãã¦ãããebpf.ioã§ã¯ãã«ã¼ãã«ãã¢ããªã±ã¼ã·ã§ã³ãäºåå®ç¾©ãããããã¯ãã¤ã³ãï¼ã·ã¹ãã ã³ã¼ã«ãé¢æ°ã®å ¥åºåãã«ã¼ãã«ã®tracepointsããããã¯ã¼ã¯ã¤ãã³ãããã®ä»ï¼ãééããã¨ãã«ãBPFããã°ã©ã ãå®è¡ãããã¨èª¬æããã¦ããã
BPFã¯ãã«ã¼ãã«å ã«BPFç¬èªã®å½ä»¤ã»ããã解éããä»®æ³ãã·ã³ãã«ã¼ãã«å ã®è¤æ°ã®ããããã°ã©ã éããããã¯ãã«ã¼ãã«ç©ºéã¨ã¦ã¼ã¶ç©ºééã§ãã¼ã¿ãå ±æããããã®ã¹ãã¬ã¼ã¸ãªãã¸ã§ã¯ãããã«ãã¼é¢æ°ããæ§æããã¦ãããBPFå½ä»¤ã«ããè¨è¿°ãããããããã°ã©ã ãã·ã¹ãã ã³ã¼ã«ï¼bpf(2)ï¼çµç±ã§ã¦ã¼ã¶ç©ºéããã«ã¼ãã«ã¸éãè¾¼ãã ã®ã¡ã«ãããããã°ã©ã ã«æå®ãããã¤ãã³ããçºç«ããã¨ãããããã°ã©ã ãå®è¡ãããããã®æ©æ§ã«ããããã¡ã¤ã«ãéããCPUãä»»æã®å½ä»¤ãå®è¡ããããããã¯ã¼ã¯ãã±ãããåä¿¡ãããã¨ãã£ãå種ã¤ãã³ããçºçããã¿ã¤ãã³ã°ã§ããã®ã¤ãã³ãããã¤ãã¼ã¿ããã¨ã«å¶ç´ã®ç¯å²å ã§ä»»æã®ããã°ã©ã ãå®è¡ã§ããã
ãã®ãããªæ©æ§ããã¤BPFã®ä¸»è¦ãªã¦ã¼ã¹ã±ã¼ã¹ã¯ã"BPF Performance Tools"2ã«ããã¨NetworkingãObservabilityãSecurityã®3ç¹ã§ãããebpf.io4ã§ãã»ã¼åæ§ã«ãNetworkingãSecurityãObservability & Tracingã®3ç¹ãæãããã¦ããããã®è¨äºã§ã¯ãObservability & Tracingã®è¦³ç¹ã§ãBPFãã¨ããããã
ãã¬ã¼ã·ã³ã°ã«ãããBPFã®ä½ç½®ä»ã
èè ã®é¢å¿å¯¾è±¡ã§ãããã¯ã©ã¦ãä¸ã®ã½ããã¦ã§ã¢ãéç¨ãããªãã¬ã¼ã¿ã¼ã®è¦³ç¹ã§ããã¬ã¼ã·ã³ã°ã«ãããBPFãä½ç½®ã¥ããã
ãã¤ã¯ããµã¼ãã¹ã¢ã¼ããã¯ãã£ãã³ã³ãããªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ã®æ®åãªã©ã®è¦å ã«ãããã¯ã©ã¦ãä¸ã«å±éãããã¢ããªã±ã¼ã·ã§ã³ã®è¤éåãå éãã¦ããããã®ãããã·ã¹ãã ã®ãªãã¬ã¼ã¿ã¼ã¯ãã·ã¹ãã ã®å é¨ç¶æ ãææ¡ãããã¨ãé£ãããªã£ã¦ãããå é¨ç¶æ ãç¥ãããã«ãã·ã¹ãã ã®ä¸ä½å±¤ã§ã¯APMï¼Application Performance Managementï¼ãåæ£ãã¬ã¼ã·ã³ã°ã¨ãã£ããã¢ããªã±ã¼ã·ã§ã³ã®ç¥èãç¨ãããã¬ã¼ã·ã³ã°æè¡ãçºå±ãã¦ããããã®ä¸æ¹ã§ãã·ã¹ãã ã®ä¸ä½å±¤ãã³ã³ãããããã«ã¦ã§ã¢ã®ããã«OSã«ã¼ãã«ã®æ©è½ãç´æ¥å¼ã³åºãã·ã¹ãã ã®ä¸ä½å±¤ã®å é¨ç¶æ ãææ¡ããå¿ è¦ãããã
ã·ã¹ãã ã®ä¸ä½å±¤ã®ç¶æ ãç¥ãã«ã¯ãå¾æ¥ãããLinuxã«ã¼ãã«ãæ¨æºã§æä¾ããprocfsãsysfsãããã¡ã¤ã«èªã¿è¾¼ã¿æä½ã«ããã¡ããªãã¯ãåå¾ãããã¨ãä¸è¬çã§ãããã·ã§ã«ã®å¯¾è©±ç°å¢ã§ãã¼ã¿ãé²è¦§ããã®ã§ããã°ãLinuxãµã¼ãã«ãã°ã¤ã³ããããã¤ããã£ã¦ãããªãã¬ã¼ã·ã§ã³ - ããããããã°ãLinux Performance Analysis in 60,000 Milliseconds | by Netflix Technology Blog | Netflix TechBlogã®ããã«ãå¤å ¸çãªã³ãã³ããé§ä½¿ããããã¼ã¿ãèç©ããã®ã§ããã°ããã¼ã¿åéç¨ã®å¸¸é§ããã»ã¹ãä¸å¤®ã®ã¹ãã¬ã¼ã¸ã¸ãã¼ã¿ãéä¿¡ããããµã¼ãç£è¦ãµã¼ãã¹Mackerelã®å ´åãmackerel-agentã¨å¼ã°ãã常é§ããã»ã¹ãprocfsããç´æ¥å¤ãèªã¿è¾¼ãããã³ãã³ãåºåãèªã¿è¾¼ãã§ãããGitHub - mackerelio/go-osstat: OS system statistics library for Go
ãããã®ã¡ããªãã¯ã示ããã®ã¯ããã¼ãã¦ã§ã¢ãªã½ã¼ã¹ã®åè¨ã®ä½¿ç¨éãªã©éå®çãªãã®ã§ãããä¾ãã°ãéä¿¡å ã®IPã¢ãã¬ã¹ãã¨ã®ãããã¯ã¼ã¯ä½¿ç¨å¸¯åãåå¾ãããã¨ã¯ã§ããªããã¾ããæ°å¤ãã¼ã¿ã¨ãã¦ã®ã¡ããªãã¯ã®åå¾ä»¥å¤ã«ãã«ã¼ãã«å ã®ã¹ã¿ãã¯ãã¬ã¼ã¹ãªã©ãããã¡ã¤ãªã³ã°ã®ããã®åºåãå¾ããã¨ãã§ããªãããã®ãããLinuxã§ã¯ã«ã¼ãã«ã®å é¨ç¶æ ããã¬ã¼ã¹ããããã®æè¡ï¼perfãftraceãSystemTapãkprobeãuprobeãDTraceãstraceãªã©ï¼ãå¤ãããåå¨ãã¦ãããLinuxã®ãã¬ã¼ã·ã³ã°æè¡ã¯ãLinuxã«ã¼ãã«ã®ããã¥ã¡ã³ãã«ã¾ã¨ãããã¦ããããã®ä»ãJulia Evansã«ããããã°ãã¹ããJake Edgeã«ããLWNã®ãã¹ãæ¥æ¬èªã§ã¯mm_iããã«ããè¨äºã§å種ãã¬ã¼ã·ã³ã°æè¡ãè¦è¦çã«æ´çããã¦ãããæ´å²çãªäºæ ããããLinuxã®ãã¬ã¼ã·ã³ã°ã®åè¦ç´ æè¡éã®é¢ä¿æ§ã¯è¤éãªãã®ã¨ãªã£ã¦ããã
ãããã®ãã¬ã¼ã·ã³ã°ãã¼ã«ã¯ãæ©è½ãå¶éããã¦ãããããã«ã¼ãã«å ã®ä»»æã®è¤éãªæ§é ãåç §ã§ãããã«ã¹ã¿ã ã®ãã¸ãã¯ãæ¸ããã¨ãé£ãããã¾ããã«ã¼ãã«å ã§ã¤ãã³ããçºçããã¨ãã«ã¼ãã«å ã®ãããã¡çµç±ã§å ¨ã¦ã®ã¤ãã³ãã®ã¬ã³ã¼ããã¦ã¼ã¶ç©ºéã®ãã¼ã«ã«éããããã¼ã«ãã¬ã³ã¼ãã解æããããã®ããã¤ãã³ãã®æµéã大ããå ´åãã«ã¼ãã«ããã¦ã¼ã¶ç©ºéã¸ã®è»¢éè² è·ã課é¡ã¨ãªãã
å¾æ¥ã®ã«ã¼ãã«æ¡å¼µæ©æ§ã§ããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¯ã«ã¼ãã«ã®ã¤ãã³ãã½ã¼ã¹ãAPIã«ã¢ã¯ã»ã¹ã§ãããããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã«ãããã«ã¼ãã«å ã§ã¤ãã³ãããã£ã«ã¿ãªã³ã°ã»éç´ãããã¨ã«ãããã¦ã¼ã¶ç©ºéã¸ã®ã¤ãã³ãã®è»¢éè² è·ãæãããã¨ãå¯è½ã§ãããã¢ãã¿ãªã³ã°ãã¼ã«ã®draios/sysdigã¯ç¾å¨ã§ã¯BPFã§å®è£ ããã¦ãããã以åã¯ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã使ç¨ããã¦ãããããããã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¯ãã°ï¼ã«ã¼ãã«ãããã¯ï¼ãã»ãã¥ãªãã£ã®èå¼±æ§ãé²ãæ©æ§ããããªããããå®å ¨æ§ã«èª²é¡ããããã¾ããã«ã¼ãã«ã«å«ã¾ããä¸å®å®ãªABIãå¼ã³åºããã¨ãã§ãããããã«ã¼ãã«ãã¼ã¸ã§ã³éã®ç§»æ¤æ§ã«ã課é¡ããã2ãSysdig社ã®ããã°è¨äºã§ã®åæ§ã®ææããããSysdig and Falco now powered by eBPF. â Sysdig
BPFã¯å°ç¨ã®ä»®æ³ãã·ã³ç¨ã®å½ä»¤ã§è¨è¿°ãããã³ã¼ããå°ç¨ã®æ¤æ»å¨ãæ¤æ»ããä¸ã§ãä»®æ³ãã·ã³ãã³ã¼ãã解éããã¢ã¼ããã¯ãã£ãã¨ããããã«ãããã«ã¼ãã«å ã§å®å ¨ãªãµã³ãããã¯ã¹åããããã¦ã¼ã¶ã¼ã®ã«ã¹ã¿ã ããã°ã©ã ãå®è¡ã§ãããä»®æ³ãã·ã³ç¨ã®å½ä»¤ã»ãããä»®æ³ãã·ã³ããå¼ã³åºãå¯è½ãªã«ã¼ãã«æ©è½ã¸ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¯ã«ã¼ãã«éçºè ã«ããå®å®ãã¦ç¶æãããããã移æ¤æ§ãé«ããBPFã«ããã¦ããã«ã¼ãã«å ã§ã¤ãã³ãããã£ã«ã¿ãªã³ã°ã»éç´ããã®ã¡ã«ã¦ã¼ã¶ç©ºéã¸è»¢éããããã¨ãã§ãããçè ã®ç 究ã«ã¦ãã«ã¼ãã«å ã®ãã¼ã¿ã®éç´ã«ãããCPUè² è·ãä½æ¸ããããã¨ãä¸ä¾ã¨ãã¦ç¢ºèªãã¦ãããåæ£ã¢ããªã±ã¼ã·ã§ã³ã®ä¾åçºè¦ã«åããTCP/UDPã½ã±ããã«åºã¥ãä½è² è·ãã¬ã¼ã·ã³ã° - ããããããã°
次ã®å³ã«ãBPFãã¬ã¼ã·ã³ã°ã®æ§æã示ãã¦ããã
BPFãã¬ã¼ã·ã³ã°ã®æè¡è¦ç´
BPFã®ä½ç½®ä»ããæ´çããã¨ããã§ã次ã¯BPFãã¬ã¼ã·ã³ã°ãç解ããããã®åè¦ç´ ã説æããã
BPFã®ã¢ã¼ããã¯ãã£
BPFã¯ç義ã«ã¯Linuxã«ã¼ãã«ã«å«ã¾ããBPFä»®æ³ãã·ã³ãæããBPFä»®æ³ãã·ã³ã¯ãBPFç¨ã®ç¬èªã®å½ä»¤ã»ããã§è¡¨ç¾ãããã³ã¼ãï¼BPFãã¤ãã³ã¼ãï¼ã解éããã«ã¼ãã«ãåä½ããããã»ããµã«é©ãããã¤ãã£ãå½ä»¤ã«å¤æããã«ã¼ãã«ã«ãã¼ãããããã¼ããããBPFããã°ã©ã ã¯ãæå®ãããã¤ãã³ããçºçãããã³ã«å®è¡ãããã
æ¢åã®ã½ããã¦ã§ã¢ãã¦ã¼ã¶ã¼ãæ¡å¼µã§ããããã«ããããã«ä»®æ³ãã·ã³ãçµã¿è¾¼ã¿ãã¦ã¼ã¶ã¼å®ç¾©ã®ã³ã¼ãã解éãããããªæ©æ§ã¯ä»ã§ãã¿ããããä¾ãã°ãRedisã¯Luaã®ä»®æ³ãã·ã³ãçµã¿è¾¼ãã§ãããã¦ã¼ã¶ã¼ãLuaã§ç¬èªã®ã³ãã³ããå®ç¾©ã§ãããããã«ãä»æ¥ã®ããå é²çãªæè¡ã«Web Assemblyãããã
BPFãã¤ãã³ã¼ãã¯ãä¸è¬ã«ãå¶ç´ä»ãã®Cè¨èªã§è¨è¿°ãããBPFããã°ã©ã ããLLVM/Clangã³ã³ãã¤ã©ã«ããçæããããBPFãã¤ãã³ã¼ãã¯ãã¦ã¼ã¶ã¼ç©ºéããbpf(2)ã·ã¹ãã ã³ã¼ã«ã«ãããã«ã¼ãã«ã«æ¸¡ããããã«ã¼ãã«ã¯BPFã®æ¤è¨¼å¨ï¼BPF Verifierï¼ã使ç¨ãã¦ãBPFãã¤ãã³ã¼ããã«ã¼ãã«ãã¯ã©ãã·ã¥ãããã«å®å ¨ã«å®è¡å¯è½ããæ¤è¨¼ãããæ¤æ»çµæã«åé¡ããªããã°ãBPFãã¤ãã³ã¼ãã¯JITï¼Just in Timeï¼ã³ã³ãã¤ã©ã«ãããã¤ãã£ãå½ä»¤ã«ãããã·ã³ã³ã¼ãã«å¤æãããããã®ã¢ã¼ããã¯ãã£ã«ããæ©æµã¯ãBPFããã°ã©ã ããã¼ãããããã«ã«ã¼ãã«ãåèµ·åããå¿ è¦ããªããã¨ã ã
BPF Verifierã®æ¤è¨¼å 容ã¯å¤å²ã«ããããä¾ãã°ãã«ã¼ãã«å ã§ã®ãããã¯ãé²ããããã«ãçµäºãä¿è¨¼ãããªãã«ã¼ããå«ãããã°ã©ã ã¯æ£å´ãããããã®ä»ãå¤æ°ã®åæåãå¢çå¤ã®ã¡ã¢ãªã¸ã¢ã¯ã»ã¹ããªããã¨ãä¿è¨¼ãããBPF Verifierã®ãããªã詳細ã¯ãeBPFã®éçºè ã§ããStarovoitovã«ããeBPF Summit 2021ã®Safe Programs, the Foundation of BPFã®åç»ã§è§£èª¬ããã¦ããã
ã«ã¼ãã«ã¯BPFããã°ã©ã ãå®è¡ããã«ããã£ã¦ããã®ããã°ã©ã ãã©ã®ããã¯ãã¤ã³ãã«ã¢ã¿ãããããããç¥ãå¿ è¦ããããããã¯ãã¤ã³ãã¯BPFããã°ã©ã ã¿ã¤ãã«å¿ãã¦å®ç¾©ããã¦ãããBPFããã°ã©ã ã¿ã¤ãã¯ãbcc/kernel-versions.mdã«ã¯ãå·çæç¹ã§22å*3ã®ããã°ã©ã ã¿ã¤ããè¨è¼ããã¦ããããã¬ã¼ã·ã³ã°ã«ä½¿ç¨ãããããã°ã©ã ã¿ã¤ãã¯æ¬¡ã®ãããªãã®ã§ããã
- Kprobeããã°ã©ã ï¼å¾è¿°ï¼
- Tracepointããã°ã©ã ï¼å¾è¿°ï¼
- Perf Eventããã°ã©ã
- Raw Tracepointããã°ã©ã
ãã®ä»ããããã¯ã¼ãã³ã°ã«ä½¿ç¨ãããã¿ã¤ãã¨ãã¦ãNICï¼Network Interface Cardï¼ããã«ã¼ãã«ã«å°çãããã±ããã«å¯¾ãã¦å¦çãããã¯ããããã®XDPï¼eXpress Data Pathï¼ãããã
BPFãããã¯ã«ã¼ãã«ã¨ã¦ã¼ã¶ã¹ãã¼ã¹ã®éã§ãã¼ã¿ãå ±æããããã®ã¹ãã¬ã¼ã¸ã§ãããé åãããã·ã¥ãããããã¥ã¼ãã¹ã¿ãã¯ããªã³ã°ãããã¡ãªã©ã®æ§ã ãªç¨®é¡ã®ãã¼ã¿æ§é ãç¨æããã¦ãããBPFãããã®ãªã¹ãã¯bcc/kernel-versions.mdã«ç¶²ç¾ ããã¦ããã
BPFããã°ã©ã ã¯ãã«ã¼ãã«ãã¼ã¸ã§ã³ã®äºææ§ã®ããã«ãã«ã¼ãã«ãæä¾ããå®å®ããAPIã§ãããã«ãã¼é¢æ°ãå¼ã³åºãããä»»æã®ã«ã¼ãã«é¢æ°ãå¼ã³åºããã¨ã¯ã§ããªãããã«ãã¼é¢æ°ã«ã¯ãBPFãããã«ã¢ã¯ã»ã¹ããããã®é¢æ°ãèªèº«ã®ã¹ã¬ããIDãuid/gidãªã©ãåå¾ããé¢æ°ãªã©ãå«ã¾ããããã«ãã¼é¢æ°ã®ãªã¹ãã¯bpf-docs/bpf_helpers.rstã«ããã
ã¤ãã³ãã½ã¼ã¹
Linuxã«ã¼ãã«ã¯BPFã®ããã¯ãã¤ã³ãã¨ãã¦æ§ã ãªã¤ãã³ãã½ã¼ã¹ãæä¾ãã¦ãããã¤ãã³ãã½ã¼ã¹ã¯æ¬¡ã®ãããªè¨è£ ã«ããå©ç¨å¯è½ã¨ãªã£ã¦ããã
åçè¨è£ ï¼åçãã¬ã¼ã·ã³ã°ã¨ãå¼ã°ããï¼ã¯å®è¡ä¸ã®ã½ããã¦ã§ã¢ã«è¨æ¸¬ãã¤ã³ããæ¿å ¥ããæ©è½ã§ãããã½ããã¦ã§ã¢ãå¤æ´ãããã«å®è¡ããããããè¨æ¸¬ãæå¹ã«ããªããã°ãè¨æ¸¬ãªã¼ããããã¯ã¼ãã«ãªãå©ç¹ãããã
Linuxã«ã¼ãã«ã®é¢æ°åãã®åçè¨è£ ã¯2004å¹´ã«éçºããã Kprobeï¼Kernel probeï¼ ã§ãããLinuxã®ã¦ã¼ã¶ã¬ãã«ã®é¢æ°ã®åçè¨è£ ã¯2012å¹´ã«Uprobeï¼User probeï¼ ã¨ãã¦éçºããããBPFã¯ä¸¡è ããµãã¼ããã¦ããã
åçè¨è£ ã®æ¬ ç¹ã¯ãã½ããã¦ã§ã¢ã®ãã¼ã¸ã§ã³å¤æ´ã«ãã£ã¦ã対象ã®ååããã©ã¡ã¼ã¿ãå¤æ´ããããã対象ãåé¤ãããå¯è½æ§ããããã¨ã ããããåé¿ããã«ã¯ãã½ããã¦ã§ã¢ã®ãã¼ã¸ã§ã³ãã¨ã«ãã¬ã¼ã·ã³ã°ã³ã¼ããæ¸ããã¨ã«ãªãã
ãã®ãããªã¤ã³ã¿ã¼ãã§ã¤ã¹ã®å®å®æ§ã®åé¡ã解決ããæ¹æ³ã¯ãé¢æ°ãå¤æ°åããã®ã¾ã¾ãã¬ã¼ã¹ããã®ã§ã¯ãªããã¤ãã³ãåãã³ã¼ãåããéçºè ããããç¶æãããã¨ã§ããããã®ãããªè¨è£ æ¹æ³ã¯éçè¨è£ ã¨å¼ã°ãããLinuxã«ã¼ãã«ã¯ã«ã¼ãã«ã¬ãã«ã®éçè¨è£ ç¨ã® tracepoint ã¨ã¦ã¼ã¶ã¼ã¬ãã«ã® USDTï¼User Statically-Defined Tracingï¼ ããµãã¼ããããUSDTãå©ç¨ããã«ã¯ããã¬ã¼ã¹å¯¾è±¡ã®ã½ããã¦ã§ã¢ãåã ã«USDTããµãã¼ãããå¿ è¦ãããããªããã¤ãUSDTãæå¹ã«ããç¶æ ã§ãã«ãããã¦ããªããã°ãªããªãã
ãã®ä»ã®ã¤ãã³ãã½ã¼ã¹ã¨ãã¦ã¯ãããã»ããµã®ã¤ãã³ãã«ã¦ã³ã¿ã§ããPMCsï¼Performance Monitoring Countersï¼ãperf_eventsãªã©ãããã
BCC (BPF Compiler Collection)
BCCã¯BPFã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ããããã®ã³ã³ãã¤ã©ãã¬ã¼ã ã¯ã¼ã¯ã¨ã©ã¤ãã©ãªãå«ããã¼ã«ãããã§ãããbccãªãã¸ããªã«ã¯ã70å以ä¸ã®æ§è½åæãã¼ã«ãå«ã¾ãã¦ããã
BPFãç¨ãããã¬ã¼ã·ã³ã°ãã¼ã«ã¯ã次ã®2ã¤ã®ããã°ã©ã ã§æ§æãããããã®2ã¤ã®ããã°ã©ã ããããã¦ããã®è¨äºã§ã¯ãBPFã¢ããªã±ã¼ã·ã§ã³ã¨è¡¨è¨ããã
- BPFããã°ã©ã ï¼ã«ã¼ãã«å ã§å®è¡ãããããã°ã©ã ãBPFå½ä»¤ã»ããã¸ã³ã³ãã¤ã«ãããã³ã¼ãã¯BPFãã¤ãã³ã¼ãã
- ããã³ãã¨ã³ãããã°ã©ã ï¼ã¦ã¼ã¶ç©ºéã§å®è¡ãããããã³ãã¨ã³ãã®ããã°ã©ã ãå®è¡æã«ãBPFããã°ã©ã ãã¦ã¼ã¶ç©ºéããã«ã¼ãã«ã¸ãã¼ãããããã¬ã¼ã·ã³ã°ã§ã¯ãã«ã¼ãã«ããBPFãããçµç±ã§ãã¬ã¼ã¹ã®çµæãåãåãã
BCCã§ã¯ãããã³ãã¨ã³ãããã°ã©ã ãPythonãLuaãããã³ãC++ã§æ¸ããã
ãã£ã¹ã¯I/Oã®ãµã¤ãºã®ã«ã¦ã³ãã¨åæ£ã表示ããbitesizeã¯ã·ã³ãã«ã§ç解ããããBCCã§æ¸ãããæ¸ãããæ§è½åæãã¼ã«ã®ä¾ã ãBPFããã°ã©ã ãPythonã®æååã¨ãã¦è¨è¿°ãã¦ãBPFã¯ã©ã¹ã®å¼æ°ã«ãã®æååã渡ãã¦ãªãã¸ã§ã¯ããçæãããªãã¸ã§ã¯ãçµç±ã§ãã¹ãã°ã©ã ãæ ¼ç´ãããBPFãããã«ã¢ã¯ã»ã¹ãããbitesizeã¯ãããã¯ããã¤ã¹å±¤ã§I/Oãçºè¡ããéã«ééããblock_rq_issueã¨ããtracepointãããã¯ãããã¨ã«ããå®ç¾ããã¦ããã
bpftrace
bpftraceã¯ããã¬ã¼ã·ã³ã°ã®ããã®å°ç¨ã®ã¹ã¯ãªããè¨èªã解éã»å®è¡ããããã®ããã³ãã¨ã³ããã¼ã«ã§ãããbpftraceã§ã¯ãå¶ç´ã¯ãããã®ã®ãããã³ãã¨ã³ãããã°ã©ã ã¨BPFããã°ã©ã ãæ¸ãåããå¿ è¦ããªããã¯ã³ã©ã¤ãã¼ã§ããã¬ã¼ã·ã³ã°ã§ããããã®ãããã¢ãããã¯ãªæ§è½åæã«ã¯æé©ãªãã¼ã«ã§ããã
bpftraceã³ããã¿ã§ããmm_iããã«ããæ¨å¹´ã®è¨äºã¯ãbpftraceã®æè¿ã®ååããã§ãã¯ããã®ã«ã¨ã¦ããããbpftrace 2020 - ç¡åä¸è¶³
CO-RE (Compile Once - Run Everywhere)
ã«ã¼ãã«ãã¬ã¼ã·ã³ã°ç¨ã®BPFããã°ã©ã ã¯ããã¬ã¼ã¹å¯¾è±¡ã®ã«ã¼ãã«ã®æ§é ä½ãé¢æ°ã®å®ç¾©ãåç §ãããããã³ã³ãã¤ã«æã«ãããã®å®£è¨ãå«ãã«ã¼ãã«ããããå¿ è¦ã¨ãªããããããã³ã³ãã¤ã«ãå®è¡ãããã¹ãã®ã«ã¼ãã«ã¨ãBPFã¢ããªã±ã¼ã·ã§ã³ã®é å¸å ã®ãã¹ãã®ã«ã¼ãã«ã®ãã¼ã¸ã§ã³ãç°ãªãå ´åã宣è¨ã¨å®éã®å®ç¾©ãçç¾ãããå¼·å¼ã«BPFããã°ã©ã ãå®è¡ããã¨ãæ§é ä½ã®ãã£ã¼ã«ãå¤æ°ã®ãªãã»ãããã«ã¼ãã«ãã¼ã¸ã§ã³éã§ç°ãªãã°ãBPFããã°ã©ã ã¯è¦å½éãã®å¤ãèªã¿åºããã¨ã«ãªãã
BCCãå«ãããã¾ã§ã®BPFã¢ããªã±ã¼ã·ã§ã³ã¯ãåä¸ãã¹ãä¸ã§BPFããã°ã©ã ãã³ã³ãã¤ã«ããã®ã¡ã«å®è¡ãã¦ããã*4ãã®ãããBPFã¢ããªã±ã¼ã·ã§ã³ã®é å¸å ã«ã³ã³ãã¤ã«ã«å¿ è¦ãªããã±ã¼ã¸ï¼clang+LLVMãLinuxã«ã¼ãã«ãããï¼ãã¤ã³ã¹ãã¼ã«ããããã¾ãã¯ãBPFã¢ããªã±ã¼ã·ã§ã³ã®é å¸ç©ã«ãããã®ã³ã³ãã¤ã«ç¨ããã±ã¼ã¸ãå梱ããå¿ è¦ãããããããé å¸ç©ã®ãµã¤ãºã®è¥å¤§åãæããã¾ãããã¹ãä¸ã§BPFã¢ããªã±ã¼ã·ã§ã³ãèµ·åããã¨ãã«ãã³ã³ãã¤ã«ã«ããä¸æçãªCPUã»ã¡ã¢ãªè² è·ãçºçãããå¤æ°ã®ãã¹ãã«å¯¾ãã¦ã常é§ã§ãã¬ã¼ã·ã³ã°ããå ´åããããã®ãªã¼ãããããç¡è¦ã§ããªããªããã¨ãããã
ãã®ãããªç§»æ¤æ§ã®èª²é¡ã解決ããããã«ã¯ãä¸åº¦ã³ã³ãã¤ã«ãããBPFãã¤ãã³ã¼ãããåã³ã³ãã¤ã«ãããã¨ãªãæ§ã ãªé å¸å ãã¹ãã«è¤è£½ãã¦é ç½®ããã®ã¿ã§åä½ãããå¿ è¦ãããã
CO-REã¯ãã³ã³ãã¤ã«æã«æ±ºå®ãããæ§é ä½ãã£ã¼ã«ãå¤æ°ã®ãªãã»ãããªã©ã®åç §æ å ±ããBPFããã°ã©ã ã®å®è¡æã«ã«ã¼ãã«ããæ£ããæ å ±ãç §åã»æ¸ãæããæ©æ§ï¼åé ç½®ï¼relocationï¼ã§ãããCO-REã®æ§æè¦ç´ ã¨ãã¦ãã³ã³ãã¤ã©ãBTFï¼BPF Type Formatï¼ãBPFãã¼ãã¼ãã«ã¼ãã«ã®4ã¤ããããã³ã³ãã¤ã©ï¼Clangï¼ã¯ãBPFãã¤ãã³ã¼ããå«ãELFãªãã¸ã§ã¯ããã¡ã¤ã«ã®åé ç½®ã»ã¯ã·ã§ã³ã«åç §æ å ±ãè¨é²ãããã«ã¼ãã«ã¯ãCè¨èªã®æ§é ä½ãé¢æ°ãã°ãã¼ãã«å¤æ°ãªã©ã®å®ç¾©æ å ±ã軽éã«è¡¨ç¾å¯è½ãªãã©ã¼ãããBTFï¼BPF Type Formatï¼ãç¨ãã¦åé ç½®æ å ±ãæä¾ãããããã³ãã¨ã³ãããã°ã©ã ã®ãã«ãæã«çµã¿è¾¼ã¾ããBPFãã¼ãã¼ï¼libbpfï¼ã¯ãããã³ãã¨ã³ãããã°ã©ã ã®å®è¡æã«ããªãã¸ã§ã¯ããã¡ã¤ã«ã®åç §æ å ±ãåãåºããå®è¡ä¸ã®ã«ã¼ãã«ããæä¾ãããBTFæ å ±ã¨ç §åãããªãã»ããããã®ä»ã®åé ç½®å¯è½ãªæ å ±ãæ´æ°ããããããã®è¦ç´ æè¡ã®çµã¿åããã«ãããå®è¡ä¸ã®ã«ã¼ãã«ã«é©åããããã«èª¿æ´ãããBPFããã°ã©ã ãå¾ããã¨ãã§ããã
CO-REããµãã¼ãããã¢ããªã±ã¼ã·ã§ã³ãåä½ãããã«ã¯ãBTFããã«ãã¤ã³ã§ãµãã¼ãããã«ã¼ãã«ãã¾ãã¯ãããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ã¨ã«ã¼ãã«ã®è¨å®å¤æ´ã¨åãã«ããå¿ è¦ã¨ãªããBTFããã«ãã¤ã³ãããã«ã¼ãã«ã¯ãUbuntuã§ããã°ãUbuntu 20.10以éã§ãµãã¼ãããããå·çæç¹ã®ææ°ã®LTSãã¼ã¸ã§ã³ã¯ããã®ã¾ã¾ã§ã¯BTFããµãã¼ãããªããã注æããå¿ è¦ããããlibbpfã®READMEã«ãã詳細ãªæ å ±ãè¨è¼ããã¦ããã
CO-REã®ããæ·±ãæè¡è©³ç´°ãç¥ãã«ã¯ãNakryikoã«ãã次ã®è¨äºãããããã BPF CO-RE (Compile Once â Run Everywhere) ã¾ããå®éã«ãªãã»ãããæ¸ãæãããã¦ããè¦ç´ ããnttlabs @brewaddictããã®æ¬¡ã®è¨äºã«æ¸ããã¦ããã ç´ç²ãªRustã¸ã®æã貫ããããlibbpfãæ¨ã¦ãRustã ãã§eBPFãåããããã | nttlabs
BPFãã¬ã¼ã·ã³ã°ã®æ´å²
BPFã®ä½ç½®ä»ããæ´çããã¨ããã§ã次ã«Observabilityã®æèã«ãããBPFã®æ´å²ãããã³Linuxãã¬ã¼ã·ã³ã°ãæ¯ããè¦ç´ æè¡ãç°¡åã«ç´¹ä»ãããBPFã¯ããæ°å¹´æ®åããæè¡ã§ããã¨èªç¥ããã¦ãããããã®èµ·æºã¯1992å¹´ã«ã¾ã§é¡ãã
1992 cBPF (classic BPF)
BPFã®æåã®ã¢ã¤ãã¢ã¯ããã¼ã¯ã¬ã¼ç 究æã®Steven McCannã«ãã1993å¹´ã®è«æ5ã«ã¦ææ¡ãããããã±ãããã£ã«ã¿ãå¹çããå®è¡ããããã«ã¯ãã«ã¼ãã«ããã¦ã¼ã¶ç©ºéã¸ã®å ¨ã¦ã®ãã±ããã転éããã®ã§ã¯ãªããã«ã¼ãã«å ã§ãã£ã«ã¿ãªã³ã°ããã®ã¡ã«ãã¦ã¼ã¶ç©ºéã¸è»¢éããå¿ è¦ããããã¹ã¿ãã¯ãã¼ã¹ã®ãªãªã¸ãã«ã®UNIXã®ãã£ã«ã¿è©ä¾¡å¨ã«ä»£ãã¦ãã¬ã¸ã¹ã¿ãã¼ã¹ã®ãã£ã«ã¿è©ä¾¡å¨ã§ããBPFãææ¡ããããeBPFç»å ´ä»¥å¾ã¯ããã®è©ä¾¡å¨ã¯classic BPFï¼cBPFï¼ã¨å¼ã°ãã¦ããã
è«æ5ã®4ç¯ã«ã"BPF is now about two years old and has been put to work in several applications."ã¨è¨è¼ããã¦ãããã¨ãããBPFãå®è£ ãããã®ã¯1990å¹´ããã ã¨æ¨å¯ãããã
1997 Linux Socket Filter (LSF)
ã¡ã¼ãªã³ã°ãªã¹ãã®å±¥æ´ã«ããã¨ãJay SchulistãLinuxã«BPFãLinux Socket Filterã¨ããå称ã§è¿½å ããã®ã¯ããã¼ã¸ã§ã³ 2.1.8xã§ããã¨è¨è¼ããã¦ãããLinuxã«ã¼ãã«ãã¼ã¸ã§ã³ã®æ´å²ã«ããã¨ã2.1.8xã®éçºã¯1997å¹´ããã§ããã
2013 eBPFã®ææ¡
2013å¹´ã«Alexei Starovoitovã¯cBPFãæ¡å¼µããããã«cBPFã®å¤§å¹ ãªæ¸ãæããææ¡ãããLKML: Alexei Starovoitov: [PATCH net-next] extended BPF ããã¦ãç¿å¹´ã®2014å¹´ã«Linuxã«ã¼ãã«ã«æè¼ãããã
æ¸ç±2ã®åºæã«ã¦ã2014å¹´ã«Starovoitovã¯BPFãé«åº¦ãªãããã¯ã¼ãã³ã°ããã®ä»ã®ããã°ã©ã ãå®è¡ã§ããæ±ç¨ã®ä»®æ³ãã·ã³ã«ãããã¨åãçµãã§ããã¨è¨è¿°ããã¦ãããåæ¸ã®2.3ç¯ã«ãSDNï¼Software Defined Networkingï¼ã®æ°ããæ¹æ³ã調æ»ãã¦ããPLUMgrid社ã«å¤åãã¦ããStarovoitovã«ãããeBPFãä½ãããã¨ãããã¾ããåæ¸ã®åºæã§ããã®åãçµã¿ãèããèè ã§ããGreggã¯BPFã®ä¸ã«æ§è½åæãã¼ã«ãéçºãããã¨ã«èå³ãæã£ãã¨è¿°æãã¦ãããeBPFã®ãããã®ææ¡ã«ã¯ãå ·ä½çãªã¦ã¼ã¹ã±ã¼ã¹ã¯è¿°ã¹ããã¦ããªãã£ãããéçºå½æãããã±ãããã£ã«ã¿ã«çã¾ããªãæ±ç¨å®è¡ã¨ã³ã¸ã³ãç®æãã¦ãããã¨ã伺ããã
2015 BCCã®éçº
2015å¹´ã«Brenden Blancoã«ãããBPFã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ããããã®ã³ã³ãã¤ã©ãã¬ã¼ã ã¯ã¼ã¯ã¨ã©ã¤ãã©ãªãå«ããã¼ã«ãããBPF Compiler Collectionï¼BCCï¼ãéçºãããã
2016 BPF Superpowers
2016å¹´ã«éå¬ããããFacebook主å¬ã®Performance @Scaleã«ã¦Brendan Greggã«ããLinux BPF Superpowersã¨é¡ãããã¬ã¼ã³ãã¼ã·ã§ã³ãæ«é²ããããã¿ã¤ãã«ã示ãããã«ãObserbabilityã®æèã§BPFã®ç§ããå¯è½æ§ãæ¥æ¬å½å ã§ãç¥ãããããã«ãªã£ããã£ããã¨ãªã£ãã
2017 bpftrace
2017å¹´ã«Alastair Robertsonã«ããbpftraceãéçºãããã
2019 CO-RE
Linux Kernel Developers' bpfconf 2019ã«ã¦ãFacebookã®Andrii NakryikoããBPFããã°ã©ã ã®ç§»æ¤æ§ãåä¸ãããããã®BPF CO-REã®ããã¸ã§ã¯ããçºè¡¨ããã
2020 BCC Pythonã®æ§è½ãã¼ã«ãå»æ¢äºå®ã«
BCCãªãã¸ããªã«ãããPythonã§ã®æ§è½åæãã¼ã«ã®ã³ã¼ãã£ã³ã°ã¯libbpf Cã«ç§»è¡ããããå»æ¢äºå®ï¼deprecatedï¼ã¨ãªã£ããBCCèªä½ãå»æ¢ãããããã§ã¯ãªãã移æ¤ãããBCCã«å«ã¾ããæ§è½åæãã¼ã«ã¯ãiovisor/bccãªãã¸ããªã®libbpf-toolsãã£ã¬ã¯ããªã«ããã
2020 ã¯ã©ã¦ããã¤ãã£ãã«ããã注ç®æè¡
ã¯ã©ã¦ããã¤ãã£ãæè¡ãæ¨é²ãã財å£ã§ããCNCFã主å¬ããKubeCon NA 2020ã«ã¦ãCNCF TOC chairã®Liz Riceã«ããã2021å¹´ã«æ³¨ç®ãã¹ã5ã¤ã®ãã¯ããã¸ã¼ã®ä¸ã¤ã¨ãã¦ãWeb Assemblyã¨eBPFãæãããã¦ããã
#CNCF TOC chair @lizrice is sharing the 5 technologies to watch in 2021 according to the TOC:
— CNCF (@CloudNativeFdn) 2020å¹´11æ20æ¥
1. Chaos engineering
2. @kubernetesio for the edge
3. Service mesh
4. Web assembly and eBPF
5. Developer + operator experience pic.twitter.com/aSRDTB0piN
2021 BPF on Windows
Microsoftã®å ¬å¼ããã°ã§ãWindowsã§BPFãåä½ãããããã¸ã§ã¯ããçºè¡¨ãããã Windows 10 and Windows Server 2016以éã§BPFããµãã¼ãããããã¨ã«ãªã£ãã
BPFãã¬ã¼ã·ã³ã°ã®ããã°ã©ãã³ã°
BPFãã¬ã¼ã·ã³ã°ãå¦ã¶ããã®ããã»ã¹ããGreggã®æ¬¡ã®è¨äºã§è¿°ã¹ããã¦ããã
è¨äºã«ããã¨ãåå¿è ãä¸ç´è ãä¸ç´è ã«åãã¦ã次ã®ãããªã¹ãããã§å¦ãã§ããã¨ããã¨ããã
- åå¿è ï¼bccã®æ§è½åæãã¼ã«ãåããã
- ä¸ç´è ï¼bpftraceã®ãã¼ã«(ã¹ã¯ãªãã)ãéçºããã
- ä¸ç´è ï¼bccã®ãã¼ã«ãéçºãããbccãbpftraceã«è²¢ç®ããã
eBPF Summit 2020ã§Liz Riceã«ããçºè¡¨ããããã®ãã¼ãºã¬ã¤ãã«ã¯ãBCCã®ç°¡åãªãã¼ã«éçºã«è³ãã¾ã§ã®æçã®éæ¡å ã示ããã¦ããã
ä»å¾ã¯ãCO-REããµãã¼ããããã¨ãæ¨å¥¨ããã¦ãããã¨ãè¸ã¾ããã¨ãBCC以å¤ã«CO-REã«å¯¾å¿ãããã¼ã«éçºãå¿ è¦ã¨ãªãã ãããããã§ãèè ã®BPFã¢ããªã±ã¼ã·ã§ã³ã®å®è£ çµé¨ãè¸ã¾ãã¦ãCO-REã«å¯¾å¿ãããã¬ã¼ã·ã³ã°ãã¼ã«éçºãç®æãããBPFããã°ã©ãã³ã°ã®ããã»ã¹ãç´¹ä»ããã
0. ä½ã®ãã¼ã«ãã¤ãããã決ãã
ã¾ãã¯ãã©ã®ãããªãã¬ã¼ã·ã³ã°ãã¼ã«ãã¤ãããã決ããã¨ããããå§ã¾ããæ¢åã®ãã¼ã«ã¨éè¤ããªããã®ãæã¾ããããæåããæ°è¦æ§ãã¤æç¨æ§ãå ¼ãåãããããªãã¼ã«ã®çæ³ã«è³ãã®ã¯é£ããã ããã
æ¸ç±2ã®Part â ¡: Using BPF toolsã®åç« æ«ã«ãã¬ã¼ã·ã³ã°ã«é¢ããç·´ç¿åé¡ãæãããã¦ãããä¸é¨ã®åé¡ã¯æ示ããããã¼ã«ã®éçºã§ããããã®åé¡ã«åãçµãã§ã¿ãã®ããããããããªããä¾ãã°ã8.5 "Optional Exercises"ã®ãªã¹ãã®3-7çªç®ã¯ãã¼ã«éçºã®åé¡ã§ããããã®ãã¡ã®4çªç®ããããããããªã®ã§ã以ä¸ã«å¼ç¨ãã¦ããã
"4. Develop a tool to show the ratio of logical file system I/O (via VFS or the file system interface) vs physical I/O (via block tracepoints)."
1. ãã¬ã¼ã·ã³ã°å¯¾è±¡ã®çºè¦
ã«ã¼ãã«ããä½ãããã®å é¨ç¶æ ãåå¾ãããã¨èããã¨ãã«ãã«ã¼ãã«ã®ã©ã®é¢æ°ãã©ã®å¤æ°ãããã¬ã¼ã¹ããã°ãããã¯èªæã§ã¯ãªãã
ã¾ãã¯ãkprobesã¨tracepointsã§ã«ã¼ãã«å
ã®ããã¯ãã¤ã³ãã®ãªã¹ããåºåãããã¬ã¼ã¹å¯è½ãªå¯¾è±¡ãæ¦è¦³ãããkprobesã§ã¢ã¿ããå¯è½ãªé¢æ°ã®ãªã¹ãã¯ã/sys/kernel/debug/tracing/available_filter_functions
ããèªã¿åºããã
# cat /sys/kernel/debug/tracing/available_filter_functions | grep -e '^tcp_v4' | head tcp_v4_init_seq tcp_v4_init_ts_off tcp_v4_reqsk_destructor tcp_v4_restore_cb tcp_v4_fill_cb tcp_v4_md5_hash_headers tcp_v4_md5_hash_skb tcp_v4_route_req tcp_v4_init_req tcp_v4_init_sock
tracepointsã®ãªã¹ãã¯bcc toolsã«å«ã¾ããtplist(8)ã®åºåããå¾ããããã·ã¹ãã ã³ã¼ã«ã¯tracepointsã«å«ã¾ããã
# tplist | grep tcp: tcp:tcp_retransmit_skb tcp:tcp_send_reset tcp:tcp_receive_reset tcp:tcp_destroy_sock tcp:tcp_rcv_space_adjust tcp:tcp_retransmit_synack tcp:tcp_probe
å®éã«æ¦è¦³ãã¦ã¿ãã¨ã大éã®ããã¯ãã¤ã³ãããããã¨ãããããããããæããã®ãçºè¦ãããã¨ã¯é£ããããããããªãããã®è² è·æ³å®ããã£ã¦ããã°ããã®æ³å®ããããã¯ãã¤ã³ãã®ãçµãè¾¼ããã
å®éã«ã«ã¼ãã«ã«è² è·ãçºçãããªããããã®è² è·ã«é¢é£ããã¤ãã³ãã½ã¼ã¹ã調ã¹ãæ¹æ³ããããbcc toolsã®profile(8) ã§ã¯ã-pãªãã·ã§ã³ã§PIDãæå®ãããã¨ã«ãããåä½ä¸ã®ããã»ã¹ã«ç´ã¥ãã¹ã¿ãã¯ãã¬ã¼ã¹ãåå¾ã§ãããã¹ã¿ãã¯ãã¬ã¼ã¹ããããã¯ãã¤ã³ãã¨ãã¦ä½¿ããããªãã®ãçºè¦ã§ãããããããªãããã®ä»ã®ã¹ã¿ãã¯ãã¬ã¼ã¹ãé¢æ°ã®å¼ã³åºãåæ°ãåºåãããã¼ã«ã¯ãfunccount(2) ã¡ã¢ãªã§ããã°memleak(8)ããã¡ã¤ã«ã·ã¹ãã ã§ããã°xfsdist(8)ãext4dist(8)ããã£ã¹ã¯I/Oã§ããã°ãbiostacks(8)ããããã¯ã¼ã¯ã®ä¸ä½å±¤ã®ã½ã±ãã層ã§ã¯ãsockstat(8)ããããbcc tools以å¤ã§ã¯ããããã¯ã¼ã¯ã®ä¸ä½å±¤ã®ãã±ããã«å¯¾ãã¦ã¯ã@YutaroHayakawaããä½ã®ipftrace2ãæç¨ã§ãããipftrace2ã¯ã«ã¼ãã«å ã®ãã±ããã®ããã¼ãé¢æ°åä½ã§è¿½è·¡ã§ããã
ããã¯ãã¤ã³ãã«è¦å½ãã¤ããã®ã¡ã«ããã®ããã¯ãã¤ã³ãã®è©³ç´°ã調ã¹ããã¾ããtplist(8)ã«ãããããã¯ãã¤ã³ãã®å¼æ°ã®ååã¨åã確èªããã
# tplist -v syscalls:sys_enter_read syscalls:sys_enter_read int __syscall_nr; unsigned int fd; char * buf; size_t count;
次ã«ãargdist(8)ã«ããå¼æ°ã®å¤ã¨è¿ãå¤ã®åæ£ã確èªã§ãããããã¯ãã¤ã³ãã®ééé »åº¦ãå°ãããã°ãtrace(8)ã§åã ã®ã¤ãã³ããåºåãããã¨ãã§ãããæå¾ã«ãbpftraceã使ç¨ãã¦ããã¯ãã¤ã³ãã«å¯¾ãã¦ç°¡åã«å¦çãæ¸ãã¦ã¿ããã¨ãã§ãããbpftraceã®ãªãã¡ã¬ã³ã¹ã¬ã¤ãã«ããããã«ããã¾ãã¾ãªã¦ã¼ãã£ãªãã£é¢æ°ãæã£ã¦ããã
2. BCCã«ãããããã¿ã¤ãã³ã°
bccãªãã¸ããªå ã®æ§è½åæãã¼ã«ãéæ¨å¥¨ã«ãªã£ãã¨ã¯ãããBCCã¯ãããã¿ã¤ãã³ã°ã«æç¨ã ãBCCã§ããã°ãBPFããã°ã©ã ã¨ããã³ãã¨ã³ãããã°ã©ã ã®ä¸¡æ¹ã1æã®ã¹ã¯ãªããå ã«åããããããã試è¡é¯èª¤ãéãããããä¾ãã°ãBPFããã°ã©ã ã¯Pythonã®æååã¨ãã¦è¨è¿°ããããããããã³ãã¨ã³ãã¸ã®å ¥åã«å¿ãã¦ãæååå¦çã§ç°¡åã«BPFããã°ã©ã ãåççæã§ãããmapã¸ã®ã¢ã¯ã»ã¹ããlibbpfãç´æ¥ä½¿ãããç°¡åã«æ¸ããã BCCã®æ©è½ã¯ãBCCã®ãªãã¡ã¬ã³ã¹ã¬ã¤ãã«æ´çããã¦ããã
id:chikuwa_it ããã®ãããããã¦ã¤ãããªããeBPFã®ã¯ããããã®ä¸ç¤ããçµç¤ã«ããã¦ãHello WorldãTCPã³ãã¯ã·ã§ã³ã®ãã¬ã¼ã¹ãã³ã³ããå¤å®ãé¡æã¨ãã¦ãBCCã«ããããã°ã©ãã³ã°ã®ã¹ããããå³è§£ããã¦ããã
èè ã¯ãããªãæçµã¹ãããã§ããlibbpf + CO-REããæ¸ãå§ããããä¸æ¦BCCã§ãããã¿ã¤ããä½æããã®ã¡ã«ãlibbpf + CO-REã§å®è£ ããã°ããã£ãã¨å¾æããã
3. libbpf + CO-RE
Nakryikoã«ããBuilding BPF applications with libbpf-bootstrapã®è¨äºã«libbpfãã¼ã¹ã®BPFã¢ããªã±ã¼ã·ã§ã³ã®æ§ç¯æ¹æ³ãã¾ã¨ãããã¦ãããåæã«ãlibbpf + Cã«ç§»æ¤ãããbcc toolsã®ã½ã¼ã¹ã³ã¼ããå ·ä½ä¾ã¨ãã¦åèã«ãªãããããã®ãªã½ã¼ã¹ããªããã°ãèè ã¯å®è£ ããã¼ã¤ããªãã£ãã ããããã ããNakryikoã®è¨äºã¯å¤ããã¼ã¸ã§ã³ã®libbpfãåºã«æ¸ããã¦ãããããlibbpf 1.0以éã§ã¯ä¸é¨ã®APIã®ä»æ§ãå¤æ´ããã¦ãããã¨ã«çæããªããã°ãªããªãã
BPFã¯éçºãæ´»çºãªãããã«ã¼ãã«ã®ç´°ããªãã¼ã¸ã§ã³ãã¨ã«å©ç¨å¯è½ãªæ©è½ã«å·®ç°ããããBPFã®æ©è½ã¨ã«ã¼ãã«ãã¼ã¸ã§ã³ã¨ã®å¯¾å¿è¡¨ãããããããµãã¼ãããã«ã¼ãã«ãã¼ã¸ã§ã³ã決ãã¦ããã©ã®æ©è½ãå©ç¨ããããè¦å½ããã¨ããã
ä½è«ã ããCO-REã®æ©æ§ã使ããã«ãç°ãªãã«ã¼ãã«ãã¼ã¸ã§ã³ã«å¯¾å¿ããæ¹æ³ããªãã¯ãªããweaveworks/tcptracer-bpfã§ã¯ãæ¢ç¥ã®ãã©ã¡ã¼ã¿ï¼æ¢ç¥ã®IPã¢ãã¬ã¹ããã¼ããªã©ï¼ã§ä¸é£ã®TCPæ¥ç¶ãä½æãããããã®ãã©ã¡ã¼ã¿ãã«ã¼ãã«ã®struct sockæ§é ä½ã®ãã£ã¼ã«ããªãã»ãããæ¤åºãã¦ããã
Goè¨èªã«ããBPFããã°ã©ãã³ã°
Prometheusã«ä»£è¡¨ãããããã«ãGoã§æ¸ãããObservabilityãã¼ã«ã¯å¤æ°åå¨ãããGoã§BPFã®ããã³ãã¨ã³ããæ¸ãããã¨ãããã¼ãºãããã ããã
Goã§BPFã®ããã³ãã¨ã³ããæ¸ãã«ã¯ã以ä¸ã®ã©ã¤ãã©ãªã®ããããã使ããã¨ã«ãªããããã³ãã¨ã³ãã®BPFã©ã¤ãã©ãªã«æä½éå¿ è¦ãªå¦çã¯ã(1)BPFãã¤ãã³ã¼ãã¨mapã®ã«ã¼ãã«ã¸ã®ãã¼ãã¨ã(2)mapã®æä½ã§ããã
- iovisor/gobpf: BCCã®Goã©ããã¼
- dropbox/goebpf: libbpfã使ããèªåã§bpfã·ã¹ãã ã³ã¼ã«ãå¼ã¶
- cilium/ebpf: Pure Go
- DataDog/ebpf: cilium/ebpfããforkãããBPFãªãã¸ã§ã¯ãã®ã©ã¤ããµã¤ã¯ã«ç®¡çããã¼ã¸ã£ã¼ã追å ããã¦ããã
- aquasecurity/libbpfgo: å ã¯ã»ãã¥ãªãã£ã©ã³ã¿ã¤ã ã®Traceeç¨ã®libbpfã®Goã©ããã¼ã
- libbpf + cgo bindings
ã«ã¼ãã«ãæä¾ããBPFã®ææ°ã®æ©è½ã使ããããã°ãã«ã¼ãã«ã®ã¢ããã¹ããªã¼ã ã§ã¡ã³ãããã¦ããlibbpfã使ããGoããã¯cgoã使ç¨ãã¦libbpfã®APIãå¼ã³åºããlibbpfãGoã®ãã¤ããªã«å«ããã«ã¯ãlibbpfãéçãªã³ã¯ããããå ·ä½çã«ã¯ãlibbpfã®éçã©ã¤ãã©ãªãã¡ã¤ã«ï¼.aï¼ãCGO_LDFLAGSã§æå®ãã¦ãã«ããããlibbpfã¯libelfã¨libzã«ä¾åããããããããã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã¦ããªãç°å¢ãæ³å®ãããªããlibelfã¨libzãèªåã§ãã«ããã¦ãã¤ããªã«å«ããã
libbpf APIãèªåã§å¼ã³åºãã®ãæéã§ããã°ãaquasecurity/libbpfgoã使ãããã ããlibbpfã®å ¨ã¦ã®APIãã©ããã³ã°ããã¦ããããã§ã¯ãªãããã使ãããAPIããµãã¼ãããã¦ãããã確èªããªããã°ãªããªãã
Pure Goã®ã©ã¤ãã©ãªã使ããããã°ãcilium/ebpfãDataDog/ebpfã使ãããã ããå·çæç¹ã§ã¯ãCO-REã«å¯¾å¿ãããã¦ããªããªã©ã®èª²é¡ãããã
Go + BPFã«ã¤ãã¦ã¯ã次ã®è¨äºã«ãæ´çããã¦ããã Getting Started with eBPF and Go | networkop
ã¾ããXDPã«ãã©ã¼ã«ã¹ããã¨ãã®Goã©ã¤ãã©ãªã®é¸æã«ã¤ãã¦ã¯ã@takemioIOããã«ãã次ã®è¨äºãåèã«ãªãã ãããGo+XDPãªéçºãå§ããã¨ãã«åèã«ãªãè¨äº/janog LT ãã©ãã¼ã¢ãã - ãè ¹.ããã¿ã
Rustè¨èªã«ããBPFããã°ã©ãã³ã°
ã·ã¹ãã ã½ããã¦ã§ã¢ç¨ã®ããã°ã©ãã³ã°è¨èªã¨ãã¦Rustã人æ°ã§ãããRustã§BPFããã°ã©ãã³ã°ããããã¨ãã人ã¯å¤ãã ãããèè ã¯Rustã®ããã°ã©ãã³ã°çµé¨ã¯ã»ã¨ãã©ãªããããæ¢åã®ãªã½ã¼ã¹ãç°¡åã«ç´¹ä»ããã«ã¨ã©ãã¦ããã
libbpf/libbpf-rsã¯libbpfã®Rustã©ããã¼ã§ãããlibbpfã«ã¯ä¾åããããlibbpfã®ææ°ã®æ©è½ã使ããããã
aya-rs/ayaã¯Rustã§ããã³ãã¨ã³ãããã°ã©ã ãæ¸ãããã®æè¿ã®BPFã©ã¤ãã©ãªã ãayaã«ãããlibbpfã«ãbccã«ãä¾åããã«ãlibcã®ã¿ã®ä¾åã§ãCO-REã«å¯¾å¿ãããã¤ããªãçæã§ããã
foniod/redbpfã¯ãããã³ãã¨ã³ãã§ã¯ãªããBPFããã°ã©ã ãRustã§æ¸ãããã®ãã¼ã«ã¨ã©ã¤ãã©ãªã§ããã
ãã®ä»ãRustã«ããBPFãã¬ã¼ã·ã³ã°ã«ã¤ãã¦ãid:udzura ããã®æ¬¡ã®ã¹ã©ã¤ããåèã«ãªããRustã§ä½ãLinuxãã¬ã¼ãµ / libbpf-core-with-rust - Speaker Deck
BPFããã°ã©ãã³ã°ã®çæäºé
èè ãæ°ã¥ããç¯å²ã§ã®BPFããã°ã©ãã³ã°ã®çæäºé ãç´¹ä»ããã
ã«ã¼ãã«ã»ã¦ã¼ã¶é並è¡æ§ ãã§ã«è¿°ã¹ãããã«ãBPFã¢ããªã±ã¼ã·ã§ã³ã¯ã«ã¼ãã«ã¨ã¦ã¼ã¶ç©ºéã®2種é¡ã®ããã°ã©ã ãmapãring bufferãªã©ã®ã«ã¼ãã«å ã®ãã¼ã¿æ§é ãçµç±ãã¦ãä¸æ¹åã¾ãã¯åæ¹åã«ãã¼ã¿ãå ±æããããã®ãããã«ã¼ãã«ã¨ã¦ã¼ã¶ã®ããããã®ããã°ã©ã ã§ä¸¦è¡ãã¦å¦çãè¡ãããããã¬ã¼ã·ã³ã°ã§ã¯ãã«ã¼ãã«ã¯MAPã«ãã¼ã¿ãæ´æ°ããã¦ã¼ã¶ãMAPã®èªã¿çµãã£ããã¼ã¿ãåé¤ãããã¨ããããããæ¸ãè¾¼ã¿ç«¶åãçºçããå¯è½æ§ããããBPF_LOOKUP_AND_DELETE_BATCHãªã©ã®ã¢ãããã¯ãªAPIã使ç¨ãã¦åé¿ã§ããã
ã«ã¼ãã«ã¹ã¬ããé並è¡æ§ ã«ã¼ãã«ã§ã¯è¤æ°ã®ã¹ã¬ãããå調ãã¦åä½ãã¦ãããã¹ã¬ããéã§ä¸¦è¡å¦çãè¡ããããkprobeã¨tracepointã§ã¢ã¿ãããããBPFããã°ã©ã ããç°ãªãã¹ã¬ããããåæã«å¼ã³åºããããã¨ãèæ ®ããå¿ è¦ããããmapã®æ§é ä½ã®ãã£ã¼ã«ãå¤æ°ã®ã¤ã³ã¯ãªã¡ã³ãæä½ãªã©ã¯ãã¢ãããã¯ã«æ´æ°ããå¿ è¦ããããã¢ãããã¯ãªæ´æ°ã«ã¯ã__atomic_add_fetch()ã使ç¨ã§ããã
ã¾ã¨ã
ãã®è¨äºã§ã¯ãBPFã®å®ç¾©ããå§ã¾ãããã¬ã¼ã·ã³ã°ã®æèã§ã®BPFã®ä½ç½®ä»ããBPFãã¬ã¼ã·ã³ã°ãæ§æããæè¡è¦ç´ ãBPFã¨BPFãã¬ã¼ã·ã³ã°ã®æ´å²ãBPFãã¬ã¼ã·ã³ã°ãã¼ã«ã®ããã°ã©ãã³ã°ã¾ã§ãæ¦è¦³ãããBPFã§ãã¼ã«ãã¤ãã£ã¦ã¿ããã¨æãç«ã£ãã¨ãã«ãå®è£ ã®ç´°é¨ã®è©¦è¡é¯èª¤ä»¥å¤ã§ã¯ãè¿·ãããªãããã«ä½ç³»çãªç¥èã¨ãã¦æ´çãããããã«å¿ãããã
æ¥æ¥ã®Ubuntu 22.04 LTSã®ãªãªã¼ã¹ããã£ããã«ãä»å¾ã¯ãããã©ã«ãã§CO-REããµãã¼ãããç°å¢ãå¢ãã¦ããã¯ãã ãããã«ä¼´ããBPFãã¬ã¼ã·ã³ã°ãã¼ã«ã®ãããã¤ã容æã«ãªããããBPFãã¬ã¼ã·ã³ã°ã¯ä¸å±¤æ®åãã¦ããã ããã
ãã¨ãã
åé ã§è¿°ã¹ãããã«ãç 究éçºåãã«çæ³ããææ³ãå®è£ ããããã«ãBPFãå¦ç¿ããå¿ è¦ããã£ããOSã«è¿ããä½ã¬ã¤ã¤ã®ããã°ã©ãã³ã°ã¯å¥½ãã§ã¯ãããã®ã®ãå¾æã¨ããã»ã©ã§ããªãããããããªãã®å¦ç¿ã³ã¹ãããã£ããCè¨èªã¯8å¹´ã¶ããããã«æ¸ããããã«æããBPFã®Cè¨èªã¯å¶ç´ãå¼·ããã³ã¼ãã«æãããªæ¬ é¥ãããã°BPF Verifierãæ¤åºãã¦ããããããCè¨èªèªä½ã«ã¯ããã»ã©è¦å´ããªãã£ããã«ã¼ãã«ã®ã³ã¼ãã®ã©ã®ç®æãããã¯ããããã©ã®å¤æ°ããå¿ è¦ãªãã¼ã¿ãèªã¿åºããã¨ãã£ãã³ã¼ãã®ç解ã«ããè¦å´ããã
ä»å¹´ã®ååã«BPFã®è©±ã仲éå ã§ãã¦ãããã@deeeetããã¨@rrreeeyyyããããã¹ãããe34.fmã«åºæ¼ããã¦ããã£ãããã®ã¨ãã«ãBPFã®åºæ¬ã¨å¿ç¨ä¾ããããªãã«èª¿æ»ãã¦ããã®ã§ããã®ãã¡ãããã¹ãã«ã¾ã¨ãããã¨æã£ããã®ã®ããã®ã¾ã¾ã«ãªã£ã¦ããå 容ãä»å¹´ã®ãã¡ã«ã¾ã¨ãããã¨ãã§ãã¦ããã£ããe34.fmã§ã¯è§¦ãããªãã£ãBPFãã¬ã¼ã·ã³ã°ã®å®è£ ã«è¸ã¿è¾¼ãã 話ãæ´çã§ããã
ä»å¹´ã®æ¥é ãããåè·ã®ååãã¡ã«ããBPF Performance Tools2ã®è¼ªèªä¼ã«åå ããã¦ããã£ã¦ããããã®æ¬ã®å¾åã¯ãCPUã»ã¡ã¢ãªã»ãã¡ã¤ã«ã·ã¹ãã ã»ãã£ã¹ã¯ã»ãããã¯ã¼ã¯ã«ã¤ãã¦ãBCCã®æ§è½åæãã¼ã«ãã²ãããã«ç´¹ä»ããã¦ãããã²ã¨ã¤ãã¤èªãã§ããã®ãè¦è¡ã«æãã¦ã¯ãããã®ã®ãBPFãã¬ã¼ã·ã³ã°ã§ã©ããããã¨ãã§ããã®ãããã¬ã¼ã·ã³ã°çµæã®è¡¨ç¤ºå½¢å¼ããã¬ã¼ã·ã³ã°ã®ãªã¼ãããããkprobeã¨tracepointã®ããããã«ã¢ã¿ããããã¨ãã®å©ç¹ã¨æ¬ ç¹ã®èæããããã§æ´ãã¤ã¤ãããï¼Thanks to id:masayoshi, id:dekokun, id:hokkai7go, id:hayajo_77ï¼
ãã®è¼ªèªä¼ã®ãªãã§ã6年以ä¸åã®æç³»åãã¼ã¿ãã¼ã¹ã®ãã£ã¹ã¯I/Oé¢é£ã®ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ã«ãBPFã使ãã¦ããã°ãªãã¨ä½åº¦ãåé²ãã¦ããMackerelã«ãããæç³»åãã¼ã¿ãã¼ã¹ã®æ§è½æ¹å / Performance Improvement of TSDB in Mackerel - Speaker Deckãã¨ã¯ãããkprobeãtracepointã¯ãã以åããåå¨ãã¦ããã®ã§ãperfãSystemTapã使ãããªãã¦ããã°å¹çãããã©ãã«ã·ã¥ã¼ãã§ãã¦ãããããããªãã
ä»å¾ã¯BPFãæ´»ç¨ãã¦ããããä¸æ¹ã§ã2010年代å¾åã®BPFãæ®åããææã¨åææã«ãã¯ã©ã¦ãã®åéã§ã¯ãOSãããä¸ä½å±¤ã®ã½ããã¦ã§ã¢ãæ½è±¡åãã¦ãµã¼ãã¹åããããã¼ã¸ããµã¼ãã¹ãæ®åãã¦ãããã¨ã¯è¦éããªããå¤ãã®ããã¼ã¸ããµã¼ãã¹ã¯ãå©ç¨è ãLinuxã«ã¼ãã«ãã¢ã¯ã»ã¹ãã¨ãå¶éãã¦ãããããBPFã使ããã¨æã£ã¦ã使ããªããã使ãå¿ è¦ãããªããã¨ããããããã¼ã¸ããµã¼ãã¹ã¯æ¥µãã¦ä¾¿å©ã§ãå®åä¸ã¯ä½¿ããªãæã¯ãªãã®ã ãã©ãã·ã¹ãã ã½ããã¦ã§ã¢ã®é åã§ãèªåã®ã¢ã¤ãã¢ã§ãªã«ããã¤ããããããªä½å°ãå¾ã ã«çã¾ã£ã¦ããããã«æããèªåããããå®åä¸ã®å©ä¾¿æ§ãç¡è¦ãããã¨ã¯é£ããããBPFãWASMã®ãããªã¦ã¼ã¶ã¼ãæ¡å¼µå¯è½ãªæè¡ã®ä¸ã«ãã·ã¹ãã ã½ããã¦ã§ã¢ã«é¢å¿ã®ããç 究è ãæè¡è ãèªåã®ã¢ã¤ãã¢ãåµé ã§ãããããªä¸çã§ãã£ã¦ã»ããã¨é¡ãã
åèæç®
- [1]: Brendan Gregg, "Systems Performance", Pearson, ed. 1st, 2013. â©
- [2]: Brendan Gregg, "BPF Performance Tools", Addison-Wesley Professional, 2019. â©
- [3]: David Calavera, and Fontana Lorenzo, "Linux Observability with BPF: Advanced Programming for Performance Analysis and Networking", O'Reilly Media, 2019. â©
- [4]: The Linux Foundation, eBPF - Introduction, Tutorials & Community Resources, https://ebpf.io/, 2021. â©
- [5]: Steven McCanne, and Van Jacobson, "The BSD Packet Filter: A New Architecture for User-level Packet Capture." USENIX winter. Vol. 46. 1993. â©
*1:è¶ é«éãªãã±ããI/Oãã¬ã¼ã ã¯ã¼ã¯ netmap ã«ã¤ã㦠- ããããããã°ãGPUãç¨ããSSLãªãã¼ã¹ãããã·ã®å®è£ ã«ã¤ã㦠- ããããããã°ãLinuxã§ãã¼ããã©ã³ãµããã£ãã·ã¥ãµã¼ãããã«ãã³ã¢ã¹ã±ã¼ã«ãããããã®ã«ã¼ãã«ãã¥ã¼ãã³ã° - ããããããã°
*2:"BPF Performance Tools"èªä½ã«ã¤ãã¦ã¯ãid:go_vargoããã«ããç±éã®ããææ³ãæ¸ããã¦ããã BPF Performance Toolsãèªãã ææ³ - go_vargoã®ããã°
*3:ãã®è¡¨ã«ãªãBPF_PROG_TYPE_TRACINGããããããå ¨ã¦ã®ããã°ã©ã ã¿ã¤ããè¨è¼ããã¦ããããã§ã¯ãªããããããªã
*4:Andrii Nakryikoã®ã¹ã©ã¤ãã§ã¯ããã®æ§è³ªã'"On the fly" compilation'ã¨å¼ãã§ããã