SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
Go execution tracer
Gophercon Brazil 2017
André Carvalho
$ whoami
• Developer @ globo.com /
tsuru
• Interested in all things
performance, tracing and
systems programming
• @andresantostc
• https://andrestc.com
Agenda
• The tool basics
• What is the Go execution tracer
• How to collect trace data
• How to analyze trace data
• Using the tracer
• to improve working code
• to investigate a strange behavior
Go execution tracer
• Gives insight into the execution of a Go program
• What are my goroutines doing when not in CPU?
• Instruments the go runtime
• Captures events in nanosecond precision
• Data is not aggregated/sampled!
• Available since go 1.5
Go execution tracer
• Events
• Goroutines creation/start/end/block/unblock
• Network
• Syscalls
• Memory allocation
• Garbage collection
Collecting traces
• Three ways to collect traces
• trace.Start / trace.Stop
• go test -trace=trace.out
• debug/pprof/trace handler
Collecting traces
• Writes the tracing output to
os.Stderr
• go run main.go 2> trace.out
• go tool trace trace.out
Trace
View Trace
1. Timeline
2. Heap usage
3. goroutines
1
2
3
4
5
4. OS threads
5. Virtual Processors
6. goroutine + events
6
View Trace
Selecting a goroutine
View Trace
Selecting an event
Tracing web applications
https://github.com/andrestc/go-tracing/tree/master/07-web
Using the tracer to
improve working code
Mandelbrot
CPU intensive calculations to
figure out each pixel’s color
https://github.com/campoy/
mandelbrot/
Pixel
Sequential
Sequential
One goroutine per pixel
One goroutine per pixel
One goroutine per pixel
One goroutine per column
Debugging a strange
test behavior
Planb
• github.com/tsuru/planb
• reverse proxy based of hipache
• One of tsuru’s key components
• Used extensively on globo.com
Planb
Planb
Host: app.cloud.com
Backend
Backend
Backend
Let’s trace it!
https://github.com/golang/go/issues/21204
Workaround
https://github.com/tsuru/planb/pull/35
Conclusions
• Go execution tracer helps understand concurrency
• Complements other tools (eg memory/cpu
profile)
• Not much documentation available
• Opportunity for contributions
Reference
• Using the go tracer to speed up fractal rendering
• Just for func #22
• Go Execution Tracer (Design Doc)
Slides and notes in english
will be available at
https://andrestc.com
Obrigado!

Mais conteúdo relacionado

Destaque

Introduction to OpenFlow, SDN and NFV
Introduction to OpenFlow, SDN and NFVIntroduction to OpenFlow, SDN and NFV
Introduction to OpenFlow, SDN and NFV
Kingston Smiler
 
2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...
2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...
2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...
Azamat Abdoullaev
 

Destaque (20)

numPYNQ @ NGCLE@e-Novia 15.11.2017
numPYNQ @ NGCLE@e-Novia 15.11.2017numPYNQ @ NGCLE@e-Novia 15.11.2017
numPYNQ @ NGCLE@e-Novia 15.11.2017
 
What in the World is Going on at The Linux Foundation?
What in the World is Going on at The Linux Foundation?What in the World is Going on at The Linux Foundation?
What in the World is Going on at The Linux Foundation?
 
Walk through an enterprise Linux migration
Walk through an enterprise Linux migrationWalk through an enterprise Linux migration
Walk through an enterprise Linux migration
 
Graduating To Go - A Jumpstart into the Go Programming Language
Graduating To Go - A Jumpstart into the Go Programming LanguageGraduating To Go - A Jumpstart into the Go Programming Language
Graduating To Go - A Jumpstart into the Go Programming Language
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
 
Communication hardware
Communication hardwareCommunication hardware
Communication hardware
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Server virtualization
Server virtualizationServer virtualization
Server virtualization
 
In-depth forensic analysis of Windows registry files
In-depth forensic analysis of Windows registry filesIn-depth forensic analysis of Windows registry files
In-depth forensic analysis of Windows registry files
 
SDN Architecture & Ecosystem
SDN Architecture & EcosystemSDN Architecture & Ecosystem
SDN Architecture & Ecosystem
 
OpenFlow
OpenFlowOpenFlow
OpenFlow
 
Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017
 
Network Virtualization
Network VirtualizationNetwork Virtualization
Network Virtualization
 
Introduction to OpenFlow, SDN and NFV
Introduction to OpenFlow, SDN and NFVIntroduction to OpenFlow, SDN and NFV
Introduction to OpenFlow, SDN and NFV
 
Scaling and Transaction Futures
Scaling and Transaction FuturesScaling and Transaction Futures
Scaling and Transaction Futures
 
2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...
2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...
2018 State of the Union Address: Rediscovering the American way: USA XXI: Fut...
 
Blockchain demystification
Blockchain demystificationBlockchain demystification
Blockchain demystification
 
High Performance TensorFlow in Production - Big Data Spain - Madrid - Nov 15 ...
High Performance TensorFlow in Production - Big Data Spain - Madrid - Nov 15 ...High Performance TensorFlow in Production - Big Data Spain - Madrid - Nov 15 ...
High Performance TensorFlow in Production - Big Data Spain - Madrid - Nov 15 ...
 
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
Jörg Schad - NO ONE PUTS Java IN THE CONTAINER - Codemotion Milan 2017
 
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
Andrea Tosatto - Kubernetes Beyond - Codemotion Milan 2017
 

Semelhante a Go Execution Tracer

Forensics WS Consolidated
Forensics WS ConsolidatedForensics WS Consolidated
Forensics WS Consolidated
Karter Rohrer
 
