Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
tracing_format.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Intel corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_TRACING_TRACING_FORMAT_H
8#define ZEPHYR_INCLUDE_TRACING_TRACING_FORMAT_H
9
10#include <toolchain/common.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
19typedef struct tracing_data {
22} __packed tracing_data_t;
23
27#define TRACING_STRING(fmt, ...) \
28 do { \
29 tracing_format_string(fmt, ##__VA_ARGS__); \
30 } while (false)
31
35#define TRACING_FORMAT_DATA(x) \
36 ((struct tracing_data){.data = (uint8_t *)&(x), .length = sizeof((x))})
37
43#define TRACING_DATA(...) \
44 do { \
45 struct tracing_data arg[] = {__VA_ARGS__}; \
46 \
47 tracing_format_data(arg, sizeof(arg) / \
48 sizeof(struct tracing_data)); \
49 } while (false)
50
57void tracing_format_string(const char *str, ...);
58
66
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif
Common toolchain abstraction.
ZTEST_BMEM int count
Definition: main.c:33
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
A structure to represent tracing data format.
Definition: tracing_format.h:19
uint8_t * data
Definition: tracing_format.h:20
uint32_t length
Definition: tracing_format.h:21
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
struct tracing_data tracing_data_t
A structure to represent tracing data format.
void tracing_format_data(tracing_data_t *tracing_data_array, uint32_t count)
Tracing a message in tracing data format.
void tracing_format_raw_data(uint8_t *data, uint32_t length)
Tracing a message in raw data format.
void tracing_format_string(const char *str,...)
Tracing a message in string format.