OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | log_callback |
Macros | |
#define | ERROR_BUF_TOO_SMALL (-3) |
#define | ERROR_FAIL (-4) |
#define | ERROR_NO_CONFIG_FILE (-2) |
#define | ERROR_NOT_IMPLEMENTED (-7) |
#define | ERROR_OK (0) |
#define | ERROR_TIMEOUT_REACHED (-6) |
#define | ERROR_WAIT (-5) |
#define | LOG_CUSTOM_LEVEL(level, expr ...) |
#define | LOG_DEBUG(expr ...) |
#define | LOG_DEBUG_IO(expr ...) |
#define | LOG_ERROR(expr ...) log_printf_lf(LOG_LVL_ERROR, __FILE__, __LINE__, __func__, expr) |
#define | LOG_INFO(expr ...) log_printf_lf(LOG_LVL_INFO, __FILE__, __LINE__, __func__, expr) |
#define | LOG_LEVEL_IS(FOO) ((debug_level) >= (FOO)) |
#define | LOG_OUTPUT(expr ...) log_printf(LOG_LVL_OUTPUT, __FILE__, __LINE__, __func__, expr) |
#define | LOG_TARGET_DEBUG(target, fmt_str, ...) LOG_DEBUG("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define | LOG_TARGET_DEBUG_IO(target, fmt_str, ...) LOG_DEBUG_IO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define | LOG_TARGET_ERROR(target, fmt_str, ...) LOG_ERROR("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define | LOG_TARGET_INFO(target, fmt_str, ...) LOG_INFO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define | LOG_TARGET_WARNING(target, fmt_str, ...) LOG_WARNING("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define | LOG_USER(expr ...) log_printf_lf(LOG_LVL_USER, __FILE__, __LINE__, __func__, expr) |
#define | LOG_USER_N(expr ...) log_printf(LOG_LVL_USER, __FILE__, __LINE__, __func__, expr) |
#define | LOG_WARNING(expr ...) log_printf_lf(LOG_LVL_WARNING, __FILE__, __LINE__, __func__, expr) |
#define | PRINTF_ATTRIBUTE_FORMAT printf |
Typedefs | |
typedef void(* | log_callback_fn) (void *priv, const char *file, unsigned int line, const char *function, const char *string) |
Enumerations | |
enum | log_levels { LOG_LVL_SILENT = -3 , LOG_LVL_OUTPUT = -2 , LOG_LVL_USER = -1 , LOG_LVL_ERROR = 0 , LOG_LVL_WARNING = 1 , LOG_LVL_INFO = 2 , LOG_LVL_DEBUG = 3 , LOG_LVL_DEBUG_IO = 4 } |
Functions | |
void | alive_sleep (uint64_t ms) |
char * | alloc_printf (const char *fmt,...) __attribute__((format(PRINTF_ATTRIBUTE_FORMAT |
char * | alloc_vprintf (const char *fmt, va_list ap) |
void | busy_sleep (uint64_t ms) |
char const char * | find_nonprint_char (const char *buf, unsigned int buf_len) |
Find the first non-printable character in the char buffer, return a pointer to it. More... | |
void | keep_alive (void) |
void | kept_alive (void) |
int | log_add_callback (log_callback_fn fn, void *priv) |
void | log_exit (void) |
void void | log_init (void) |
Initialize logging module. More... | |
void | log_printf (enum log_levels level, const char *file, unsigned int line, const char *function, const char *format,...) __attribute__((format(PRINTF_ATTRIBUTE_FORMAT |
void | log_printf_lf (enum log_levels level, const char *file, unsigned int line, const char *function, const char *format,...) __attribute__((format(PRINTF_ATTRIBUTE_FORMAT |
int | log_register_commands (struct command_context *cmd_ctx) |
int | log_remove_callback (log_callback_fn fn, void *priv) |
void | log_socket_error (const char *socket_desc) |
void void | log_vprintf_lf (enum log_levels level, const char *file, unsigned int line, const char *function, const char *format, va_list args) |
Variables | |
int | debug_level |
#define LOG_CUSTOM_LEVEL | ( | level, | |
expr ... | |||
) |
#define LOG_DEBUG | ( | expr ... | ) |
#define LOG_DEBUG_IO | ( | expr ... | ) |
#define LOG_ERROR | ( | expr ... | ) | log_printf_lf(LOG_LVL_ERROR, __FILE__, __LINE__, __func__, expr) |
#define LOG_INFO | ( | expr ... | ) | log_printf_lf(LOG_LVL_INFO, __FILE__, __LINE__, __func__, expr) |
#define LOG_LEVEL_IS | ( | FOO | ) | ((debug_level) >= (FOO)) |
#define LOG_OUTPUT | ( | expr ... | ) | log_printf(LOG_LVL_OUTPUT, __FILE__, __LINE__, __func__, expr) |
#define LOG_TARGET_DEBUG | ( | target, | |
fmt_str, | |||
... | |||
) | LOG_DEBUG("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define LOG_TARGET_DEBUG_IO | ( | target, | |
fmt_str, | |||
... | |||
) | LOG_DEBUG_IO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define LOG_TARGET_ERROR | ( | target, | |
fmt_str, | |||
... | |||
) | LOG_ERROR("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define LOG_TARGET_INFO | ( | target, | |
fmt_str, | |||
... | |||
) | LOG_INFO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define LOG_TARGET_WARNING | ( | target, | |
fmt_str, | |||
... | |||
) | LOG_WARNING("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) |
#define LOG_USER | ( | expr ... | ) | log_printf_lf(LOG_LVL_USER, __FILE__, __LINE__, __func__, expr) |
#define LOG_USER_N | ( | expr ... | ) | log_printf(LOG_LVL_USER, __FILE__, __LINE__, __func__, expr) |
#define LOG_WARNING | ( | expr ... | ) | log_printf_lf(LOG_LVL_WARNING, __FILE__, __LINE__, __func__, expr) |
typedef void(* log_callback_fn) (void *priv, const char *file, unsigned int line, const char *function, const char *string) |
enum log_levels |
void alive_sleep | ( | uint64_t | ms | ) |
Definition at line 456 of file log.c.
References keep_alive().
Referenced by aduc702x_check_flash_completion(), aducm360_check_flash_completion(), ambiqmicro_exec_command(), ap_poll_register(), arc_exit_debug(), arc_halt(), arc_step(), arm720t_soft_reset_halt(), arm7_9_execute_sys_speed(), arm7_9_soft_reset_halt(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), at91sam7_wait_status_busy(), at91sam9_nand_ready(), bitbang_swd_read_reg(), bitbang_swd_write_reg(), cfi_intel_wait_status_busy(), cfi_spansion_wait_status_busy(), COMMAND_HANDLER(), cortex_m_soft_reset_halt(), dap_dp_poll_register(), davinci_nand_ready(), efm32x_wait_status(), em357_wait_status_busy(), esirisc_wait_debug_active(), esp32_apptrace_wait4halt(), esp32_apptrace_wait_tracing_finished(), esp32_soc_reset(), esp32s2_soc_reset(), esp32s3_soc_reset(), esp_algorithm_run_image(), fespi_wip(), imx31_nand_ready(), isc_leave(), jtag_sleep(), jtagspi_wait(), kinetis_ke_ftmrx_command(), kinetis_ke_mdm_poll_register(), kinetis_ke_prepare_flash(), kinetis_mdm_poll_register(), lpc2900_wait_status(), lpc3180_controller_ready(), lpc3180_nand_ready(), lpc3180_tc_ready(), lpc32xx_controller_ready(), lpc32xx_dma_ready(), lpc32xx_nand_ready(), lpc32xx_tc_ready(), mrvlqspi_fifo_flush(), mrvlqspi_flash_busy_status(), mrvlqspi_set_ss_state(), mrvlqspi_stop_transfer(), mxc_nand_ready(), nand_page_command(), nand_poll_ready(), nand_read_status(), nrf5_erase_page(), nrf5_wait_for_nvmc(), nuc910_nand_ready(), or1k_is_cpu_running(), pic32mx_wait_status_busy(), poll_busy(), poll_ssp_busy(), poll_tff(), psoc5lp_spc_busy_wait_data(), psoc5lp_spc_busy_wait_idle(), rpc_hf_wait_tend(), s3c2440_nand_ready(), sh_qspi_wait_for_bit(), sim3x_erase_page(), sim3x_flash_erase(), stm32l4_wait_status_busy(), stm32lx_wait_until_bsy_clear_timeout(), stm32x_wait_flash_op_queue(), stm32x_wait_status_busy(), stm32x_write_option(), stmqspi_erase(), str7x_waitbusy(), str9x_erase(), str9x_write(), str9xpec_erase_area(), swd_connect_multidrop(), swd_connect_single(), swm050_erase(), swm050_mass_erase(), target_profiling_default(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), tms470_try_flash_keys(), tms470_write(), w600_start_do(), wait_till_ready(), xcf_erase_check(), xds110_init(), xmc4xxx_wait_status_busy(), xscale_read_tx(), and xscale_write_rx().
char* alloc_printf | ( | const char * | fmt, |
... | |||
) |
char* alloc_vprintf | ( | const char * | fmt, |
va_list | ap | ||
) |
Definition at line 339 of file log.c.
References NULL.
Referenced by __attribute__(), alloc_printf(), command_print(), command_print_sameline(), command_run_linef(), log_printf(), and log_vprintf_lf().
void busy_sleep | ( | uint64_t | ms | ) |
Definition at line 469 of file log.c.
References timeval_ms().
Referenced by COMMAND_HANDLER(), niietcm4_opstatus_check(), niietcm4_uopstatus_check(), numicro_erase(), numicro_fmc_cmd(), and numicro_write().
char const char* find_nonprint_char | ( | const char * | buf, |
unsigned int | buf_len | ||
) |
Find the first non-printable character in the char buffer, return a pointer to it.
If no such character exists, return NULL.
Definition at line 508 of file log.c.
References NULL.
Referenced by gdb_log_incoming_packet(), and gdb_log_outgoing_packet().
void keep_alive | ( | void | ) |
Definition at line 415 of file log.c.
References gdb_timeout_warning(), KEEP_ALIVE_KICK_TIME_MS, KEEP_ALIVE_TIMEOUT_MS, last_time, server_keep_clients_alive(), and timeval_ms().
Referenced by alive_sleep(), arm720t_soft_reset_halt(), arm7_9_execute_sys_speed(), arm7_9_read_memory(), arm7_9_soft_reset_halt(), arm7_9_write_memory(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), armv7a_l1_d_cache_clean_virt(), armv7a_l1_d_cache_flush_level(), armv7a_l1_d_cache_flush_virt(), armv7a_l1_d_cache_inval_virt(), armv7a_l1_i_cache_inval_virt(), ath79_erase(), avrf_write(), cc26xx_wait_algo_done(), cc26xx_write(), cc3220sf_erase(), cc3220sf_mass_erase(), cc3220sf_write(), cfi_intel_write_block(), COMMAND_HANDLER(), COMMAND_HELPER(), cortex_m_load_core_reg_u32(), cortex_m_store_core_reg_u32(), dmi_op_timeout(), efm32x_write_word(), esirisc_flash_wait(), fespi_erase(), image_calculate_checksum(), ipc_acquire(), ipc_poll_lock_stat(), jtag_add_sleep(), kinetis_write_inner(), kinetis_write_sections(), mips64_ejtag_fastdata_scan(), mips_ejtag_add_scan_96(), mips_ejtag_drscan_32_queued(), mips_ejtag_drscan_64(), mips_ejtag_fastdata_scan(), mpsse_flush(), msp432_wait_inactive(), msp432_wait_return_code(), msp432_write(), npcx_get_flash_id(), nrf5_wait_for_nvmc(), qn908x_write(), qspi_verify(), read_memory_bus_v1(), riscv_batch_run(), riscv_get_register(), riscv_program_exec(), riscv_set_register(), samd_check_error(), same5_wait_and_check_error(), sh_qspi_erase(), slow_fespi_write_buffer(), stlink_tcp_send_cmd(), stmqspi_blank_check(), stmqspi_erase(), stmsmi_erase(), stmsmi_write(), target_call_timer_callbacks_check_time(), target_fill_mem(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), target_wait_state(), xmc4xxx_wait_status_busy(), xscale_read_tx(), xscale_write_rx(), and xtensa_wait_algorithm().
void kept_alive | ( | void | ) |
Definition at line 443 of file log.c.
References gdb_timeout_warning(), KEEP_ALIVE_TIMEOUT_MS, last_time, and timeval_ms().
Referenced by gdb_put_packet().
int log_add_callback | ( | log_callback_fn | fn, |
void * | priv | ||
) |
Definition at line 297 of file log.c.
References ERROR_BUF_TOO_SMALL, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, log_callback::fn, log_callbacks, log_callback::next, log_callback::priv, and priv.
Referenced by command_log_capture_start(), gdb_new_connection(), and telnet_new_connection().
void log_exit | ( | void | ) |
Definition at line 287 of file log.c.
References log_output, and NULL.
Referenced by openocd_main().
void void log_init | ( | void | ) |
Initialize logging module.
Call during program startup.
Definition at line 267 of file log.c.
References debug_level, ERROR_OK, last_time, LOG_LVL_DEBUG_IO, LOG_LVL_SILENT, log_output, start, and timeval_ms().
Referenced by setup_command_handler().
void log_printf | ( | enum log_levels | level, |
const char * | file, | ||
unsigned int | line, | ||
const char * | function, | ||
const char * | format, | ||
... | |||
) |
void log_printf_lf | ( | enum log_levels | level, |
const char * | file, | ||
unsigned int | line, | ||
const char * | function, | ||
const char * | format, | ||
... | |||
) |
int log_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 262 of file log.c.
References log_command_handlers, NULL, and register_commands().
Referenced by setup_command_handler().
int log_remove_callback | ( | log_callback_fn | fn, |
void * | priv | ||
) |
Definition at line 322 of file log.c.
References ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, log_callback::fn, log_callbacks, log_callback::next, log_callback::priv, and priv.
Referenced by command_log_capture_finish(), gdb_connection_closed(), and telnet_connection_closed().
void log_socket_error | ( | const char * | socket_desc | ) |
Definition at line 484 of file log.c.
References DWORD, LOG_ERROR, MAX_SOCKET_ERR_MSG_LENGTH, and NULL.
Referenced by gdb_get_char_inner(), jtag_vpi_quit(), jtag_vpi_receive_cmd(), jtag_vpi_send_cmd(), remote_bitbang_fill_buf(), remote_bitbang_flush(), remote_bitbang_init_tcp(), remote_bitbang_init_unix(), remote_bitbang_quit(), semihosting_redirect_read(), and semihosting_redirect_write().
void void log_vprintf_lf | ( | enum log_levels | level, |
const char * | file, | ||
unsigned int | line, | ||
const char * | function, | ||
const char * | format, | ||
va_list | args | ||
) |
Definition at line 159 of file log.c.
References alloc_vprintf(), count, debug_level, and log_puts().
Referenced by jaylink_log_handler(), and log_printf_lf().
|
extern |
Definition at line 35 of file log.c.
Referenced by arc_arch_state(), arc_exit_debug(), arc_halt(), arm720t_soft_reset_halt(), arm7_9_execute_sys_speed(), arm7_9_soft_reset_halt(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), COMMAND_HANDLER(), default_interface_jtag_execute_queue(), dump_field(), ecos_check_app_info(), execute_abstract_command(), log_init(), log_memory_access(), log_printf(), log_puts(), log_vprintf_lf(), poll_target(), script_debug(), xscale_read_tx(), and xscale_write_rx().