Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 1 | /** |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 2 | * Copyright (C) ARM Limited 2010-2014. All rights reserved. |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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 | |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 14 | #include "Config.h" |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 15 | #include "Counter.h" |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 16 | #include "FSDriver.h" |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 17 | #include "Hwmon.h" |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 18 | #include "MaliVideoDriver.h" |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 19 | #include "PerfDriver.h" |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 20 | |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 21 | #define PROTOCOL_VERSION 19 |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 22 | #define PROTOCOL_DEV 1000 // Differentiates development versions (timestamp) from release versions |
| 23 | |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 24 | #define NS_PER_S ((uint64_t)1000000000) |
| 25 | |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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); |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 39 | void readCpuInfo(); |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 40 | |
| 41 | Hwmon hwmon; |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 42 | FSDriver fsDriver; |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 43 | PerfDriver perf; |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 44 | MaliVideoDriver maliVideo; |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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 |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 58 | bool mIsEBS; |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 59 | bool mSentSummary; |
| 60 | |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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; |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 67 | int mPageSize; |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 68 | int *mCpuIds; |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 69 | int mMaxCpuId; |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 70 | |
| 71 | // PMU Counters |
| 72 | int mCounterOverflow; |
| 73 | Counter mCounters[MAX_PERFORMANCE_COUNTERS]; |
| 74 | |
| 75 | private: |
Jon Medhurst | 34d9769 | 2013-12-19 09:23:06 +0000 | [diff] [blame] | 76 | // Intentionally unimplemented |
| 77 | SessionData(const SessionData &); |
| 78 | SessionData &operator=(const SessionData &); |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | extern SessionData* gSessionData; |
| 82 | |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame^] | 83 | uint64_t getTime(); |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 84 | int getEventKey(); |
| 85 | |
| 86 | #endif // SESSION_DATA_H |