2_Big Data Sources part3-Day 1-B Tools.pptx
2_Big Data Sources part3-Day 1-B Tools.pptx2_Big Data Sources part3-Day 1-B Tools.pptx
2_Big Data Sources part3-Day 1-B Tools.pptx
ssuser87a462
 
Pekka_Aho_Complementing GUI Testing Scripts - Testing Assembly 2022.pdf
Pekka_Aho_Complementing GUI Testing Scripts -  Testing Assembly 2022.pdfPekka_Aho_Complementing GUI Testing Scripts -  Testing Assembly 2022.pdf
Pekka_Aho_Complementing GUI Testing Scripts - Testing Assembly 2022.pdf
FiSTB
 

Semelhante a Go Execution Tracer (20)

Tracer
TracerTracer
Tracer
 
A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning process
 
Что нам стоіт таск манагер построіт. Ігор Лущик. LvivPy #6
Что нам стоіт таск манагер построіт. Ігор Лущик. LvivPy #6Что нам стоіт таск манагер построіт. Ігор Лущик. LvivPy #6
Что нам стоіт таск манагер построіт. Ігор Лущик. LvivPy #6
 
Silicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in productionSilicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in production
 
Monitoring your API
Monitoring your APIMonitoring your API
Monitoring your API
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
Campus days 2013 - Instrumentation
Campus days 2013 - InstrumentationCampus days 2013 - Instrumentation
Campus days 2013 - Instrumentation
 
Scrapy
ScrapyScrapy
Scrapy
 
Forensics WS Consolidated
Forensics WS ConsolidatedForensics WS Consolidated
Forensics WS Consolidated
 
MW_Arch Fastest_way_to_hunt_on_Windows_v1.01
MW_Arch Fastest_way_to_hunt_on_Windows_v1.01MW_Arch Fastest_way_to_hunt_on_Windows_v1.01
MW_Arch Fastest_way_to_hunt_on_Windows_v1.01
 
Introducing ArTHIR - ATT&CK Remote Threat Hunting Incident Response Windows tool
Introducing ArTHIR - ATT&CK Remote Threat Hunting Incident Response Windows toolIntroducing ArTHIR - ATT&CK Remote Threat Hunting Incident Response Windows tool
Introducing ArTHIR - ATT&CK Remote Threat Hunting Incident Response Windows tool
 
Cloud Foundry Monitoring How-To: Collecting Metrics and Logs
Cloud Foundry Monitoring How-To: Collecting Metrics and LogsCloud Foundry Monitoring How-To: Collecting Metrics and Logs
Cloud Foundry Monitoring How-To: Collecting Metrics and Logs
 
Operating System Forensics
Operating System ForensicsOperating System Forensics
Operating System Forensics
 
2_Big Data Sources part3-Day 1-B Tools.pptx
2_Big Data Sources part3-Day 1-B Tools.pptx2_Big Data Sources part3-Day 1-B Tools.pptx
2_Big Data Sources part3-Day 1-B Tools.pptx
 
Keep Calm and Distributed Tracing
Keep Calm and Distributed TracingKeep Calm and Distributed Tracing
Keep Calm and Distributed Tracing
 
When Security Tools Fail You
When Security Tools Fail YouWhen Security Tools Fail You
When Security Tools Fail You
 
Pekka_Aho_Complementing GUI Testing Scripts - Testing Assembly 2022.pdf
Pekka_Aho_Complementing GUI Testing Scripts -  Testing Assembly 2022.pdfPekka_Aho_Complementing GUI Testing Scripts -  Testing Assembly 2022.pdf
Pekka_Aho_Complementing GUI Testing Scripts - Testing Assembly 2022.pdf
 
Hands-on go profiling
Hands-on go profilingHands-on go profiling
Hands-on go profiling
 
DEEPSEC 2013: Malware Datamining And Attribution
DEEPSEC 2013: Malware Datamining And AttributionDEEPSEC 2013: Malware Datamining And Attribution
DEEPSEC 2013: Malware Datamining And Attribution
 

Mais de André Carvalho

Mais de André Carvalho (7)

Containers na Globo.com - Passado, Presente e Futuro
Containers na Globo.com - Passado, Presente e FuturoContainers na Globo.com - Passado, Presente e Futuro
Containers na Globo.com - Passado, Presente e Futuro
 
Tsuru - Deploys Fáceis e Seguros
Tsuru - Deploys Fáceis e SegurosTsuru - Deploys Fáceis e Seguros
Tsuru - Deploys Fáceis e Seguros
 
Classificação de séries temporais via divergente entre densidades de probabil...
Classificação de séries temporais via divergente entre densidades de probabil...Classificação de séries temporais via divergente entre densidades de probabil...
Classificação de séries temporais via divergente entre densidades de probabil...
 
Instrumentando aplicações Go com Prometheus
Instrumentando aplicações Go com PrometheusInstrumentando aplicações Go com Prometheus
Instrumentando aplicações Go com Prometheus
 
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...
Um estudo sobre a aplicação de algoritmos genéticos no investimento em ações ...
 
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...
Uma comparação do desempenho de SGBDS de grafos com armazenamento nativo e SG...
 
Clusterização de padrões de candlesticks utilizando Mapas de Kohonen
Clusterização de padrões de candlesticks utilizando Mapas de KohonenClusterização de padrões de candlesticks utilizando Mapas de Kohonen
Clusterização de padrões de candlesticks utilizando Mapas de Kohonen
 

Último

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

Go Execution Tracer