blob: 835082d86c4bf921aa773269922189bba5dada76 [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"
Jon Medhurste31266f2014-08-04 15:47:44 +010016#include "FSDriver.h"
Jon Medhurstaaf37a32013-06-11 12:10:56 +010017#include "Hwmon.h"
Jon Medhurste31266f2014-08-04 15:47:44 +010018#include "MaliVideoDriver.h"
Jon Medhurst15ce78d2014-04-10 09:02:02 +010019#include "PerfDriver.h"
Jon Medhurstaaf37a32013-06-11 12:10:56 +010020
Jon Medhurste31266f2014-08-04 15:47:44 +010021#define PROTOCOL_VERSION 19
Jon Medhurstaaf37a32013-06-11 12:10:56 +010022#define PROTOCOL_DEV 1000 // Differentiates development versions (timestamp) from release versions
23
Jon Medhurste31266f2014-08-04 15:47:44 +010024#define NS_PER_S ((uint64_t)1000000000)
25
Jon Medhurstaaf37a32013-06-11 12:10:56 +010026struct ImageLinkList {
27 char* path;
28 struct ImageLinkList *next;
29};
30
31class SessionData {
32public:
33 static const size_t MAX_STRING_LEN = 80;
34
35 SessionData();
36 ~SessionData();
37 void initialize();
38 void parseSessionXML(char* xmlString);
Jon Medhurste31266f2014-08-04 15:47:44 +010039 void readCpuInfo();
Jon Medhurstaaf37a32013-06-11 12:10:56 +010040
41 Hwmon hwmon;
Jon Medhurste31266f2014-08-04 15:47:44 +010042 FSDriver fsDriver;
Jon Medhurst15ce78d2014-04-10 09:02:02 +010043 PerfDriver perf;
Jon Medhurste31266f2014-08-04 15:47:44 +010044 MaliVideoDriver maliVideo;
Jon Medhurstaaf37a32013-06-11 12:10:56 +010045
46 char mCoreName[MAX_STRING_LEN];
47 struct ImageLinkList *mImages;
48 char* mConfigurationXMLPath;
49 char* mSessionXMLPath;
50 char* mEventsXMLPath;
51 char* mTargetPath;
52 char* mAPCDir;
53
54 bool mWaitingOnCommand;
55 bool mSessionIsActive;
56 bool mLocalCapture;
57 bool mOneShot; // halt processing of the driver data until profiling is complete or the buffer is filled
Jon Medhurst15ce78d2014-04-10 09:02:02 +010058 bool mIsEBS;
Jon Medhurste31266f2014-08-04 15:47:44 +010059 bool mSentSummary;
60
Jon Medhurstaaf37a32013-06-11 12:10:56 +010061 int mBacktraceDepth;
62 int mTotalBufferSize; // number of MB to use for the entire collection buffer
63 int mSampleRate;
64 int64_t mLiveRate;
65 int mDuration;
66 int mCores;
Jon Medhurst15ce78d2014-04-10 09:02:02 +010067 int mPageSize;
Jon Medhurste31266f2014-08-04 15:47:44 +010068 int *mCpuIds;
Jon Medhurst15ce78d2014-04-10 09:02:02 +010069 int mMaxCpuId;
Jon Medhurstaaf37a32013-06-11 12:10:56 +010070
71 // PMU Counters
72 int mCounterOverflow;
73 Counter mCounters[MAX_PERFORMANCE_COUNTERS];
74
75private:
Jon Medhurst34d97692013-12-19 09:23:06 +000076 // Intentionally unimplemented
77 SessionData(const SessionData &);
78 SessionData &operator=(const SessionData &);
Jon Medhurstaaf37a32013-06-11 12:10:56 +010079};
80
81extern SessionData* gSessionData;
82
Jon Medhurste31266f2014-08-04 15:47:44 +010083uint64_t getTime();
Jon Medhurstaaf37a32013-06-11 12:10:56 +010084int getEventKey();
85
86#endif // SESSION_DATA_H