SlideShare uma empresa Scribd logo
1 de 58
COPYRIGHT 2016 – Fundação CERTI
C++ and
Embedded Linux:
a perfect match
Vinicius Zein | Fundação CERTI
COPYRIGHT 2016 – Fundação CERTI
https://br.linkedin.com/in/viniciuszein
Vinicius Tadeu Zein
R&D Coordinator @CERTI Foundation
• Responsible for the Embedded Systems team
• More than 10 years developing Embedded Systems
• In companies like Atmel, LG Electronics and CERTI
COPYRIGHT 2016 – Fundação CERTI
R&D Institute
Founded in 1984 with the mission to
develop technology solutions for products
and processes
500 employees
Private, but results are reinvested in R&D
MCTI and SUFRAMA accredited – projects
with “Lei de Informática”, “Lei do Bem”
and Embrapii
More than 500 clients around the world
COPYRIGHT 2016 – Fundação CERTI
The information in this presentation was compiled from sources believed to be
reliable for informational purposes only.
Content includes opinions, presentations, articles, hyperlinks or other third party
content (“Third Party Material”) that is not intended to, nor constitutes an
endorsement by CERTI of the author or the Third Party Materials. The content
and views within the Third Party Material are solely those of the third party and
do not reflect the opinions of CERTI.
The opinions expressed in this presentation and on the following slides are
solely those of the
presenter and not necessarily those of CERTI. CERTI does not guarantee the
accuracy or
reliability of the information provided herein.
.Disclaimer
COPYRIGHT 2016 – Fundação CERTI
SU
MMA
RY
CHAPTER 1
Embedded
Linux
CHAPTER 2
C++
CHAPTER 3
Development
tools and
debugging
CHAPTER 4
Test
frameworks
CHAPTER 5
Test driven
development
CHAPTER 6
Final
considerations
COPYRIGHT 2016 – Fundação CERTI
Embedded
Linux
Chapter 1
COPYRIGHT 2016 – Fundação CERTI
CAPÍTULO 1 | LINUX EMBARCADO
COPYRIGHT 2016 – Fundação CERTI
Telephone exchanges
IP Phones and Smartphones
TVs and Set-top boxes
Printers
Electronic Control Units for cars
Cameras
Android systems
CHAPTER 1 | EMBEDDED LINUX
COPYRIGHT 2016 – Fundação CERTI
C++
CHAPTER 2
COPYRIGHT 2016 – Fundação CERTI
C++“cee plus plus”
CHAPTER 2 Multi-paradigm
Object oriented
Templates, inline functions
Metaprogramming
High-performative and powerfull
Lots of tools
Compatibility with C - just in case ;)
STL, Boost, ACE
Evolving language
CHAPTER 2 | C++
C++85 style "C with Classes”, C++98, C++03,
C++11, C++14, C++17
COPYRIGHT 2016 – Fundação CERTI
Don’t lower
your level of
abstraction
without a good reason!
Low-levelimplies
Morecode
Morebugs
Highermaintenancecosts
COPYRIGHT 2016 – Fundação CERTI
Embedded
Linux
C+
+
Perfect match
CHAPTER 2 | C++
COPYRIGHT 2016 – Fundação CERTI
DEVELOPMENT
TOOLS AND
DEBUGGING
CHAPTER 3
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
“Making Embedded Linux Easy
Buildroot is a simple, efficient and
easy-to-use tool to generate
embedded Linux systems through
cross-compilation.”
Build systems > Buildroot
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
Build systems > Yocto Project
“It's not an embedded
Linux distribution
– it creates a custom
one for you”
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
Build systems > Autoconf
Rake
Boost.Build
Qmake
Scons
CMake
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
IDEs * Code edition and navigation
Vim
Emacs
Sublime Text 2
Eclipse CDT
Netbeans
SlickEdit
QtCreator
JetBrains AppCode
If debugging is the
process of removing
bugs,
then programming must
be the process of putting
them in Edsger Dijkstra
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
Debugging
Logs
Command Line Interface (CLI)
gdb (post morten)
gdb + gdbserver
ddd
Google BreakPad
For each
bug found,
a new unit
test.
COPYRIGHT 2016 – Fundação CERTI
CAPÍTULO 3 | FERRAMENTAS DESENVOLVIMENTO E DEBUGGING
Debugging > GDB
Post morten
gdb <program> -c <core_file>
bt full -> backtrace
print <variable>
frame <frame_id>
thread <thread_id>
COPYRIGHT 2016 – Fundação CERTI
COPYRIGHT 2016 – Fundação CERTI
COPYRIGHT 2016 – Fundação CERTI
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
Debugging > Breakpad
COPYRIGHT 2016 – Fundação CERTI
Debugging > Breakpad
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
COPYRIGHT 2016 – Fundação CERTI
Continuos integration
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
COPYRIGHT 2016 – Fundação CERTI
Other tools > Static annalysis
coverity, cppcheck
Coverage– cccc
Valgrind, tcmalloc
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
COPYRIGHT 2016 – Fundação CERTI
COPYRIGHT 2016 – Fundação CERTI
Code coverage
CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
COPYRIGHT 2016 – Fundação CERTI
Test frameworks for
C++
CHAPTER 4
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 4 | TEST FRAMEWORKS FOR C++
Unit tests – gtest > Well documented
Multiplatform
Linux, Windows, Mac OS X
Easy to use, easy to configure
1 execution > multiple failures
COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
COPYRIGHT 2016 – Fundação CERTI
gmock > Google Mocking Framework for tests
in C++
Real targets are not always available
Simulating behavior
Creating emulators
CHAPTER 4 | TEST FRAMEWORKS FOR C++
COPYRIGHT 2016 – Fundação CERTI gmock
COPYRIGHT 2016 – Fundação CERTI gmock
COPYRIGHT 2016 – Fundação CERTI gmock
COPYRIGHT 2016 – Fundação CERTI gmock
COPYRIGHT 2016 – Fundação CERTI gmock
COPYRIGHT 2016 – Fundação CERTI
Google Benchmark
https://github.com/google/benchmark
Function benchmarking
CHAPTER 4 | TEST FRAMEWORKS FOR C++
COPYRIGHT 2016 – Fundação CERTI Google Benchmark
Test driven
development
CHAPTER 5
COPYRIGHT 2016 – Fundação CERTI
CHAPTER 5 | TEST DRIVEN DEVELOPMENT
Final considerations
CHAPTER 6
COPYRIGHT 2016 – Fundação CERTI
Use smart
pointers
std::shared_ptr,
std::scoped_ptr,
std::unique_ptr
COPYRIGHT 2016 – Fundação CERTI
RAIIRAII
COPYRIGHT 2016 – Fundação CERTI
CAPÍTULO 6 | Final considerations
RAII
RAII
Resource
Acquisition Is
Initialization
COPYRIGHT 2016 – Fundação CERTI
Use a
code standard
http://www.chromium.org/developers/coding-style
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
http://clang.llvm.org/docs/ClangFormat.html
COPYRIGHT 2016 – Fundação CERTI
Unit test first
Then code
>TDD
COPYRIGHT 2016 – Fundação CERTI
Prefere
STL/Boost
algorithms
COPYRIGHT 2016 – Fundação CERTI
COPYRIGHT 2016 – Fundação CERTI
Thanks!
Vinicius Zein vtz@certi.org.br
COPYRIGHT 2016 – Fundação CERTI
References
Slide 6 http://events.linuxfoundation.org/sites/events/files/slides/csimmonds-embedded-linux-timeline-2013.pdf
Slide 11 http://ecn.channel9.msdn.com/events/GoingNative12/GN12Cpp11Style.pdf
Slides 24, 25 and 26 https://code.google.com/p/google-breakpad/wiki/GettingStartedWithBreakpad
Slide 48 http://www.pathfindersolns.com/

