blob: ea34240e2df7c3ec271bf9b6917d7c45ba4037f8 [file] [log] [blame]
Jon Medhurstaaf37a32013-06-11 12:10:56 +01001/**
Jon Medhurst15ce78d2014-04-10 09:02:02 +01002 * Copyright (C) ARM Limited 2010-2014. All rights reserved.
Jon Medhurstaaf37a32013-06-11 12:10:56 +01003 *
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 Medhurst15ce78d2014-04-10 09:02:02 +010014#include "Config.h"
Jon Medhurstaaf37a32013-06-11 12:10:56 +010015#include "Counter.h"
16#include "Hwmon.h"
Jon Medhurst15ce78d2014-04-10 09:02:02 +010017#include "PerfDriver.h"
Jon Medhurstaaf37a32013-06-11 12:10:56 +010018
Jon Medhurst15ce78d2014-04-10 09:02:02 +010019#define PROTOCOL_VERSION 18
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;
Jon Medhurst15ce78d2014-04-10 09:02:02 +010037 PerfDriver perf;
Jon Medhurstaaf37a32013-06-11 12:10:56 +010038
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 Medhurst15ce78d2014-04-10 09:02:02 +010051 bool mIsEBS;
Jon Medhurstaaf37a32013-06-11 12:10:56 +010052
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 Medhurst15ce78d2014-04-10 09:02:02 +010059 int mPageSize;
60 int mCpuIds[NR_CPUS];
61 int mMaxCpuId;
Jon Medhurstaaf37a32013-06-11 12:10:56 +010062
63 // PMU Counters
64 int mCounterOverflow;
65 Counter mCounters[MAX_PERFORMANCE_COUNTERS];
66
67private:
68 void readCpuInfo();
Jon Medhurst34d97692013-12-19 09:23:06 +000069
70 // Intentionally unimplemented
71 SessionData(const SessionData &);
72 SessionData &operator=(const SessionData &);
Jon Medhurstaaf37a32013-06-11 12:10:56 +010073};
74
75extern SessionData* gSessionData;
76
77int getEventKey();
78
79#endif // SESSION_DATA_H