PX4 Firmware
PX4 Autopilot Software http://px4.io
print_load_posix.c File Reference

Print the current system load. More...

#include <px4_platform_common/posix.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <systemlib/cpuload.h>
#include <systemlib/printload.h>
#include <drivers/drv_hrt.h>
Include dependency graph for print_load_posix.c:

Go to the source code of this file.

Macros

#define CL   "\033[K"
 

Functions

void init_print_load_s (uint64_t t, struct print_load_s *s)
 
void print_load (uint64_t t, int fd, struct print_load_s *print_state)
 
void print_load_buffer (uint64_t t, char *buffer, int buffer_length, print_load_callback_f cb, void *user, struct print_load_s *print_state)
 Print load to a buffer, and call cb after each written line (buffer will not include '
') More...
 

Variables

struct system_load_s system_load
 

Detailed Description

Print the current system load.

Author
Lorenz Meier loren.nosp@m.z@px.nosp@m.4.io

Definition in file print_load_posix.c.

Macro Definition Documentation

◆ CL

#define CL   "\033[K"

Definition at line 64 of file print_load_posix.c.

Referenced by print_load().

Function Documentation

◆ init_print_load_s()

void init_print_load_s ( uint64_t  t,
struct print_load_s s 
)

Definition at line 66 of file print_load_posix.c.

References print_load_s::blocked_count, CONFIG_MAX_TASKS, print_load_s::interval_start_time, print_load_s::interval_time_ms_inv, print_load_s::last_times, print_load_s::new_time, print_load_s::running_count, and print_load_s::total_user_time.

Referenced by px4::logger::Logger::initialize_load_output(), and top_main().

Here is the caller graph for this function:

◆ print_load()

void print_load ( uint64_t  t,
int  fd,
struct print_load_s print_state 
)

Definition at line 84 of file print_load_posix.c.

References CL.

Referenced by top_main().

Here is the caller graph for this function:

◆ print_load_buffer()

void print_load_buffer ( uint64_t  t,
char *  buffer,
int  buffer_length,
print_load_callback_f  cb,
void *  user,
struct print_load_s print_state 
)

Print load to a buffer, and call cb after each written line (buffer will not include '
')

Definition at line 178 of file print_load_posix.c.

Referenced by px4::logger::Logger::initialize_load_output(), and px4::logger::Logger::write_load_output().

Here is the caller graph for this function:

Variable Documentation

◆ system_load