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