2020-02-06 11:59:54 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Intel corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _TRACE_FORMAT_COMMON_H
|
|
|
|
#define _TRACE_FORMAT_COMMON_H
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <sys/printk.h>
|
2020-02-06 22:14:51 +08:00
|
|
|
#include <tracing/tracing_format.h>
|
2020-02-06 11:59:54 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief A structure to represent tracing format context.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
int status;
|
2020-05-28 00:26:57 +08:00
|
|
|
uint32_t length;
|
2020-02-06 11:59:54 +08:00
|
|
|
} tracing_ctx_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Put string format tracing message to tracing buffer.
|
|
|
|
*
|
|
|
|
* @param str String to format.
|
|
|
|
* @param args Variable parameters.
|
|
|
|
*
|
|
|
|
* @return true if put tracing message to tracing buffer successfully.
|
|
|
|
*/
|
|
|
|
bool tracing_format_string_put(const char *str, va_list args);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Put raw data format tracing message to tracing buffer.
|
|
|
|
*
|
|
|
|
* @param data Raw data to be traced.
|
|
|
|
* @param length Raw data length.
|
|
|
|
*
|
|
|
|
* @return true if put tracing message to tracing buffer successfully.
|
|
|
|
*/
|
2020-05-28 00:26:57 +08:00
|
|
|
bool tracing_format_raw_data_put(uint8_t *data, uint32_t size);
|
2020-02-06 11:59:54 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Put tracing_data format message to tracing buffer.
|
|
|
|
*
|
|
|
|
* @param tracing_data_array Tracing_data format data array to be traced.
|
|
|
|
* @param count Tracing_data array data count.
|
|
|
|
*
|
|
|
|
* @return true if put tracing message to tracing buffer successfully.
|
|
|
|
*/
|
2020-05-28 00:26:57 +08:00
|
|
|
bool tracing_format_data_put(tracing_data_t *tracing_data_array, uint32_t count);
|
2020-02-06 11:59:54 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|