Pro Yearly is on sale from $80 to $50! »

BCC(BPF Compiler Collection) for Ruby

BCC(BPF Compiler Collection) for Ruby

BCCをRubyから使えるようにした話

@ Kernel/VM探検隊online #1
https://connpass.com/event/175388/

demo: https://www.youtube.com/watch?v=xNUN9vdgASI

2cf373725ded741824c50fd571eda6e1?s=128

KONDO Uchio

June 06, 2020
Tweet

Transcript

  1. ۙ౻͏͓ͪ,FSOFM7.୳ݕୂPOMJOFQBSU! #$$Λ3VCZͰ
 ࢖͑ΔΑ͏ʹͨ͠࿩

  2. GMOϖύϘ ΤϯδχΞ ۙ౻ Ӊஐ࿕ / @udzura Uchio Kondo ٕज़෦ ٕज़ج൫νʔϜ

    * Ruby, Containers, eBPF Novice * Author of Haconiwa
 (a container runtime built upon mruby) * Duolingo 363 Days Streaker
 * Animal Crossing Blue Rose Grower
  3. F#1'

  4. FYUFOEFE#FSLFMFZ1BDLFU'JMUFS w໊લͷ௨Γ΋ͱ΋ͱύέοτϑΟϧλϦϯάʹར༻ʢD#1'ʣ wΧʔωϧ಺෦ͰύέοτΛϑΟϧλͯ͠ޮ཰Α͘ w-JOVYͰύέοτҎ֎ͷϑΟϧλϦϯάʹ΋༻͍ΒΕΔΑ͏ʹͳͬͨ wTFDDPNQNPEFʢ-JOVYʙʣγεςϜίʔϧͷϑΟϧλ w-JOVY͔ΒΑΓ൚༻తʹ࢖͑ΔΑ͏ʹʹF#1' wݱࡏɺύέοτɺγεςϜίʔϧɺΧʔωϧτϨʔγϯάͳͲ

  5. IUUQXXXCSFOEBOHSFHHDPNCMPHCQGQFSGPSNBODFUPPMTCPPLIUNM

  6. IUUQXXXCSFOEBOHSFHHDPNCMPHCQGBOFXUZQFPGTPGUXBSFIUNM

  7. None
  8. 5PPMT 3FMBUFETZTDBMMT 4JEF&⒎FDU gdb strace ptrace(2) େ perf perf_event_open(2) தʙখ

    bpftrace BCC bpf(2) perf_event_open(2) খ طଘͷπʔϧͱͷൺֱ ˞ൃද࣌ΑΓิ଍GUSBDF TZTUFNUBQͳͲ΋͋Γ·͢
  9. #$$

  10. #1'$PNQJMFS$PMMFDUJPO wF#1'ͰΧʔωϧτϨʔγϯά΍ωοτϫʔΫϑΟϧλʔͷͨΊͷ
 ϓϩάϥϜΛޮ཰Α͘࡞ΔͨΊͷπʔϧΩοτ wʴ#$$Λ࢖ͬͨ؆୯ͳτϨʔεπʔϧ܈ wCQG  γεςϜίʔϧʹ͸جຊόΠτίʔυ͔͠౉ͤͳ͍ͨΊ wJPWJTPSϓϩδΣΫτͰ։ൃத

  11. None
  12. 1ZUIPO -VB

  13. 3VCZͰ΋ ࢖͑ͳ͍͔ͳʁ

  14. None
  15. None
  16. 1ZUIPOͷίʔυ 

  17. 3VCZͷίʔυ 

  18. #$$3VOOJOH%FNP 1ZUIPOc3VCZ

  19. Ͳ͜·Ͱ࢖͑Δͷʁ

  20. None
  21. #1'2- w˞USBDFQPJOUͷΈ

  22. ͪͳΈʹ

  23. νϡʔτϦΞϧͷ3VCZ൛͕͋Γ·͢ w1ZUIPO൛ʹͳ͍೔ຊޠ൛΋

  24. ࠓ͙͢ʂ gem install rbbcc # libbcc ΛͲ͏ʹ͔͜͏ʹ͔Πϯετʔϧͨ͠ޙͰ

  25. ࢀߟ wʮF#1'ͷ঺հʯ wIUUQTRJJUBDPNTHNBUTVNPUPJUFNTECEEGB wʮ#FSLFMFZ1BDLFU'JMUFSʢ#1'ʣೖ໳ʯγϦʔζ wIUUQTXXXBUNBSLJUDPKQBJUTFSJFT

  26. ँࣙ w3VCZΞιγΤʔγϣϯͷօ༷ w೥౓3VCZΞιγΤʔγϣϯ։ൃॿ੒ϓϩδΣΫτͰ͢ɻ w࡫ాߞҰ͞Μɺদຊ྄հ͞Μ͸͡ΊΞυόΠεΛͩͬͨ͘͞օ༷

  27. 13 wIUUQTSVCZBTTPDJBUJPOEPPSLFFQFSKQFWFOUT