Merge tag 'v3.10.54' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / tools / gator / daemon / SessionData.h
1 /**
2  * Copyright (C) ARM Limited 2010-2014. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #ifndef SESSION_DATA_H
10 #define SESSION_DATA_H
11
12 #include <stdint.h>
13
14 #include "Config.h"
15 #include "Counter.h"
16 #include "FSDriver.h"
17 #include "Hwmon.h"
18 #include "MaliVideoDriver.h"
19 #include "PerfDriver.h"
20
21 #define PROTOCOL_VERSION        19
22 #define PROTOCOL_DEV            1000    // Differentiates development versions (timestamp) from release versions
23
24 #define NS_PER_S ((uint64_t)1000000000)
25
26 struct ImageLinkList {
27         char* path;
28         struct ImageLinkList *next;
29 };
30
31 class SessionData {
32 public:
33         static const size_t MAX_STRING_LEN = 80;
34
35         SessionData();
36         ~SessionData();
37         void initialize();
38         void parseSessionXML(char* xmlString);
39         void readCpuInfo();
40
41         Hwmon hwmon;
42         FSDriver fsDriver;
43         PerfDriver perf;
44         MaliVideoDriver maliVideo;
45
46         char mCoreName[MAX_STRING_LEN];
47         struct ImageLinkList *mImages;
48         char* mConfigurationXMLPath;
49         char* mSessionXMLPath;
50         char* mEventsXMLPath;
51         char* mTargetPath;
52         char* mAPCDir;
53
54         bool mWaitingOnCommand;
55         bool mSessionIsActive;
56         bool mLocalCapture;
57         bool mOneShot;          // halt processing of the driver data until profiling is complete or the buffer is filled
58         bool mIsEBS;
59         bool mSentSummary;
60
61         int mBacktraceDepth;
62         int mTotalBufferSize;   // number of MB to use for the entire collection buffer
63         int mSampleRate;
64         int64_t mLiveRate;
65         int mDuration;
66         int mCores;
67         int mPageSize;
68         int *mCpuIds;
69         int mMaxCpuId;
70
71         // PMU Counters
72         int mCounterOverflow;
73         Counter mCounters[MAX_PERFORMANCE_COUNTERS];
74
75 private:
76         // Intentionally unimplemented
77         SessionData(const SessionData &);
78         SessionData &operator=(const SessionData &);
79 };
80
81 extern SessionData* gSessionData;
82
83 uint64_t getTime();
84 int getEventKey();
85
86 #endif // SESSION_DATA_H