tracing_format_common.h 1.3 KB

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