Mais conteúdo relacionado

Destaque

C++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkC++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkHumberto Marchezi
 
AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)Yuvaraja Ravi
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationBarbara Jones
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using pythonYuvaraja Ravi
 
Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Lars Thorup
 
Automated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in ActionAutomated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in ActionAANDTech
 
Embedded systems class notes
Embedded systems  class notes Embedded systems  class notes
Embedded systems class notes Dr.YNM
 
Unit 1 embedded systems and applications
Unit 1 embedded systems and applicationsUnit 1 embedded systems and applications
Unit 1 embedded systems and applicationsDr.YNM
 
ppt on embedded system
ppt on embedded systemppt on embedded system
ppt on embedded systemmanish katara
 

Destaque (14)

C++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing FrameworkC++ Unit Test with Google Testing Framework
C++ Unit Test with Google Testing Framework
 
AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)
 
Python in Test automation
Python in Test automationPython in Test automation
Python in Test automation
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and Validation
 
Embedded System Test Automation
Embedded System Test AutomationEmbedded System Test Automation
Embedded System Test Automation
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using python
 
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
 
Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++
 
Automated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in ActionAutomated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in Action
 
Embedded systems class notes
Embedded systems  class notes Embedded systems  class notes
Embedded systems class notes
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 1 embedded systems and applications
Unit 1 embedded systems and applicationsUnit 1 embedded systems and applications
Unit 1 embedded systems and applications
 
