SlideShare a Scribd company logo
guider: a system-wide
performance analyzer
Peace Lee
iipeace5@gmail.com
Introduction
• Dig deeper into your machine
Installation
• git
$ git clone https://github.com/iipeace/guider.git
$ cd guider
# make && make install
• pip
# pip install –pre guider
Contents
• A system-wide performance analyzer
– thread analysis
– function analysis
– real-time analysis
– file analysis
• Open-source contribution
– https://github.com/iipeace/guider
Requirement
• Linux kernel (>= 3.0)
• Python (>= 2.7)
• Kernel configuration
– CONFIG_FTRACE
– CONFIG_TRACING, CONFIG_TRACING_SUPPORT
– CONFIG_EVENT_TRACING
– CONFIG_TRACEPOINTS
– CONFIG_DYNAMIC_FTRACE
– CONFIG_FTRACE_SYSCALLS
– CONFIG_UPROBES, CONFIG_UPROBE_EVENT
– CONFIG_KPROBES, CONFIG_KPROBE_EVENTS
Thread analysis
# guider record -s ./
Input ctrl + c
# guider ./guider.dat -o ./ -a
View guider.out Save report file in current directory
Show all information
Save trace file in current directory
Thread analysis
• CPU usage of yes(29309) thread
– Running for 1,370ms(92.7%)
– Delayed for 200ms by preemption
– Preempted 231 times by other threads
Thread analysis
# guider record -s ./ -e mbi
Input ctrl + c
# guider ./guider.dat -o ./ -a
View guider.out
Save report file in current directory
Show all information
Save trace file in current directory
Trace also memory, block, irq
Thread analysis
• Memory and block usage of cat(28912) thread
– Allocated 17MB memory into user space
– Loaded 17MB file for 60ms
Thread analysis
• Family and signal of cat(31668) thread
– Created by bash(11562) after 1.727 sec from starting tracing
– Running for 10ms on CPU
– Let its parent bash(11562) wait for 67ms
– Sent SIGCHLD signal to bash(11562) at 1.794369 sec
Thread analysis
• Interrupts
– Check irq(88) and softirq(1, 3, 7, 9)
• Usage: total time for handling the interrupt
• ProcMax: maximum time for handling the interrupt
• ProcMin: minimum time for handling the interrupt
• InterMax: longest interval of the interrupt
• InterMin: shortest interval of the interrupt
Thread analysis
# guider record -s ./ -e mb
Input ctrl + c
# guider ./guider.dat -o ./ -a -i
View guider.out
Save report file in current directory
Show all information
Save trace file in current directory
Trace also memory and block
Show also interval information
Thread analysis
• Memory and block usage of cat(28912) thread
– Allocated 17MB memory into user space
– Loaded 17MB file for 60ms
Thread analysis
• Interval information
– Divided as each interval
• Default: 1 sec
– Check life cycle of threads
• N: New
• D: Die
• F: Fault
Thread analysis
# guider record -s ./ -t -u
# guider stop
# guider ./guider.dat -o ./ -a
View guider.out
Save report file in current directory
Show all information
Save trace file in current directory
Trace also systemcall
Run in background
Thread analysis
• Per-thread systemcall summary
Thread analysis
• Per-thread systemcall history
Thread analysis
• Restrictions
– Sufficient system memory is required to record events
• Long time recording will cause wrong result in poor memory system
• If you should record for long time then use -R option for recording
Contents
• A system-wide performance analyzer
– thread analysis
– function analysis
– real-time analysis
– file analysis
• Open-source contribution
– https://github.com/iipeace/guider
Requirement
• Linux kernel (>= 3.0)
• Python (>= 2.7)
• Kernel configuration
– CONFIG_FTRACE
– CONFIG_TRACING, CONFIG_TRACING_SUPPORT
– CONFIG_EVENT_TRACING
– CONFIG_TRACEPOINTS
– CONFIG_DYNAMIC_FTRACE
– CONFIG_FTRACE_SYSCALLS
– CONFIG_STACKTRACE, CONFIG_STACKTRACE_SUPPORT, CONFIG_USER_STACKTRACE_SUPPORT
– CONFIG_UPROBES, CONFIG_UPROBE_EVENT
– CONFIG_KPROBES, CONFIG_KPROBE_EVENTS
• Kernel patch
– ust_arm_apcs.patch (only for ARM)
Function analysis
• memTest()
– Alloc 10MB to memory
• diskTest()
– Read 10MB from disk
• cpuTest()
– Spin in a loop
Function analysis
$ gcc test.c -rdynamic -fno-omit-frame-pointer
# guider record -f -s ./ -e mb -u
$ ./a.out &
# guider stop
# guider ./guider.dat -o ./ -l $(which addr2line) -r /
View guider.out
Function mode
Save trace file in current directory
Trace also memory and block
Save report file in current directory
Set addr2line path
Set root path
Run in background
Function analysis
# guider ./guider.dat -o ./ -l $(which addr2line) -r / -g 30807
View guider.out
Function analysis
Function analysis
Function analysis
Function analysis
• diskTest()
– Open “testBin” file
• faultTest()
– Access violation
Function analysis
$ gcc test.c -rdynamic -fno-omit-frame-pointer
# guider record -f -s ./ -u –ep \
-K file:getname:NONE:**string, open:sys_open:NONE:, segflt:bad_area:NONE:
$ ./a.out &
# guider stop
# guider ./guider.dat -o ./ -l $(which addr2line) -r / -a
View guider.out
Trace getname function including return value
Save report file in current directory
Set addr2line path
Set root path
Trace sys_open function
Trace bad_area function to detect fault
Save trace data immediately
Show all information
Function analysis
# guider ./guider.dat -o ./ -l $(which addr2line) -r / -a -g 972
View guider.out
Function analysis
File names opened
Call sequence of open
Call sequence of segmentation fault
Function analysis
• Restrictions
– Target threads should be alive during profiling
• If target threads should be killed then use -e p option for recording
– Relevant binaries should be built with bellow options
• -rdynamic -fno-omit-frame-pointer
• -mapcs-frame (only for ARM)
– A kernel patch is needed to trace user stack
• ust_arm_apcs.patch (only for ARM)
– the max length of a call chain is restricted by 8
Contents
• A system-wide performance analyzer
– thread analysis
– function analysis
– real-time analysis
– file analysis
• Open-source contribution
– https://github.com/iipeace/guider
Real-time analysis
• Show real-time system status with processes
$ guider top
Real-time analysis
• Show real-time system status with threads
$ guider top -e t
Real-time analysis
• Show only specific processes
$ guider top -g chrome
Real-time analysis
• Show memory details of processes
$ guider top -e m
Real-time analysis
• Show all information every 3 second
$ guider top -a -i 3
Real-time analysis
• Show open files of specific processes
$ guider top -e f -g sshd, upstart
Real-time analysis
• Show stacks of specific processes
$ guider top -e s -g init
Real-time analysis
• Show system report
$ guider top -o ./ -u
$ guider stop
View guider.out
• System summary information
Set path of report file
Run in background
Real-time analysis
• CPU usage(%) per process in report
Real-time analysis
• Memory usage(MB) per process in report
Real-time analysis
• Memory details per process in report
Real-time analysis
• System statistics in report
Real-time analysis
• Show system graph and memory chart
$ guider top -e g -I guider.out
View guider_graph.png
Real-time analysis
• Show system graph and memory chart
$ guider top -e g -I guider.out
View guider_chart.png
Real-time analysis
• Restrictions
– It is possible that statistics of some process is loss
• Because sampling rate of real-time mode is bigger than 1 second
– Sampling rate that is shorter than 1 second is not supported
– Python matplotlib is required to draw graph and chart
Contents
• A system-wide performance analyzer
– thread analysis
– function analysis
– real-time analysis
– file analysis
• Open-source contribution
– https://github.com/iipeace/guider
File analysis
• Show usage of files mapped to processes
# guider record -F -o ./
File mode
Save report file in current directory
File analysis
• Show usage of files mapped to processes
# guider record -F -o ./ -i -u
# guider send
# guider send
# guider stop
View guider.out File mode
Save report file in current directory
Show diff of files
Run in background
Get diff of files between previous and current
Initial on-RAM file size
Total file size
diff on-RAM file size last on-RAM file size
Commands
• $ guider -h -a
Thanks 
https://github.com/iipeace/guider

More Related Content

What's hot

The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
Sasha Goldshtein
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
Sasha Goldshtein
 
Debugging node in prod
Debugging node in prodDebugging node in prod
Debugging node in prod
Yunong Xiao
 
Apache Pig: A big data processor
Apache Pig: A big data processorApache Pig: A big data processor
Apache Pig: A big data processor
Tushar B Kute
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
Prakash Dantuluri
 
Git hub
Git hubGit hub
Git hub
Nitin Goel
 
Low Overhead System Tracing with eBPF
Low Overhead System Tracing with eBPFLow Overhead System Tracing with eBPF
Low Overhead System Tracing with eBPF
Akshay Kapoor
 
Introduction to SLURM
Introduction to SLURMIntroduction to SLURM
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
AltaVista Search Engine Architecture
AltaVista Search Engine ArchitectureAltaVista Search Engine Architecture
AltaVista Search Engine Architecture
Changshu Liu
 
Using R on High Performance Computers
Using R on High Performance ComputersUsing R on High Performance Computers
Using R on High Performance Computers
Dave Hiltbrand
 
Slurm @ 2018 LabTech
Slurm @  2018 LabTechSlurm @  2018 LabTech
Slurm @ 2018 LabTech
Tin Ho
 
Spack - A Package Manager for HPC
Spack - A Package Manager for HPCSpack - A Package Manager for HPC
Spack - A Package Manager for HPC
inside-BigData.com
 
