1 /* 2 * Copyright (c) 2019 Intel corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef _TRACE_FORMAT_COMMON_H 8 #define _TRACE_FORMAT_COMMON_H 9 10 #include <stdarg.h> 11 #include <sys/printk.h> 12 #include <tracing/tracing_format.h> 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 /** 19 * @brief A structure to represent tracing format context. 20 */ 21 typedef struct { 22 int status; 23 uint32_t length; 24 } tracing_ctx_t; 25 26 /** 27 * @brief Put string format tracing message to tracing buffer. 28 * 29 * @param str String to format. 30 * @param args Variable parameters. 31 * 32 * @return true if put tracing message to tracing buffer successfully. 33 */ 34 bool tracing_format_string_put(const char *str, va_list args); 35 36 /** 37 * @brief Put raw data format tracing message to tracing buffer. 38 * 39 * @param data Raw data to be traced. 40 * @param length Raw data length. 41 * 42 * @return true if put tracing message to tracing buffer successfully. 43 */ 44 bool tracing_format_raw_data_put(uint8_t *data, uint32_t size); 45 46 /** 47 * @brief Put tracing_data format message to tracing buffer. 48 * 49 * @param tracing_data_array Tracing_data format data array to be traced. 50 * @param count Tracing_data array data count. 51 * 52 * @return true if put tracing message to tracing buffer successfully. 53 */ 54 bool tracing_format_data_put(tracing_data_t *tracing_data_array, uint32_t count); 55 56 #ifdef __cplusplus 57 } 58 #endif 59 60 #endif 61