ppt on embedded system
ppt on embedded systemppt on embedded system
ppt on embedded system
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 

Semelhante a C++ and Embedded Linux - a perfect match

5/ GitHub Inner Source @ OPEN'16
5/ GitHub Inner Source @ OPEN'165/ GitHub Inner Source @ OPEN'16
5/ GitHub Inner Source @ OPEN'16Kangaroot
 
Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...
Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...
Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...Kiratech
 
Serverless survival kit
Serverless survival kitServerless survival kit
Serverless survival kitSteve Houël
 
How To Start Your InfoSec Career
How To Start Your InfoSec CareerHow To Start Your InfoSec Career
How To Start Your InfoSec CareerAndrew McNicol
 
The Need for Speed
The Need for SpeedThe Need for Speed
The Need for SpeedCapgemini
 
How Spotify reaches the 80%+ of satisfaction of the techies making developers...
How Spotify reaches the 80%+ of satisfaction of the techies making developers...How Spotify reaches the 80%+ of satisfaction of the techies making developers...
How Spotify reaches the 80%+ of satisfaction of the techies making developers...Francesco Corti
 
Beyond Gerrit @ Gerrit User Summit 2017, London
Beyond Gerrit @ Gerrit User Summit 2017, LondonBeyond Gerrit @ Gerrit User Summit 2017, London
Beyond Gerrit @ Gerrit User Summit 2017, LondonJacek Centkowski
 
Building an AI Assistant Factory - Rasa Summit 2021
Building an AI Assistant Factory - Rasa Summit 2021Building an AI Assistant Factory - Rasa Summit 2021
Building an AI Assistant Factory - Rasa Summit 2021Rasa Technologies
 
Automation in iOS development
Automation in iOS developmentAutomation in iOS development
Automation in iOS developmentCong Nguyen
 
OSS - enterprise adoption strategy and governance
OSS -  enterprise adoption strategy and governanceOSS -  enterprise adoption strategy and governance
OSS - enterprise adoption strategy and governancePrabir Kr Sarkar
 
How open source empowers startups to start big, with case Double Open Oy
How open source empowers startups to start big, with case Double Open OyHow open source empowers startups to start big, with case Double Open Oy
How open source empowers startups to start big, with case Double Open OyMindtrek
 
Enterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring BudgetEnterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring BudgetChris Tankersley
 
