SlideShare a Scribd company logo
1 of 36
© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Debugging & Profiling
2© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
Debugging
Various Techniques
Using Debugger: gdb
Profiling using
Program Checkers
Code Coverage Tools
Performance Analyzers
3© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Debugging
4© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Ways of Debugging
Basic: Printing
Querying
Kernel Windows: /proc, /sys
Using Commands like ipcs
Tracing: strace
Debugger: gdb
5© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Debugger: gdb
Text mode debugger
Repetition of previous command
Very powerful
All kind of options: Breakpoint, Watch, ...
Extensive Help
GUI interfaces: ddd, ...
6© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Debugging Strategies
Oh no!!! Another tool to learn
Worth learning a new tool
Segmentation faults & Core dumps
Execution intercepted by gdb
Allows examining the state, backtrace, etc
Debugging is Narrowing Down
Reaching close & then stepping
7© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
'gdb' Usage
Compile with -g option
gcc -g file.c -o file
Run gdb (with desired options)
gdb [options] ./file [core file]
Pass command line arguments by setting args
set args <cmd_line_args>
Run the program by
Typing c, or
run <cmd_line_args>
For debugging: break, watch, backtrace, …
For help: help <command>
8© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Examining Source Files
list <line>
Print 10 lines around <line>
list [<filename>:]<function>
Print 10 lines around beginning of <function>
list <start>,<end>
Print lines from <start> to <end>
list
Print 10 more lines
9© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Other ways of Running
step [ count ] – step into sub-routines
next – run over sub-routines in a go
finish – run till current function returns
return – make selected stack frame return to its
caller
jump <address> – continue program at specified
line or address
10© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Breakpoints
info break – Show list & status of breakpoints
Setting breakpoints (returns its number)
[t]break <function> [ if <expr> ]
[t]break [<file>:]<line>
Breakpoint Operations
disable <break_no>
enable <break_no>
delete <break_no>
commands <break_no>
Execute gdb commands on reaching <break_no>
11© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Examining the Stack
Stack grows down
Each call state is referred as a frame
backtrace – Show stack frames
frame <frame_no> – Select <frame_no>
down – Select callee's frame
up – Select caller's frame
info args – Show args of current frame
info locals – Show locals of current frame
12© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Examining Data
print[/xduotcf] <expr>
Evaluate the valid C <expr> within current frame
set variable <var> = <expr>
Assign <expr> to <var> in the current scope
Variables starting with $ are local to gdb
display <expr>
Print <expr> whenever program stops
undisplay
Cancels all previous display requests
13© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Other Examinations
Watchpoints / Catchpoints
info watchpoints (Same as info break)
watch <expr> - Break on Write watchpoint
rwatch <expr> - Break on Read watchpoint
awatch <expr> - Break on Both watchpoint
Default is hardware watchpoint
Registers: info registers
Set-able options: info set
14© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Shortcuts
Just enough of command
To make it unique
Added with tab completion
First letter only for
break, delete, run, continue, step, next, print
Repeat last by <Enter>
Executing the same set of initial commands
Put them in .gdbinit
-x <gdb command file>
15© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Miscellaneous
Set editmode for gdb command line
editmode [ emacs | vi | dumb ]
Execute a shell command
shell <cmd>
Print command history
history
Set logging
set logging <on | off>
set logging file <log_file> (Default: gdb.txt)
16© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Thread Debugging
Automatic notification of new threads
Switching among threads
thread <thread_no>
Auto switching on stop by breakpoint or signal
Inquiry on existing threads
info threads
Applying command to a list of threads
thread apply <thread_no> | all <cmd>
Thread specific breakpoints
Example: break <line> thread <thread_no>
17© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
gdb: Multi-Process Debugging
gdb version >= 7.1
Multiple processes from same session
Before that
Run different programs with different gdb
If parent-child program
Run the parent using gdb
Attach another gdb with running child pid
18© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Let's Debug
Debug
debugging_cprog.c
find_the_bug.c
Thread Debugging
multi_threads.c
19© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
User Process Memory Debugging
ElectricFence → DUMA
MEMWATCH
All these tools replaces the usual memory
allocation functions like malloc, free, … by the ones
to keep track of the same
20© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Profiling
21© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
W's of Profiling
Analyzing & Understanding Programs
Many varieties
Coding Style Checker
Logic Analysis
Memory Analysis
Execution Time Profiling
Run Time Error Capture
Execution Flow Analysis
22© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Profiling Categories
Program Check
Static (splint)
Dynamic (memwatch, ElectricFence → DUMA)
Code Coverage (Dynamic)
Execution Flow using test vectors (gcov)
Performance Analysis (Dynamic)
Execution Time using test vectors (gprof)
All in One: valgrind
23© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Static Program Checkers
Compiler itself
Really fast
But too naive
Other Extreme: Formal Verification Tools
Extensive
But needs huge resources
Preference: In between solutions
Example: splint
24© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
'splint' detects
Memory related Problems
Dereferencing a possibly null pointer, Using possibly undefined storage
Returning storage that is not properly defined
Dangling references, Memory leaks, Buffer overflow, ...
Dangerous Coding
Likely infinite loops, fall-through cases or incomplete switches
Suspicious statements, Dangerous aliasing
Dangerous macro implementations or invocations
Type mismatches with greater precision and flexibility, ...
Specific Violations of
Customized naming conventions
Information hiding
Modifications & Usage of global variable as per specified interfaces
...
25© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
'splint' Usage
Run splint (with desired options)
splint [options] file[.c]
Prints out all the messages about the file
On standard output
Errors on standard error (using -usestderr)
Some interesting options
-weak for lesser messages
-I <incl_dirs>
Try 'splint splint_cprog'
26© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Dynamic Program Checkers
Memory Debugging
mtrace (export MALLOC_TRACE=outfile.txt)
memwatch
ElectricFence → DUMA
...
Replaces the memory allocation functions
Like malloc, free, ...
By the ones to keep track of the same
27© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Code Coverage
Dynamic Execution Flow Analysis
Done by actually running the Program
Usually done with sets of test vectors
Providing the Test Code Coverage
Coverage of: Line of Code, Branches, Blocks, ...
Typically provides
Entity executed or not executed
% or times of execution of various entities
Tool: gcov
Could provide performance info when used with gprof
28© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
'gcov' Usage
Compile with -fprofile-arcs -ftest-coverage options
gcc -fprofile-arcs -ftest-coverage file.c -o file
Execute the program with the test vectors
./file [ <cmd_line_args> ]
Generates .gcda (Data) & .gcno (Graph) files
Run gcov (with desired options)
gcov [options] file.c
Interesting options: --all-blocks --branch-probabilities
Generates coverage output in .gcov file
Try with gcov_cprog.c
29© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Performance Analysis
Dynamic Execution Time Analysis
Done by actually running the Program
Usually done with sets of test vectors
Providing the Test Performance Analysis
Typically provides info on Functions
Time Spent, Times Called
Call Graph Profile Data
Performance Bottlenecks
Tool: gprof
30© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
'gprof' Usage
Compile with -pg option
gcc -pg file.c -o file
Run the program
./file [ <cmd_line_args> ]
Generates gmon.out file
Run gprof (with desired options)
gprof [options] ./file [gmon.out]
Dumps profiling info on stdout
Try with gprof_cprog.c
31© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Interesting 'gprof' Options
-b # Brief output
-p # Flat Profile
-q # Call Graph Analysis
-A # Print with Annotated source code
-x # Annotate all lines
-l # Line-by-line profiling
-s # Sum
-z # Display unused functions
-r, -R <mapfile> # Reordering suggestions
32© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Tool Suite: valgrind
Provides a number of debugging & profiling tools
Most popular being Memcheck
Best behaviour without optimization
Other possibly useful tools
Cachegrind: Profiler for cache (miss) and branch (misprediction) events
Callgrind: Profiler to show cost relationships across function calls,
optionally with cache simulation
Massif: Space profiler to explore in detail which parts of your program
allocate memory
Helgrind: Debugging tool for threaded programs
Looks for various kinds of synchronisation errors in code
That uses the POSIX pthreads API
GUI frontend: valkyrie
33© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
valgrind: Memcheck detects
Touching “shouldn’t” memories
Overrunning heap block boundaries
Reading/Writing freed/unallocated memory
Memory leaks
Not freeing heap blocks
Incorrect freeing of memory
Double-freeing heap blocks
Using values before initialization
34© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
'valgrind' Usage
Compile with -g option
gcc -g file.c -o file
Run using valgrind & desired options
valgrind [options] ./file [ <cmd_line_args> ]
By default, runs Memcheck
Profiles out the memory usage of the program
For using other tools of valgrind, add
--tool=<toolname>
Try with valgrind_cprog.c
35© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all have we learnt?
Debugging
Various Techniques
Using Debugger: gdb
Profiling using
Program Checkers
splint, mtrace, memwatch, ...
Code Coverage Tools
gcov
Performance Analyzers
gprof, valgrind, ...
36© 2010-15 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

