PX4 Firmware
PX4 Autopilot Software http://px4.io
px4::logger Namespace Reference

Namespaces

 util
 

Classes

class  Logger
 
struct  LoggerSubscription
 
class  LogWriter
 Manages starting, stopping & writing of logged data using the configured backend. More...
 
class  LogWriterFile
 Writes logging data to a file. More...
 
class  LogWriterMavlink
 Writes logging data to uORB, and then sent via mavlink. More...
 
struct  perf_callback_data_t
 
struct  watchdog_data_t
 

Enumerations

enum  LogType { LogType::Full = 0, LogType::Mission, LogType::Count }
 Defines different log (file) types. More...
 
enum  SDLogProfileMask : int32_t {
  SDLogProfileMask::DEFAULT = 1 << 0, SDLogProfileMask::ESTIMATOR_REPLAY = 1 << 1, SDLogProfileMask::THERMAL_CALIBRATION = 1 << 2, SDLogProfileMask::SYSTEM_IDENTIFICATION = 1 << 3,
  SDLogProfileMask::HIGH_RATE = 1 << 4, SDLogProfileMask::DEBUG_TOPICS = 1 << 5, SDLogProfileMask::SENSOR_COMPARISON = 1 << 6, SDLogProfileMask::VISION_AND_AVOIDANCE = 1 << 7
}
 
enum  MissionLogType : int32_t { MissionLogType::Disabled = 0, MissionLogType::Complete = 1, MissionLogType::Geotagging = 2 }
 

Functions

const char * log_type_str (LogType type)
 
bool operator & (SDLogProfileMask a, SDLogProfileMask b)
 
bool watchdog_update (watchdog_data_t &watchdog_data)
 Update the watchdog and trigger it if necessary. More...
 
void watchdog_initialize (const pid_t pid_logger_main, const pthread_t writer_thread, watchdog_data_t &watchdog_data)
 Initialize the watchdog, fill in watchdog_data. More...
 

Variables

static constexpr uint8_t MSG_ID_INVALID = UINT8_MAX
 

Enumeration Type Documentation

◆ LogType

enum px4::logger::LogType
strong

Defines different log (file) types.

Enumerator
Full 

Normal, full size log.

Mission 

reduced mission log (e.g. for geotagging)

Count 

Definition at line 51 of file log_writer_file.h.

◆ MissionLogType

enum px4::logger::MissionLogType : int32_t
strong
Enumerator
Disabled 
Complete 
Geotagging 

Definition at line 75 of file logger.h.

◆ SDLogProfileMask

enum px4::logger::SDLogProfileMask : int32_t
strong
Enumerator
DEFAULT 
ESTIMATOR_REPLAY 
THERMAL_CALIBRATION 
SYSTEM_IDENTIFICATION 
HIGH_RATE 
DEBUG_TOPICS 
SENSOR_COMPARISON 
VISION_AND_AVOIDANCE 

Definition at line 64 of file logger.h.

Function Documentation

◆ log_type_str()

const char * px4::logger::log_type_str ( LogType  type)

Definition at line 375 of file log_writer_file.cpp.

References Count, Full, and Mission.

Referenced by px4::logger::LogWriterFile::start_log(), and px4::logger::Logger::start_log_file().

Here is the caller graph for this function:

◆ operator &()

bool px4::logger::operator& ( SDLogProfileMask  a,
SDLogProfileMask  b 
)
inline

Definition at line 81 of file logger.h.

◆ watchdog_initialize()

void px4::logger::watchdog_initialize ( const pid_t  pid_logger_main,
const pthread_t  writer_thread,
watchdog_data_t watchdog_data 
)

Initialize the watchdog, fill in watchdog_data.

Definition at line 134 of file watchdog.cpp.

References CONFIG_MAX_TASKS, and system_load.

Referenced by px4::logger::Logger::run().

Here is the caller graph for this function:

◆ watchdog_update()

bool px4::logger::watchdog_update ( watchdog_data_t watchdog_data)

Update the watchdog and trigger it if necessary.

It is triggered when the log writer task is in ready state for a certain period of time, but did not get scheduled. It means that most likely some other higher-prio task runs busy. When the watchdog triggers, it boosts the priority of the logger's main & writer tasks to maximum, so that they get scheduled again.

Expected to be called from IRQ context.

Parameters
watchdog_data
Returns
true if watchdog is triggered, false otherwise

Definition at line 49 of file watchdog.cpp.

References counter, hrt_absolute_time(), hrt_abstime, and system_load.

Referenced by timer_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MSG_ID_INVALID

constexpr uint8_t px4::logger::MSG_ID_INVALID = UINT8_MAX
static

Definition at line 86 of file logger.h.

Referenced by px4::logger::Logger::write_add_logged_msg().