mmprofile_internal.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef __MMPROFILE_INTERNAL_H__
  2. #define __MMPROFILE_INTERNAL_H__
  3. #include <mmprofile.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define MMProfileMaxEventCount 1000
  8. #define MMP_EVENT_STATE_ENABLED (1 << 0)
  9. #define MMP_EVENT_STATE_FTRACE (1 << 1)
  10. typedef struct {
  11. unsigned int parentId;
  12. char name[MMProfileEventNameMaxLen + 1];
  13. } MMProfile_EventInfo_t;
  14. typedef struct {
  15. unsigned int lock;
  16. unsigned int id;
  17. unsigned int timeLow;
  18. unsigned int timeHigh;
  19. unsigned int flag;
  20. unsigned int data1;
  21. unsigned int data2;
  22. unsigned int meta_data_cookie;
  23. } MMProfile_Event_t;
  24. typedef struct {
  25. unsigned int enable;
  26. unsigned int start;
  27. unsigned int write_pointer;
  28. unsigned int reg_event_index;
  29. unsigned int buffer_size_record;
  30. unsigned int buffer_size_bytes;
  31. unsigned int record_size;
  32. unsigned int meta_buffer_size;
  33. unsigned int new_buffer_size_record;
  34. unsigned int new_meta_buffer_size;
  35. unsigned int selected_buffer;
  36. unsigned int max_event_count;
  37. unsigned int event_state[MMProfileMaxEventCount];
  38. } MMProfile_Global_t;
  39. typedef struct {
  40. unsigned int cookie;
  41. MMP_MetaDataType data_type;
  42. unsigned int data_size;
  43. unsigned int data_offset;
  44. } MMProfile_MetaData_t;
  45. typedef struct {
  46. unsigned int id;
  47. MMP_LogType type;
  48. MMP_MetaData_t meta_data;
  49. } MMProfile_MetaLog_t;
  50. #define MMProfileGlobalsSize ((sizeof(MMProfile_Global_t)+(PAGE_SIZE-1))&(~(PAGE_SIZE-1)))
  51. #define CONFIG_MMPROFILE_PATH "/data/MMProfileConfig.dat"
  52. #define MMProfilePrimaryBuffer 1
  53. #define MMProfileGlobalsBuffer 2
  54. #define MMProfileMetaDataBuffer 3
  55. #define MMP_IOC_MAGIC 'M'
  56. #define MMP_IOC_ENABLE _IOW(MMP_IOC_MAGIC, 1, int)
  57. #define MMP_IOC_START _IOW(MMP_IOC_MAGIC, 2, int)
  58. #define MMP_IOC_TIME _IOW(MMP_IOC_MAGIC, 3, int)
  59. #define MMP_IOC_REGEVENT _IOWR(MMP_IOC_MAGIC, 4, int)
  60. #define MMP_IOC_FINDEVENT _IOWR(MMP_IOC_MAGIC, 5, int)
  61. #define MMP_IOC_ENABLEEVENT _IOW(MMP_IOC_MAGIC, 6, int)
  62. #define MMP_IOC_LOG _IOW(MMP_IOC_MAGIC, 7, int)
  63. #define MMP_IOC_DUMPEVENTINFO _IOR(MMP_IOC_MAGIC, 8, int)
  64. #define MMP_IOC_METADATALOG _IOW(MMP_IOC_MAGIC, 9, int)
  65. #define MMP_IOC_DUMPMETADATA _IOR(MMP_IOC_MAGIC, 10, int)
  66. #define MMP_IOC_SELECTBUFFER _IOW(MMP_IOC_MAGIC, 11, int)
  67. #define MMP_IOC_TRYLOG _IOWR(MMP_IOC_MAGIC, 12, int)
  68. #define MMP_IOC_ISENABLE _IOR(MMP_IOC_MAGIC, 13, int)
  69. #define MMP_IOC_REMOTESTART _IOR(MMP_IOC_MAGIC, 14, int)
  70. #define MMP_IOC_TEST _IOWR(MMP_IOC_MAGIC, 100, int)
  71. /* fix build warning: unused */
  72. /*static void MMProfileInitBuffer(void);*/
  73. /*static void MMProfileResetBuffer(void);*/
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif