Minimal Structured Logging for Autonomous Vehicles - Robert Keelan - CppCon 2019

preview_player
Показать описание



In order to quickly diagnose issues with autonomous vehicles, it is important to produce human readable debug logs for developers, vehicle operators, and triage engineers. The logged format should also allow for easy data aggregation across a large fleet of vehicles. Traditionally, debug logging frameworks that are based on iostream s cannot meet the performance and usability demands of this domain. This talk will describe a fast and efficient structured debug logging framework. This framework can also be incorporated into error handling code, and is easily toolable for offline statistics gathering.

We'll begin with a quick look at debug logging requirements for autonomous vehicles and a review of current debug logging frameworks. Next, we'll discuss the implementation of the Explanation<> class, which is the centerpiece of the debug logging framework and is the actual data type being logged. The data type uses static and constexpr data to efficiently represent a formatted string. It also allows significant performance improvements to be made to the the debug logging framework. The framework enables novel usability improvements, like the ability to efficiently pass around log statements encoded in the Explanation<> type.

Next, we'll compare the performance of this approach to the original logging framework based on iostreams for runtime performance, log size, and toolability. Finally, we will illustrate how the implementation of this library will greatly simplified by C++20.

Robert Keelan
Argo AI
Onboard Code Health Lead

Rob Keelan began his programming career as a Mechanical Engineering PhD student coding biological heat transfer simulations for heterogeneous systems. Rob leads the C++ Code Health team at Argo AI. The team is responsible for maintaining Argo’s standard library, and writing custom static analysis and refactoring tools. He is particularly interested in using library design and static analysis tools to ensure fast, efficient, and safe code for autonomous vehicles.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

Very interesting presentation! Is the open source of code now available?

sarojmahapatra
Автор

Hi!

I suspect, that linking you list of globals might not be thread safe - at least some knowing people told me that about my similar idea.

There is this thing, called Deferred dynamic initialisation

I'd suggest looking into it.

Everything else is really nice.

denisyaroshevskiy
Автор

At 11:09, I didn't understand the rationale behind do while (false). Why not just use braces instead for scoping objects?

mohammedj