What's hot

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 SecretsBrendan Gregg
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Jérôme Petazzoni
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Edureka!
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersSyah Dwi Prihatmoko
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemdYusaku OGAWA
 
Linux PCI device driver
Linux PCI device driverLinux PCI device driver
Linux PCI device driver艾鍗科技
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernellcplcp1
 
Openwrt startup
Openwrt startupOpenwrt startup
Openwrt startup晓东 杜
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsQUONTRASOLUTIONS
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 

What's hot (20)

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
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemd
 
Linux PCI device driver
Linux PCI device driverLinux PCI device driver
Linux PCI device driver
 
Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernel
 
Openwrt startup
Openwrt startupOpenwrt startup
Openwrt startup
 
Linux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platformLinux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platform
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 

Viewers also liked (20)

Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Timers
TimersTimers
Timers
 
Threads
ThreadsThreads
Threads
 
Synchronization
SynchronizationSynchronization
Synchronization
 
System Calls
System CallsSystem Calls
System Calls
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Signals
SignalsSignals
Signals
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
References
ReferencesReferences
References
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Interrupts
InterruptsInterrupts
Interrupts
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 

Similar to Linux User Space Debugging & Profiling

jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasualYuji Kubota
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the CloudJim Driscoll
 
Android developmenttools 20100424
Android developmenttools 20100424Android developmenttools 20100424
Android developmenttools 20100424Marakana Inc.
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8Chris Bailey
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android晓东 杜
 
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...Sharon James
 
