blob: 22a8af0512165f5f1f301358b255dfb743194e2f [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
19#define PROTOCOL_VERSION 14
20#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();
65};
66
67extern SessionData* gSessionData;
68
69int getEventKey();
70
71#endif // SESSION_DATA_H