Tech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @CriteoTech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @CriteoGilles Legoux
 
Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...
Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...
Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...Sacha Bruttin
 
Open-DO: Towards a Lean Approach for Certification (Cyrille Comar)
Open-DO: Towards a Lean Approach for Certification  (Cyrille Comar)Open-DO: Towards a Lean Approach for Certification  (Cyrille Comar)
Open-DO: Towards a Lean Approach for Certification (Cyrille Comar)AdaCore
 
An Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android DevelopmentAn Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android DevelopmentVíctor Bolinches
 
Enterprise Learning Ecosystem
Enterprise Learning EcosystemEnterprise Learning Ecosystem
Enterprise Learning EcosystemMegan Bowe
 
CWIN17 telford api management, practical implementation experience - david ru...
CWIN17 telford api management, practical implementation experience - david ru...CWIN17 telford api management, practical implementation experience - david ru...
CWIN17 telford api management, practical implementation experience - david ru...Capgemini
 
2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night
2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night
2016 CaribbeanStartups.com Fall Boot Camp/ Demo NightChristine Souffrant Ntim
 

Semelhante a C++ and Embedded Linux - a perfect match (20)

5/ GitHub Inner Source @ OPEN'16
5/ GitHub Inner Source @ OPEN'165/ GitHub Inner Source @ OPEN'16
5/ GitHub Inner Source @ OPEN'16
 
Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...
Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...
Slides Webinar "Start your DevOps Journey with GITHUB" (in Italiano) by Kirat...
 
Serverless survival kit
Serverless survival kitServerless survival kit
Serverless survival kit
 
How To Start Your InfoSec Career
How To Start Your InfoSec CareerHow To Start Your InfoSec Career
How To Start Your InfoSec Career
 
The Need for Speed
The Need for SpeedThe Need for Speed
The Need for Speed
 
How Spotify reaches the 80%+ of satisfaction of the techies making developers...
How Spotify reaches the 80%+ of satisfaction of the techies making developers...How Spotify reaches the 80%+ of satisfaction of the techies making developers...
How Spotify reaches the 80%+ of satisfaction of the techies making developers...
 
Beyond Gerrit @ Gerrit User Summit 2017, London
Beyond Gerrit @ Gerrit User Summit 2017, LondonBeyond Gerrit @ Gerrit User Summit 2017, London
Beyond Gerrit @ Gerrit User Summit 2017, London
 
Building an AI Assistant Factory - Rasa Summit 2021
Building an AI Assistant Factory - Rasa Summit 2021Building an AI Assistant Factory - Rasa Summit 2021
Building an AI Assistant Factory - Rasa Summit 2021
 
Automation in iOS development
Automation in iOS developmentAutomation in iOS development
Automation in iOS development
 
OSS - enterprise adoption strategy and governance
OSS -  enterprise adoption strategy and governanceOSS -  enterprise adoption strategy and governance
OSS - enterprise adoption strategy and governance
 
How open source empowers startups to start big, with case Double Open Oy
How open source empowers startups to start big, with case Double Open OyHow open source empowers startups to start big, with case Double Open Oy
How open source empowers startups to start big, with case Double Open Oy
 
Enterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring BudgetEnterprise Development on a Shoestring Budget
Enterprise Development on a Shoestring Budget
 
Tech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @CriteoTech Job Conference: Software Engineer @Criteo
Tech Job Conference: Software Engineer @Criteo
 
Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...
Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...
Windows Store Apps using HTML and JavaScript: Become a Windows App Store deve...
 
2015 03-siia-iin-byte9-v1
2015 03-siia-iin-byte9-v12015 03-siia-iin-byte9-v1
2015 03-siia-iin-byte9-v1
 
Open-DO: Towards a Lean Approach for Certification (Cyrille Comar)
Open-DO: Towards a Lean Approach for Certification  (Cyrille Comar)Open-DO: Towards a Lean Approach for Certification  (Cyrille Comar)
Open-DO: Towards a Lean Approach for Certification (Cyrille Comar)
 
An Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android DevelopmentAn Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android Development
 
Enterprise Learning Ecosystem
Enterprise Learning EcosystemEnterprise Learning Ecosystem
Enterprise Learning Ecosystem
 
CWIN17 telford api management, practical implementation experience - david ru...
CWIN17 telford api management, practical implementation experience - david ru...CWIN17 telford api management, practical implementation experience - david ru...
CWIN17 telford api management, practical implementation experience - david ru...
 
2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night
2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night
2016 CaribbeanStartups.com Fall Boot Camp/ Demo Night
 

Último

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 

Último (20)

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 

C++ and Embedded Linux - a perfect match

  • 1. COPYRIGHT 2016 – Fundação CERTI C++ and Embedded Linux: a perfect match Vinicius Zein | Fundação CERTI
  • 2. COPYRIGHT 2016 – Fundação CERTI https://br.linkedin.com/in/viniciuszein Vinicius Tadeu Zein R&D Coordinator @CERTI Foundation • Responsible for the Embedded Systems team • More than 10 years developing Embedded Systems • In companies like Atmel, LG Electronics and CERTI
  • 3. COPYRIGHT 2016 – Fundação CERTI R&D Institute Founded in 1984 with the mission to develop technology solutions for products and processes 500 employees Private, but results are reinvested in R&D MCTI and SUFRAMA accredited – projects with “Lei de Informática”, “Lei do Bem” and Embrapii More than 500 clients around the world
  • 4. COPYRIGHT 2016 – Fundação CERTI The information in this presentation was compiled from sources believed to be reliable for informational purposes only. Content includes opinions, presentations, articles, hyperlinks or other third party content (“Third Party Material”) that is not intended to, nor constitutes an endorsement by CERTI of the author or the Third Party Materials. The content and views within the Third Party Material are solely those of the third party and do not reflect the opinions of CERTI. The opinions expressed in this presentation and on the following slides are solely those of the presenter and not necessarily those of CERTI. CERTI does not guarantee the accuracy or reliability of the information provided herein. .Disclaimer
  • 5. COPYRIGHT 2016 – Fundação CERTI SU MMA RY CHAPTER 1 Embedded Linux CHAPTER 2 C++ CHAPTER 3 Development tools and debugging CHAPTER 4 Test frameworks CHAPTER 5 Test driven development CHAPTER 6 Final considerations
  • 6. COPYRIGHT 2016 – Fundação CERTI Embedded Linux Chapter 1
  • 7. COPYRIGHT 2016 – Fundação CERTI CAPÍTULO 1 | LINUX EMBARCADO
  • 8. COPYRIGHT 2016 – Fundação CERTI Telephone exchanges IP Phones and Smartphones TVs and Set-top boxes Printers Electronic Control Units for cars Cameras Android systems CHAPTER 1 | EMBEDDED LINUX
  • 9.
  • 10. COPYRIGHT 2016 – Fundação CERTI C++ CHAPTER 2
  • 11. COPYRIGHT 2016 – Fundação CERTI C++“cee plus plus” CHAPTER 2 Multi-paradigm Object oriented Templates, inline functions Metaprogramming High-performative and powerfull Lots of tools Compatibility with C - just in case ;) STL, Boost, ACE Evolving language CHAPTER 2 | C++ C++85 style "C with Classes”, C++98, C++03, C++11, C++14, C++17
  • 12. COPYRIGHT 2016 – Fundação CERTI Don’t lower your level of abstraction without a good reason! Low-levelimplies Morecode Morebugs Highermaintenancecosts
  • 13. COPYRIGHT 2016 – Fundação CERTI Embedded Linux C+ + Perfect match CHAPTER 2 | C++
  • 14. COPYRIGHT 2016 – Fundação CERTI DEVELOPMENT TOOLS AND DEBUGGING CHAPTER 3
  • 15. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING “Making Embedded Linux Easy Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation.” Build systems > Buildroot
  • 16. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING Build systems > Yocto Project “It's not an embedded Linux distribution – it creates a custom one for you”
  • 17. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING Build systems > Autoconf Rake Boost.Build Qmake Scons CMake
  • 18. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING IDEs * Code edition and navigation Vim Emacs Sublime Text 2 Eclipse CDT Netbeans SlickEdit QtCreator JetBrains AppCode
  • 19. If debugging is the process of removing bugs, then programming must be the process of putting them in Edsger Dijkstra
  • 20. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING Debugging Logs Command Line Interface (CLI) gdb (post morten) gdb + gdbserver ddd Google BreakPad For each bug found, a new unit test.
  • 21. COPYRIGHT 2016 – Fundação CERTI CAPÍTULO 3 | FERRAMENTAS DESENVOLVIMENTO E DEBUGGING Debugging > GDB Post morten gdb <program> -c <core_file> bt full -> backtrace print <variable> frame <frame_id> thread <thread_id>
  • 22. COPYRIGHT 2016 – Fundação CERTI
  • 23. COPYRIGHT 2016 – Fundação CERTI
  • 24. COPYRIGHT 2016 – Fundação CERTI
  • 25. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING Debugging > Breakpad
  • 26. COPYRIGHT 2016 – Fundação CERTI Debugging > Breakpad CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  • 27. COPYRIGHT 2016 – Fundação CERTI Continuos integration CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  • 28. COPYRIGHT 2016 – Fundação CERTI Other tools > Static annalysis coverity, cppcheck Coverage– cccc Valgrind, tcmalloc CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  • 29. COPYRIGHT 2016 – Fundação CERTI
  • 30. COPYRIGHT 2016 – Fundação CERTI Code coverage CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  • 31. COPYRIGHT 2016 – Fundação CERTI
  • 33. COPYRIGHT 2016 – Fundação CERTI CHAPTER 4 | TEST FRAMEWORKS FOR C++ Unit tests – gtest > Well documented Multiplatform Linux, Windows, Mac OS X Easy to use, easy to configure 1 execution > multiple failures
  • 34. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  • 35. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  • 36. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  • 37. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  • 38. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  • 39. COPYRIGHT 2016 – Fundação CERTI gmock > Google Mocking Framework for tests in C++ Real targets are not always available Simulating behavior Creating emulators CHAPTER 4 | TEST FRAMEWORKS FOR C++
  • 40. COPYRIGHT 2016 – Fundação CERTI gmock
  • 41. COPYRIGHT 2016 – Fundação CERTI gmock
  • 42. COPYRIGHT 2016 – Fundação CERTI gmock
  • 43. COPYRIGHT 2016 – Fundação CERTI gmock
  • 44. COPYRIGHT 2016 – Fundação CERTI gmock
  • 45. COPYRIGHT 2016 – Fundação CERTI Google Benchmark https://github.com/google/benchmark Function benchmarking CHAPTER 4 | TEST FRAMEWORKS FOR C++
  • 46. COPYRIGHT 2016 – Fundação CERTI Google Benchmark
  • 48. COPYRIGHT 2016 – Fundação CERTI CHAPTER 5 | TEST DRIVEN DEVELOPMENT
  • 50. COPYRIGHT 2016 – Fundação CERTI Use smart pointers std::shared_ptr, std::scoped_ptr, std::unique_ptr
  • 51. COPYRIGHT 2016 – Fundação CERTI RAIIRAII
  • 52. COPYRIGHT 2016 – Fundação CERTI CAPÍTULO 6 | Final considerations RAII RAII Resource Acquisition Is Initialization
  • 53. COPYRIGHT 2016 – Fundação CERTI Use a code standard http://www.chromium.org/developers/coding-style http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml http://clang.llvm.org/docs/ClangFormat.html
  • 54. COPYRIGHT 2016 – Fundação CERTI Unit test first Then code >TDD
  • 55. COPYRIGHT 2016 – Fundação CERTI Prefere STL/Boost algorithms
  • 56. COPYRIGHT 2016 – Fundação CERTI
  • 57. COPYRIGHT 2016 – Fundação CERTI Thanks! Vinicius Zein vtz@certi.org.br
  • 58. COPYRIGHT 2016 – Fundação CERTI References Slide 6 http://events.linuxfoundation.org/sites/events/files/slides/csimmonds-embedded-linux-timeline-2013.pdf Slide 11 http://ecn.channel9.msdn.com/events/GoingNative12/GN12Cpp11Style.pdf Slides 24, 25 and 26 https://code.google.com/p/google-breakpad/wiki/GettingStartedWithBreakpad Slide 48 http://www.pathfindersolns.com/

