htbuffer_types.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*************************************************************************/ /*!
  2. @File htbuffer_types.h
  3. @Title Host Trace Buffer types.
  4. @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
  5. @Description Host Trace Buffer provides a mechanism to log Host events to a
  6. buffer in a similar way to the Firmware Trace mechanism.
  7. Host Trace Buffer logs data using a Transport Layer buffer.
  8. The Transport Layer and pvrtld tool provides the mechanism to
  9. retrieve the trace data.
  10. @License Dual MIT/GPLv2
  11. The contents of this file are subject to the MIT license as set out below.
  12. Permission is hereby granted, free of charge, to any person obtaining a copy
  13. of this software and associated documentation files (the "Software"), to deal
  14. in the Software without restriction, including without limitation the rights
  15. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16. copies of the Software, and to permit persons to whom the Software is
  17. furnished to do so, subject to the following conditions:
  18. The above copyright notice and this permission notice shall be included in
  19. all copies or substantial portions of the Software.
  20. Alternatively, the contents of this file may be used under the terms of
  21. the GNU General Public License Version 2 ("GPL") in which case the provisions
  22. of GPL are applicable instead of those above.
  23. If you wish to allow use of your version of this file only under the terms of
  24. GPL, and not to allow others to use your version of this file under the terms
  25. of the MIT license, indicate your decision by deleting the provisions above
  26. and replace them with the notice and other provisions required by GPL as set
  27. out in the file called "GPL-COPYING" included in this distribution. If you do
  28. not delete the provisions above, a recipient may use your version of this file
  29. under the terms of either the MIT license or GPL.
  30. This License is also included in this distribution in the file called
  31. "MIT-COPYING".
  32. EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
  33. PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  34. BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  35. PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
  36. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  37. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  38. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  39. */ /**************************************************************************/
  40. #ifndef HTBUFFER_TYPES_H
  41. #define HTBUFFER_TYPES_H
  42. #if defined(__cplusplus)
  43. extern "C" {
  44. #endif
  45. #include "img_defs.h"
  46. #include "htbuffer_sf.h"
  47. /* The group flags array of ints large enough to store all the group flags */
  48. #define HTB_FLAG_NUM_EL (((HTB_GROUP_DBG-1) / HTB_FLAG_NUM_BITS_IN_EL) + 1)
  49. extern IMG_INTERNAL HTB_FLAG_EL_T g_auiHTBGroupEnable[HTB_FLAG_NUM_EL];
  50. #define HTB_GROUP_ENABLED(SF) (g_auiHTBGroupEnable[HTB_LOG_GROUP_FLAG_GROUP(HTB_SF_GID(SF))] & HTB_LOG_GROUP_FLAG(HTB_SF_GID(SF)))
  51. /*************************************************************************/ /*!
  52. Host Trace Buffer operation mode
  53. Care must be taken if changing this enum to ensure the MapFlags[] array
  54. in htbserver.c is kept in-step.
  55. */ /**************************************************************************/
  56. typedef enum
  57. {
  58. /*! Undefined operation mode */
  59. HTB_OPMODE_UNDEF = 0,
  60. /*! Drop latest, intended for continuous logging to a UM daemon.
  61. * If the daemon does not keep up, the most recent log data
  62. * will be dropped
  63. */
  64. HTB_OPMODE_DROPLATEST,
  65. /*! Drop oldest, intended for crash logging.
  66. * Data will be continuously written to a circular buffer.
  67. * After a crash the buffer will contain events leading up to the crash
  68. */
  69. HTB_OPMODE_DROPOLDEST,
  70. /*! Block write if buffer is full */
  71. HTB_OPMODE_BLOCK,
  72. HTB_OPMODE_LAST = HTB_OPMODE_BLOCK
  73. } HTB_OPMODE_CTRL;
  74. /*************************************************************************/ /*!
  75. Host Trace Buffer log mode control
  76. */ /**************************************************************************/
  77. typedef enum
  78. {
  79. /*! Undefined log mode, used if update is not applied */
  80. HTB_LOGMODE_UNDEF = 0,
  81. /*! Log trace messages for all PIDs. */
  82. HTB_LOGMODE_ALLPID,
  83. /*! Log trace messages for specific PIDs only. */
  84. HTB_LOGMODE_RESTRICTEDPID,
  85. HTB_LOGMODE_LAST = HTB_LOGMODE_RESTRICTEDPID
  86. } HTB_LOGMODE_CTRL;
  87. #if defined(__cplusplus)
  88. }
  89. #endif
  90. #endif /* HTBUFFER_TYPES_H */
  91. /******************************************************************************
  92. End of file (htbuffer_types.h)
  93. ******************************************************************************/