Sacándole jugo a git
Sacándole jugo a gitSacándole jugo a git
Sacándole jugo a git
Berny Cantos
 
Basic Git
Basic GitBasic Git
Basic Git
Knut Haugen
 
Git Basic
Git BasicGit Basic
Git Basic
Luke Luo
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
Daniel Kummer
 
BPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLabBPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLab
Taeung Song
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 

What's hot (20)

The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
Debugging node in prod
Debugging node in prodDebugging node in prod
Debugging node in prod
 
Apache Pig: A big data processor
Apache Pig: A big data processorApache Pig: A big data processor
Apache Pig: A big data processor
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 
Git hub
Git hubGit hub
Git hub
 
Low Overhead System Tracing with eBPF
Low Overhead System Tracing with eBPFLow Overhead System Tracing with eBPF
Low Overhead System Tracing with eBPF
 
Introduction to SLURM
Introduction to SLURMIntroduction to SLURM
Introduction to SLURM
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
AltaVista Search Engine Architecture
AltaVista Search Engine ArchitectureAltaVista Search Engine Architecture
AltaVista Search Engine Architecture
 
Using R on High Performance Computers
Using R on High Performance ComputersUsing R on High Performance Computers
Using R on High Performance Computers
 
Slurm @ 2018 LabTech
Slurm @  2018 LabTechSlurm @  2018 LabTech
Slurm @ 2018 LabTech
 
Spack - A Package Manager for HPC
Spack - A Package Manager for HPCSpack - A Package Manager for HPC
Spack - A Package Manager for HPC
 
Sacándole jugo a git
Sacándole jugo a gitSacándole jugo a git
Sacándole jugo a git
 
Basic Git
Basic GitBasic Git
Basic Git
 
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
 
Git Basic
Git BasicGit Basic
Git Basic
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
BPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLabBPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLab
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 

Similar to guider: a system-wide performance analyzer

Guider: An Integrated Runtime Performance Analyzer on AGL
Guider: An Integrated Runtime Performance Analyzer on AGLGuider: An Integrated Runtime Performance Analyzer on AGL
Guider: An Integrated Runtime Performance Analyzer on AGL
Peace Lee
 
systemd @ Facebook -- a year later
systemd @ Facebook -- a year latersystemd @ Facebook -- a year later
systemd @ Facebook -- a year later
Davide Cavalca
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
Brendan Gregg
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
維泰 蔡
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Brendan Gregg
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
Deepak Singhal
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Sysdig
 
Git basics
Git basicsGit basics
Git basics
Malihe Asemani
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
Kellyn Pot'Vin-Gorman
 
Advanced windows debugging
Advanced windows debuggingAdvanced windows debugging
Advanced windows debugging
chrisortman
 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
ssuser28de9e
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
Monitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance Analysis
Brendan Gregg
 
16aug06.ppt
16aug06.ppt16aug06.ppt
16aug06.ppt
zagreb2
 
Source Code Management systems
Source Code Management systemsSource Code Management systems
Source Code Management systems
xSawyer
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
Himani Singh
 
Live Memory Forensics on Android devices
Live Memory Forensics on Android devicesLive Memory Forensics on Android devices
Live Memory Forensics on Android devices
Nikos Gkogkos
 
2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurement2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurementPTIHPA
 
Airflow at lyft
Airflow at lyftAirflow at lyft
Airflow at lyft
Tao Feng
 

Similar to guider: a system-wide performance analyzer (20)

Guider: An Integrated Runtime Performance Analyzer on AGL
Guider: An Integrated Runtime Performance Analyzer on AGLGuider: An Integrated Runtime Performance Analyzer on AGL
Guider: An Integrated Runtime Performance Analyzer on AGL
 
systemd @ Facebook -- a year later
systemd @ Facebook -- a year latersystemd @ Facebook -- a year later
systemd @ Facebook -- a year later
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
Git basics
Git basicsGit basics
Git basics
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
 
Advanced windows debugging
Advanced windows debuggingAdvanced windows debugging
Advanced windows debugging
 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Monitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance Analysis
 
16aug06.ppt
16aug06.ppt16aug06.ppt
16aug06.ppt
 
Source Code Management systems
Source Code Management systemsSource Code Management systems
Source Code Management systems
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
 
Live Memory Forensics on Android devices
Live Memory Forensics on Android devicesLive Memory Forensics on Android devices
Live Memory Forensics on Android devices
 
2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurement2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurement
 
Airflow at lyft
Airflow at lyftAirflow at lyft
Airflow at lyft
 

Recently uploaded

GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 

Recently uploaded (20)

GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 

guider: a system-wide performance analyzer

  • 1. guider: a system-wide performance analyzer Peace Lee iipeace5@gmail.com
  • 2. Introduction • Dig deeper into your machine
  • 3. Installation • git $ git clone https://github.com/iipeace/guider.git $ cd guider # make && make install • pip # pip install –pre guider
  • 4. Contents • A system-wide performance analyzer – thread analysis – function analysis – real-time analysis – file analysis • Open-source contribution – https://github.com/iipeace/guider
  • 5. Requirement • Linux kernel (>= 3.0) • Python (>= 2.7) • Kernel configuration – CONFIG_FTRACE – CONFIG_TRACING, CONFIG_TRACING_SUPPORT – CONFIG_EVENT_TRACING – CONFIG_TRACEPOINTS – CONFIG_DYNAMIC_FTRACE – CONFIG_FTRACE_SYSCALLS – CONFIG_UPROBES, CONFIG_UPROBE_EVENT – CONFIG_KPROBES, CONFIG_KPROBE_EVENTS
  • 6. Thread analysis # guider record -s ./ Input ctrl + c # guider ./guider.dat -o ./ -a View guider.out Save report file in current directory Show all information Save trace file in current directory
  • 7. Thread analysis • CPU usage of yes(29309) thread – Running for 1,370ms(92.7%) – Delayed for 200ms by preemption – Preempted 231 times by other threads
  • 8. Thread analysis # guider record -s ./ -e mbi Input ctrl + c # guider ./guider.dat -o ./ -a View guider.out Save report file in current directory Show all information Save trace file in current directory Trace also memory, block, irq
  • 9. Thread analysis • Memory and block usage of cat(28912) thread – Allocated 17MB memory into user space – Loaded 17MB file for 60ms
  • 10. Thread analysis • Family and signal of cat(31668) thread – Created by bash(11562) after 1.727 sec from starting tracing – Running for 10ms on CPU – Let its parent bash(11562) wait for 67ms – Sent SIGCHLD signal to bash(11562) at 1.794369 sec
  • 11. Thread analysis • Interrupts – Check irq(88) and softirq(1, 3, 7, 9) • Usage: total time for handling the interrupt • ProcMax: maximum time for handling the interrupt • ProcMin: minimum time for handling the interrupt • InterMax: longest interval of the interrupt • InterMin: shortest interval of the interrupt
  • 12. Thread analysis # guider record -s ./ -e mb Input ctrl + c # guider ./guider.dat -o ./ -a -i View guider.out Save report file in current directory Show all information Save trace file in current directory Trace also memory and block Show also interval information
  • 13. Thread analysis • Memory and block usage of cat(28912) thread – Allocated 17MB memory into user space – Loaded 17MB file for 60ms
  • 14. Thread analysis • Interval information – Divided as each interval • Default: 1 sec – Check life cycle of threads • N: New • D: Die • F: Fault
  • 15. Thread analysis # guider record -s ./ -t -u # guider stop # guider ./guider.dat -o ./ -a View guider.out Save report file in current directory Show all information Save trace file in current directory Trace also systemcall Run in background
  • 16. Thread analysis • Per-thread systemcall summary
  • 17. Thread analysis • Per-thread systemcall history
  • 18. Thread analysis • Restrictions – Sufficient system memory is required to record events • Long time recording will cause wrong result in poor memory system • If you should record for long time then use -R option for recording
  • 19. Contents • A system-wide performance analyzer – thread analysis – function analysis – real-time analysis – file analysis • Open-source contribution – https://github.com/iipeace/guider
  • 20. Requirement • Linux kernel (>= 3.0) • Python (>= 2.7) • Kernel configuration – CONFIG_FTRACE – CONFIG_TRACING, CONFIG_TRACING_SUPPORT – CONFIG_EVENT_TRACING – CONFIG_TRACEPOINTS – CONFIG_DYNAMIC_FTRACE – CONFIG_FTRACE_SYSCALLS – CONFIG_STACKTRACE, CONFIG_STACKTRACE_SUPPORT, CONFIG_USER_STACKTRACE_SUPPORT – CONFIG_UPROBES, CONFIG_UPROBE_EVENT – CONFIG_KPROBES, CONFIG_KPROBE_EVENTS • Kernel patch – ust_arm_apcs.patch (only for ARM)
  • 21. Function analysis • memTest() – Alloc 10MB to memory • diskTest() – Read 10MB from disk • cpuTest() – Spin in a loop
  • 22. Function analysis $ gcc test.c -rdynamic -fno-omit-frame-pointer # guider record -f -s ./ -e mb -u $ ./a.out & # guider stop # guider ./guider.dat -o ./ -l $(which addr2line) -r / View guider.out Function mode Save trace file in current directory Trace also memory and block Save report file in current directory Set addr2line path Set root path Run in background
  • 23. Function analysis # guider ./guider.dat -o ./ -l $(which addr2line) -r / -g 30807 View guider.out
  • 27. Function analysis • diskTest() – Open “testBin” file • faultTest() – Access violation
  • 28. Function analysis $ gcc test.c -rdynamic -fno-omit-frame-pointer # guider record -f -s ./ -u –ep \ -K file:getname:NONE:**string, open:sys_open:NONE:, segflt:bad_area:NONE: $ ./a.out & # guider stop # guider ./guider.dat -o ./ -l $(which addr2line) -r / -a View guider.out Trace getname function including return value Save report file in current directory Set addr2line path Set root path Trace sys_open function Trace bad_area function to detect fault Save trace data immediately Show all information
  • 29. Function analysis # guider ./guider.dat -o ./ -l $(which addr2line) -r / -a -g 972 View guider.out
  • 30. Function analysis File names opened Call sequence of open Call sequence of segmentation fault
  • 31. Function analysis • Restrictions – Target threads should be alive during profiling • If target threads should be killed then use -e p option for recording – Relevant binaries should be built with bellow options • -rdynamic -fno-omit-frame-pointer • -mapcs-frame (only for ARM) – A kernel patch is needed to trace user stack • ust_arm_apcs.patch (only for ARM) – the max length of a call chain is restricted by 8
  • 32. Contents • A system-wide performance analyzer – thread analysis – function analysis – real-time analysis – file analysis • Open-source contribution – https://github.com/iipeace/guider
  • 33. Real-time analysis • Show real-time system status with processes $ guider top
  • 34. Real-time analysis • Show real-time system status with threads $ guider top -e t
  • 35. Real-time analysis • Show only specific processes $ guider top -g chrome
  • 36. Real-time analysis • Show memory details of processes $ guider top -e m
  • 37. Real-time analysis • Show all information every 3 second $ guider top -a -i 3
  • 38. Real-time analysis • Show open files of specific processes $ guider top -e f -g sshd, upstart
  • 39. Real-time analysis • Show stacks of specific processes $ guider top -e s -g init
  • 40. Real-time analysis • Show system report $ guider top -o ./ -u $ guider stop View guider.out • System summary information Set path of report file Run in background
  • 41. Real-time analysis • CPU usage(%) per process in report
  • 42. Real-time analysis • Memory usage(MB) per process in report
  • 43. Real-time analysis • Memory details per process in report
  • 44. Real-time analysis • System statistics in report
  • 45. Real-time analysis • Show system graph and memory chart $ guider top -e g -I guider.out View guider_graph.png
  • 46. Real-time analysis • Show system graph and memory chart $ guider top -e g -I guider.out View guider_chart.png
  • 47. Real-time analysis • Restrictions – It is possible that statistics of some process is loss • Because sampling rate of real-time mode is bigger than 1 second – Sampling rate that is shorter than 1 second is not supported – Python matplotlib is required to draw graph and chart
  • 48. Contents • A system-wide performance analyzer – thread analysis – function analysis – real-time analysis – file analysis • Open-source contribution – https://github.com/iipeace/guider
  • 49. File analysis • Show usage of files mapped to processes # guider record -F -o ./ File mode Save report file in current directory
  • 50. File analysis • Show usage of files mapped to processes # guider record -F -o ./ -i -u # guider send # guider send # guider stop View guider.out File mode Save report file in current directory Show diff of files Run in background Get diff of files between previous and current Initial on-RAM file size Total file size diff on-RAM file size last on-RAM file size