Notas do Editor

  1. By 1995 Linux was already attracting attention beyond desktop and server It just needed a few more steps to make it a real contender… BusyBox: Originally written by Bruce Perens in 1995 and declared complete for his intended usage in 1996,[14] BusyBox originally aimed to put a complete bootable system on a single floppy that would serve both as a rescue disk and as an installer for the Debian distribution. Since that time, it has been extended to become the de facto standard core userspace toolset for embedded Linux devices and Linux distribution installers. Since each Linux executable requires several kilobytes of overhead, having the BusyBox program combine over two hundred programs together often saves substantial disk space and system memory. Making the Linux code portable 1995 Mips 1996 m68k, ppc 1998 ucLinux portadk pra Dragonball 1999 ARM
  2. Where are we today? Android has 1.5 million activations per day, installed base 900 million 250 million set top boxes and smart TVs per annum Embedded Linux is the default OS 2005 Nokia 770 Internet Tablet running Maemo Linux 2002: December: Linksys release the WRT54G 2003: July Linksys post GPL source components of the WRT54G firmware 2004: OpenWRT project starts 2004 onwards: a large proportion of WiFi routers run Linux Where are we today? Android has 1.5 million activations per day, installed base 900 million 250 million set top boxes and smart TVs per annum Embedded Linux is the default OS
  3. When was C++ invented? I started work on what became C++ in 1979. The initial version was called "C with Classes". The first version of C++ was used internally in AT&T in August 1983. The name "C++" was used late that year. The first commercial implementation was released October 1985 at the same time as the publication of the 1st edition of The C++ Programming Language. Templates and exception handling were included later in the 1980's and documented in The Annotated C++ Reference Manual and The C++ Programming Language (2rd Edition). The first ISO C++ standard was C++98 as described in The C++ Programming Language (3rd Edition). The current definition of C++ The 2011 ISO C++ Standard described in The C++ Programming Language (4th Edition). You can find a more complete timeline and more detailed explanations in The Design and Evolution of C++ and A History of C++: 1979-1991 and Evolving a language in and for the real world: C++ 19.
  4. Different projects have different constraints – Hardware resources – Reliability constraints – Efficiency constraints • Time • Power – Time to completion – Developer skills Extremes – All that matters is to get to the market first! – If the program fails, people die – A 50% overhead implies the need for another $50M server farm
  5. -> para gerar fs básico, compilar bibliotecas de terceiros, -> permite adicionar novas bibliotecas Buildroot is a set of Makefiles and patches that makes it easy to generate a complete embedded Linux system. Buildroot can generate any or all of a cross-compilation toolchain, a root filesystem, a kernel image and a bootloader image. Buildroot is useful mainly for people working with small or embedded systems, using various CPU architectures (x86, ARM, MIPS, PowerPC, etc.) : it automates the building process of your embedded system and eases the cross-compilation process. The major Buildroot features are: Can handle everything in your embedded system development project: cross-compiling toolchain, root filesystem generation, kernel image compilation and bootloader compilation. Buildroot is also sufficiently flexible that it can also be used for only one or several of these steps. Is very easy to set up, thanks to its menuconfig, gconfig and xconfig configuration interfaces, familiar to all embedded Linux developers. Building a basic embedded Linux system with Buildroot typically takes 15-30 minutes. Supports several hundreds of packages for userspace applications and libraries: X.org stack, Gtk2, Qt, DirectFB, SDL, GStreamer and a large number of network-related and system-related utilities and libraries are supported. Supports multiple filesystem types for the root filesystem image: JFFS2, UBIFS, tarballs, romfs, cramfs, squashfs and more. Can generate an (e)glibc or uClibc cross-compilation toolchain, or re-use your existing glibc, eglibc or uClibc cross-compilation toolchain Has a simple structure that makes it easy to understand and extend. It relies only on the well-known Makefile language. Buildroot is maintained by Peter Korsgaard, and licensed under the GNU GENERAL PUBLIC LICENSE V2 (Or later). Stable releases are delivered every three months.
  6. The Yocto Project is an open-source collaboration project focused on embedded Linux developers. Among other things, the Yocto Project uses a build system based on the OpenEmbedded (OE) project, which uses the BitBake tool, to construct complete Linux images. The BitBake and OE components are combined together to form Poky, a reference build system. Intel Linux Foundation
  7. -> Autoconf -> complexo, curva de aprendizagem é alta -> Rake -> não escala bem, depende das ferramentas do Ruby -> Boost.build – Bjam -> Qmake -> qt make -> Cmake -> escala bem, é rápido, não tem outras dependências *** 1-click / 1-line build -> alterou o código, com 1 clique ou 1 linha, reconstrói tudo ?? Falar do ninja?
  8. Uma ferramenta de logs com informações como timestamp, thread id, file name e line number facilita muito a investigação de problemas. Gdb para analise após o crash -> geração de stack trace, verificação de estados de objetos e seus atributos Gdb+gdbserver -> breakpoints, debugging em real time Breakpad -> strace
  9. -> gerar um core dump -> investigar com o gdb na hr Ulimit –c unlimited
  10. Framework do Google para testes em C++ Google Test is designed to be portable: it doesn't require exceptions or RTTI; it works around various bugs in various compilers and environments; etc. As a result, it works on Linux, Mac OS X, Windows and several embedded operating systems. Nonfatal assertions (EXPECT_*) have proven to be great time savers, as they allow a test to report multiple failures in a single edit-compile-test cycle. It's easy to write assertions that generate informative messages: you just use the stream syntax to append any additional information, e.g.ASSERT_EQ(5, Foo(i)) << " where i = " << i;. It doesn't require a new set of macros or special functions. Google Test automatically detects your tests and doesn't require you to enumerate them in order to run them. Death tests are pretty handy for ensuring that your asserts in production code are triggered by the right conditions. SCOPED_TRACE helps you understand the context of an assertion failure when it comes from inside a sub-routine or loop. You can decide which tests to run using name patterns. This saves time when you want to quickly reproduce a test failure. Google Test can generate XML test result reports that can be parsed by popular continuous build system like Hudson. Simple things are easy in Google Test, while hard things are possible: in addition to advanced features like global test environments and tests parameterized by values or types, Google Test supports various ways for the user to extend the framework -- if Google Test doesn't do something out of the box, chances are that a user can implement the feature using Google Test's public API, without changing Google Test itself. In particular, you can: expand your testing vocabulary by defining custom predicates, teach Google Test how to print your types, define your own testing macros or utilities and verify them using Google Test's Service Provider Interface, and reflect on the test cases or change the test output format by intercepting the test events.
  11. Antes de implementar uma nova feature, implementar testes para essa nova feature Novo bug -> novo caso de teste Como fazer isso em C++ e embarcados?