Merge tag 'v3.10.46' 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 "Hwmon.h"
17 #include "PerfDriver.h"
18
19 #define PROTOCOL_VERSION        18
20 #define PROTOCOL_DEV            1000    // Differentiates development versions (timestamp) from release versions
21
22 struct ImageLinkList {
23         char* path;
24         struct ImageLinkList *next;
25 };
26
27 class SessionData {
28 public:
29         static const size_t MAX_STRING_LEN = 80;
30
31         SessionData();
32         ~SessionData();
33         void initialize();
34         void parseSessionXML(char* xmlString);
35
36         Hwmon hwmon;
37         PerfDriver perf;
38
39         char mCoreName[MAX_STRING_LEN];
40         struct ImageLinkList *mImages;
41         char* mConfigurationXMLPath;
42         char* mSessionXMLPath;
43         char* mEventsXMLPath;
44         char* mTargetPath;
45         char* mAPCDir;
46
47         bool mWaitingOnCommand;
48         bool mSessionIsActive;
49         bool mLocalCapture;
50         bool mOneShot;          // halt processing of the driver data until profiling is complete or the buffer is filled
51         bool mIsEBS;
52         
53         int mBacktraceDepth;
54         int mTotalBufferSize;   // number of MB to use for the entire collection buffer
55         int mSampleRate;
56         int64_t mLiveRate;
57         int mDuration;
58         int mCores;
59         int mPageSize;
60         int mCpuIds[NR_CPUS];
61         int mMaxCpuId;
62
63         // PMU Counters
64         int mCounterOverflow;
65         Counter mCounters[MAX_PERFORMANCE_COUNTERS];
66
67 private:
68         void readCpuInfo();
69
70         // Intentionally unimplemented
71         SessionData(const SessionData &);
72         SessionData &operator=(const SessionData &);
73 };
74
75 extern SessionData* gSessionData;
76
77 int getEventKey();
78
79 #endif // SESSION_DATA_H