osd_coretracelogger class¶
Obtain and decode a core trace (high-level API).
Usage¶
#include <osd/osd.h>
#include <osd/coretracelogger.h>
Public Interface¶
Functions
-
osd_result
osd_coretracelogger_new
(struct osd_coretracelogger_ctx ** ctx, struct osd_log_ctx * log_ctx, const char * host_controller_address, uint16_t ctm_di_addr)¶ Create a new context object
-
osd_result
osd_coretracelogger_connect
(struct osd_coretracelogger_ctx * ctx)¶ Connect to the host controller
- Return
- OSD_OK on success, any other value indicates an error
- See
- osd_hostmod_disconnect()
- Parameters
ctx
: the osd_hostmod_ctx context object
-
osd_result
osd_coretracelogger_disconnect
(struct osd_coretracelogger_ctx * ctx)¶ Shut down all communication with the device
- Return
- OSD_OK on success, any other value indicates an error
- See
- osd_hostmod_run()
- Parameters
ctx
: the osd_hostmod context object
-
bool
osd_coretracelogger_is_connected
(struct osd_coretracelogger_ctx * ctx)¶ Is the connection to the device active?
- Return
- 1 if connected, 0 if not connected
- See
- osd_hostmod_connect()
- See
- osd_hostmod_disconnect()
- Parameters
ctx
: the osd_hostmod context object
-
void
osd_coretracelogger_free
(struct osd_coretracelogger_ctx ** ctx_p)¶ Free the context object
-
osd_result
osd_coretracelogger_start
(struct osd_coretracelogger_ctx * ctx)¶ Start collecting system logs
Instruct the STM module to start sending traces to us.
-
osd_result
osd_coretracelogger_stop
(struct osd_coretracelogger_ctx * ctx)¶ Stop collecting system logs
-
osd_result
osd_coretracelogger_set_log
(struct osd_coretracelogger_ctx * ctx, FILE * fp)¶ Set a file to write all log output to
- Return
- OSD_OK if successful, any other value indicates an error
- Parameters
ctx
: context objectfp
: a file pointer to write the logs to
-
osd_result
osd_coretracelogger_set_elf
(struct osd_coretracelogger_ctx * ctx, const char * elf_filename)¶ Set the path to the ELF file used to decode the core trace events
To disable ELF parsing, set elf_filename to NULL.
- Return
- OSD_OK when reading the ELF file succeeded any other value indicates an error
- Parameters
ctx
: context objectelf_filename
: path to the ELF file. Set to NULL to disable ELF parsing.