Advanced Python, Part 2
Advanced Python, Part 2Advanced Python, Part 2
Advanced Python, Part 2Zaar Hai
 
Accelerated Mac OS X Core Dump Analysis training public slides
Accelerated Mac OS X Core Dump Analysis training public slidesAccelerated Mac OS X Core Dump Analysis training public slides
Accelerated Mac OS X Core Dump Analysis training public slidesDmitry Vostokov
 
Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)anandvaidya
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaArvind Kumar G.S
 
BeeGFS Training.pdf
BeeGFS Training.pdfBeeGFS Training.pdf
BeeGFS Training.pdfssusercbaa33
 
Troubleshooting real production problems
Troubleshooting real production problemsTroubleshooting real production problems
Troubleshooting real production problemsTier1 app
 
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...Codemotion
 
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...Codemotion
 

Similar to Linux User Space Debugging & Profiling (20)

Linux Internals Part - 3
Linux Internals Part - 3Linux Internals Part - 3
Linux Internals Part - 3
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasual
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Android developmenttools 20100424
Android developmenttools 20100424Android developmenttools 20100424
Android developmenttools 20100424
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
Processes
ProcessesProcesses
Processes
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
 
Advanced Python, Part 2
Advanced Python, Part 2Advanced Python, Part 2
Advanced Python, Part 2
 
Accelerated Mac OS X Core Dump Analysis training public slides
Accelerated Mac OS X Core Dump Analysis training public slidesAccelerated Mac OS X Core Dump Analysis training public slides
Accelerated Mac OS X Core Dump Analysis training public slides
 
Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)Linux Cluster Job Management Systems (SGE)
Linux Cluster Job Management Systems (SGE)
 
groovy & grails - lecture 9
groovy & grails - lecture 9groovy & grails - lecture 9
groovy & grails - lecture 9
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
BeeGFS Training.pdf
BeeGFS Training.pdfBeeGFS Training.pdf
BeeGFS Training.pdf
 
Troubleshooting real production problems
Troubleshooting real production problemsTroubleshooting real production problems
Troubleshooting real production problems
 
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
 
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
Jörg Schad - Hybrid Cloud (Kubernetes, Spark, HDFS, …)-as-a-Service - Codemot...
 

More from Anil Kumar Pugalia (13)

File System Modules
File System ModulesFile System Modules
File System Modules
 
