5b6899b20796f7541b8745e521146030df40e4f9
1 /**
2 * Copyright (C) ARM Limited 2010-2013. 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 */
9 #ifndef SESSION_DATA_H
10 #define SESSION_DATA_H
12 #include <stdint.h>
14 #include "Counter.h"
15 #include "Hwmon.h"
17 #define MAX_PERFORMANCE_COUNTERS 50
19 #define PROTOCOL_VERSION 13
20 #define PROTOCOL_DEV 1000 // Differentiates development versions (timestamp) from release versions
22 struct ImageLinkList {
23 char* path;
24 struct ImageLinkList *next;
25 };
27 class SessionData {
28 public:
29 static const size_t MAX_STRING_LEN = 80;
31 SessionData();
32 ~SessionData();
33 void initialize();
34 void parseSessionXML(char* xmlString);
36 Hwmon hwmon;
38 char mCoreName[MAX_STRING_LEN];
39 struct ImageLinkList *mImages;
40 char* mConfigurationXMLPath;
41 char* mSessionXMLPath;
42 char* mEventsXMLPath;
43 char* mTargetPath;
44 char* mAPCDir;
46 bool mWaitingOnCommand;
47 bool mSessionIsActive;
48 bool mLocalCapture;
49 bool mOneShot; // halt processing of the driver data until profiling is complete or the buffer is filled
51 int mBacktraceDepth;
52 int mTotalBufferSize; // number of MB to use for the entire collection buffer
53 int mSampleRate;
54 int64_t mLiveRate;
55 int mDuration;
56 int mCores;
57 int mCpuId;
59 // PMU Counters
60 bool mCounterOverflow;
61 Counter mCounters[MAX_PERFORMANCE_COUNTERS];
63 private:
64 void readCpuInfo();
65 };
67 extern SessionData* gSessionData;
69 int getEventKey();
71 #endif // SESSION_DATA_H