blob: c834251527cf22334e3a06f2346c20d9f97fbd09 [file] [log] [blame]
Jon Medhurstaaf37a32013-06-11 12:10:56 +01001/**
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 */
8
9#ifndef SESSION_DATA_H
10#define SESSION_DATA_H
11
12#include <stdint.h>
13
14#include "Counter.h"
15#include "Hwmon.h"
16
17#define MAX_PERFORMANCE_COUNTERS 50
18
Jon Medhurst34d97692013-12-19 09:23:06 +000019#define PROTOCOL_VERSION 17
Jon Medhurstaaf37a32013-06-11 12:10:56 +010020#define PROTOCOL_DEV 1000 // Differentiates development versions (timestamp) from release versions
21
22struct ImageLinkList {
23 char* path;
24 struct ImageLinkList *next;
25};
26
27class SessionData {
28public:
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
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;
45
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
50
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;
58
59 // PMU Counters
60 int mCounterOverflow;
61 Counter mCounters[MAX_PERFORMANCE_COUNTERS];
62
63private:
64 void readCpuInfo();
Jon Medhurst34d97692013-12-19 09:23:06 +000065
66 // Intentionally unimplemented
67 SessionData(const SessionData &);
68 SessionData &operator=(const SessionData &);
Jon Medhurstaaf37a32013-06-11 12:10:56 +010069};
70
71extern SessionData* gSessionData;
72
73int getEventKey();
74
75#endif // SESSION_DATA_H