arm-spe-pkt-decoder.h 903 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Arm Statistical Profiling Extensions (SPE) support
  4. * Copyright (c) 2017-2018, Arm Ltd.
  5. */
  6. #ifndef INCLUDE__ARM_SPE_PKT_DECODER_H__
  7. #define INCLUDE__ARM_SPE_PKT_DECODER_H__
  8. #include <stddef.h>
  9. #include <stdint.h>
  10. #define ARM_SPE_PKT_DESC_MAX 256
  11. #define ARM_SPE_NEED_MORE_BYTES -1
  12. #define ARM_SPE_BAD_PACKET -2
  13. enum arm_spe_pkt_type {
  14. ARM_SPE_BAD,
  15. ARM_SPE_PAD,
  16. ARM_SPE_END,
  17. ARM_SPE_TIMESTAMP,
  18. ARM_SPE_ADDRESS,
  19. ARM_SPE_COUNTER,
  20. ARM_SPE_CONTEXT,
  21. ARM_SPE_OP_TYPE,
  22. ARM_SPE_EVENTS,
  23. ARM_SPE_DATA_SOURCE,
  24. };
  25. struct arm_spe_pkt {
  26. enum arm_spe_pkt_type type;
  27. unsigned char index;
  28. uint64_t payload;
  29. };
  30. const char *arm_spe_pkt_name(enum arm_spe_pkt_type);
  31. int arm_spe_get_packet(const unsigned char *buf, size_t len,
  32. struct arm_spe_pkt *packet);
  33. int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, size_t len);
  34. #endif