O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

TDC2016SP - Trilha Linux Embarcado

159 visualizações

Publicada em

C++ e Linux Embarcado: União Perfeita

Publicada em: Educação
  • Seja o primeiro a comentar

TDC2016SP - Trilha Linux Embarcado

  1. 1. COPYRIGHT 2016 – Fundação CERTI C++ and Embedded Linux: a perfect match Vinicius Zein | Fundação CERTI
  2. 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. 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. 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. 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. 6. COPYRIGHT 2016 – Fundação CERTI Embedded Linux Chapter 1
  7. 7. COPYRIGHT 2016 – Fundação CERTI CAPÍTULO 1 | LINUX EMBARCADO
  8. 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. 9. COPYRIGHT 2016 – Fundação CERTI C++ CHAPTER 2
  10. 10. 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
  11. 11. COPYRIGHT 2016 – Fundação CERTI Don’t lower your level of abstraction without a good reason! Low-levelimplies Morecode Morebugs Highermaintenancecosts
  12. 12. COPYRIGHT 2016 – Fundação CERTI Embedded Linux C++ Perfect match CHAPTER 2 | C++
  13. 13. COPYRIGHT 2016 – Fundação CERTI DEVELOPMENT TOOLS AND DEBUGGING CHAPTER 3
  14. 14. 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
  15. 15. 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”
  16. 16. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING Build systems > Autoconf Rake Boost.Build Qmake Scons CMake
  17. 17. 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
  18. 18. If debugging is the process of removing bugs, then programming must be the process of putting them in Edsger Dijkstra
  19. 19. 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.
  20. 20. 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>
  21. 21. COPYRIGHT 2016 – Fundação CERTI
  22. 22. COPYRIGHT 2016 – Fundação CERTI
  23. 23. COPYRIGHT 2016 – Fundação CERTI
  24. 24. COPYRIGHT 2016 – Fundação CERTI CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING Debugging > Breakpad
  25. 25. COPYRIGHT 2016 – Fundação CERTI Debugging > Breakpad CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  26. 26. COPYRIGHT 2016 – Fundação CERTI Continuos integration CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  27. 27. COPYRIGHT 2016 – Fundação CERTI Other tools > Static annalysis coverity, cppcheck Coverage– cccc Valgrind, tcmalloc CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  28. 28. COPYRIGHT 2016 – Fundação CERTI
  29. 29. COPYRIGHT 2016 – Fundação CERTI Code coverage CHAPTER 3 | DEVELOPMENT TOOLS AND DEBUGGING
  30. 30. COPYRIGHT 2016 – Fundação CERTI
  31. 31. Test frameworks for C++ CHAPTER 4
  32. 32. 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
  33. 33. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  34. 34. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  35. 35. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  36. 36. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  37. 37. COPYRIGHT 2016 – Fundação CERTI Unit tests – gtest
  38. 38. 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++
  39. 39. COPYRIGHT 2016 – Fundação CERTI gmock
  40. 40. COPYRIGHT 2016 – Fundação CERTI gmock
  41. 41. COPYRIGHT 2016 – Fundação CERTI gmock
  42. 42. COPYRIGHT 2016 – Fundação CERTI gmock
  43. 43. COPYRIGHT 2016 – Fundação CERTI gmock
  44. 44. COPYRIGHT 2016 – Fundação CERTI Google Benchmark https://github.com/google/benchmark Function benchmarking CHAPTER 4 | TEST FRAMEWORKS FOR C++
  45. 45. COPYRIGHT 2016 – Fundação CERTI Google Benchmark
  46. 46. Test driven development CHAPTER 5
  47. 47. COPYRIGHT 2016 – Fundação CERTI CHAPTER 5 | TEST DRIVEN DEVELOPMENT
  48. 48. Final considerations CHAPTER 6
  49. 49. COPYRIGHT 2016 – Fundação CERTI Use smart pointers std::shared_ptr, std::scoped_ptr, std::unique_ptr
  50. 50. COPYRIGHT 2016 – Fundação CERTI RAIIRAII
  51. 51. COPYRIGHT 2016 – Fundação CERTI CAPÍTULO 6 | Final considerations RAII RAII Resource Acquisition Is Initialization
  52. 52. COPYRIGHT 2016 – Fundação CERTI Use a code standard h#p://www.chromium.org/developers/coding-style h#p://google-styleguide.googlecode.com/svn/trunk/cppguide.xml h#p://clang.llvm.org/docs/ClangFormat.html
  53. 53. COPYRIGHT 2016 – Fundação CERTI Unit test first Then code >TDD
  54. 54. COPYRIGHT 2016 – Fundação CERTI Prefere STL/Boost algorithms
  55. 55. COPYRIGHT 2016 – Fundação CERTI ?
  56. 56. COPYRIGHT 2016 – Fundação CERTI Thanks! Vinicius Zein vtz@certi.org.br
  57. 57. COPYRIGHT 2016 – Fundação CERTI References Slide 6 h#p://events.linuxfounda?on.org/sites/events/files/slides/csimmonds-embedded-linux-?meline-2013.pdf Slide 11 h#p://ecn.channel9.msdn.com/events/GoingNa?ve12/GN12Cpp11Style.pdf Slides 24, 25 and 26 h#ps://code.google.com/p/google-breakpad/wiki/GeJngStartedWithBreakpad Slide 48 h#p://www.pathfindersolns.com/

×