System Calls
System CallsSystem Calls
System Calls
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Power of vi
Power of viPower of vi
Power of vi
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 
Processes
ProcessesProcesses
Processes
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Linux User Space Debugging & Profiling

  • 1. © 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Debugging & Profiling
  • 2. 2© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? Debugging Various Techniques Using Debugger: gdb Profiling using Program Checkers Code Coverage Tools Performance Analyzers
  • 3. 3© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Debugging
  • 4. 4© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Ways of Debugging Basic: Printing Querying Kernel Windows: /proc, /sys Using Commands like ipcs Tracing: strace Debugger: gdb
  • 5. 5© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Debugger: gdb Text mode debugger Repetition of previous command Very powerful All kind of options: Breakpoint, Watch, ... Extensive Help GUI interfaces: ddd, ...
  • 6. 6© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Debugging Strategies Oh no!!! Another tool to learn Worth learning a new tool Segmentation faults & Core dumps Execution intercepted by gdb Allows examining the state, backtrace, etc Debugging is Narrowing Down Reaching close & then stepping
  • 7. 7© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. 'gdb' Usage Compile with -g option gcc -g file.c -o file Run gdb (with desired options) gdb [options] ./file [core file] Pass command line arguments by setting args set args <cmd_line_args> Run the program by Typing c, or run <cmd_line_args> For debugging: break, watch, backtrace, … For help: help <command>
  • 8. 8© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Examining Source Files list <line> Print 10 lines around <line> list [<filename>:]<function> Print 10 lines around beginning of <function> list <start>,<end> Print lines from <start> to <end> list Print 10 more lines
  • 9. 9© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Other ways of Running step [ count ] – step into sub-routines next – run over sub-routines in a go finish – run till current function returns return – make selected stack frame return to its caller jump <address> – continue program at specified line or address
  • 10. 10© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Breakpoints info break – Show list & status of breakpoints Setting breakpoints (returns its number) [t]break <function> [ if <expr> ] [t]break [<file>:]<line> Breakpoint Operations disable <break_no> enable <break_no> delete <break_no> commands <break_no> Execute gdb commands on reaching <break_no>
  • 11. 11© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Examining the Stack Stack grows down Each call state is referred as a frame backtrace – Show stack frames frame <frame_no> – Select <frame_no> down – Select callee's frame up – Select caller's frame info args – Show args of current frame info locals – Show locals of current frame
  • 12. 12© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Examining Data print[/xduotcf] <expr> Evaluate the valid C <expr> within current frame set variable <var> = <expr> Assign <expr> to <var> in the current scope Variables starting with $ are local to gdb display <expr> Print <expr> whenever program stops undisplay Cancels all previous display requests
  • 13. 13© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Other Examinations Watchpoints / Catchpoints info watchpoints (Same as info break) watch <expr> - Break on Write watchpoint rwatch <expr> - Break on Read watchpoint awatch <expr> - Break on Both watchpoint Default is hardware watchpoint Registers: info registers Set-able options: info set
  • 14. 14© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Shortcuts Just enough of command To make it unique Added with tab completion First letter only for break, delete, run, continue, step, next, print Repeat last by <Enter> Executing the same set of initial commands Put them in .gdbinit -x <gdb command file>
  • 15. 15© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Miscellaneous Set editmode for gdb command line editmode [ emacs | vi | dumb ] Execute a shell command shell <cmd> Print command history history Set logging set logging <on | off> set logging file <log_file> (Default: gdb.txt)
  • 16. 16© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Thread Debugging Automatic notification of new threads Switching among threads thread <thread_no> Auto switching on stop by breakpoint or signal Inquiry on existing threads info threads Applying command to a list of threads thread apply <thread_no> | all <cmd> Thread specific breakpoints Example: break <line> thread <thread_no>
  • 17. 17© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. gdb: Multi-Process Debugging gdb version >= 7.1 Multiple processes from same session Before that Run different programs with different gdb If parent-child program Run the parent using gdb Attach another gdb with running child pid
  • 18. 18© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Let's Debug Debug debugging_cprog.c find_the_bug.c Thread Debugging multi_threads.c
  • 19. 19© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. User Process Memory Debugging ElectricFence → DUMA MEMWATCH All these tools replaces the usual memory allocation functions like malloc, free, … by the ones to keep track of the same
  • 20. 20© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Profiling
  • 21. 21© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. W's of Profiling Analyzing & Understanding Programs Many varieties Coding Style Checker Logic Analysis Memory Analysis Execution Time Profiling Run Time Error Capture Execution Flow Analysis
  • 22. 22© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Profiling Categories Program Check Static (splint) Dynamic (memwatch, ElectricFence → DUMA) Code Coverage (Dynamic) Execution Flow using test vectors (gcov) Performance Analysis (Dynamic) Execution Time using test vectors (gprof) All in One: valgrind
  • 23. 23© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Static Program Checkers Compiler itself Really fast But too naive Other Extreme: Formal Verification Tools Extensive But needs huge resources Preference: In between solutions Example: splint
  • 24. 24© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. 'splint' detects Memory related Problems Dereferencing a possibly null pointer, Using possibly undefined storage Returning storage that is not properly defined Dangling references, Memory leaks, Buffer overflow, ... Dangerous Coding Likely infinite loops, fall-through cases or incomplete switches Suspicious statements, Dangerous aliasing Dangerous macro implementations or invocations Type mismatches with greater precision and flexibility, ... Specific Violations of Customized naming conventions Information hiding Modifications & Usage of global variable as per specified interfaces ...
  • 25. 25© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. 'splint' Usage Run splint (with desired options) splint [options] file[.c] Prints out all the messages about the file On standard output Errors on standard error (using -usestderr) Some interesting options -weak for lesser messages -I <incl_dirs> Try 'splint splint_cprog'
  • 26. 26© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Dynamic Program Checkers Memory Debugging mtrace (export MALLOC_TRACE=outfile.txt) memwatch ElectricFence → DUMA ... Replaces the memory allocation functions Like malloc, free, ... By the ones to keep track of the same
  • 27. 27© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Code Coverage Dynamic Execution Flow Analysis Done by actually running the Program Usually done with sets of test vectors Providing the Test Code Coverage Coverage of: Line of Code, Branches, Blocks, ... Typically provides Entity executed or not executed % or times of execution of various entities Tool: gcov Could provide performance info when used with gprof
  • 28. 28© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. 'gcov' Usage Compile with -fprofile-arcs -ftest-coverage options gcc -fprofile-arcs -ftest-coverage file.c -o file Execute the program with the test vectors ./file [ <cmd_line_args> ] Generates .gcda (Data) & .gcno (Graph) files Run gcov (with desired options) gcov [options] file.c Interesting options: --all-blocks --branch-probabilities Generates coverage output in .gcov file Try with gcov_cprog.c
  • 29. 29© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Performance Analysis Dynamic Execution Time Analysis Done by actually running the Program Usually done with sets of test vectors Providing the Test Performance Analysis Typically provides info on Functions Time Spent, Times Called Call Graph Profile Data Performance Bottlenecks Tool: gprof
  • 30. 30© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. 'gprof' Usage Compile with -pg option gcc -pg file.c -o file Run the program ./file [ <cmd_line_args> ] Generates gmon.out file Run gprof (with desired options) gprof [options] ./file [gmon.out] Dumps profiling info on stdout Try with gprof_cprog.c
  • 31. 31© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Interesting 'gprof' Options -b # Brief output -p # Flat Profile -q # Call Graph Analysis -A # Print with Annotated source code -x # Annotate all lines -l # Line-by-line profiling -s # Sum -z # Display unused functions -r, -R <mapfile> # Reordering suggestions
  • 32. 32© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Tool Suite: valgrind Provides a number of debugging & profiling tools Most popular being Memcheck Best behaviour without optimization Other possibly useful tools Cachegrind: Profiler for cache (miss) and branch (misprediction) events Callgrind: Profiler to show cost relationships across function calls, optionally with cache simulation Massif: Space profiler to explore in detail which parts of your program allocate memory Helgrind: Debugging tool for threaded programs Looks for various kinds of synchronisation errors in code That uses the POSIX pthreads API GUI frontend: valkyrie
  • 33. 33© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. valgrind: Memcheck detects Touching “shouldn’t” memories Overrunning heap block boundaries Reading/Writing freed/unallocated memory Memory leaks Not freeing heap blocks Incorrect freeing of memory Double-freeing heap blocks Using values before initialization
  • 34. 34© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. 'valgrind' Usage Compile with -g option gcc -g file.c -o file Run using valgrind & desired options valgrind [options] ./file [ <cmd_line_args> ] By default, runs Memcheck Profiles out the memory usage of the program For using other tools of valgrind, add --tool=<toolname> Try with valgrind_cprog.c
  • 35. 35© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? Debugging Various Techniques Using Debugger: gdb Profiling using Program Checkers splint, mtrace, memwatch, ... Code Coverage Tools gcov Performance Analyzers gprof, valgrind, ...
  • 36. 36© 2010-15 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?