PebbleOS v4.45.0-162-g88634f016
Loading...
Searching...
No Matches
pbl_coredump_backend_api Struct Reference

Backend operations. More...

#include <backend.h>

Data Fields

int(* init )(const struct pbl_coredump_backend *backend)
 Bring up what the backend needs without OS services.
 
int(* start )(const struct pbl_coredump_backend *backend, bool forced, uint32_t timestamp)
 Get ready to receive a dump.
 
int(* write )(const struct pbl_coredump_backend *backend, const void *data, size_t len)
 Write the next bytes of the dump.
 
size_t(* space )(const struct pbl_coredump_backend *backend)
 Get the bytes that can still be written.
 
void(* end )(const struct pbl_coredump_backend *backend)
 The image is complete.
 
int(* stored_find )(const struct pbl_coredump_backend *backend, bool unread_only, uint32_t *id)
 Find the most recent stored dump.
 
int(* stored_read )(const struct pbl_coredump_backend *backend, uint32_t id, uint32_t offset, void *buf, size_t len)
 Read a stored dump.
 
int(* stored_mark_read )(const struct pbl_coredump_backend *backend, uint32_t id)
 Mark a stored dump as read.
 

Detailed Description

Backend operations.

Field Documentation

◆ end

void(* pbl_coredump_backend_api::end) (const struct pbl_coredump_backend *backend)

The image is complete.

Optional.

◆ init

int(* pbl_coredump_backend_api::init) (const struct pbl_coredump_backend *backend)

Bring up what the backend needs without OS services.

Optional.

Runs before pbl_coredump_platform_prepare(), and must not change what is stored.

Returns
0 on success, or a negative errno.

◆ space

size_t(* pbl_coredump_backend_api::space) (const struct pbl_coredump_backend *backend)

Get the bytes that can still be written.

Lets the core end the image cleanly, between chunks. Optional, for unbounded outputs.

◆ start

int(* pbl_coredump_backend_api::start) (const struct pbl_coredump_backend *backend, bool forced, uint32_t timestamp)

Get ready to receive a dump.

Stored dumps can be replaced from here on.

Parameters
backendBackend.
forcedReplace a dump that has not been read yet, however recent.
timestampWall clock time of the dump, in seconds.
Returns
0 on success, -EEXIST to keep the stored dump and skip this one, or a negative errno.

◆ stored_find

int(* pbl_coredump_backend_api::stored_find) (const struct pbl_coredump_backend *backend, bool unread_only, uint32_t *id)

Find the most recent stored dump.

Optional.

Parameters
backendBackend.
unread_onlyOnly consider dumps that have not been marked as read.
[out]idIdentifier of the dump.
Returns
0 on success, or -ENOENT if there is none.

◆ stored_mark_read

int(* pbl_coredump_backend_api::stored_mark_read) (const struct pbl_coredump_backend *backend, uint32_t id)

Mark a stored dump as read.

Required with stored_find.

Returns
0 on success, or a negative errno.

◆ stored_read

int(* pbl_coredump_backend_api::stored_read) (const struct pbl_coredump_backend *backend, uint32_t id, uint32_t offset, void *buf, size_t len)

Read a stored dump.

Required with stored_find.

Returns
0 on success, or a negative errno, also for a range outside the storage of the dump.

◆ write

int(* pbl_coredump_backend_api::write) (const struct pbl_coredump_backend *backend, const void *data, size_t len)

Write the next bytes of the dump.

Returns
0 on success, or a negative errno.

The documentation for this struct was generated from the following file: