Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Programming RbBCC
Search
KONDO Uchio
July 17, 2020
Technology
0
580
Programming RbBCC
@ Ruby Association Activity Report
https://rubyassociation.doorkeeper.jp/events/107156
KONDO Uchio
July 17, 2020
Tweet
Share
More Decks by KONDO Uchio
See All by KONDO Uchio
大規模レガシーテストを 倒すための CI基盤の作り方 / #CICD2023
udzura
5
2.3k
Ruby x BPF in Action / RubyKaigi 2022
udzura
0
190
Narrative of Ruby & Rust
udzura
0
170
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.6k
Talk of RBS
udzura
0
390
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
710
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
670
Device access filtering in cgroup v2
udzura
1
770
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
720
Other Decks in Technology
See All in Technology
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
750
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
200
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
110
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
Can We Measure Developer Productivity?
ewolff
1
150
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
120
Featured
See All Featured
Writing Fast Ruby
sferik
627
61k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
How STYLIGHT went responsive
nonsquared
95
5.2k
Adopting Sorbet at Scale
ufuk
73
9.1k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
How to Ace a Technical Interview
jacobian
276
23k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
It's Worth the Effort
3n
183
27k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Transcript
-JOVYͷτϨʔγϯάٕज़Λ $3VCZ͔Βར༻͢Δڥͷඋ 6DIJP,POEP(.01FQBCP *OD !3VCZ"TTPDJBUJPO"DUJWJUZ3FQPSU 1SPHSBNNJOH3C#$$
େࣄͳ͓Βͤ
3C#$$ຊϦϦʔε 3C#$$ 3VCZͰಈ͖·ͤΜ pEEMF** charܕʹͳ͍ͬͯΔҾʹ ۭจࣈΛ͢ͱɺ0,ɺ4&(7
wۙ౻Ӊஐ࿕,POEP6DIJP w(.0ϖύϘٕज़ج൫νʔϜ wຊۀ%VPMJOHPͱ0WFSDPPLFE wझຯ-JOVYɺ$POUBJOFSTɺγεϓϩ w3VCZ,BJHJ
ΞδΣϯμ wF#1'ͱ3C#$$ͷհʢdNʣ wຊॿʹΑΔՌͷհʢdNʣ w؆୯ͳ3C#$$ͷϥΠϒίʔσΟϯάʢNdʣ w·ͱΊɺࠓޙʢdNʣ
F#1'ͷ
F#1'ͱ w#FSLFMFZ1BDLFU'JMUFS wຊདྷɺύέοτϑΟϧλͷͨΊͷΞϧΰϦζϜɾٕज़ͷ໊લ wʹ-JOVYʹҠ২͞ΕɺMJCQDBQͷதͳͲͰར༻ wঃʑʹTFDDPNQɺΧʔωϧΠϕϯττϨʔεʹར༻͞ΕΔ
Ͱ͖Δ͜ͱ wF#1'ɺಠࣗͷ໋ྩηοτΛ࣋ͭ7.ͱߟ͑ͯྑ͍ɻ wΧʔωϧͷதͰಈ͍ͯɺߴʹ༷ʑͳͷΛϑΟϧλϦϯά͢Δ wύέοτϑΟϧλʔʢUDQEVNQɺUDɺ9%1ʣ wγεςϜίʔϧͷϑΟϧλʔʢTFDDPNQʣ wΧʔωϧΠϕϯτͷϑΟϧλʔʢ#$$CQGUSBDFʣ wͦͷଞʢDHSPVQͷσόΠεΞΫηε੍ޚͰͬͨΓʣ
IUUQXXXCSFOEBOHSFHHDPNCMPHCQGQFSGPSNBODFUPPMTCPPLIUNM
#$$ͱʁ wF#1'ͷϓϩάϥϜΛಈ͔͢ʹɺCQG γεςϜίʔϧʹόΠτ ίʔυΛ͢ܗʹͳΔɻόΠτίʔυΛਓ͕ॻ͘ͷ͍͠ wͦ͜Ͱ#1'$PNQJMFS$PMMFDUJPO w$ϕʔεͷҰछͷ%4-ʴεΫϦϓτݴޠʢ1ZUIPOɺ-VBͷϥΠϒϥϦ ΛಉࠝʣͰF#1'ͷπʔϧΛॻ͘͜ͱ͕Ͱ͖Δ
طଘٕज़ͱͷҧ͍ wطଘͷτϨʔγϯάٕज़͕͍͔ͭ͋͘Δ wTUSBDF HECQUSBDF ϕʔεͷͷɺҰॠࢭΊͯݕࠪ͢ΔΞʔΩςΫνϟ ͳͷͰɺΦʔόʔϔου͕ແࢹͰ͖ͳ͍ϨϕϧʹͳΔ wQFSGجຊతʹूܭ͕ϢʔβϥϯυͳͷͰɺෛՙʹͳΔ͜ͱ͕͋Δ wTZUFNUBQ GUSBDFF#1'ͱಉͷιʔεΛ͍ΠϕϯτΛऔΔɻͨͩɺ
F#1'ͷ࣋ͭόϦσʔγϣϯʹΑΔ҆શੑɺΧʔωϧଆͰͷूܭʹΑΔߴੑ ͳͲϝϦοτ͔
ൺֱਤ 5PPMT 3FMBUFETZTDBMMT 4JEF&⒎FDU /PUF gdb strace ptrace(2) େ ରΛҰ࣌తʹࢭΊͯɺ
ใΛऔಘ͠࠶։͢Δ perf perf_event_open(2) தʙখ جຊతʹूܭ͔Βઌ Ϣʔβϥϯυ systemtap ftrace (kern module) (tracefs) தʙখ F#1'ΑΓݹΊͷΧʔωϧ Ͱར༻Մೳ bpftrace BCC bpf(2) perf_event_open(2) খ WBMJEBUPSɺ#1'NBQͳͲ ར༻ՄɺݴޠόΠϯσΟϯάଟ
طଘٕज़ͱͷҧ͍ wF#1'ΧʔωϧͰϓϩάϥϜΛಈ͔͢Έ wΧʔωϧͰϓϩάϥϜΛಈ͔͢ͱ͍͏ҙຯͰૉʹϞδϡʔϧΛॻ ͘͜ͱͰ͖Δ wΧʔωϧϞδϡʔϧવɺඇৗʹଟ͘ͷ͜ͱ͕Մೳ͕ͩɺόά ةݥͳίʔυ࣮ߦՄೳͰɺΧʔωϧύχοΫͷڪΕ͕͋Δ wF#1'ͷ࣮ߦػߏʹWFSJpFS͕ଘࡏ͠ɺةݥͳίʔυΛݕ͢Δ ʢFHແݶϧʔϓʣ
IUUQXXXCSFOEBOHSFHHDPNCMPHCQGBOFXUZQFPGTPGUXBSFIUNM
F#1'ࣗମͷઆ໌ࢿྉʢࢀߟʣ wIUUQTTQFBLFSEFDLDPNDIJLVXBJUMFBSOFCQG
Ϟνϕʔγϣϯ
#$$ͱʢ࠶ܝʣ wF#1'ͷϓϩάϥϜΛಈ͔͢ʹɺCQG γεςϜίʔϧʹόΠτ ίʔυΛ͢ܗʹͳΔɻόΠτίʔυΛਓ͕ॻ͘ͷ͍͠ wͦ͜Ͱ#1'$PNQJMFS$PMMFDUJPO w$ϕʔεͷҰछͷ%4-ʴεΫϦϓτݴޠʢ1ZUIPOɺ-VBͷϥΠϒϥϦ ΛಉࠝʣͰF#1'ͷπʔϧΛॻ͘͜ͱ͕Ͱ͖Δ
͑ͬ3VCZ
ॻ͔͘͠ͳ͍ ʢ͍ͭͰʹษڧ͠Α͏ʣ
F#1'Y3VCZͷϞνϕʔγϣϯ w3VCZΛಈ͔͢04ͱͯ͠ॏཁͳɺ-JOVYͷਐԽͷԸܙΛɺ3VCZ։ൃऀ ʢݴޠίΞ։ൃऀɺϢʔβ྆ํʣ͕ڗडͰ͖ΔΑ͏ʹ͍ͨ͠ w3C#$$Ͱɺ3VCZίΞ։ൃऀͷڞ௨ݴޠͰ͋Δ$ݴޠͱ3VCZͷ ͚ࣝͩͰෳࡶͳτϨʔγϯά͕Ͱ͖ΔΑ͏ʹͳΔ w%4-ͷΑ͏ͳΈͱΈ߹ΘͤΔ͜ͱͰɺτϨʔγϯάΛͬͱ &OKPZBCMFͳͷʹͰ͖ͳ͍͔
Ռ
ୡͨ͜͠ͱ w#$$ͷ1ZUIPO࣮Λ࣮༻ʹेͳػೳʹ͍ͭͯ3VCZʹҠ২ͨ͠ wαϯϓϧϓϩάϥϜɺԿΑΓνϡʔτϦΞϧΛ࡞ͨ͠ wຊޠ൛νϡʔτϦΞϧؚΉ w3C#$$Λར༻ͨ͠1P$Ϩϕϧͷ࣮ྫɾπʔϧΛ։ൃ
#$$3C#$$ w#$$ جຊతʹ MJCCDDͷ''*
#$$3C#$$ w3VCZඪ४ͷ pEEMFͰ 1ZUIPOͷ DUZQFTΛஔ
pEEMFͷར༻ w3C#$$3VCZͷඪ४ϥΠϒϥϦͷΈͰಈ࡞͢Δ ʢͪΖΜMJCCDDTP͕ೖ͍ͬͯΔલఏͰ͋Δɻϔομෆཁʣ
1ZUIPO൛ͷϦϑΝϨϯεʹ͋Δؔཏ
αϯϓϧ͍͔ͭ͘ɺνϡʔτϦΞϧ
ຊޠνϡʔτϦΞϧ
1ZUIPO൛ͱͷൺֱ wఏग़ͨ͠࠷ऴใࠂΛ͝ཡ͍ͩ͘͞
։ൃͨ͠πʔϧ#1'2- wCQGUSBDFͷ͋ͷݴޠͰͳ͘:".-3VCZͰτϨʔεͰ͖ΔίϚϯυ CQGUSBDF #1'2-3VCZ%4-
ಈը
։ൃͨ͠πʔϧ3BDL' w64%5ʢޙड़ʣΛར༻͠ɺ3BDL.JEEMFXBSFʹ1SPCFΛࠐΈܭଌ ूܭ͢Δαϯϓϧ
3BDL'ͷಈ࡞ݪཧ w੍ݶεϨουʹϦΫΤετͱ͍͏લఏ͕͋Δ
ಈը
3C#$$ͷ ར༻ʹ͋ͨͬͯ
ϙΠϯτ͍͔ͭ͘ wΠϕϯτιʔεͰओཁͳͷͭ͋Δɺ͓ͬͯ͘ wLQSPCFɺUSBDFQPJOUɺVQSPCFɺ64%5 wΠϯετʔϧखॱͳͲ(FUUJOH4UBSUFEͰ6CVOUVָ͕ wMJCCDDͷόʔδϣϯɹਪ0, wιϑτΣΞͷੑ্࣭ɺ୯७ʹ%PDLFSԽͮ͠Β͍ w݁ہΓ͍ͨͷϗετ͕Ͳ͏ͳͬͯΔ͔ͩͬͨΓ͢ΔΜͰ
LQSPCFLSFUQSPCF wΧʔωϧ෦ͷؔΛѻ͏QSPCFɻ wόʔδϣϯͰΠϯλϑΣʔε͕มΘΔ͔͠Εͳ͍ɻ wLQSPCF͕ؔΤϯλʔ࣌ɺLSFUQSPCF͕Ϧλʔϯ࣌ wͲͷΑ͏ͳLQSPCF͕ԿʹΘΕ͍ͯΔ͔αϯϓϧͰษڧ
USBDFQPJOU w3VCZͷ5SBDF1PJOUͱҧ͏֓೦Ͱɺ-JOVYͷQSPCFͷ͜ͱ wΧʔωϧʹ੩తʹΈࠐ·Εɺ໊લҾجຊతʹมΘΒͳ͍ wυΩϡϝϯτ͕ίϝϯτʹ͋Δ߹͋Δ wαϯϓϧͰͷΘΕํΛݟΔ΄͏͕ૣ͍͜ͱ͕ଟ͍ wྫ wTZTDBMMTTZT@FOUFS@ cTZT@FYJU@ γεςϜίʔϧͷ͍͔͚ wSBOEPNVSBOEPN@SFBEVSBOEPNͷಡΈऔΓ
wTDIFETDIFE@QSPDFTT@FYJUϓϩηεͷऴྃͳͲ
VQSPCFVSFUQSPCF wϢʔβϓϩάϥϜͷؔͳͲʹϑοΫͨ͠ΠϕϯτΛɺΧʔωϧͰ ͍͔͚ΒΕΔػೳɻ wجຊతʹFYQPSU͞ΕͯΔγϯϘϧΛQSPCF͢Δ wͪ͜ΒVQSPCF͕ΤϯλʔɺVSFUQSPCF͕Ϧλʔϯ
64%5 wϢʔβϓϩάϥϜͷҙͷՕॴʹQSPCFΛຒΊࠐΉػೳɻ wͲ͜ʹຒΊࠐ·Ε͍ͯΔ͔&-'ϔομͰ֬ೝͰ͖Δɻ wτϨʔε༗ޮ࣌ʹॳΊͯτϨʔε໋ྩ͕ಈ࡞͠ɺීஈOPQ໋ྩʹ ͳ͍ͬͯΔɻ͕ͨͬͯ͠ແޮ࣌Φʔόϔου͕ͳ͍ɻ
3VCZͷ64%5 w--enable-dtraceΦϓγϣϯΛ༗ޮʹͯ͠Ϗϧυ͢Ε༗ޮʹ wSCFOWͳΒɺ36#:@$0/'*(63&@0154ڥมͰࢦఆ wԿ͕ຒ·͍ͬͯΔ͔%5SBDFଆͷυΩϡϝϯτΛࢀর wTFFʮ3VCZͷ%5SBDFͷհʯ w IUUQTNBHB[JOFSVCZJTUOFUBSUJDMFT4QFDJBMEUSBDFIUNM w 8JLJIUUQTCVHTSVCZMBOHPSHQSPKFDUTSVCZXJLJ%5SBDF1SPCFT
3VCZͷ64%5
ϥΠϒͰͷ πʔϧ࡞σϞ
Ͳ͏ʂ VE[VSBͰ͢
ࠓޙͷల ʢ͕࣌ؒ͋Εʣ
3FE%BUB5PPMT࿈ܞ w۩ମతʹɺ$IBSUZͷσʔλߏʹɺ3C#$$ʹ͓͚Δ#1'NBQΛ දݱͨ͠ΫϥεΛରԠ͍ͤͨ͞ w$IBSUZ5BCMF"EBQUFST#$$తͳΞμϓλΛ࣮͢ΔͱΑ͍ w$IBSUZͷࢿ࢈Λͦͷ··ͬͯʢFHVOJDPEF@QMPUSCʣ τϨʔε݁ՌͷՄࢹԽ͕Ͱ͖Δ
ωοτϫʔΫτϨʔεपล wຊՈͷFYBNQMFTOFUXPSLJOHԼʹ͋ΔΑ͏ͳαϯϓϧͷҠ২ wগ͚ͩ͠։͍࢝ͯ͠Δ w9%1ྲྀߦͬͯΔͷͰ wطͷQZSPVUF૬ͷHFN͕3VCZʹͳ͍ͷͰɺҰ෦ͷαϯ ϓϧ؆୯ͳҠ২ͱ͍͏Θ͚ʹ͍͔ͣ·͍͠ɻ wOFUMJOLTPDLFUͱ͓͠ΌΓ͢ΔHFN͕ཉ͍͠ɻ
ͬͱকདྷVQTUSFBNͷߩݙ wকདྷJPWJTPSϓϩδΣΫτʹدଃ͠ɺ #$$։ൃίΞͱาௐΛ߹ΘͤΔͳͲ͍ͨ͠ wͦͷલʹ࣭Λ্͍͛ͨʢݴ͍༁ʣ wͲ͏͍͏खଓ͖ΛͱΕ͍͍ͷͩΖ͏ʁ w͜ͷࢿྉΛݟͨํͰॿݴ͕͋Εͱࢥ͍·͢
ँࣙ
ँࣙ wϝϯλʔͷాߞҰ͞Μ w͘͞ΒΠϯλʔωοτͷদຊ྄հ͞Μɺभେֶใج൫ݚڀ։ൃ ηϯλʔͷౢ٢ོઌੜɺּݪٛߊઌੜ wಛʹɺ#1'2-ౢ٢ઌੜͷΞυόΠεΛԼෑ͖ʹ͍ͯ͠·͢
&OKPZ 5SBDJOH