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" |
| 16 | #include "Hwmon.h" |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame^] | 17 | #include "PerfDriver.h" |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 18 | |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame^] | 19 | #define PROTOCOL_VERSION 18 |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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; |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame^] | 37 | PerfDriver perf; |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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 |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame^] | 51 | bool mIsEBS; |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 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; |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame^] | 59 | int mPageSize; |
| 60 | int mCpuIds[NR_CPUS]; |
| 61 | int mMaxCpuId; |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 62 | |
| 63 | // PMU Counters |
| 64 | int mCounterOverflow; |
| 65 | Counter mCounters[MAX_PERFORMANCE_COUNTERS]; |
| 66 | |
| 67 | private: |
| 68 | void readCpuInfo(); |
Jon Medhurst | 34d9769 | 2013-12-19 09:23:06 +0000 | [diff] [blame] | 69 | |
| 70 | // Intentionally unimplemented |
| 71 | SessionData(const SessionData &); |
| 72 | SessionData &operator=(const SessionData &); |
Jon Medhurst | aaf37a3 | 2013-06-11 12:10:56 +0100 | [diff] [blame] | 73 | }; |
| 74 | |
| 75 | extern SessionData* gSessionData; |
| 76 | |
| 77 | int getEventKey(); |
| 78 | |
| 79 | #endif // SESSION_DATA_H |