summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Weaver2014-08-01 16:13:58 -0500
committerLucas Weaver2014-08-01 16:13:58 -0500
commit279fe40953bf856e94b85d2cadce1cceeca86b29 (patch)
treebd6bc6af1254f1185f61332e88e209d1ca4ea790
parentbc8a84cf0b138a2951679581453da7bd93003db6 (diff)
downloadarm-ds5-gator-DS-5.18-ti.tar.gz
arm-ds5-gator-DS-5.18-ti.tar.xz
arm-ds5-gator-DS-5.18-ti.zip
Gator Driver and DaemonDS-5.18-ti
Gator driver and daemon updated to enable DS-5 Streamline on TI device. Signed-off-by: Lucas Weaver <l-weaver@ti.com>
-rw-r--r--daemon/Android.mk6
-rw-r--r--daemon/Buffer.cpp36
-rw-r--r--daemon/Buffer.h11
-rw-r--r--daemon/CapturedXML.cpp11
-rw-r--r--daemon/CapturedXML.h2
-rw-r--r--daemon/Child.cpp45
-rw-r--r--daemon/Child.h2
-rw-r--r--daemon/ConfigurationXML.cpp10
-rw-r--r--daemon/Counter.h4
-rw-r--r--daemon/DriverSource.cpp53
-rw-r--r--daemon/DriverSource.h5
-rw-r--r--daemon/EventsXML.cpp16
-rw-r--r--daemon/EventsXML.h5
-rw-r--r--daemon/ExternalSource.cpp177
-rw-r--r--daemon/ExternalSource.h11
-rw-r--r--daemon/Fifo.h2
-rw-r--r--daemon/Hwmon.cpp16
-rw-r--r--daemon/KMod.cpp11
-rw-r--r--daemon/LocalCapture.h2
-rw-r--r--daemon/Logging.h2
-rw-r--r--daemon/Makefile8
-rw-r--r--daemon/Makefile_aarch649
-rw-r--r--daemon/Monitor.cpp11
-rw-r--r--daemon/Monitor.h1
-rw-r--r--daemon/OlySocket.cpp77
-rw-r--r--daemon/OlySocket.h14
-rw-r--r--daemon/PerfDriver.cpp92
-rw-r--r--daemon/PerfDriver.h6
-rw-r--r--daemon/PerfGroup.cpp28
-rw-r--r--daemon/PerfGroup.h2
-rw-r--r--daemon/PerfSource.cpp14
-rw-r--r--daemon/Proc.cpp106
-rw-r--r--daemon/Proc.h2
-rw-r--r--daemon/Sender.h2
-rw-r--r--daemon/SessionData.cpp55
-rw-r--r--daemon/SessionData.h17
-rw-r--r--daemon/SessionXML.cpp8
-rw-r--r--daemon/StreamlineSetup.cpp2
-rw-r--r--daemon/StreamlineSetup.h4
-rw-r--r--daemon/UEvent.cpp6
-rw-r--r--daemon/UserSpaceSource.cpp14
-rw-r--r--daemon/UserSpaceSource.h2
-rw-r--r--daemon/common.mk16
-rw-r--r--daemon/defaults.xml5
-rw-r--r--daemon/defaults_xml.h306
-rw-r--r--daemon/escapebin0 -> 8900 bytes
-rw-r--r--daemon/escape.c2
-rw-r--r--daemon/events-CCI-400.xml21
-rw-r--r--daemon/events-CCN-504.xml9
-rw-r--r--daemon/events-Cortex-A53.xml84
-rw-r--r--daemon/events-Cortex-A57.xml84
-rw-r--r--daemon/events-L2C-310.xml30
-rw-r--r--daemon/events-Linux.xml5
-rw-r--r--daemon/events-Mali-4xx.xml126
-rw-r--r--daemon/events-Mali-T6xx.xml26
-rw-r--r--daemon/events-Mali-T6xx_hw.xml33
-rw-r--r--daemon/events.xml1670
-rw-r--r--daemon/events_xml.h16317
-rw-r--r--[l---------]daemon/k/perf_event.h793
-rw-r--r--daemon/main.cpp260
-rw-r--r--driver/Makefile15
-rw-r--r--driver/gator.h6
-rw-r--r--driver/gator_backtrace.c2
-rw-r--r--driver/gator_buffer.c6
-rw-r--r--driver/gator_events_armv7.c4
-rw-r--r--driver/gator_events_block.c12
-rw-r--r--driver/gator_events_mali_4xx.c144
-rw-r--r--driver/gator_events_mali_common.c36
-rw-r--r--driver/gator_events_mali_common.h20
-rw-r--r--driver/gator_events_mali_t6xx.c5
-rw-r--r--driver/gator_events_mali_t6xx_hw.c183
-rw-r--r--driver/gator_events_mmapped.c26
-rw-r--r--driver/gator_events_perf_pmu.c6
-rw-r--r--driver/gator_events_scorpion.c4
-rw-r--r--driver/gator_iks.c2
-rw-r--r--driver/gator_main.c77
-rw-r--r--driver/gator_marshaling.c101
-rw-r--r--driver/gator_trace_gpu.c142
-rw-r--r--driver/gator_trace_power.c4
-rw-r--r--driver/gator_trace_sched.c85
-rw-r--r--driver/mali_t6xx.mk4
81 files changed, 20133 insertions, 1445 deletions
<
diff --git a/daemon/Android.mk b/daemon/Android.mk
index 44c069c..045d028 100644
--- a/daemon/Android.mk
+++ b/daemon/Android.mk
@@ -3,7 +3,7 @@ include $(CLEAR_VARS)
3 3
4XML_H := $(shell cd $(LOCAL_PATH) && make events_xml.h defaults_xml.h) 4XML_H := $(shell cd $(LOCAL_PATH) && make events_xml.h defaults_xml.h)
5 5
6LOCAL_CFLAGS += -Wall -O3 -mthumb-interwork -fno-exceptions -pthread -DETCDIR=\"/etc\" -Ilibsensors 6LOCAL_CFLAGS += -Wall -O3 -mthumb-interwork -fno-exceptions -DETCDIR=\"/etc\" -Ilibsensors
7 7
8LOCAL_SRC_FILES := \ 8LOCAL_SRC_FILES := \
9 Buffer.cpp \ 9 Buffer.cpp \
@@ -15,14 +15,12 @@ LOCAL_SRC_FILES := \
15 DynBuf.cpp \ 15 DynBuf.cpp \
16 EventsXML.cpp \ 16 EventsXML.cpp \
17 ExternalSource.cpp \ 17 ExternalSource.cpp \
18 FSDriver.cpp \
19 Fifo.cpp \ 18 Fifo.cpp \
20 Hwmon.cpp \ 19 Hwmon.cpp \
21 KMod.cpp \ 20 KMod.cpp \
22 LocalCapture.cpp \ 21 LocalCapture.cpp \
23 Logging.cpp \ 22 Logging.cpp \
24 main.cpp \ 23 main.cpp \
25 MaliVideoDriver.cpp \
26 Monitor.cpp \ 24 Monitor.cpp \
27 OlySocket.cpp \ 25 OlySocket.cpp \
28 OlyUtility.cpp \ 26 OlyUtility.cpp \
@@ -57,7 +55,7 @@ LOCAL_SRC_FILES := \
57 mxml/mxml-set.c \ 55 mxml/mxml-set.c \
58 mxml/mxml-string.c 56 mxml/mxml-string.c
59 57
60LOCAL_C_INCLUDES := $(LOCAL_PATH) 58LOCAL_C_INCLUDES := $(LOCAL_PATH)
61 59
62LOCAL_MODULE := gatord 60LOCAL_MODULE := gatord
63LOCAL_MODULE_TAGS := optional 61LOCAL_MODULE_TAGS := optional
diff --git a/daemon/Buffer.cpp b/daemon/Buffer.cpp
index dd19f7f..93557da 100644
--- a/daemon/Buffer.cpp
+++ b/daemon/Buffer.cpp
@@ -15,12 +15,11 @@
15#define mask (mSize - 1) 15#define mask (mSize - 1)
16 16
17enum { 17enum {
18 CODE_PEA = 1, 18 CODE_PEA = 1,
19 CODE_KEYS = 2, 19 CODE_KEYS = 2,
20 CODE_FORMAT = 3, 20 CODE_FORMAT = 3,
21 CODE_MAPS = 4, 21 CODE_MAPS = 4,
22 CODE_COMM = 5, 22 CODE_COMM = 5,
23 CODE_KEYS_OLD = 6,
24}; 23};
25 24
26// Summary Frame Messages 25// Summary Frame Messages
@@ -168,7 +167,7 @@ void Buffer::check(const uint64_t time) {
168 } 167 }
169} 168}
170 169
171void Buffer::packInt(char *const buf, const int size, int &writePos, int32_t x) { 170void Buffer::packInt(int32_t x) {
172 int packedBytes = 0; 171 int packedBytes = 0;
173 int more = true; 172 int more = true;
174 while (more) { 173 while (more) {
@@ -182,15 +181,11 @@ void Buffer::packInt(char *const buf, const int size, int &writePos, int32_t x)
182 b |= 0x80; 181 b |= 0x80;
183 } 182 }
184 183
185 buf[(writePos + packedBytes) & /*mask*/(size - 1)] = b; 184 mBuf[(mWritePos + packedBytes) & mask] = b;
186 packedBytes++; 185 packedBytes++;
187 } 186 }
188 187
189 writePos = (writePos + packedBytes) & /*mask*/(size - 1); 188 mWritePos = (mWritePos + packedBytes) & mask;
190}
191
192void Buffer::packInt(int32_t x) {
193 packInt(mBuf, mSize, mWritePos, x);
194} 189}
195 190
196void Buffer::packInt64(int64_t x) { 191void Buffer::packInt64(int64_t x) {
@@ -325,21 +320,6 @@ void Buffer::keys(const int count, const __u64 *const ids, const int *const keys
325 check(1); 320 check(1);
326} 321}
327 322
328void Buffer::keysOld(const int keyCount, const int *const keys, const int bytes, const char *const buf) {
329 if (checkSpace((2 + keyCount) * MAXSIZE_PACK32 + bytes)) {
330 packInt(CODE_KEYS_OLD);
331 packInt(keyCount);
332 for (int i = 0; i < keyCount; ++i) {
333 packInt(keys[i]);
334 }
335 writeBytes(buf, bytes);
336 } else {
337 logg->logError(__FILE__, __LINE__, "Ran out of buffer space for perf attrs");
338 handleException();
339 }
340 check(1);
341}
342
343void Buffer::format(const int length, const char *const format) { 323void Buffer::format(const int length, const char *const format) {
344 if (checkSpace(MAXSIZE_PACK32 + length + 1)) { 324 if (checkSpace(MAXSIZE_PACK32 + length + 1)) {
345 packInt(CODE_FORMAT); 325 packInt(CODE_FORMAT);
diff --git a/daemon/Buffer.h b/daemon/Buffer.h
index 2de1b97..5023777 100644
--- a/daemon/Buffer.h
+++ b/daemon/Buffer.h
@@ -54,7 +54,6 @@ public:
54 // Perf Attrs messages 54 // Perf Attrs messages
55 void pea(const struct perf_event_attr *const pea, int key); 55 void pea(const struct perf_event_attr *const pea, int key);
56 void keys(const int count, const __u64 *const ids, const int *const keys); 56 void keys(const int count, const __u64 *const ids, const int *const keys);
57 void keysOld(const int keyCount, const int *const keys, const int bytes, const char *const buf);
58 void format(const int length, const char *const format); 57 void format(const int length, const char *const format);
59 void maps(const int pid, const int tid, const char *const maps); 58 void maps(const int pid, const int tid, const char *const maps);
60 void comm(const int pid, const int tid, const char *const image, const char *const comm); 59 void comm(const int pid, const int tid, const char *const image, const char *const comm);
@@ -65,11 +64,6 @@ public:
65 // Prefer a new member to using these functions if possible 64 // Prefer a new member to using these functions if possible
66 char *getWritePos() { return mBuf + mWritePos; } 65 char *getWritePos() { return mBuf + mWritePos; }
67 void advanceWrite(int bytes) { mWritePos = (mWritePos + bytes) & /*mask*/(mSize - 1); } 66 void advanceWrite(int bytes) { mWritePos = (mWritePos + bytes) & /*mask*/(mSize - 1); }
68 static void packInt(char *const buf, const int size, int &writePos, int32_t x);
69 void packInt(int32_t x);
70 void packInt64(int64_t x);
71 void writeBytes(const void *const data, size_t count);
72 void writeString(const char *const str);
73 67
74 static void writeLEInt(unsigned char *buf, int v) { 68 static void writeLEInt(unsigned char *buf, int v) {
75 buf[0] = (v >> 0) & 0xFF; 69 buf[0] = (v >> 0) & 0xFF;
@@ -82,6 +76,11 @@ private:
82 bool commitReady() const; 76 bool commitReady() const;
83 bool checkSpace(int bytes); 77 bool checkSpace(int bytes);
84 78
79 void packInt(int32_t x);
80 void packInt64(int64_t x);
81 void writeBytes(const void *const data, size_t count);
82 void writeString(const char *const str);
83
85 const int32_t mCore; 84 const int32_t mCore;
86 const int32_t mBufType; 85 const int32_t mBufType;
87 const int mSize; 86 const int mSize;
diff --git a/daemon/CapturedXML.cpp b/daemon/CapturedXML.cpp
index 4a11415..cf79b72 100644
--- a/daemon/CapturedXML.cpp
+++ b/daemon/CapturedXML.cpp
@@ -33,7 +33,7 @@ mxml_node_t* CapturedXML::getTree(bool includeTime) {
33 captured = mxmlNewElement(xml, "captured"); 33 captured = mxmlNewElement(xml, "captured");
34 mxmlElementSetAttr(captured, "version", "1"); 34 mxmlElementSetAttr(captured, "version", "1");
35 if (gSessionData->perf.isSetup()) { 35 if (gSessionData->perf.isSetup()) {
36 mxmlElementSetAttr(captured, "type", "Perf"); 36 mxmlElementSetAttr(captured, "type", "Perf");
37 } 37 }
38 mxmlElementSetAttrf(captured, "protocol", "%d", PROTOCOL_VERSION); 38 mxmlElementSetAttrf(captured, "protocol", "%d", PROTOCOL_VERSION);
39 if (includeTime) { // Send the following only after the capture is complete 39 if (includeTime) { // Send the following only after the capture is complete
@@ -66,15 +66,10 @@ mxml_node_t* CapturedXML::getTree(bool includeTime) {
66 mxml_node_t *const node = mxmlNewElement(counters, "counter"); 66 mxml_node_t *const node = mxmlNewElement(counters, "counter");
67 mxmlElementSetAttrf(node, "key", "0x%x", counter.getKey()); 67 mxmlElementSetAttrf(node, "key", "0x%x", counter.getKey());
68 mxmlElementSetAttr(node, "type", counter.getType()); 68 mxmlElementSetAttr(node, "type", counter.getType());
69 if (counter.getEvent() != -1) { 69 mxmlElementSetAttrf(node, "event", "0x%x", counter.getEvent());
70 mxmlElementSetAttrf(node, "event", "0x%x", counter.getEvent());
71 }
72 if (counter.getCount() > 0) { 70 if (counter.getCount() > 0) {
73 mxmlElementSetAttrf(node, "count", "%d", counter.getCount()); 71 mxmlElementSetAttrf(node, "count", "%d", counter.getCount());
74 } 72 }
75 if (counter.getCores() > 0) {
76 mxmlElementSetAttrf(node, "cores", "%d", counter.getCores());
77 }
78 } 73 }
79 } 74 }
80 75
@@ -94,7 +89,7 @@ void CapturedXML::write(char* path) {
94 89
95 // Set full path 90 // Set full path
96 snprintf(file, PATH_MAX, "%s/captured.xml", path); 91 snprintf(file, PATH_MAX, "%s/captured.xml", path);
97 92
98 char* xml = getXML(true); 93 char* xml = getXML(true);
99 if (util->writeToDisk(file, xml) < 0) { 94 if (util->writeToDisk(file, xml) < 0) {
100 logg->logError(__FILE__, __LINE__, "Error writing %s\nPlease verify the path.", file); 95 logg->logError(__FILE__, __LINE__, "Error writing %s\nPlease verify the path.", file);
diff --git a/daemon/CapturedXML.h b/daemon/CapturedXML.h
index ed08c44..efc1e52 100644
--- a/daemon/CapturedXML.h
+++ b/daemon/CapturedXML.h
@@ -23,4 +23,4 @@ private:
23 23
24const char * mxmlWhitespaceCB(mxml_node_t *node, int where); 24const char * mxmlWhitespaceCB(mxml_node_t *node, int where);
25 25
26#endif //__CAPTURED_XML_H__ 26#endif //__CAPTURED_XML_H__
diff --git a/daemon/Child.cpp b/daemon/Child.cpp
index 1901ecc..ca33561 100644
--- a/daemon/Child.cpp
+++ b/daemon/Child.cpp
@@ -26,13 +26,13 @@
26#include "Driver.h" 26#include "Driver.h"
27#include "PerfSource.h" 27#include "PerfSource.h"
28#include "DriverSource.h" 28#include "DriverSource.h"
29#include "ExternalSource.h"
30#include "UserSpaceSource.h" 29#include "UserSpaceSource.h"
30#include "ExternalSource.h"
31 31
32static sem_t haltPipeline, senderThreadStarted, startProfile, senderSem; // Shared by Child and spawned threads 32static sem_t haltPipeline, senderThreadStarted, startProfile, senderSem; // Shared by Child and spawned threads
33static Source *primarySource = NULL; 33static Source *primarySource = NULL;
34static Source *externalSource = NULL;
35static Source *userSpaceSource = NULL; 34static Source *userSpaceSource = NULL;
35static Source *externalSource = NULL;
36static Sender* sender = NULL; // Shared by Child.cpp and spawned threads 36static Sender* sender = NULL; // Shared by Child.cpp and spawned threads
37Child* child = NULL; // shared by Child.cpp and main.cpp 37Child* child = NULL; // shared by Child.cpp and main.cpp
38 38
@@ -147,16 +147,16 @@ static void *senderThread(void *) {
147 prctl(PR_SET_NAME, (unsigned long)&"gatord-sender", 0, 0, 0); 147 prctl(PR_SET_NAME, (unsigned long)&"gatord-sender", 0, 0, 0);
148 sem_wait(&haltPipeline); 148 sem_wait(&haltPipeline);
149 149
150 while (!primarySource->isDone() || 150 while (!primarySource->isDone() || (userSpaceSource != NULL && !userSpaceSource->isDone()) || (externalSource != NULL && !externalSource->isDone())) {
151 !externalSource->isDone() ||
152 (userSpaceSource != NULL && !userSpaceSource->isDone())) {
153 sem_wait(&senderSem); 151 sem_wait(&senderSem);
154 152
155 primarySource->write(sender); 153 primarySource->write(sender);
156 externalSource->write(sender);
157 if (userSpaceSource != NULL) { 154 if (userSpaceSource != NULL) {
158 userSpaceSource->write(sender); 155 userSpaceSource->write(sender);
159 } 156 }
157 if (externalSource != NULL) {
158 externalSource->write(sender);
159 }
160 } 160 }
161 161
162 // write end-of-capture sequence 162 // write end-of-capture sequence
@@ -202,10 +202,6 @@ void Child::initialization() {
202void Child::endSession() { 202void Child::endSession() {
203 gSessionData->mSessionIsActive = false; 203 gSessionData->mSessionIsActive = false;
204 primarySource->interrupt(); 204 primarySource->interrupt();
205 externalSource->interrupt();
206 if (userSpaceSource != NULL) {
207 userSpaceSource->interrupt();
208 }
209 sem_post(&haltPipeline); 205 sem_post(&haltPipeline);
210} 206}
211 207
@@ -231,9 +227,9 @@ void Child::run() {
231 227
232 // Set up the driver; must be done after gSessionData->mPerfCounterType[] is populated 228 // Set up the driver; must be done after gSessionData->mPerfCounterType[] is populated
233 if (!gSessionData->perf.isSetup()) { 229 if (!gSessionData->perf.isSetup()) {
234 primarySource = new DriverSource(&senderSem, &startProfile); 230 primarySource = new DriverSource(&senderSem, &startProfile);
235 } else { 231 } else {
236 primarySource = new PerfSource(&senderSem, &startProfile); 232 primarySource = new PerfSource(&senderSem, &startProfile);
237 } 233 }
238 234
239 // Initialize all drivers 235 // Initialize all drivers
@@ -284,18 +280,11 @@ void Child::run() {
284 thread_creation_success = false; 280 thread_creation_success = false;
285 } else if (socket && pthread_create(&stopThreadID, NULL, stopThread, NULL)) { 281 } else if (socket && pthread_create(&stopThreadID, NULL, stopThread, NULL)) {
286 thread_creation_success = false; 282 thread_creation_success = false;
287 } else if (pthread_create(&senderThreadID, NULL, senderThread, NULL)) { 283 } else if (pthread_create(&senderThreadID, NULL, senderThread, NULL)){
288 thread_creation_success = false; 284 thread_creation_success = false;
289 } 285 }
290 286
291 externalSource = new ExternalSource(&senderSem); 287 if (gSessionData->hwmon.countersEnabled()) {
292 if (!externalSource->prepare()) {
293 logg->logError(__FILE__, __LINE__, "Unable to prepare for capture");
294 handleException();
295 }
296 externalSource->start();
297
298 if (gSessionData->hwmon.countersEnabled() || gSessionData->fsDriver.countersEnabled()) {
299 userSpaceSource = new UserSpaceSource(&senderSem); 288 userSpaceSource = new UserSpaceSource(&senderSem);
300 if (!userSpaceSource->prepare()) { 289 if (!userSpaceSource->prepare()) {
301 logg->logError(__FILE__, __LINE__, "Unable to prepare for capture"); 290 logg->logError(__FILE__, __LINE__, "Unable to prepare for capture");
@@ -303,6 +292,14 @@ void Child::run() {
303 } 292 }
304 userSpaceSource->start(); 293 userSpaceSource->start();
305 } 294 }
295 if (access("/tmp/gator", F_OK) == 0) {
296 externalSource = new ExternalSource(&senderSem);
297 if (!externalSource->prepare()) {
298 logg->logError(__FILE__, __LINE__, "Unable to prepare for capture");
299 handleException();
300 }
301 externalSource->start();
302 }
306 303
307 if (!thread_creation_success) { 304 if (!thread_creation_success) {
308 logg->logError(__FILE__, __LINE__, "Failed to create gator threads"); 305 logg->logError(__FILE__, __LINE__, "Failed to create gator threads");
@@ -315,10 +312,12 @@ void Child::run() {
315 // Start profiling 312 // Start profiling
316 primarySource->run(); 313 primarySource->run();
317 314
315 if (externalSource != NULL) {
316 externalSource->join();
317 }
318 if (userSpaceSource != NULL) { 318 if (userSpaceSource != NULL) {
319 userSpaceSource->join(); 319 userSpaceSource->join();
320 } 320 }
321 externalSource->join();
322 321
323 // Wait for the other threads to exit 322 // Wait for the other threads to exit
324 pthread_join(senderThreadID, NULL); 323 pthread_join(senderThreadID, NULL);
@@ -338,8 +337,8 @@ void Child::run() {
338 337
339 logg->logMessage("Profiling ended."); 338 logg->logMessage("Profiling ended.");
340 339
341 delete userSpaceSource;
342 delete externalSource; 340 delete externalSource;
341 delete userSpaceSource;
343 delete primarySource; 342 delete primarySource;
344 delete sender; 343 delete sender;
345 delete localCapture; 344 delete localCapture;
diff --git a/daemon/Child.h b/daemon/Child.h
index a306a77..9e206d7 100644
--- a/daemon/Child.h
+++ b/daemon/Child.h
@@ -30,4 +30,4 @@ private:
30 Child &operator=(const Child &); 30 Child &operator=(const Child &);
31}; 31};
32 32
33#endif //__CHILD_H__ 33#endif //__CHILD_H__
diff --git a/daemon/ConfigurationXML.cpp b/daemon/ConfigurationXML.cpp
index 6590dd3..fd479f2 100644
--- a/daemon/ConfigurationXML.cpp
+++ b/daemon/ConfigurationXML.cpp
@@ -21,13 +21,12 @@ static const char* ATTR_COUNTER = "counter";
21static const char* ATTR_REVISION = "revision"; 21static const char* ATTR_REVISION = "revision";
22static const char* ATTR_EVENT = "event"; 22static const char* ATTR_EVENT = "event";
23static const char* ATTR_COUNT = "count"; 23static const char* ATTR_COUNT = "count";
24static const char* ATTR_CORES = "cores";
25 24
26ConfigurationXML::ConfigurationXML() { 25ConfigurationXML::ConfigurationXML() {
27 const char * configuration_xml; 26 const char * configuration_xml;
28 unsigned int configuration_xml_len; 27 unsigned int configuration_xml_len;
29 getDefaultConfigurationXml(configuration_xml, configuration_xml_len); 28 getDefaultConfigurationXml(configuration_xml, configuration_xml_len);
30 29
31 char path[PATH_MAX]; 30 char path[PATH_MAX];
32 31
33 getPath(path); 32 getPath(path);
@@ -54,7 +53,7 @@ ConfigurationXML::ConfigurationXML() {
54 53
55 break; 54 break;
56 } 55 }
57 56
58 validate(); 57 validate();
59} 58}
60 59
@@ -83,7 +82,7 @@ int ConfigurationXML::parse(const char* configurationXML) {
83 node = mxmlGetFirstChild(tree); 82 node = mxmlGetFirstChild(tree);
84 while (node && mxmlGetType(node) != MXML_ELEMENT) 83 while (node && mxmlGetType(node) != MXML_ELEMENT)
85 node = mxmlWalkNext(node, tree, MXML_NO_DESCEND); 84 node = mxmlWalkNext(node, tree, MXML_NO_DESCEND);
86 85
87 ret = configurationsTag(node); 86 ret = configurationsTag(node);
88 87
89 node = mxmlGetFirstChild(node); 88 node = mxmlGetFirstChild(node);
@@ -128,7 +127,7 @@ void ConfigurationXML::validate(void) {
128#define CONFIGURATION_REVISION 3 127#define CONFIGURATION_REVISION 3
129int ConfigurationXML::configurationsTag(mxml_node_t *node) { 128int ConfigurationXML::configurationsTag(mxml_node_t *node) {
130 const char* revision_string; 129 const char* revision_string;
131 130
132 revision_string = mxmlElementGetAttr(node, ATTR_REVISION); 131 revision_string = mxmlElementGetAttr(node, ATTR_REVISION);
133 if (!revision_string) { 132 if (!revision_string) {
134 return 1; //revision issue; 133 return 1; //revision issue;
@@ -159,7 +158,6 @@ void ConfigurationXML::configurationTag(mxml_node_t *node) {
159 if (mxmlElementGetAttr(node, ATTR_COUNTER)) counter.setType(mxmlElementGetAttr(node, ATTR_COUNTER)); 158 if (mxmlElementGetAttr(node, ATTR_COUNTER)) counter.setType(mxmlElementGetAttr(node, ATTR_COUNTER));
160 if (mxmlElementGetAttr(node, ATTR_EVENT)) counter.setEvent(strtol(mxmlElementGetAttr(node, ATTR_EVENT), NULL, 16)); 159 if (mxmlElementGetAttr(node, ATTR_EVENT)) counter.setEvent(strtol(mxmlElementGetAttr(node, ATTR_EVENT), NULL, 16));
161 if (mxmlElementGetAttr(node, ATTR_COUNT)) counter.setCount(strtol(mxmlElementGetAttr(node, ATTR_COUNT), NULL, 10)); 160 if (mxmlElementGetAttr(node, ATTR_COUNT)) counter.setCount(strtol(mxmlElementGetAttr(node, ATTR_COUNT), NULL, 10));
162 if (mxmlElementGetAttr(node, ATTR_CORES)) counter.setCores(strtol(mxmlElementGetAttr(node, ATTR_CORES), NULL, 10));
163 if (counter.getCount() > 0) { 161 if (counter.getCount() > 0) {
164 gSessionData->mIsEBS = true; 162 gSessionData->mIsEBS = true;
165 } 163 }
diff --git a/daemon/Counter.h b/daemon/Counter.h
index 5202aa0..6891745 100644
--- a/daemon/Counter.h
+++ b/daemon/Counter.h
@@ -27,7 +27,6 @@ public:
27 mEnabled = false; 27 mEnabled = false;
28 mEvent = -1; 28 mEvent = -1;
29 mCount = 0; 29 mCount = 0;
30 mCores = -1;
31 mKey = 0; 30 mKey = 0;
32 mDriver = NULL; 31 mDriver = NULL;
33 } 32 }
@@ -36,7 +35,6 @@ public:
36 void setEnabled(const bool enabled) { mEnabled = enabled; } 35 void setEnabled(const bool enabled) { mEnabled = enabled; }
37 void setEvent(const int event) { mEvent = event; } 36 void setEvent(const int event) { mEvent = event; }
38 void setCount(const int count) { mCount = count; } 37 void setCount(const int count) { mCount = count; }
39 void setCores(const int cores) { mCores = cores; }
40 void setKey(const int key) { mKey = key; } 38 void setKey(const int key) { mKey = key; }
41 void setDriver(Driver *const driver) { mDriver = driver; } 39 void setDriver(Driver *const driver) { mDriver = driver; }
42 40
@@ -44,7 +42,6 @@ public:
44 bool isEnabled() const { return mEnabled; } 42 bool isEnabled() const { return mEnabled; }
45 int getEvent() const { return mEvent; } 43 int getEvent() const { return mEvent; }
46 int getCount() const { return mCount; } 44 int getCount() const { return mCount; }
47 int getCores() const { return mCores; }
48 int getKey() const { return mKey; } 45 int getKey() const { return mKey; }
49 Driver *getDriver() const { return mDriver; } 46 Driver *getDriver() const { return mDriver; }
50 47
@@ -57,7 +54,6 @@ private:
57 bool mEnabled; 54 bool mEnabled;
58 int mEvent; 55 int mEvent;
59 int mCount; 56 int mCount;
60 int mCores;
61 int mKey; 57 int mKey;
62 Driver *mDriver; 58 Driver *mDriver;
63}; 59};
diff --git a/daemon/DriverSource.cpp b/daemon/DriverSource.cpp
index 11d3095..f78ec6b 100644
--- a/daemon/DriverSource.cpp
+++ b/daemon/DriverSource.cpp
@@ -12,24 +12,19 @@
12 12
13#include <fcntl.h> 13#include <fcntl.h>
14#include <inttypes.h> 14#include <inttypes.h>
15#include <sys/prctl.h>
16#include <unistd.h> 15#include <unistd.h>
17 16
18#include "Buffer.h"
19#include "Child.h" 17#include "Child.h"
20#include "DynBuf.h"
21#include "Fifo.h" 18#include "Fifo.h"
22#include "Logging.h" 19#include "Logging.h"
23#include "Proc.h"
24#include "Sender.h" 20#include "Sender.h"
25#include "SessionData.h" 21#include "SessionData.h"
26 22
27extern Child *child; 23extern Child *child;
28 24
29DriverSource::DriverSource(sem_t *senderSem, sem_t *startProfile) : mBuffer(NULL), mFifo(NULL), mSenderSem(senderSem), mStartProfile(startProfile), mBufferSize(0), mBufferFD(0), mLength(1) { 25DriverSource::DriverSource(sem_t *senderSem, sem_t *startProfile) : mFifo(NULL), mSenderSem(senderSem), mStartProfile(startProfile), mBufferSize(0), mBufferFD(0), mLength(1) {
30 int driver_version = 0; 26 int driver_version = 0;
31 27
32 mBuffer = new Buffer(0, FRAME_PERF_ATTRS, 4*1024*1024, senderSem);
33 if (readIntDriver("/dev/gator/version", &driver_version) == -1) { 28 if (readIntDriver("/dev/gator/version", &driver_version) == -1) {
34 logg->logError(__FILE__, __LINE__, "Error reading gator driver version"); 29 logg->logError(__FILE__, __LINE__, "Error reading gator driver version");
35 handleException(); 30 handleException();
@@ -48,7 +43,7 @@ DriverSource::DriverSource(sem_t *senderSem, sem_t *startProfile) : mBuffer(NULL
48 handleException(); 43 handleException();
49 } else { 44 } else {
50 // Release version mismatch 45 // Release version mismatch
51 logg->logError(__FILE__, __LINE__, 46 logg->logError(__FILE__, __LINE__,
52 "gator driver version \"%d\" is different than gator daemon version \"%d\".\n" 47 "gator driver version \"%d\" is different than gator daemon version \"%d\".\n"
53 ">> Please upgrade the driver and daemon to the latest versions.", driver_version, PROTOCOL_VERSION); 48 ">> Please upgrade the driver and daemon to the latest versions.", driver_version, PROTOCOL_VERSION);
54 handleException(); 49 handleException();
@@ -92,28 +87,6 @@ bool DriverSource::prepare() {
92 return true; 87 return true;
93} 88}
94 89
95void DriverSource::bootstrapThread() {
96 prctl(PR_SET_NAME, (unsigned long)&"gatord-bootstrap", 0, 0, 0);
97
98 DynBuf printb;
99 DynBuf b1;
100 DynBuf b2;
101 DynBuf b3;
102
103 if (!readProc(mBuffer, false, &printb, &b1, &b2, &b3)) {
104 logg->logMessage("%s(%s:%i): readProc failed", __FUNCTION__, __FILE__, __LINE__);
105 handleException();
106 }
107
108 mBuffer->commit(1);
109 mBuffer->setDone();
110}
111
112void *DriverSource::bootstrapThreadStatic(void *arg) {
113 static_cast<DriverSource *>(arg)->bootstrapThread();
114 return NULL;
115}
116
117void DriverSource::run() { 90void DriverSource::run() {
118 // Get the initial pointer to the collect buffer 91 // Get the initial pointer to the collect buffer
119 char *collectBuffer = mFifo->start(); 92 char *collectBuffer = mFifo->start();
@@ -165,12 +138,6 @@ void DriverSource::run() {
165 138
166 sem_post(mStartProfile); 139 sem_post(mStartProfile);
167 140
168 pthread_t bootstrapThreadID;
169 if (pthread_create(&bootstrapThreadID, NULL, bootstrapThreadStatic, this) != 0) {
170 logg->logError(__FILE__, __LINE__, "Unable to start the gator_bootstrap thread");
171 handleException();
172 }
173
174 // Collect Data 141 // Collect Data
175 do { 142 do {
176 // This command will stall until data is received from the driver 143 // This command will stall until data is received from the driver
@@ -197,8 +164,6 @@ void DriverSource::run() {
197 } while (bytesCollected > 0); 164 } while (bytesCollected > 0);
198 165
199 logg->logMessage("Exit collect data loop"); 166 logg->logMessage("Exit collect data loop");
200
201 pthread_join(bootstrapThreadID, NULL);
202} 167}
203 168
204void DriverSource::interrupt() { 169void DriverSource::interrupt() {
@@ -209,7 +174,7 @@ void DriverSource::interrupt() {
209} 174}
210 175
211bool DriverSource::isDone() { 176bool DriverSource::isDone() {
212 return mLength <= 0 && (mBuffer == NULL || mBuffer->isDone()); 177 return mLength <= 0;
213} 178}
214 179
215void DriverSource::write(Sender *sender) { 180void DriverSource::write(Sender *sender) {
@@ -217,16 +182,6 @@ void DriverSource::write(Sender *sender) {
217 if (data != NULL) { 182 if (data != NULL) {
218 sender->writeData(data, mLength, RESPONSE_APC_DATA); 183 sender->writeData(data, mLength, RESPONSE_APC_DATA);
219 mFifo->release(); 184 mFifo->release();
220 // Assume the summary packet is in the first block received from the driver
221 gSessionData->mSentSummary = true;
222 }
223 if (mBuffer != NULL && !mBuffer->isDone()) {
224 mBuffer->write(sender);
225 if (mBuffer->isDone()) {
226 Buffer *buf = mBuffer;
227 mBuffer = NULL;
228 delete buf;
229 }
230 } 185 }
231} 186}
232 187
@@ -272,7 +227,7 @@ int DriverSource::readInt64Driver(const char *fullpath, int64_t *value) {
272 char *endptr; 227 char *endptr;
273 errno = 0; 228 errno = 0;
274 *value = strtoll(data, &endptr, 10); 229 *value = strtoll(data, &endptr, 10);
275 if (errno != 0 || (*endptr != '\n' && *endptr != '\0')) { 230 if (errno != 0 || *endptr != '\n') {
276 logg->logMessage("Invalid value in file %s", fullpath); 231 logg->logMessage("Invalid value in file %s", fullpath);
277 return -1; 232 return -1;
278 } 233 }
diff --git a/daemon/DriverSource.h b/daemon/DriverSource.h
index ec27b08..dcf1078 100644
--- a/daemon/DriverSource.h
+++ b/daemon/DriverSource.h
@@ -14,7 +14,6 @@
14 14
15#include "Source.h" 15#include "Source.h"
16 16
17class Buffer;
18class Fifo; 17class Fifo;
19 18
20class DriverSource : public Source { 19class DriverSource : public Source {
@@ -38,10 +37,6 @@ public:
38 static int writeReadDriver(const char *path, int64_t *value); 37 static int writeReadDriver(const char *path, int64_t *value);
39 38
40private: 39private:
41 static void *bootstrapThreadStatic(void *arg);
42 void bootstrapThread();
43
44 Buffer *mBuffer;
45 Fifo *mFifo; 40 Fifo *mFifo;
46 sem_t *const mSenderSem; 41 sem_t *const mSenderSem;
47 sem_t *const mStartProfile; 42 sem_t *const mStartProfile;
diff --git a/daemon/EventsXML.cpp b/daemon/EventsXML.cpp
index cf0192e..a07a046 100644
--- a/daemon/EventsXML.cpp
+++ b/daemon/EventsXML.cpp
@@ -13,7 +13,7 @@
13#include "OlyUtility.h" 13#include "OlyUtility.h"
14#include "SessionData.h" 14#include "SessionData.h"
15 15
16mxml_node_t *EventsXML::getTree() { 16char* EventsXML::getXML() {
17#include "events_xml.h" // defines and initializes char events_xml[] and int events_xml_len 17#include "events_xml.h" // defines and initializes char events_xml[] and int events_xml_len
18 char path[PATH_MAX]; 18 char path[PATH_MAX];
19 mxml_node_t *xml; 19 mxml_node_t *xml;
@@ -38,12 +38,6 @@ mxml_node_t *EventsXML::getTree() {
38 xml = mxmlLoadString(NULL, (const char *)events_xml, MXML_NO_CALLBACK); 38 xml = mxmlLoadString(NULL, (const char *)events_xml, MXML_NO_CALLBACK);
39 } 39 }
40 40
41 return xml;
42}
43
44char *EventsXML::getXML() {
45 mxml_node_t *xml = getTree();
46
47 // Add dynamic events from the drivers 41 // Add dynamic events from the drivers
48 mxml_node_t *events = mxmlFindElement(xml, xml, "events", NULL, NULL, MXML_DESCEND); 42 mxml_node_t *events = mxmlFindElement(xml, xml, "events", NULL, NULL, MXML_DESCEND);
49 if (!events) { 43 if (!events) {
@@ -54,19 +48,19 @@ char *EventsXML::getXML() {
54 driver->writeEvents(events); 48 driver->writeEvents(events);
55 } 49 }
56 50
57 char *string = mxmlSaveAllocString(xml, mxmlWhitespaceCB); 51 char* string = mxmlSaveAllocString(xml, mxmlWhitespaceCB);
58 mxmlDelete(xml); 52 mxmlDelete(xml);
59 53
60 return string; 54 return string;
61} 55}
62 56
63void EventsXML::write(const char *path) { 57void EventsXML::write(const char* path) {
64 char file[PATH_MAX]; 58 char file[PATH_MAX];
65 59
66 // Set full path 60 // Set full path
67 snprintf(file, PATH_MAX, "%s/events.xml", path); 61 snprintf(file, PATH_MAX, "%s/events.xml", path);
68 62
69 char *buf = getXML(); 63 char* buf = getXML();
70 if (util->writeToDisk(file, buf) < 0) { 64 if (util->writeToDisk(file, buf) < 0) {
71 logg->logError(__FILE__, __LINE__, "Error writing %s\nPlease verify the path.", file); 65 logg->logError(__FILE__, __LINE__, "Error writing %s\nPlease verify the path.", file);
72 handleException(); 66 handleException();
diff --git a/daemon/EventsXML.h b/daemon/EventsXML.h
index ff7a02f..6cd1560 100644
--- a/daemon/EventsXML.h
+++ b/daemon/EventsXML.h
@@ -9,12 +9,9 @@
9#ifndef EVENTS_XML 9#ifndef EVENTS_XML
10#define EVENTS_XML 10#define EVENTS_XML
11 11
12#include "mxml/mxml.h"
13
14class EventsXML { 12class EventsXML {
15public: 13public:
16 mxml_node_t *getTree(); 14 char* getXML();
17 char *getXML();
18 void write(const char* path); 15 void write(const char* path);
19}; 16};
20 17
diff --git a/daemon/ExternalSource.cpp b/daemon/ExternalSource.cpp
index b6ec301..fe5824b 100644
--- a/daemon/ExternalSource.cpp
+++ b/daemon/ExternalSource.cpp
@@ -8,195 +8,41 @@
8 8
9#include "ExternalSource.h" 9#include "ExternalSource.h"
10 10
11#include <fcntl.h>
12#include <sys/prctl.h> 11#include <sys/prctl.h>
13#include <unistd.h>
14 12
15#include "Logging.h" 13#include "Logging.h"
16#include "OlySocket.h" 14#include "OlySocket.h"
17#include "SessionData.h" 15#include "SessionData.h"
18 16
19static const char MALI_VIDEO[] = "\0mali-video"; 17ExternalSource::ExternalSource(sem_t *senderSem) : mBuffer(0, FRAME_EXTERNAL, 1024, senderSem), mSock("/tmp/gator") {
20static const char MALI_VIDEO_STARTUP[] = "\0mali-video-startup";
21static const char MALI_VIDEO_V1[] = "MALI_VIDEO 1\n";
22
23static bool setNonblock(const int fd) {
24 int flags;
25
26 flags = fcntl(fd, F_GETFL);
27 if (flags < 0) {
28 logg->logMessage("fcntl getfl failed");
29 return false;
30 }
31
32 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) != 0) {
33 logg->logMessage("fcntl setfl failed");
34 return false;
35 }
36
37 return true;
38}
39
40ExternalSource::ExternalSource(sem_t *senderSem) : mBuffer(0, FRAME_EXTERNAL, 128*1024, senderSem), mMonitor(), mMveStartupUds(MALI_VIDEO_STARTUP, sizeof(MALI_VIDEO_STARTUP)), mInterruptFd(-1), mMveUds(-1) {
41 sem_init(&mBufferSem, 0, 0);
42} 18}
43 19
44ExternalSource::~ExternalSource() { 20ExternalSource::~ExternalSource() {
45} 21}
46 22
47void ExternalSource::waitFor(const uint64_t currTime, const int bytes) {
48 while (mBuffer.bytesAvailable() <= bytes) {
49 mBuffer.check(currTime);
50 sem_wait(&mBufferSem);
51 }
52}
53
54void ExternalSource::configureConnection(const int fd, const char *const handshake, size_t size) {
55 if (!setNonblock(fd)) {
56 logg->logError(__FILE__, __LINE__, "Unable to set nonblock on fh");
57 handleException();
58 }
59
60 if (!mMonitor.add(fd)) {
61 logg->logError(__FILE__, __LINE__, "Unable to add fh to monitor");
62 handleException();
63 }
64
65 // Write the handshake to the circular buffer
66 waitFor(1, Buffer::MAXSIZE_PACK32 + 4 + size - 1);
67 mBuffer.packInt(fd);
68 mBuffer.writeLEInt((unsigned char *)mBuffer.getWritePos(), size - 1);
69 mBuffer.advanceWrite(4);
70 mBuffer.writeBytes(handshake, size - 1);
71}
72
73bool ExternalSource::connectMve() {
74 if (!gSessionData->maliVideo.countersEnabled()) {
75 return true;
76 }
77
78 mMveUds = OlySocket::connect(MALI_VIDEO, sizeof(MALI_VIDEO));
79 if (mMveUds < 0) {
80 return false;
81 }
82
83 if (!gSessionData->maliVideo.start(mMveUds)) {
84 return false;
85 }
86
87 configureConnection(mMveUds, MALI_VIDEO_V1, sizeof(MALI_VIDEO_V1));
88
89 return true;
90}
91
92bool ExternalSource::prepare() { 23bool ExternalSource::prepare() {
93 if (!mMonitor.init() || !setNonblock(mMveStartupUds.getFd()) || !mMonitor.add(mMveStartupUds.getFd())) {
94 return false;
95 }
96
97 connectMve();
98
99 return true; 24 return true;
100} 25}
101 26
102void ExternalSource::run() { 27void ExternalSource::run() {
103 int pipefd[2]; 28 prctl(PR_SET_NAME, (unsigned long)&"gatord-uds", 0, 0, 0);
104
105 prctl(PR_SET_NAME, (unsigned long)&"gatord-external", 0, 0, 0);
106
107 if (pipe(pipefd) != 0) {
108 logg->logError(__FILE__, __LINE__, "pipe failed");
109 handleException();
110 }
111 mInterruptFd = pipefd[1];
112
113 if (!mMonitor.add(pipefd[0])) {
114 logg->logError(__FILE__, __LINE__, "Monitor::add failed");
115 handleException();
116 }
117 29
118 while (gSessionData->mSessionIsActive) { 30 while (gSessionData->mSessionIsActive) {
119 struct epoll_event events[16]; 31 // Will be aborted when the socket is closed at the end of the capture
120 // Clear any pending sem posts 32 int length = mSock.receive(mBuffer.getWritePos(), mBuffer.contiguousSpaceAvailable());
121 while (sem_trywait(&mBufferSem) == 0); 33 if (length <= 0) {
122 int ready = mMonitor.wait(events, ARRAY_LENGTH(events), -1); 34 break;
123 if (ready < 0) {
124 logg->logError(__FILE__, __LINE__, "Monitor::wait failed");
125 handleException();
126 } 35 }
127 36
128 const uint64_t currTime = getTime(); 37 mBuffer.advanceWrite(length);
129 38 mBuffer.check(0);
130 for (int i = 0; i < ready; ++i) {
131 const int fd = events[i].data.fd;
132 if (fd == mMveStartupUds.getFd()) {
133 // Mali Video Engine says it's alive
134 int client = mMveStartupUds.acceptConnection();
135 // Don't read from this connection, establish a new connection to Mali-V500
136 close(client);
137 if (!connectMve()) {
138 logg->logError(__FILE__, __LINE__, "Unable to configure incoming Mali video connection");
139 handleException();
140 }
141 } else if (fd == pipefd[0]) {
142 // Means interrupt has been called and mSessionIsActive should be reread
143 } else {
144 while (true) {
145 waitFor(currTime, Buffer::MAXSIZE_PACK32 + 4);
146
147 mBuffer.packInt(fd);
148 char *const bytesPos = mBuffer.getWritePos();
149 mBuffer.advanceWrite(4);
150 const int contiguous = mBuffer.contiguousSpaceAvailable();
151 const int bytes = read(fd, mBuffer.getWritePos(), contiguous);
152 if (bytes < 0) {
153 if (errno == EAGAIN) {
154 // Nothing left to read, and Buffer convention dictates that writePos can't go backwards
155 mBuffer.writeLEInt((unsigned char *)bytesPos, 0);
156 break;
157 }
158 // Something else failed, close the socket
159 mBuffer.writeLEInt((unsigned char *)bytesPos, -1);
160 close(fd);
161 break;
162 } else if (bytes == 0) {
163 // The other side is closed
164 mBuffer.writeLEInt((unsigned char *)bytesPos, -1);
165 close(fd);
166 break;
167 }
168
169 mBuffer.writeLEInt((unsigned char *)bytesPos, bytes);
170 mBuffer.advanceWrite(bytes);
171
172 // Short reads also mean nothing is left to read
173 if (bytes < contiguous) {
174 break;
175 }
176 }
177 }
178 }
179
180 // Only call mBufferCheck once per iteration
181 mBuffer.check(currTime);
182 } 39 }
183 40
184 mBuffer.setDone(); 41 mBuffer.setDone();
185
186 mInterruptFd = -1;
187 close(pipefd[0]);
188 close(pipefd[1]);
189} 42}
190 43
191void ExternalSource::interrupt() { 44void ExternalSource::interrupt() {
192 if (mInterruptFd >= 0) { 45 // Do nothing
193 int8_t c = 0;
194 // Write to the pipe to wake the monitor which will cause mSessionIsActive to be reread
195 if (::write(mInterruptFd, &c, sizeof(c)) != sizeof(c)) {
196 logg->logError(__FILE__, __LINE__, "write failed");
197 handleException();
198 }
199 }
200} 46}
201 47
202bool ExternalSource::isDone() { 48bool ExternalSource::isDone() {
@@ -204,12 +50,7 @@ bool ExternalSource::isDone() {
204} 50}
205 51
206void ExternalSource::write(Sender *sender) { 52void ExternalSource::write(Sender *sender) {
207 // Don't send external data until the summary packet is sent so that monotonic delta is available
208 if (!gSessionData->mSentSummary) {
209 return;
210 }
211 if (!mBuffer.isDone()) { 53 if (!mBuffer.isDone()) {
212 mBuffer.write(sender); 54 mBuffer.write(sender);
213 sem_post(&mBufferSem);
214 } 55 }
215} 56}
diff --git a/daemon/ExternalSource.h b/daemon/ExternalSource.h
index 2e7ed27..2052bdf 100644
--- a/daemon/ExternalSource.h
+++ b/daemon/ExternalSource.h
@@ -12,7 +12,6 @@
12#include <semaphore.h> 12#include <semaphore.h>
13 13
14#include "Buffer.h" 14#include "Buffer.h"
15#include "Monitor.h"
16#include "OlySocket.h" 15#include "OlySocket.h"
17#include "Source.h" 16#include "Source.h"
18 17
@@ -30,16 +29,8 @@ public:
30 void write(Sender *sender); 29 void write(Sender *sender);
31 30
32private: 31private:
33 void waitFor(const uint64_t currTime, const int bytes);
34 void configureConnection(const int fd, const char *const handshake, size_t size);
35 bool connectMve();
36
37 sem_t mBufferSem;
38 Buffer mBuffer; 32 Buffer mBuffer;
39 Monitor mMonitor; 33 OlySocket mSock;
40 OlyServerSocket mMveStartupUds;
41 int mInterruptFd;
42 int mMveUds;
43 34
44 // Intentionally unimplemented 35 // Intentionally unimplemented
45 ExternalSource(const ExternalSource &); 36 ExternalSource(const ExternalSource &);
diff --git a/daemon/Fifo.h b/daemon/Fifo.h
index bdda3f5..7dd7426 100644
--- a/daemon/Fifo.h
+++ b/daemon/Fifo.h
@@ -45,4 +45,4 @@ private:
45 Fifo &operator=(const Fifo &); 45 Fifo &operator=(const Fifo &);
46}; 46};
47 47
48#endif //__FIFO_H__ 48#endif //__FIFO_H__
diff --git a/daemon/Hwmon.cpp b/daemon/Hwmon.cpp
index e444247..778f307 100644
--- a/daemon/Hwmon.cpp
+++ b/daemon/Hwmon.cpp
@@ -28,7 +28,6 @@ public:
28 const char *getTitle() const { return title; } 28 const char *getTitle() const { return title; }
29 bool isDuplicate() const { return duplicate; } 29 bool isDuplicate() const { return duplicate; }
30 const char *getDisplay() const { return display; } 30 const char *getDisplay() const { return display; }
31 const char *getCounterClass() const { return counter_class; }
32 const char *getUnit() const { return unit; } 31 const char *getUnit() const { return unit; }
33 int getModifier() const { return modifier; } 32 int getModifier() const { return modifier; }
34 33
@@ -59,7 +58,6 @@ private:
59 char *label; 58 char *label;
60 const char *title; 59 const char *title;
61 const char *display; 60 const char *display;
62 const char *counter_class;
63 const char *unit; 61 const char *unit;
64 int modifier; 62 int modifier;
65 double previous_value; 63 double previous_value;
@@ -89,8 +87,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
89 case SENSORS_FEATURE_IN: 87 case SENSORS_FEATURE_IN:
90 title = "Voltage"; 88 title = "Voltage";
91 input = SENSORS_SUBFEATURE_IN_INPUT; 89 input = SENSORS_SUBFEATURE_IN_INPUT;
92 display = "maximum"; 90 display = "average";
93 counter_class = "absolute";
94 unit = "V"; 91 unit = "V";
95 modifier = 1000; 92 modifier = 1000;
96 monotonic = false; 93 monotonic = false;
@@ -99,7 +96,6 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
99 title = "Fan"; 96 title = "Fan";
100 input = SENSORS_SUBFEATURE_FAN_INPUT; 97 input = SENSORS_SUBFEATURE_FAN_INPUT;
101 display = "average"; 98 display = "average";
102 counter_class = "absolute";
103 unit = "RPM"; 99 unit = "RPM";
104 modifier = 1; 100 modifier = 1;
105 monotonic = false; 101 monotonic = false;
@@ -108,7 +104,6 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
108 title = "Temperature"; 104 title = "Temperature";
109 input = SENSORS_SUBFEATURE_TEMP_INPUT; 105 input = SENSORS_SUBFEATURE_TEMP_INPUT;
110 display = "maximum"; 106 display = "maximum";
111 counter_class = "absolute";
112 unit = "°C"; 107 unit = "°C";
113 modifier = 1000; 108 modifier = 1000;
114 monotonic = false; 109 monotonic = false;
@@ -116,8 +111,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
116 case SENSORS_FEATURE_POWER: 111 case SENSORS_FEATURE_POWER:
117 title = "Power"; 112 title = "Power";
118 input = SENSORS_SUBFEATURE_POWER_INPUT; 113 input = SENSORS_SUBFEATURE_POWER_INPUT;
119 display = "maximum"; 114 display = "average";
120 counter_class = "absolute";
121 unit = "W"; 115 unit = "W";
122 modifier = 1000000; 116 modifier = 1000000;
123 monotonic = false; 117 monotonic = false;
@@ -126,7 +120,6 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
126 title = "Energy"; 120 title = "Energy";
127 input = SENSORS_SUBFEATURE_ENERGY_INPUT; 121 input = SENSORS_SUBFEATURE_ENERGY_INPUT;
128 display = "accumulate"; 122 display = "accumulate";
129 counter_class = "delta";
130 unit = "J"; 123 unit = "J";
131 modifier = 1000000; 124 modifier = 1000000;
132 monotonic = true; 125 monotonic = true;
@@ -134,8 +127,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
134 case SENSORS_FEATURE_CURR: 127 case SENSORS_FEATURE_CURR:
135 title = "Current"; 128 title = "Current";
136 input = SENSORS_SUBFEATURE_CURR_INPUT; 129 input = SENSORS_SUBFEATURE_CURR_INPUT;
137 display = "maximum"; 130 display = "average";
138 counter_class = "absolute";
139 unit = "A"; 131 unit = "A";
140 modifier = 1000; 132 modifier = 1000;
141 monotonic = false; 133 monotonic = false;
@@ -144,7 +136,6 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
144 title = "Humidity"; 136 title = "Humidity";
145 input = SENSORS_SUBFEATURE_HUMIDITY_INPUT; 137 input = SENSORS_SUBFEATURE_HUMIDITY_INPUT;
146 display = "average"; 138 display = "average";
147 counter_class = "absolute";
148 unit = "%"; 139 unit = "%";
149 modifier = 1000; 140 modifier = 1000;
150 monotonic = false; 141 monotonic = false;
@@ -320,7 +311,6 @@ void Hwmon::writeEvents(mxml_node_t *root) const {
320 mxmlElementSetAttr(node, "name", counter->getLabel()); 311 mxmlElementSetAttr(node, "name", counter->getLabel());
321 } 312 }
322 mxmlElementSetAttr(node, "display", counter->getDisplay()); 313 mxmlElementSetAttr(node, "display", counter->getDisplay());
323 mxmlElementSetAttr(node, "class", counter->getCounterClass());
324 mxmlElementSetAttr(node, "units", counter->getUnit()); 314 mxmlElementSetAttr(node, "units", counter->getUnit());
325 if (counter->getModifier() != 1) { 315 if (counter->getModifier() != 1) {
326 mxmlElementSetAttrf(node, "modifier", "%d", counter->getModifier()); 316 mxmlElementSetAttrf(node, "modifier", "%d", counter->getModifier());
diff --git a/daemon/KMod.cpp b/daemon/KMod.cpp
index 73e123d..9300002 100644
--- a/daemon/KMod.cpp
+++ b/daemon/KMod.cpp
@@ -58,15 +58,10 @@ void KMod::setupCounter(Counter &counter) {
58 return; 58 return;
59 } 59 }
60 60
61 int value = 0;
62 snprintf(text, sizeof(text), "%s/key", base); 61 snprintf(text, sizeof(text), "%s/key", base);
63 DriverSource::readIntDriver(text, &value); 62 int key = 0;
64 counter.setKey(value); 63 DriverSource::readIntDriver(text, &key);
65 64 counter.setKey(key);
66 snprintf(text, sizeof(text), "%s/cores", base);
67 if (DriverSource::readIntDriver(text, &value) == 0) {
68 counter.setCores(value);
69 }
70 65
71 snprintf(text, sizeof(text), "%s/event", base); 66 snprintf(text, sizeof(text), "%s/event", base);
72 DriverSource::writeDriver(text, counter.getEvent()); 67 DriverSource::writeDriver(text, counter.getEvent());
diff --git a/daemon/LocalCapture.h b/daemon/LocalCapture.h
index b1e7219..aadecce 100644
--- a/daemon/LocalCapture.h
+++ b/daemon/LocalCapture.h
@@ -23,4 +23,4 @@ private:
23 int removeDirAndAllContents(char* path); 23 int removeDirAndAllContents(char* path);
24}; 24};
25 25
26#endif //__LOCAL_CAPTURE_H__ 26#endif //__LOCAL_CAPTURE_H__
diff --git a/daemon/Logging.h b/daemon/Logging.h
index 4934bb0..6ae3280 100644
--- a/daemon/Logging.h
+++ b/daemon/Logging.h
@@ -33,4 +33,4 @@ extern Logging* logg;
33 33
34extern void handleException() __attribute__ ((noreturn)); 34extern void handleException() __attribute__ ((noreturn));
35 35
36#endif //__LOGGING_H__ 36#endif //__LOGGING_H__
diff --git a/daemon/Makefile b/daemon/Makefile
index 2ed49fd..24ee940 100644
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -8,14 +8,14 @@
8# targets run 'make SOFTFLOAT=1 SYSROOT=/path/to/sysroot', see 8# targets run 'make SOFTFLOAT=1 SYSROOT=/path/to/sysroot', see
9# README_Streamline.txt for more details 9# README_Streamline.txt for more details
10 10
11CC = $(CROSS_COMPILE)gcc 11CPP = $(CROSS_COMPILE)g++
12CXX = $(CROSS_COMPILE)g++ 12GCC = $(CROSS_COMPILE)gcc
13 13
14# -mthumb-interwork is required for interworking to ARM or Thumb stdlibc 14# -mthumb-interwork is required for interworking to ARM or Thumb stdlibc
15CPPFLAGS += -mthumb-interwork 15CFLAGS += -mthumb-interwork
16 16
17ifeq ($(SOFTFLOAT),1) 17ifeq ($(SOFTFLOAT),1)
18 CPPFLAGS += -marm -march=armv4t -mfloat-abi=soft 18 CFLAGS += -marm -march=armv4t -mfloat-abi=soft
19 LDFLAGS += -marm -march=armv4t -mfloat-abi=soft 19 LDFLAGS += -marm -march=armv4t -mfloat-abi=soft
20endif 20endif
21ifneq ($(SYSROOT),) 21ifneq ($(SYSROOT),)
diff --git a/daemon/Makefile_aarch64 b/daemon/Makefile_aarch64
index efd1fa0..10b4b4a 100644
--- a/daemon/Makefile_aarch64
+++ b/daemon/Makefile_aarch64
@@ -4,9 +4,12 @@
4# 4#
5 5
6# Uncomment and define CROSS_COMPILE if it is not already defined 6# Uncomment and define CROSS_COMPILE if it is not already defined
7# CROSS_COMPILE=/path/to/cross-compiler/aarch64-linux-gnu- 7# CROSS_COMPILE=/path/to/cross-compiler/arm-linux-gnueabihf-
8# NOTE: This toolchain uses the hardfloat abi by default. For non-hardfloat
9# targets it is necessary to add options
10# '-marm -march=armv4t -mfloat-abi=soft'.
8 11
9CC = $(CROSS_COMPILE)gcc 12CPP = $(CROSS_COMPILE)g++
10CXX = $(CROSS_COMPILE)g++ 13GCC = $(CROSS_COMPILE)gcc
11 14
12include common.mk 15include common.mk
diff --git a/daemon/Monitor.cpp b/daemon/Monitor.cpp
index b34a15f..90d5c47 100644
--- a/daemon/Monitor.cpp
+++ b/daemon/Monitor.cpp
@@ -18,15 +18,8 @@ Monitor::Monitor() : mFd(-1) {
18} 18}
19 19
20Monitor::~Monitor() { 20Monitor::~Monitor() {
21 if (mFd >= 0) { 21 if (mFd >= -1) {
22 ::close(mFd); 22 close(mFd);
23 }
24}
25
26void Monitor::close() {
27 if (mFd >= 0) {
28 ::close(mFd);
29 mFd = -1;
30 } 23 }
31} 24}
32 25
diff --git a/daemon/Monitor.h b/daemon/Monitor.h
index 7194e0e..6e268b6 100644
--- a/daemon/Monitor.h
+++ b/daemon/Monitor.h
@@ -16,7 +16,6 @@ public:
16 Monitor(); 16 Monitor();
17 ~Monitor(); 17 ~Monitor();
18 18
19 void close();
20 bool init(); 19 bool init();
21 bool add(const int fd); 20 bool add(const int fd);
22 int wait(struct epoll_event *const events, int maxevents, int timeout); 21 int wait(struct epoll_event *const events, int maxevents, int timeout);
diff --git a/daemon/OlySocket.cpp b/daemon/OlySocket.cpp
index 28774e3..26e4768 100644
--- a/daemon/OlySocket.cpp
+++ b/daemon/OlySocket.cpp
@@ -9,7 +9,6 @@
9#include "OlySocket.h" 9#include "OlySocket.h"
10 10
11#include <stdio.h> 11#include <stdio.h>
12#include <string.h>
13#ifdef WIN32 12#ifdef WIN32
14#include <Winsock2.h> 13#include <Winsock2.h>
15#include <ws2tcpip.h> 14#include <ws2tcpip.h>
@@ -44,18 +43,16 @@ OlyServerSocket::OlyServerSocket(int port) {
44 createServerSocket(port); 43 createServerSocket(port);
45} 44}
46 45
46OlySocket::OlySocket(int port, const char* host) {
47 createClientSocket(host, port);
48}
49
47OlySocket::OlySocket(int socketID) : mSocketID(socketID) { 50OlySocket::OlySocket(int socketID) : mSocketID(socketID) {
48} 51}
49 52
50#ifndef WIN32 53#ifndef WIN32
51 54
52#define MIN(A, B) ({ \ 55OlyServerSocket::OlyServerSocket(const char* path) {
53 const __typeof__(A) __a = A; \
54 const __typeof__(B) __b = B; \
55 __a > __b ? __b : __a; \
56})
57
58OlyServerSocket::OlyServerSocket(const char* path, const size_t pathSize) {
59 // Create socket 56 // Create socket
60 mFDServer = socket(PF_UNIX, SOCK_STREAM, 0); 57 mFDServer = socket(PF_UNIX, SOCK_STREAM, 0);
61 if (mFDServer < 0) { 58 if (mFDServer < 0) {
@@ -63,11 +60,13 @@ OlyServerSocket::OlyServerSocket(const char* path, const size_t pathSize) {
63 handleException(); 60 handleException();
64 } 61 }
65 62
63 unlink(path);
64
66 // Create sockaddr_in structure, ensuring non-populated fields are zero 65 // Create sockaddr_in structure, ensuring non-populated fields are zero
67 struct sockaddr_un sockaddr; 66 struct sockaddr_un sockaddr;
68 memset((void*)&sockaddr, 0, sizeof(sockaddr)); 67 memset((void*)&sockaddr, 0, sizeof(sockaddr));
69 sockaddr.sun_family = AF_UNIX; 68 sockaddr.sun_family = AF_UNIX;
70 memcpy(sockaddr.sun_path, path, MIN(pathSize, sizeof(sockaddr.sun_path))); 69 strncpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1);
71 sockaddr.sun_path[sizeof(sockaddr.sun_path) - 1] = '\0'; 70 sockaddr.sun_path[sizeof(sockaddr.sun_path) - 1] = '\0';
72 71
73 // Bind the socket to an address 72 // Bind the socket to an address
@@ -83,25 +82,24 @@ OlyServerSocket::OlyServerSocket(const char* path, const size_t pathSize) {
83 } 82 }
84} 83}
85 84
86int OlySocket::connect(const char* path, const size_t pathSize) { 85OlySocket::OlySocket(const char* path) {
87 int fd = socket(PF_UNIX, SOCK_STREAM, 0); 86 mSocketID = socket(PF_UNIX, SOCK_STREAM, 0);
88 if (fd < 0) { 87 if (mSocketID < 0) {
89 return -1; 88 return;
90 } 89 }
91 90
92 // Create sockaddr_in structure, ensuring non-populated fields are zero 91 // Create sockaddr_in structure, ensuring non-populated fields are zero
93 struct sockaddr_un sockaddr; 92 struct sockaddr_un sockaddr;
94 memset((void*)&sockaddr, 0, sizeof(sockaddr)); 93 memset((void*)&sockaddr, 0, sizeof(sockaddr));
95 sockaddr.sun_family = AF_UNIX; 94 sockaddr.sun_family = AF_UNIX;
96 memcpy(sockaddr.sun_path, path, MIN(pathSize, sizeof(sockaddr.sun_path))); 95 strncpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1);
97 sockaddr.sun_path[sizeof(sockaddr.sun_path) - 1] = '\0'; 96 sockaddr.sun_path[sizeof(sockaddr.sun_path) - 1] = '\0';
98 97
99 if (::connect(fd, (const struct sockaddr*)&sockaddr, sizeof(sockaddr)) < 0) { 98 if (connect(mSocketID, (const struct sockaddr*)&sockaddr, sizeof(sockaddr)) < 0) {
100 close(fd); 99 close(mSocketID);
101 return -1; 100 mSocketID = -1;
101 return;
102 } 102 }
103
104 return fd;
105} 103}
106 104
107#endif 105#endif
@@ -139,6 +137,47 @@ void OlyServerSocket::closeServerSocket() {
139 mFDServer = 0; 137 mFDServer = 0;
140} 138}
141 139
140void OlySocket::createClientSocket(const char* hostname, int portno) {
141#ifdef WIN32
142 // TODO: Implement for Windows
143#else
144 char buf[32];
145 struct addrinfo hints, *res, *res0;
146
147 snprintf(buf, sizeof(buf), "%d", portno);
148 mSocketID = -1;
149 memset((void*)&hints, 0, sizeof(hints));
150 hints.ai_family = PF_UNSPEC;
151 hints.ai_socktype = SOCK_STREAM;
152
153 if (getaddrinfo(hostname, buf, &hints, &res0)) {
154 logg->logError(__FILE__, __LINE__, "Client socket failed to get address info for %s", hostname);
155 handleException();
156 }
157 for (res=res0; res!=NULL; res = res->ai_next) {
158 if ( res->ai_family != PF_INET || res->ai_socktype != SOCK_STREAM ) {
159 continue;
160 }
161 mSocketID = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
162 if (mSocketID < 0) {
163 continue;
164 }
165 if (connect(mSocketID, res->ai_addr, res->ai_addrlen) < 0) {
166 close(mSocketID);
167 mSocketID = -1;
168 }
169 if (mSocketID > 0) {
170 break;
171 }
172 }
173 freeaddrinfo(res0);
174 if (mSocketID <= 0) {
175 logg->logError(__FILE__, __LINE__, "Could not connect to client socket. Ensure ARM Streamline is running.");
176 handleException();
177 }
178#endif
179}
180
142void OlyServerSocket::createServerSocket(int port) { 181void OlyServerSocket::createServerSocket(int port) {
143 int family = AF_INET6; 182 int family = AF_INET6;
144 183
diff --git a/daemon/OlySocket.h b/daemon/OlySocket.h
index 20c67cc..eab786b 100644
--- a/daemon/OlySocket.h
+++ b/daemon/OlySocket.h
@@ -9,15 +9,13 @@
9#ifndef __OLY_SOCKET_H__ 9#ifndef __OLY_SOCKET_H__
10#define __OLY_SOCKET_H__ 10#define __OLY_SOCKET_H__
11 11
12#include <stddef.h>
13
14class OlySocket { 12class OlySocket {
15public: 13public:
14 OlySocket(int port, const char* hostname);
15 OlySocket(int socketID);
16#ifndef WIN32 16#ifndef WIN32
17 static int connect(const char* path, const size_t pathSize); 17 OlySocket(const char* path);
18#endif 18#endif
19
20 OlySocket(int socketID);
21 ~OlySocket(); 19 ~OlySocket();
22 20
23 void closeSocket(); 21 void closeSocket();
@@ -31,21 +29,21 @@ public:
31 29
32private: 30private:
33 int mSocketID; 31 int mSocketID;
32
33 void createClientSocket(const char* hostname, int port);
34}; 34};
35 35
36class OlyServerSocket { 36class OlyServerSocket {
37public: 37public:
38 OlyServerSocket(int port); 38 OlyServerSocket(int port);
39#ifndef WIN32 39#ifndef WIN32
40 OlyServerSocket(const char* path, const size_t pathSize); 40 OlyServerSocket(const char* path);
41#endif 41#endif
42 ~OlyServerSocket(); 42 ~OlyServerSocket();
43 43
44 int acceptConnection(); 44 int acceptConnection();
45 void closeServerSocket(); 45 void closeServerSocket();
46 46
47 int getFd() { return mFDServer; }
48
49private: 47private:
50 int mFDServer; 48 int mFDServer;
51 49
diff --git a/daemon/PerfDriver.cpp b/daemon/PerfDriver.cpp
index ac97a07..8e25c22 100644
--- a/daemon/PerfDriver.cpp
+++ b/daemon/PerfDriver.cpp
@@ -11,7 +11,6 @@
11#include <dirent.h> 11#include <dirent.h>
12#include <sys/utsname.h> 12#include <sys/utsname.h>
13#include <time.h> 13#include <time.h>
14#include <unistd.h>
15 14
16#include "Buffer.h" 15#include "Buffer.h"
17#include "Config.h" 16#include "Config.h"
@@ -31,7 +30,7 @@
31struct gator_cpu { 30struct gator_cpu {
32 const int cpuid; 31 const int cpuid;
33 // Human readable name 32 // Human readable name
34 const char *const core_name; 33 const char core_name[32];
35 // gatorfs event and Perf PMU name 34 // gatorfs event and Perf PMU name
36 const char *const pmnc_name; 35 const char *const pmnc_name;
37 const int pmnc_counters; 36 const int pmnc_counters;
@@ -63,20 +62,9 @@ static const struct gator_cpu gator_cpus[] = {
63static const char OLD_PMU_PREFIX[] = "ARMv7 Cortex-"; 62static const char OLD_PMU_PREFIX[] = "ARMv7 Cortex-";
64static const char NEW_PMU_PREFIX[] = "ARMv7_Cortex_"; 63static const char NEW_PMU_PREFIX[] = "ARMv7_Cortex_";
65 64
66struct uncore_counter {
67 // gatorfs event and Perf PMU name
68 const char *const name;
69 const int count;
70};
71
72static const struct uncore_counter uncore_counters[] = {
73 { "CCI_400", 4 },
74 { "CCI_400-r1", 4 },
75};
76
77class PerfCounter { 65class PerfCounter {
78public: 66public:
79 PerfCounter(PerfCounter *next, const char *name, uint32_t type, uint64_t config, bool perCpu) : mNext(next), mName(name), mType(type), mCount(0), mKey(getEventKey()), mConfig(config), mEnabled(false), mPerCpu(perCpu) {} 67 PerfCounter(PerfCounter *next, const char *name, uint32_t type, uint64_t config) : mNext(next), mName(name), mType(type), mCount(0), mKey(getEventKey()), mConfig(config), mEnabled(false) {}
80 ~PerfCounter() { 68 ~PerfCounter() {
81 delete [] mName; 69 delete [] mName;
82 } 70 }
@@ -91,7 +79,6 @@ public:
91 void setConfig(const uint64_t config) { mConfig = config; } 79 void setConfig(const uint64_t config) { mConfig = config; }
92 bool isEnabled() const { return mEnabled; } 80 bool isEnabled() const { return mEnabled; }
93 void setEnabled(const bool enabled) { mEnabled = enabled; } 81 void setEnabled(const bool enabled) { mEnabled = enabled; }
94 bool isPerCpu() const { return mPerCpu; }
95 82
96private: 83private:
97 PerfCounter *const mNext; 84 PerfCounter *const mNext;
@@ -100,11 +87,10 @@ private:
100 int mCount; 87 int mCount;
101 const int mKey; 88 const int mKey;
102 uint64_t mConfig; 89 uint64_t mConfig;
103 int mEnabled : 1, 90 bool mEnabled;
104 mPerCpu : 1;
105}; 91};
106 92
107PerfDriver::PerfDriver() : mCounters(NULL), mIsSetup(false), mLegacySupport(false) { 93PerfDriver::PerfDriver() : mCounters(NULL), mIsSetup(false) {
108} 94}
109 95
110PerfDriver::~PerfDriver() { 96PerfDriver::~PerfDriver() {
@@ -119,27 +105,13 @@ void PerfDriver::addCpuCounters(const char *const counterName, const int type, c
119 int len = snprintf(NULL, 0, "%s_ccnt", counterName) + 1; 105 int len = snprintf(NULL, 0, "%s_ccnt", counterName) + 1;
120 char *name = new char[len]; 106 char *name = new char[len];
121 snprintf(name, len, "%s_ccnt", counterName); 107 snprintf(name, len, "%s_ccnt", counterName);
122 mCounters = new PerfCounter(mCounters, name, type, -1, true); 108 mCounters = new PerfCounter(mCounters, name, type, -1);
123 109
124 for (int j = 0; j < numCounters; ++j) { 110 for (int j = 0; j < numCounters; ++j) {
125 len = snprintf(NULL, 0, "%s_cnt%d", counterName, j) + 1; 111 len = snprintf(NULL, 0, "%s_cnt%d", counterName, j) + 1;
126 name = new char[len]; 112 name = new char[len];
127 snprintf(name, len, "%s_cnt%d", counterName, j); 113 snprintf(name, len, "%s_cnt%d", counterName, j);
128 mCounters = new PerfCounter(mCounters, name, type, -1, true); 114 mCounters = new PerfCounter(mCounters, name, type, -1);
129 }
130}
131
132void PerfDriver::addUncoreCounters(const char *const counterName, const int type, const int numCounters) {
133 int len = snprintf(NULL, 0, "%s_ccnt", counterName) + 1;
134 char *name = new char[len];
135 snprintf(name, len, "%s_ccnt", counterName);
136 mCounters = new PerfCounter(mCounters, name, type, -1, false);
137
138 for (int j = 0; j < numCounters; ++j) {
139 len = snprintf(NULL, 0, "%s_cnt%d", counterName, j) + 1;
140 name = new char[len];
141 snprintf(name, len, "%s_cnt%d", counterName, j);
142 mCounters = new PerfCounter(mCounters, name, type, -1, false);
143 } 115 }
144} 116}
145 117
@@ -167,16 +139,10 @@ bool PerfDriver::setup() {
167 } 139 }
168 } 140 }
169 141
170 if (KERNEL_VERSION(release[0], release[1], release[2]) < KERNEL_VERSION(3, 4, 0)) { 142 if (KERNEL_VERSION(release[0], release[1], release[2]) < KERNEL_VERSION(3, 12, 0)) {
171 logg->logMessage("%s(%s:%i): Unsupported kernel version", __FUNCTION__, __FILE__, __LINE__); 143 logg->logMessage("%s(%s:%i): Unsupported kernel version", __FUNCTION__, __FILE__, __LINE__);
172 return false; 144 return false;
173 } 145 }
174 mLegacySupport = KERNEL_VERSION(release[0], release[1], release[2]) < KERNEL_VERSION(3, 12, 0);
175
176 if (access(EVENTS_PATH, R_OK) != 0) {
177 logg->logMessage("%s(%s:%i): " EVENTS_PATH " does not exist, is CONFIG_TRACING enabled?", __FUNCTION__, __FILE__, __LINE__);
178 return false;
179 }
180 146
181 // Add supported PMUs 147 // Add supported PMUs
182 bool foundCpu = false; 148 bool foundCpu = false;
@@ -208,21 +174,6 @@ bool PerfDriver::setup() {
208 foundCpu = true; 174 foundCpu = true;
209 addCpuCounters(gator_cpus[i].pmnc_name, type, gator_cpus[i].pmnc_counters); 175 addCpuCounters(gator_cpus[i].pmnc_name, type, gator_cpus[i].pmnc_counters);
210 } 176 }
211
212 for (int i = 0; i < ARRAY_LENGTH(uncore_counters); ++i) {
213 if (strcmp(dirent->d_name, uncore_counters[i].name) != 0) {
214 continue;
215 }
216
217 int type;
218 char buf[256];
219 snprintf(buf, sizeof(buf), PERF_DEVICES "/%s/type", dirent->d_name);
220 if (DriverSource::readIntDriver(buf, &type) != 0) {
221 continue;
222 }
223
224 addUncoreCounters(uncore_counters[i].name, type, uncore_counters[i].count);
225 }
226 } 177 }
227 closedir(dir); 178 closedir(dir);
228 179
@@ -252,12 +203,12 @@ bool PerfDriver::setup() {
252 203
253 id = getTracepointId("irq/softirq_exit", &printb); 204 id = getTracepointId("irq/softirq_exit", &printb);
254 if (id >= 0) { 205 if (id >= 0) {
255 mCounters = new PerfCounter(mCounters, "Linux_irq_softirq", PERF_TYPE_TRACEPOINT, id, true); 206 mCounters = new PerfCounter(mCounters, "Linux_irq_softirq", PERF_TYPE_TRACEPOINT, id);
256 } 207 }
257 208
258 id = getTracepointId("irq/irq_handler_exit", &printb); 209 id = getTracepointId("irq/irq_handler_exit", &printb);
259 if (id >= 0) { 210 if (id >= 0) {
260 mCounters = new PerfCounter(mCounters, "Linux_irq_irq", PERF_TYPE_TRACEPOINT, id, true); 211 mCounters = new PerfCounter(mCounters, "Linux_irq_irq", PERF_TYPE_TRACEPOINT, id);
261 } 212 }
262 213
263 //Linux_block_rq_wr 214 //Linux_block_rq_wr
@@ -267,7 +218,7 @@ bool PerfDriver::setup() {
267 218
268 id = getTracepointId(SCHED_SWITCH, &printb); 219 id = getTracepointId(SCHED_SWITCH, &printb);
269 if (id >= 0) { 220 if (id >= 0) {
270 mCounters = new PerfCounter(mCounters, "Linux_sched_switch", PERF_TYPE_TRACEPOINT, id, true); 221 mCounters = new PerfCounter(mCounters, "Linux_sched_switch", PERF_TYPE_TRACEPOINT, id);
271 } 222 }
272 223
273 //Linux_meminfo_memused 224 //Linux_meminfo_memused
@@ -276,7 +227,7 @@ bool PerfDriver::setup() {
276 //Linux_power_cpu_freq 227 //Linux_power_cpu_freq
277 //Linux_power_cpu_idle 228 //Linux_power_cpu_idle
278 229
279 mCounters = new PerfCounter(mCounters, "Linux_cpu_wait_contention", TYPE_DERIVED, -1, false); 230 mCounters = new PerfCounter(mCounters, "Linux_cpu_wait_contention", TYPE_DERIVED, -1);
280 231
281 //Linux_cpu_wait_io 232 //Linux_cpu_wait_io
282 233
@@ -301,16 +252,15 @@ bool PerfDriver::summary(Buffer *const buffer) {
301 } 252 }
302 const int64_t timestamp = (int64_t)ts.tv_sec * 1000000000L + ts.tv_nsec; 253 const int64_t timestamp = (int64_t)ts.tv_sec * 1000000000L + ts.tv_nsec;
303 254
304 const int64_t uptime = getTime(); 255 if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
256 logg->logMessage("%s(%s:%i): clock_gettime failed", __FUNCTION__, __FILE__, __LINE__);
257 return false;
258 }
259 const int64_t uptime = (int64_t)ts.tv_sec * 1000000000L + ts.tv_nsec;
305 260
306 buffer->summary(timestamp, uptime, 0, buf); 261 buffer->summary(timestamp, uptime, 0, buf);
307 262
308 for (int i = 0; i < gSessionData->mCores; ++i) { 263 for (int i = 0; i < gSessionData->mCores; ++i) {
309 // Don't send information on a cpu we know nothing about
310 if (gSessionData->mCpuIds[i] == -1) {
311 continue;
312 }
313
314 int j; 264 int j;
315 for (j = 0; j < ARRAY_LENGTH(gator_cpus); ++j) { 265 for (j = 0; j < ARRAY_LENGTH(gator_cpus); ++j) {
316 if (gator_cpus[j].cpuid == gSessionData->mCpuIds[i]) { 266 if (gator_cpus[j].cpuid == gSessionData->mCpuIds[i]) {
@@ -320,11 +270,7 @@ bool PerfDriver::summary(Buffer *const buffer) {
320 if (gator_cpus[j].cpuid == gSessionData->mCpuIds[i]) { 270 if (gator_cpus[j].cpuid == gSessionData->mCpuIds[i]) {
321 buffer->coreName(i, gSessionData->mCpuIds[i], gator_cpus[j].core_name); 271 buffer->coreName(i, gSessionData->mCpuIds[i], gator_cpus[j].core_name);
322 } else { 272 } else {
323 if (gSessionData->mCpuIds[i] == -1) { 273 snprintf(buf, sizeof(buf), "Unknown (0x%.3x)", gSessionData->mCpuIds[i]);
324 snprintf(buf, sizeof(buf), "Unknown");
325 } else {
326 snprintf(buf, sizeof(buf), "Unknown (0x%.3x)", gSessionData->mCpuIds[i]);
327 }
328 buffer->coreName(i, gSessionData->mCpuIds[i], buf); 274 buffer->coreName(i, gSessionData->mCpuIds[i], buf);
329 } 275 }
330 } 276 }
@@ -380,10 +326,10 @@ int PerfDriver::writeCounters(mxml_node_t *root) const {
380 return count; 326 return count;
381} 327}
382 328
383bool PerfDriver::enable(PerfGroup *const group, Buffer *const buffer) const { 329bool PerfDriver::enable(PerfGroup *group, Buffer *const buffer) const {
384 for (PerfCounter * counter = mCounters; counter != NULL; counter = counter->getNext()) { 330 for (PerfCounter * counter = mCounters; counter != NULL; counter = counter->getNext()) {
385 if (counter->isEnabled() && (counter->getType() != TYPE_DERIVED)) { 331 if (counter->isEnabled() && (counter->getType() != TYPE_DERIVED)) {
386 if (!group->add(buffer, counter->getKey(), counter->getType(), counter->getConfig(), counter->getCount(), counter->getCount() > 0 ? PERF_SAMPLE_TID | PERF_SAMPLE_IP : 0, counter->isPerCpu() ? PERF_GROUP_PER_CPU : 0)) { 332 if (!group->add(buffer, counter->getKey(), counter->getType(), counter->getConfig(), counter->getCount(), 0, 0)) {
387 logg->logMessage("%s(%s:%i): PerfGroup::add failed", __FUNCTION__, __FILE__, __LINE__); 333 logg->logMessage("%s(%s:%i): PerfGroup::add failed", __FUNCTION__, __FILE__, __LINE__);
388 return false; 334 return false;
389 } 335 }
diff --git a/daemon/PerfDriver.h b/daemon/PerfDriver.h
index 2cae575..3181b74 100644
--- a/daemon/PerfDriver.h
+++ b/daemon/PerfDriver.h
@@ -27,8 +27,6 @@ public:
27 PerfDriver(); 27 PerfDriver();
28 ~PerfDriver(); 28 ~PerfDriver();
29 29
30 bool getLegacySupport() const { return mLegacySupport; }
31
32 bool setup(); 30 bool setup();
33 bool summary(Buffer *const buffer); 31 bool summary(Buffer *const buffer);
34 bool isSetup() const { return mIsSetup; } 32 bool isSetup() const { return mIsSetup; }
@@ -39,18 +37,16 @@ public:
39 37
40 int writeCounters(mxml_node_t *root) const; 38 int writeCounters(mxml_node_t *root) const;
41 39
42 bool enable(PerfGroup *const group, Buffer *const buffer) const; 40 bool enable(PerfGroup *group, Buffer *const buffer) const;
43 41
44 static long long getTracepointId(const char *const name, DynBuf *const printb); 42 static long long getTracepointId(const char *const name, DynBuf *const printb);
45 43
46private: 44private:
47 PerfCounter *findCounter(const Counter &counter) const; 45 PerfCounter *findCounter(const Counter &counter) const;
48 void addCpuCounters(const char *const counterName, const int type, const int numCounters); 46 void addCpuCounters(const char *const counterName, const int type, const int numCounters);
49 void addUncoreCounters(const char *const counterName, const int type, const int numCounters);
50 47
51 PerfCounter *mCounters; 48 PerfCounter *mCounters;
52 bool mIsSetup; 49 bool mIsSetup;
53 bool mLegacySupport;
54 50
55 // Intentionally undefined 51 // Intentionally undefined
56 PerfDriver(const PerfDriver &); 52 PerfDriver(const PerfDriver &);
diff --git a/daemon/PerfGroup.cpp b/daemon/PerfGroup.cpp
index 2a0239f..faf5fca 100644
--- a/daemon/PerfGroup.cpp
+++ b/daemon/PerfGroup.cpp
@@ -23,9 +23,7 @@
23#define DEFAULT_PEA_ARGS(pea, additionalSampleType) \ 23#define DEFAULT_PEA_ARGS(pea, additionalSampleType) \
24 pea.size = sizeof(pea); \ 24 pea.size = sizeof(pea); \
25 /* Emit time, read_format below, group leader id, and raw tracepoint info */ \ 25 /* Emit time, read_format below, group leader id, and raw tracepoint info */ \
26 pea.sample_type = (gSessionData->perf.getLegacySupport() \ 26 pea.sample_type = PERF_SAMPLE_TIME | PERF_SAMPLE_READ | PERF_SAMPLE_IDENTIFIER | additionalSampleType; \
27 ? PERF_SAMPLE_TID | PERF_SAMPLE_IP | PERF_SAMPLE_TIME | PERF_SAMPLE_READ | PERF_SAMPLE_ID \
28 : PERF_SAMPLE_TIME | PERF_SAMPLE_READ | PERF_SAMPLE_IDENTIFIER ) | additionalSampleType; \
29 /* Emit emit value in group format */ \ 27 /* Emit emit value in group format */ \
30 pea.read_format = PERF_FORMAT_ID | PERF_FORMAT_GROUP; \ 28 pea.read_format = PERF_FORMAT_ID | PERF_FORMAT_GROUP; \
31 /* start out disabled */ \ 29 /* start out disabled */ \
@@ -41,7 +39,6 @@ static int sys_perf_event_open(struct perf_event_attr *const attr, const pid_t p
41 39
42PerfGroup::PerfGroup(PerfBuffer *const pb) : mPb(pb) { 40PerfGroup::PerfGroup(PerfBuffer *const pb) : mPb(pb) {
43 memset(&mAttrs, 0, sizeof(mAttrs)); 41 memset(&mAttrs, 0, sizeof(mAttrs));
44 memset(&mPerCpu, 0, sizeof(mPerCpu));
45 memset(&mKeys, -1, sizeof(mKeys)); 42 memset(&mKeys, -1, sizeof(mKeys));
46 memset(&mFds, -1, sizeof(mFds)); 43 memset(&mFds, -1, sizeof(mFds));
47} 44}
@@ -78,7 +75,6 @@ bool PerfGroup::add(Buffer *const buffer, const int key, const __u32 type, const
78 mAttrs[i].freq = (flags & PERF_GROUP_FREQ ? 1 : 0); 75 mAttrs[i].freq = (flags & PERF_GROUP_FREQ ? 1 : 0);
79 mAttrs[i].task = (flags & PERF_GROUP_TASK ? 1 : 0); 76 mAttrs[i].task = (flags & PERF_GROUP_TASK ? 1 : 0);
80 mAttrs[i].sample_id_all = (flags & PERF_GROUP_SAMPLE_ID_ALL ? 1 : 0); 77 mAttrs[i].sample_id_all = (flags & PERF_GROUP_SAMPLE_ID_ALL ? 1 : 0);
81 mPerCpu[i] = (flags & PERF_GROUP_PER_CPU);
82 78
83 mKeys[i] = key; 79 mKeys[i] = key;
84 80
@@ -95,17 +91,13 @@ bool PerfGroup::prepareCPU(const int cpu) {
95 continue; 91 continue;
96 } 92 }
97 93
98 if ((cpu != 0) && !mPerCpu[i]) {
99 continue;
100 }
101
102 const int offset = i * gSessionData->mCores; 94 const int offset = i * gSessionData->mCores;
103 if (mFds[cpu + offset] >= 0) { 95 if (mFds[cpu + offset] >= 0) {
104 logg->logMessage("%s(%s:%i): cpu already online or not correctly cleaned up", __FUNCTION__, __FILE__, __LINE__); 96 logg->logMessage("%s(%s:%i): cpu already online or not correctly cleaned up", __FUNCTION__, __FILE__, __LINE__);
105 return false; 97 return false;
106 } 98 }
107 99
108 logg->logMessage("%s(%s:%i): perf_event_open cpu: %i type: %lli config: %lli sample: %lli sample_type: 0x%llx pinned: %i mmap: %i comm: %i freq: %i task: %i sample_id_all: %i", __FUNCTION__, __FILE__, __LINE__, cpu, (long long)mAttrs[i].type, (long long)mAttrs[i].config, (long long)mAttrs[i].sample_period, (long long)mAttrs[i].sample_type, mAttrs[i].pinned, mAttrs[i].mmap, mAttrs[i].comm, mAttrs[i].freq, mAttrs[i].task, mAttrs[i].sample_id_all); 100 logg->logMessage("%s(%s:%i): perf_event_open cpu: %i type: %lli config: %lli sample: %lli sample_type: %lli", __FUNCTION__, __FILE__, __LINE__, cpu, (long long)mAttrs[i].type, (long long)mAttrs[i].config, (long long)mAttrs[i].sample_period, (long long)mAttrs[i].sample_type);
109 mFds[cpu + offset] = sys_perf_event_open(&mAttrs[i], -1, cpu, i == 0 ? -1 : mFds[cpu], i == 0 ? 0 : PERF_FLAG_FD_OUTPUT); 101 mFds[cpu + offset] = sys_perf_event_open(&mAttrs[i], -1, cpu, i == 0 ? -1 : mFds[cpu], i == 0 ? 0 : PERF_FLAG_FD_OUTPUT);
110 if (mFds[cpu + offset] < 0) { 102 if (mFds[cpu + offset] < 0) {
111 logg->logMessage("%s(%s:%i): failed %s", __FUNCTION__, __FILE__, __LINE__, strerror(errno)); 103 logg->logMessage("%s(%s:%i): failed %s", __FUNCTION__, __FILE__, __LINE__, strerror(errno));
@@ -133,9 +125,7 @@ int PerfGroup::onlineCPU(const int cpu, const bool start, Buffer *const buffer,
133 } 125 }
134 126
135 coreKeys[idCount] = mKeys[i]; 127 coreKeys[idCount] = mKeys[i];
136 if (!gSessionData->perf.getLegacySupport() && ioctl(fd, PERF_EVENT_IOC_ID, &ids[idCount]) != 0 && 128 if (ioctl(fd, PERF_EVENT_IOC_ID, &ids[idCount]) != 0) {
137 // Workaround for running 32-bit gatord on 64-bit systems, kernel patch in the works
138 ioctl(fd, (PERF_EVENT_IOC_ID & ~IOCSIZE_MASK) | (8 << _IOC_SIZESHIFT), &ids[idCount]) != 0) {
139 logg->logMessage("%s(%s:%i): ioctl failed", __FUNCTION__, __FILE__, __LINE__); 129 logg->logMessage("%s(%s:%i): ioctl failed", __FUNCTION__, __FILE__, __LINE__);
140 return false; 130 return false;
141 } 131 }
@@ -147,17 +137,7 @@ int PerfGroup::onlineCPU(const int cpu, const bool start, Buffer *const buffer,
147 return false; 137 return false;
148 } 138 }
149 139
150 if (!gSessionData->perf.getLegacySupport()) { 140 buffer->keys(idCount, ids, coreKeys);
151 buffer->keys(idCount, ids, coreKeys);
152 } else {
153 char buf[1024];
154 ssize_t bytes = read(mFds[cpu], buf, sizeof(buf));
155 if (bytes < 0) {
156 logg->logMessage("read failed");
157 return false;
158 }
159 buffer->keysOld(idCount, coreKeys, bytes, buf);
160 }
161 141
162 if (start) { 142 if (start) {
163 for (int i = 0; i < ARRAY_LENGTH(mKeys); ++i) { 143 for (int i = 0; i < ARRAY_LENGTH(mKeys); ++i) {
diff --git a/daemon/PerfGroup.h b/daemon/PerfGroup.h
index 3f1e2bb..af496d4 100644
--- a/daemon/PerfGroup.h
+++ b/daemon/PerfGroup.h
@@ -24,7 +24,6 @@ enum PerfGroupFlags {
24 PERF_GROUP_FREQ = 1 << 2, 24 PERF_GROUP_FREQ = 1 << 2,
25 PERF_GROUP_TASK = 1 << 3, 25 PERF_GROUP_TASK = 1 << 3,
26 PERF_GROUP_SAMPLE_ID_ALL = 1 << 4, 26 PERF_GROUP_SAMPLE_ID_ALL = 1 << 4,
27 PERF_GROUP_PER_CPU = 1 << 5,
28}; 27};
29 28
30class PerfGroup { 29class PerfGroup {
@@ -44,7 +43,6 @@ public:
44private: 43private:
45 // +1 for the group leader 44 // +1 for the group leader
46 struct perf_event_attr mAttrs[MAX_PERFORMANCE_COUNTERS + 1]; 45 struct perf_event_attr mAttrs[MAX_PERFORMANCE_COUNTERS + 1];
47 bool mPerCpu[MAX_PERFORMANCE_COUNTERS + 1];
48 int mKeys[MAX_PERFORMANCE_COUNTERS + 1]; 46 int mKeys[MAX_PERFORMANCE_COUNTERS + 1];
49 int mFds[NR_CPUS * (MAX_PERFORMANCE_COUNTERS + 1)]; 47 int mFds[NR_CPUS * (MAX_PERFORMANCE_COUNTERS + 1)];
50 PerfBuffer *const mPb; 48 PerfBuffer *const mPb;
diff --git a/daemon/PerfSource.cpp b/daemon/PerfSource.cpp
index ecfaa66..1f1cb19 100644
--- a/daemon/PerfSource.cpp
+++ b/daemon/PerfSource.cpp
@@ -37,7 +37,7 @@ static bool sendTracepointFormat(Buffer *const buffer, const char *const name, D
37 return true; 37 return true;
38} 38}
39 39
40PerfSource::PerfSource(sem_t *senderSem, sem_t *startProfile) : mSummary(0, FRAME_SUMMARY, 1024, senderSem), mBuffer(0, FRAME_PERF_ATTRS, 4*1024*1024, senderSem), mCountersBuf(), mCountersGroup(&mCountersBuf), mMonitor(), mUEvent(), mSenderSem(senderSem), mStartProfile(startProfile), mInterruptFd(-1), mIsDone(false) { 40PerfSource::PerfSource(sem_t *senderSem, sem_t *startProfile) : mSummary(0, FRAME_SUMMARY, 1024, senderSem), mBuffer(0, FRAME_PERF_ATTRS, 1024*1024, senderSem), mCountersBuf(), mCountersGroup(&mCountersBuf), mMonitor(), mUEvent(), mSenderSem(senderSem), mStartProfile(startProfile), mInterruptFd(-1), mIsDone(false) {
41 long l = sysconf(_SC_PAGE_SIZE); 41 long l = sysconf(_SC_PAGE_SIZE);
42 if (l < 0) { 42 if (l < 0) {
43 logg->logError(__FILE__, __LINE__, "Unable to obtain the page size"); 43 logg->logError(__FILE__, __LINE__, "Unable to obtain the page size");
@@ -74,9 +74,6 @@ bool PerfSource::prepare() {
74 DynBuf b3; 74 DynBuf b3;
75 long long schedSwitchId; 75 long long schedSwitchId;
76 76
77 // Reread cpuinfo since cores may have changed since startup
78 gSessionData->readCpuInfo();
79
80 if (0 77 if (0
81 || !mMonitor.init() 78 || !mMonitor.init()
82 || !mUEvent.init() 79 || !mUEvent.init()
@@ -86,14 +83,14 @@ bool PerfSource::prepare() {
86 || !sendTracepointFormat(&mBuffer, SCHED_SWITCH, &printb, &b1) 83 || !sendTracepointFormat(&mBuffer, SCHED_SWITCH, &printb, &b1)
87 84
88 // Only want RAW but not IP on sched_switch and don't want TID on SAMPLE_ID 85 // Only want RAW but not IP on sched_switch and don't want TID on SAMPLE_ID
89 || !mCountersGroup.add(&mBuffer, 100/**/, PERF_TYPE_TRACEPOINT, schedSwitchId, 1, PERF_SAMPLE_RAW, PERF_GROUP_MMAP | PERF_GROUP_COMM | PERF_GROUP_TASK | PERF_GROUP_SAMPLE_ID_ALL | PERF_GROUP_PER_CPU) 86 || !mCountersGroup.add(&mBuffer, 100/**/, PERF_TYPE_TRACEPOINT, schedSwitchId, 1, PERF_SAMPLE_RAW, PERF_GROUP_MMAP | PERF_GROUP_COMM | PERF_GROUP_TASK | PERF_GROUP_SAMPLE_ID_ALL)
90 87
91 // Only want TID and IP but not RAW on timer 88 // Only want TID and IP but not RAW on timer
92 || (gSessionData->mSampleRate > 0 && !gSessionData->mIsEBS && !mCountersGroup.add(&mBuffer, 99/**/, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK, 1000000000UL / gSessionData->mSampleRate, PERF_SAMPLE_TID | PERF_SAMPLE_IP, PERF_GROUP_PER_CPU)) 89 || (gSessionData->mSampleRate > 0 && !gSessionData->mIsEBS && !mCountersGroup.add(&mBuffer, 99/**/, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK, 1000000000UL / gSessionData->mSampleRate, PERF_SAMPLE_TID | PERF_SAMPLE_IP, 0))
93 90
94 || !gSessionData->perf.enable(&mCountersGroup, &mBuffer) 91 || !gSessionData->perf.enable(&mCountersGroup, &mBuffer)
95 || 0) { 92 || 0) {
96 logg->logMessage("%s(%s:%i): perf setup failed, are you running Linux 3.4 or later?", __FUNCTION__, __FILE__, __LINE__); 93 logg->logMessage("%s(%s:%i): perf setup failed, are you running Linux 3.12 or later?", __FUNCTION__, __FILE__, __LINE__);
97 return false; 94 return false;
98 } 95 }
99 96
@@ -137,7 +134,7 @@ bool PerfSource::prepare() {
137 return false; 134 return false;
138 } 135 }
139 136
140 if (!readProc(&mBuffer, true, &printb, &b1, &b2, &b3)) { 137 if (!readProc(&mBuffer, &printb, &b1, &b2, &b3)) {
141 logg->logMessage("%s(%s:%i): readProc failed", __FUNCTION__, __FILE__, __LINE__); 138 logg->logMessage("%s(%s:%i): readProc failed", __FUNCTION__, __FILE__, __LINE__);
142 return false; 139 return false;
143 } 140 }
@@ -263,7 +260,6 @@ bool PerfSource::isDone () {
263void PerfSource::write (Sender *sender) { 260void PerfSource::write (Sender *sender) {
264 if (!mSummary.isDone()) { 261 if (!mSummary.isDone()) {
265 mSummary.write(sender); 262 mSummary.write(sender);
266 gSessionData->mSentSummary = true;
267 } 263 }
268 if (!mBuffer.isDone()) { 264 if (!mBuffer.isDone()) {
269 mBuffer.write(sender); 265 mBuffer.write(sender);
diff --git a/daemon/Proc.cpp b/daemon/Proc.cpp
index 9f01770..e0b9e22 100644
--- a/daemon/Proc.cpp
+++ b/daemon/Proc.cpp
@@ -57,57 +57,14 @@ static bool readProcStat(ProcStat *const ps, const char *const pathname, DynBuf
57 return true; 57 return true;
58} 58}
59 59
60static const char *readProcExe(DynBuf *const printb, const int pid, const int tid, DynBuf *const b) { 60static bool readProcTask(Buffer *const buffer, const int pid, const char *const image, DynBuf *const printb, DynBuf *const b) {
61 if (tid == -1 ? !printb->printf("/proc/%i/exe", pid)
62 : !printb->printf("/proc/%i/task/%i/exe", pid, tid)) {
63 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__);
64 return NULL;
65 }
66
67 const int err = b->readlink(printb->getBuf());
68 const char *image;
69 if (err == 0) {
70 image = strrchr(b->getBuf(), '/');
71 if (image == NULL) {
72 image = b->getBuf();
73 } else {
74 ++image;
75 }
76 } else if (err == -ENOENT) {
77 // readlink /proc/[pid]/exe returns ENOENT for kernel threads
78 image = "\0";
79 } else {
80 logg->logMessage("%s(%s:%i): DynBuf::readlink failed", __FUNCTION__, __FILE__, __LINE__);
81 return NULL;
82 }
83
84 // Android apps are run by app_process but the cmdline is changed to reference the actual app name
85 if (strcmp(image, "app_process") != 0) {
86 return image;
87 }
88
89 if (tid == -1 ? !printb->printf("/proc/%i/cmdline", pid)
90 : !printb->printf("/proc/%i/task/%i/cmdline", pid, tid)) {
91 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__);
92 return NULL;
93 }
94
95 if (!b->read(printb->getBuf())) {
96 logg->logMessage("%s(%s:%i): DynBuf::read failed, likely because the thread exited", __FUNCTION__, __FILE__, __LINE__);
97 return NULL;
98 }
99
100 return b->getBuf();
101}
102
103static bool readProcTask(Buffer *const buffer, const int pid, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2) {
104 bool result = false; 61 bool result = false;
105 62
106 if (!b1->printf("/proc/%i/task", pid)) { 63 if (!b->printf("/proc/%i/task", pid)) {
107 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__); 64 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__);
108 return result; 65 return result;
109 } 66 }
110 DIR *task = opendir(b1->getBuf()); 67 DIR *task = opendir(b->getBuf());
111 if (task == NULL) { 68 if (task == NULL) {
112 logg->logMessage("%s(%s:%i): opendir failed", __FUNCTION__, __FILE__, __LINE__); 69 logg->logMessage("%s(%s:%i): opendir failed", __FUNCTION__, __FILE__, __LINE__);
113 return result; 70 return result;
@@ -127,17 +84,11 @@ static bool readProcTask(Buffer *const buffer, const int pid, DynBuf *const prin
127 goto fail; 84 goto fail;
128 } 85 }
129 ProcStat ps; 86 ProcStat ps;
130 if (!readProcStat(&ps, printb->getBuf(), b1)) { 87 if (!readProcStat(&ps, printb->getBuf(), b)) {
131 logg->logMessage("%s(%s:%i): readProcStat failed", __FUNCTION__, __FILE__, __LINE__); 88 logg->logMessage("%s(%s:%i): readProcStat failed", __FUNCTION__, __FILE__, __LINE__);
132 goto fail; 89 goto fail;
133 } 90 }
134 91
135 const char *const image = readProcExe(printb, pid, tid, b2);
136 if (image == NULL) {
137 logg->logMessage("%s(%s:%i): readImage failed", __FUNCTION__, __FILE__, __LINE__);
138 goto fail;
139 }
140
141 buffer->comm(pid, tid, image, ps.comm); 92 buffer->comm(pid, tid, image, ps.comm);
142 } 93 }
143 94
@@ -149,7 +100,7 @@ static bool readProcTask(Buffer *const buffer, const int pid, DynBuf *const prin
149 return result; 100 return result;
150} 101}
151 102
152bool readProc(Buffer *const buffer, bool sendMaps, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2, DynBuf *const b3) { 103bool readProc(Buffer *const buffer, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2, DynBuf *const b3) {
153 bool result = false; 104 bool result = false;
154 105
155 DIR *proc = opendir("/proc"); 106 DIR *proc = opendir("/proc");
@@ -177,29 +128,42 @@ bool readProc(Buffer *const buffer, bool sendMaps, DynBuf *const printb, DynBuf
177 goto fail; 128 goto fail;
178 } 129 }
179 130
180 if (sendMaps) { 131 if (!printb->printf("/proc/%i/exe", pid)) {
181 if (!printb->printf("/proc/%i/maps", pid)) { 132 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__);
182 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__); 133 goto fail;
183 goto fail;
184 }
185 if (!b2->read(printb->getBuf())) {
186 logg->logMessage("%s(%s:%i): DynBuf::read failed, likely because the process exited", __FUNCTION__, __FILE__, __LINE__);
187 // This is not a fatal error - the process just doesn't exist any more
188 continue;
189 }
190
191 buffer->maps(pid, pid, b2->getBuf());
192 } 134 }
193 if (ps.numThreads <= 1) { 135 const int err = b1->readlink(printb->getBuf());
194 const char *const image = readProcExe(printb, pid, -1, b1); 136 const char *image;
137 if (err == 0) {
138 image = strrchr(b1->getBuf(), '/');
195 if (image == NULL) { 139 if (image == NULL) {
196 logg->logMessage("%s(%s:%i): readImage failed", __FUNCTION__, __FILE__, __LINE__); 140 image = b1->getBuf();
197 goto fail; 141 } else {
142 ++image;
198 } 143 }
144 } else if (err == -ENOENT) {
145 // readlink /proc/[pid]/exe returns ENOENT for kernel threads
146 image = "\0";
147 } else {
148 logg->logMessage("%s(%s:%i): DynBuf::readlink failed", __FUNCTION__, __FILE__, __LINE__);
149 goto fail;
150 }
199 151
152 if (!printb->printf("/proc/%i/maps", pid)) {
153 logg->logMessage("%s(%s:%i): DynBuf::printf failed", __FUNCTION__, __FILE__, __LINE__);
154 goto fail;
155 }
156 if (!b2->read(printb->getBuf())) {
157 logg->logMessage("%s(%s:%i): DynBuf::read failed, likely because the process exited", __FUNCTION__, __FILE__, __LINE__);
158 // This is not a fatal error - the process just doesn't exist any more
159 continue;
160 }
161
162 buffer->maps(pid, pid, b2->getBuf());
163 if (ps.numThreads <= 1) {
200 buffer->comm(pid, pid, image, ps.comm); 164 buffer->comm(pid, pid, image, ps.comm);
201 } else { 165 } else {
202 if (!readProcTask(buffer, pid, printb, b1, b3)) { 166 if (!readProcTask(buffer, pid, image, printb, b3)) {
203 logg->logMessage("%s(%s:%i): readProcTask failed", __FUNCTION__, __FILE__, __LINE__); 167 logg->logMessage("%s(%s:%i): readProcTask failed", __FUNCTION__, __FILE__, __LINE__);
204 goto fail; 168 goto fail;
205 } 169 }
diff --git a/daemon/Proc.h b/daemon/Proc.h
index 31c2eec..057b610 100644
--- a/daemon/Proc.h
+++ b/daemon/Proc.h
@@ -12,6 +12,6 @@
12class Buffer; 12class Buffer;
13class DynBuf; 13class DynBuf;
14 14
15bool readProc(Buffer *const buffer, bool sendMaps, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2, DynBuf *const b3); 15bool readProc(Buffer *const buffer, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2, DynBuf *const b3);
16 16
17#endif // PROC_H 17#endif // PROC_H
diff --git a/daemon/Sender.h b/daemon/Sender.h
index 33b6cc3..4c359db 100644
--- a/daemon/Sender.h
+++ b/daemon/Sender.h
@@ -39,4 +39,4 @@ private:
39 Sender &operator=(const Sender &); 39 Sender &operator=(const Sender &);
40}; 40};
41 41
42#endif //__SENDER_H__ 42#endif //__SENDER_H__
diff --git a/daemon/SessionData.cpp b/daemon/SessionData.cpp
index 14d995f..c169299 100644
--- a/daemon/SessionData.cpp
+++ b/daemon/SessionData.cpp
@@ -9,7 +9,6 @@
9#include "SessionData.h" 9#include "SessionData.h"
10 10
11#include <string.h> 11#include <string.h>
12#include <sys/mman.h>
13 12
14#include "SessionXML.h" 13#include "SessionXML.h"
15#include "Logging.h" 14#include "Logging.h"
@@ -28,15 +27,6 @@ void SessionData::initialize() {
28 mSessionIsActive = false; 27 mSessionIsActive = false;
29 mLocalCapture = false; 28 mLocalCapture = false;
30 mOneShot = false; 29 mOneShot = false;
31 mSentSummary = false;
32 const size_t cpuIdSize = sizeof(int)*NR_CPUS;
33 // Share mCpuIds across all instances of gatord
34 mCpuIds = (int *)mmap(NULL, cpuIdSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
35 if (mCpuIds == MAP_FAILED) {
36 logg->logError(__FILE__, __LINE__, "Unable to mmap shared memory for cpuids");
37 handleException();
38 }
39 memset(mCpuIds, -1, cpuIdSize);
40 readCpuInfo(); 30 readCpuInfo();
41 mConfigurationXMLPath = NULL; 31 mConfigurationXMLPath = NULL;
42 mSessionXMLPath = NULL; 32 mSessionXMLPath = NULL;
@@ -101,9 +91,10 @@ void SessionData::parseSessionXML(char* xmlString) {
101void SessionData::readCpuInfo() { 91void SessionData::readCpuInfo() {
102 char temp[256]; // arbitrarily large amount 92 char temp[256]; // arbitrarily large amount
103 strcpy(mCoreName, "unknown"); 93 strcpy(mCoreName, "unknown");
94 memset(&mCpuIds, -1, sizeof(mCpuIds));
104 mMaxCpuId = -1; 95 mMaxCpuId = -1;
105 96
106 FILE* f = fopen("/proc/cpuinfo", "r"); 97 FILE* f = fopen("/proc/cpuinfo", "r");
107 if (f == NULL) { 98 if (f == NULL) {
108 logg->logMessage("Error opening /proc/cpuinfo\n" 99 logg->logMessage("Error opening /proc/cpuinfo\n"
109 "The core name in the captured xml file will be 'unknown'."); 100 "The core name in the captured xml file will be 'unknown'.");
@@ -111,18 +102,10 @@ void SessionData::readCpuInfo() {
111 } 102 }
112 103
113 bool foundCoreName = false; 104 bool foundCoreName = false;
114 int processor = -1; 105 int processor = 0;
115 while (fgets(temp, sizeof(temp), f)) { 106 while (fgets(temp, sizeof(temp), f)) {
116 const size_t len = strlen(temp); 107 if (strlen(temp) > 0) {
117 108 temp[strlen(temp) - 1] = 0; // Replace the line feed with a null
118 if (len == 1) {
119 // New section, clear the processor. Streamline will not know the cpus if the pre Linux 3.8 format of cpuinfo is encountered but also that no incorrect information will be transmitted.
120 processor = -1;
121 continue;
122 }
123
124 if (len > 0) {
125 temp[len - 1] = '\0'; // Replace the line feed with a null
126 } 109 }
127 110
128 const bool foundHardware = strstr(temp, "Hardware") != 0; 111 const bool foundHardware = strstr(temp, "Hardware") != 0;
@@ -144,15 +127,10 @@ void SessionData::readCpuInfo() {
144 } 127 }
145 128
146 if (foundCPUPart) { 129 if (foundCPUPart) {
147 const int cpuId = strtol(position, NULL, 0); 130 mCpuIds[processor] = strtol(position, NULL, 0);
148 // If this does not have the full topology in /proc/cpuinfo, mCpuIds[0] may not have the 1 CPU part emitted - this guarantees it's in mMaxCpuId 131 // If this does not have the full topology in /proc/cpuinfo, mCpuIds[0] may not have the 1 CPU part emitted - this guarantees it's in mMaxCpuId
149 if (cpuId > mMaxCpuId) { 132 if (mCpuIds[processor] > mMaxCpuId) {
150 mMaxCpuId = cpuId; 133 mMaxCpuId = mCpuIds[processor];
151 }
152 if (processor >= NR_CPUS) {
153 logg->logMessage("Too many processors, please increase NR_CPUS");
154 } else if (processor >= 0) {
155 mCpuIds[processor] = cpuId;
156 } 134 }
157 } 135 }
158 136
@@ -164,23 +142,10 @@ void SessionData::readCpuInfo() {
164 142
165 if (!foundCoreName) { 143 if (!foundCoreName) {
166 logg->logMessage("Could not determine core name from /proc/cpuinfo\n" 144 logg->logMessage("Could not determine core name from /proc/cpuinfo\n"
167 "The core name in the captured xml file will be 'unknown'."); 145 "The core name in the captured xml file will be 'unknown'.");
168 } 146 }
169 fclose(f); 147 fclose(f);
170} 148 }
171
172uint64_t getTime() {
173 struct timespec ts;
174#ifndef CLOCK_MONOTONIC_RAW
175 // Android doesn't have this defined but it was added in Linux 2.6.28
176#define CLOCK_MONOTONIC_RAW 4
177#endif
178 if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) != 0) {
179 logg->logError(__FILE__, __LINE__, "Failed to get uptime");
180 handleException();
181 }
182 return (NS_PER_S*ts.tv_sec + ts.tv_nsec);
183}
184 149
185int getEventKey() { 150int getEventKey() {
186 // key 0 is reserved as a timestamp 151 // key 0 is reserved as a timestamp
diff --git a/daemon/SessionData.h b/daemon/SessionData.h
index 835082d..ea34240 100644
--- a/daemon/SessionData.h
+++ b/daemon/SessionData.h
@@ -13,16 +13,12 @@
13 13
14#include "Config.h" 14#include "Config.h"
15#include "Counter.h" 15#include "Counter.h"
16#include "FSDriver.h"
17#include "Hwmon.h" 16#include "Hwmon.h"
18#include "MaliVideoDriver.h"
19#include "PerfDriver.h" 17#include "PerfDriver.h"
20 18
21#define PROTOCOL_VERSION 19 19#define PROTOCOL_VERSION 18
22#define PROTOCOL_DEV 1000 // Differentiates development versions (timestamp) from release versions 20#define PROTOCOL_DEV 1000 // Differentiates development versions (timestamp) from release versions
23 21
24#define NS_PER_S ((uint64_t)1000000000)
25
26struct ImageLinkList { 22struct ImageLinkList {
27 char* path; 23 char* path;
28 struct ImageLinkList *next; 24 struct ImageLinkList *next;
@@ -36,12 +32,9 @@ public:
36 ~SessionData(); 32 ~SessionData();
37 void initialize(); 33 void initialize();
38 void parseSessionXML(char* xmlString); 34 void parseSessionXML(char* xmlString);
39 void readCpuInfo();
40 35
41 Hwmon hwmon; 36 Hwmon hwmon;
42 FSDriver fsDriver;
43 PerfDriver perf; 37 PerfDriver perf;
44 MaliVideoDriver maliVideo;
45 38
46 char mCoreName[MAX_STRING_LEN]; 39 char mCoreName[MAX_STRING_LEN];
47 struct ImageLinkList *mImages; 40 struct ImageLinkList *mImages;
@@ -56,8 +49,7 @@ public:
56 bool mLocalCapture; 49 bool mLocalCapture;
57 bool mOneShot; // halt processing of the driver data until profiling is complete or the buffer is filled 50 bool mOneShot; // halt processing of the driver data until profiling is complete or the buffer is filled
58 bool mIsEBS; 51 bool mIsEBS;
59 bool mSentSummary; 52
60
61 int mBacktraceDepth; 53 int mBacktraceDepth;
62 int mTotalBufferSize; // number of MB to use for the entire collection buffer 54 int mTotalBufferSize; // number of MB to use for the entire collection buffer
63 int mSampleRate; 55 int mSampleRate;
@@ -65,7 +57,7 @@ public:
65 int mDuration; 57 int mDuration;
66 int mCores; 58 int mCores;
67 int mPageSize; 59 int mPageSize;
68 int *mCpuIds; 60 int mCpuIds[NR_CPUS];
69 int mMaxCpuId; 61 int mMaxCpuId;
70 62
71 // PMU Counters 63 // PMU Counters
@@ -73,6 +65,8 @@ public:
73 Counter mCounters[MAX_PERFORMANCE_COUNTERS]; 65 Counter mCounters[MAX_PERFORMANCE_COUNTERS];
74 66
75private: 67private:
68 void readCpuInfo();
69
76 // Intentionally unimplemented 70 // Intentionally unimplemented
77 SessionData(const SessionData &); 71 SessionData(const SessionData &);
78 SessionData &operator=(const SessionData &); 72 SessionData &operator=(const SessionData &);
@@ -80,7 +74,6 @@ private:
80 74
81extern SessionData* gSessionData; 75extern SessionData* gSessionData;
82 76
83uint64_t getTime();
84int getEventKey(); 77int getEventKey();
85 78
86#endif // SESSION_DATA_H 79#endif // SESSION_DATA_H
diff --git a/daemon/SessionXML.cpp b/daemon/SessionXML.cpp
index 8cdc940..55b2f92 100644
--- a/daemon/SessionXML.cpp
+++ b/daemon/SessionXML.cpp
@@ -17,15 +17,15 @@
17#include "SessionData.h" 17#include "SessionData.h"
18 18
19static const char* TAG_SESSION = "session"; 19static const char* TAG_SESSION = "session";
20static const char* TAG_IMAGE = "image"; 20static const char* TAG_IMAGE = "image";
21 21
22static const char* ATTR_VERSION = "version"; 22static const char* ATTR_VERSION = "version";
23static const char* ATTR_CALL_STACK_UNWINDING = "call_stack_unwinding"; 23static const char* ATTR_CALL_STACK_UNWINDING = "call_stack_unwinding";
24static const char* ATTR_BUFFER_MODE = "buffer_mode"; 24static const char* ATTR_BUFFER_MODE = "buffer_mode";
25static const char* ATTR_SAMPLE_RATE = "sample_rate"; 25static const char* ATTR_SAMPLE_RATE = "sample_rate";
26static const char* ATTR_DURATION = "duration"; 26static const char* ATTR_DURATION = "duration";
27static const char* ATTR_PATH = "path"; 27static const char* ATTR_PATH = "path";
28static const char* ATTR_LIVE_RATE = "live_rate"; 28static const char* ATTR_LIVE_RATE = "live_rate";
29 29
30SessionXML::SessionXML(const char *str) { 30SessionXML::SessionXML(const char *str) {
31 parameters.buffer_mode[0] = 0; 31 parameters.buffer_mode[0] = 0;
diff --git a/daemon/StreamlineSetup.cpp b/daemon/StreamlineSetup.cpp
index 2b61eae..caa665e 100644
--- a/daemon/StreamlineSetup.cpp
+++ b/daemon/StreamlineSetup.cpp
@@ -266,7 +266,7 @@ void StreamlineSetup::writeConfiguration(char* xml) {
266 { ConfigurationXML configuration; } 266 { ConfigurationXML configuration; }
267 267
268 if (gSessionData->mCounterOverflow > 0) { 268 if (gSessionData->mCounterOverflow > 0) {
269 logg->logError(__FILE__, __LINE__, "Only %i performance counters are permitted, %i are selected", MAX_PERFORMANCE_COUNTERS, gSessionData->mCounterOverflow); 269 logg->logError(__FILE__, __LINE__, "Only %i performance counters counters are permitted, %i are selected", MAX_PERFORMANCE_COUNTERS, gSessionData->mCounterOverflow);
270 handleException(); 270 handleException();
271 } 271 }
272} 272}
diff --git a/daemon/StreamlineSetup.h b/daemon/StreamlineSetup.h
index b380f46..74bb197 100644
--- a/daemon/StreamlineSetup.h
+++ b/daemon/StreamlineSetup.h
@@ -21,7 +21,7 @@ enum {
21 COMMAND_APC_START = 2, 21 COMMAND_APC_START = 2,
22 COMMAND_APC_STOP = 3, 22 COMMAND_APC_STOP = 3,
23 COMMAND_DISCONNECT = 4, 23 COMMAND_DISCONNECT = 4,
24 COMMAND_PING = 5 24 COMMAND_PING = 5
25}; 25};
26 26
27class StreamlineSetup { 27class StreamlineSetup {
@@ -47,4 +47,4 @@ private:
47 StreamlineSetup &operator=(const StreamlineSetup &); 47 StreamlineSetup &operator=(const StreamlineSetup &);
48}; 48};
49 49
50#endif //__STREAMLINE_SETUP_H__ 50#endif //__STREAMLINE_SETUP_H__
diff --git a/daemon/UEvent.cpp b/daemon/UEvent.cpp
index 54d4575..d977cd0 100644
--- a/daemon/UEvent.cpp
+++ b/daemon/UEvent.cpp
@@ -8,11 +8,11 @@
8 8
9#include "UEvent.h" 9#include "UEvent.h"
10 10
11#include <string.h>
12#include <sys/socket.h> 11#include <sys/socket.h>
13#include <unistd.h>
14
15#include <linux/netlink.h> 12#include <linux/netlink.h>
13#include <string.h>
14
15#include <unistd.h>
16 16
17#include "Logging.h" 17#include "Logging.h"
18 18
diff --git a/daemon/UserSpaceSource.cpp b/daemon/UserSpaceSource.cpp
index 8c328e0..debe696 100644
--- a/daemon/UserSpaceSource.cpp
+++ b/daemon/UserSpaceSource.cpp
@@ -16,6 +16,7 @@
16#include "Logging.h" 16#include "Logging.h"
17#include "SessionData.h" 17#include "SessionData.h"
18 18
19#define NS_PER_S ((uint64_t)1000000000)
19#define NS_PER_US 1000 20#define NS_PER_US 1000
20 21
21extern Child *child; 22extern Child *child;
@@ -34,7 +35,6 @@ void UserSpaceSource::run() {
34 prctl(PR_SET_NAME, (unsigned long)&"gatord-counters", 0, 0, 0); 35 prctl(PR_SET_NAME, (unsigned long)&"gatord-counters", 0, 0, 0);
35 36
36 gSessionData->hwmon.start(); 37 gSessionData->hwmon.start();
37 gSessionData->fsDriver.start();
38 38
39 int64_t monotonic_started = 0; 39 int64_t monotonic_started = 0;
40 while (monotonic_started <= 0) { 40 while (monotonic_started <= 0) {
@@ -48,7 +48,16 @@ void UserSpaceSource::run() {
48 48
49 uint64_t next_time = 0; 49 uint64_t next_time = 0;
50 while (gSessionData->mSessionIsActive) { 50 while (gSessionData->mSessionIsActive) {
51 const uint64_t curr_time = getTime() - monotonic_started; 51 struct timespec ts;
52#ifndef CLOCK_MONOTONIC_RAW
53 // Android doesn't have this defined but it was added in Linux 2.6.28
54#define CLOCK_MONOTONIC_RAW 4
55#endif
56 if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) != 0) {
57 logg->logError(__FILE__, __LINE__, "Failed to get uptime");
58 handleException();
59 }
60 const uint64_t curr_time = (NS_PER_S*ts.tv_sec + ts.tv_nsec) - monotonic_started;
52 // Sample ten times a second ignoring gSessionData->mSampleRate 61 // Sample ten times a second ignoring gSessionData->mSampleRate
53 next_time += NS_PER_S/10;//gSessionData->mSampleRate; 62 next_time += NS_PER_S/10;//gSessionData->mSampleRate;
54 if (next_time < curr_time) { 63 if (next_time < curr_time) {
@@ -58,7 +67,6 @@ void UserSpaceSource::run() {
58 67
59 if (mBuffer.eventHeader(curr_time)) { 68 if (mBuffer.eventHeader(curr_time)) {
60 gSessionData->hwmon.read(&mBuffer); 69 gSessionData->hwmon.read(&mBuffer);
61 gSessionData->fsDriver.read(&mBuffer);
62 // Only check after writing all counters so that time and corresponding counters appear in the same frame 70 // Only check after writing all counters so that time and corresponding counters appear in the same frame
63 mBuffer.check(curr_time); 71 mBuffer.check(curr_time);
64 } 72 }
diff --git a/daemon/UserSpaceSource.h b/daemon/UserSpaceSource.h
index 9b36660..fb5889d 100644
--- a/daemon/UserSpaceSource.h
+++ b/daemon/UserSpaceSource.h
@@ -14,7 +14,7 @@
14#include "Buffer.h" 14#include "Buffer.h"
15#include "Source.h" 15#include "Source.h"
16 16
17// User space counters 17// User space counters - currently just hwmon
18class UserSpaceSource : public Source { 18class UserSpaceSource : public Source {
19public: 19public:
20 UserSpaceSource(sem_t *senderSem); 20 UserSpaceSource(sem_t *senderSem);
diff --git a/daemon/common.mk b/daemon/common.mk
index 769a92e..d9dc146 100644
--- a/daemon/common.mk
+++ b/daemon/common.mk
@@ -5,17 +5,16 @@
5# -Werror treats warnings as errors 5# -Werror treats warnings as errors
6# -std=c++0x is the planned new c++ standard 6# -std=c++0x is the planned new c++ standard
7# -std=c++98 is the 1998 c++ standard 7# -std=c++98 is the 1998 c++ standard
8CPPFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors 8CFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors
9CXXFLAGS += -fno-rtti -Wextra # -Weffc++ 9CXXFLAGS += -fno-rtti -Wextra # -Weffc++
10ifeq ($(WERROR),1) 10ifeq ($(WERROR),1)
11 CPPFLAGS += -Werror 11 CFLAGS += -Werror
12endif 12endif
13# -s strips the binary of debug info 13# -s strips the binary of debug info
14LDFLAGS += -s 14LDFLAGS += -s
15LDLIBS += -lrt -lm -pthread
16TARGET = gatord 15TARGET = gatord
17C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c) 16C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c)
18CXX_SRC = $(wildcard *.cpp) 17CPP_SRC = $(wildcard *.cpp)
19 18
20all: $(TARGET) 19all: $(TARGET)
21 20
@@ -36,15 +35,14 @@ libsensors/conf-parse.c: ;
36 ./escape $< > $@ 35 ./escape $< > $@
37 36
38%.o: %.c 37%.o: %.c
39 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< 38 $(GCC) -c $(CFLAGS) -o $@ $<
40 39
41%.o: %.cpp 40%.o: %.cpp
42 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< 41 $(CPP) -c $(CFLAGS) $(CXXFLAGS) -o $@ $<
43 42
44$(TARGET): $(CXX_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o) 43$(TARGET): $(CPP_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o)
45 $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ 44 $(CPP) $(LDFLAGS) -o $@ $^ -lrt -pthread
46 45
47# Intentionally ignore CC as a native binary is required
48escape: escape.c 46escape: escape.c
49 gcc $^ -o $@ 47 gcc $^ -o $@
50 48
diff --git a/daemon/defaults.xml b/daemon/defaults.xml
index 39a0f65..5bf096c 100644
--- a/daemon/defaults.xml
+++ b/daemon/defaults.xml
@@ -58,10 +58,5 @@
58 <configuration counter="Linux_meminfo_memused"/> 58 <configuration counter="Linux_meminfo_memused"/>
59 <configuration counter="Linux_meminfo_memfree"/> 59 <configuration counter="Linux_meminfo_memfree"/>
60 <configuration counter="Linux_power_cpu_freq"/> 60 <configuration counter="Linux_power_cpu_freq"/>
61 <configuration counter="ARM_Mali-4xx_fragment"/>
62 <configuration counter="ARM_Mali-4xx_vertex"/>
63 <configuration counter="ARM_Mali-T6xx_fragment" cores="1"/>
64 <configuration counter="ARM_Mali-T6xx_vertex" cores="1"/>
65 <configuration counter="ARM_Mali-T6xx_opencl" cores="1"/>
66 <configuration counter="L2C-310_cnt0" event="0x1"/> 61 <configuration counter="L2C-310_cnt0" event="0x1"/>
67</configurations> 62</configurations>
diff --git a/daemon/defaults_xml.h b/daemon/defaults_xml.h
new file mode 100644
index 0000000..b00e814
--- /dev/null
+++ b/daemon/defaults_xml.h
@@ -0,0 +1,306 @@
1static const unsigned char defaults_xml[] = {
2 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
3 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f,
4 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x22,
5 0x3f, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
6 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x72, 0x65, 0x76, 0x69, 0x73,
7 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x33, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
8 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
9 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41,
10 0x52, 0x4d, 0x5f, 0x41, 0x52, 0x4d, 0x31, 0x31, 0x5f, 0x63, 0x63, 0x6e,
11 0x74, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78,
12 0x66, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e,
13 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,
14 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f,
15 0x41, 0x52, 0x4d, 0x31, 0x31, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20,
16 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x37, 0x22, 0x2f,
17 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
18 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74,
19 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x41, 0x52, 0x4d, 0x31,
20 0x31, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e,
21 0x74, 0x3d, 0x22, 0x30, 0x78, 0x62, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
22 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
23 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
24 0x41, 0x52, 0x4d, 0x5f, 0x41, 0x52, 0x4d, 0x31, 0x31, 0x4d, 0x50, 0x43,
25 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20, 0x65, 0x76,
26 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x66, 0x66, 0x22, 0x2f, 0x3e,
27 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
28 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
29 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x41, 0x52, 0x4d, 0x31, 0x31,
30 0x4d, 0x50, 0x43, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22,
31 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x30, 0x38,
32 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69,
33 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75,
34 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x41, 0x52,
35 0x4d, 0x31, 0x31, 0x4d, 0x50, 0x43, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x6e,
36 0x74, 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30,
37 0x78, 0x30, 0x62, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f,
38 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
39 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d,
40 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x35,
41 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
42 0x3d, 0x22, 0x30, 0x78, 0x66, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
43 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
44 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
45 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
46 0x5f, 0x41, 0x35, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65, 0x76,
47 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x38, 0x22, 0x2f, 0x3e, 0x0a,
48 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
49 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
50 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74,
51 0x65, 0x78, 0x5f, 0x41, 0x35, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20,
52 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x22, 0x2f,
53 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
54 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74,
55 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f,
56 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x37, 0x5f, 0x63, 0x63, 0x6e, 0x74,
57 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x66,
58 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66,
59 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f,
60 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37,
61 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x37, 0x5f, 0x63,
62 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22,
63 0x30, 0x78, 0x30, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
64 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
65 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52,
66 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41,
67 0x37, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e,
68 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x30, 0x22, 0x2f, 0x3e, 0x0a, 0x20,
69 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
70 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d,
71 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65,
72 0x78, 0x5f, 0x41, 0x37, 0x5f, 0x63, 0x6e, 0x74, 0x32, 0x22, 0x20, 0x65,
73 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x36, 0x22, 0x2f,
74 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
75 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74,
76 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f,
77 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x38, 0x5f, 0x63, 0x63, 0x6e, 0x74,
78 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x66,
79 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66,
80 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f,
81 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37,
82 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x38, 0x5f, 0x63,
83 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22,
84 0x30, 0x78, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f,
85 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
86 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d,
87 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x38,
88 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
89 0x3d, 0x22, 0x30, 0x78, 0x34, 0x34, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
90 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
91 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
92 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
93 0x5f, 0x41, 0x38, 0x5f, 0x63, 0x6e, 0x74, 0x32, 0x22, 0x20, 0x65, 0x76,
94 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x34, 0x33, 0x22, 0x2f, 0x3e,
95 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
96 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
97 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72,
98 0x74, 0x65, 0x78, 0x5f, 0x41, 0x38, 0x5f, 0x63, 0x6e, 0x74, 0x33, 0x22,
99 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x30,
100 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69,
101 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75,
102 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f,
103 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x39, 0x5f, 0x63, 0x63,
104 0x6e, 0x74, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30,
105 0x78, 0x66, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f,
106 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
107 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d,
108 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x39,
109 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
110 0x3d, 0x22, 0x30, 0x78, 0x36, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
111 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
112 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
113 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
114 0x5f, 0x41, 0x39, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20, 0x65, 0x76,
115 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x30, 0x36, 0x22, 0x2f, 0x3e,
116 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
117 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
118 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72,
119 0x74, 0x65, 0x78, 0x5f, 0x41, 0x39, 0x5f, 0x63, 0x6e, 0x74, 0x32, 0x22,
120 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x30, 0x37,
121 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69,
122 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75,
123 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f,
124 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x39, 0x5f, 0x63, 0x6e,
125 0x74, 0x33, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30,
126 0x78, 0x30, 0x33, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f,
127 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
128 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d,
129 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x39,
130 0x5f, 0x63, 0x6e, 0x74, 0x34, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
131 0x3d, 0x22, 0x30, 0x78, 0x30, 0x34, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
132 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
133 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
134 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
135 0x5f, 0x41, 0x31, 0x32, 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20, 0x65,
136 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x66, 0x66, 0x22, 0x2f,
137 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
138 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74,
139 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f,
140 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x31, 0x32, 0x5f, 0x63, 0x6e, 0x74,
141 0x30, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78,
142 0x30, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e,
143 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,
144 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76,
145 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x31, 0x32,
146 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
147 0x3d, 0x22, 0x30, 0x78, 0x31, 0x36, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
148 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
149 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
150 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
151 0x5f, 0x41, 0x31, 0x32, 0x5f, 0x63, 0x6e, 0x74, 0x32, 0x22, 0x20, 0x65,
152 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x30, 0x22, 0x2f,
153 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
154 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74,
155 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f,
156 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x31, 0x32, 0x5f, 0x63, 0x6e, 0x74,
157 0x33, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78,
158 0x31, 0x39, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e,
159 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,
160 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76,
161 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x31, 0x35,
162 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
163 0x3d, 0x22, 0x30, 0x78, 0x66, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
164 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
165 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
166 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
167 0x5f, 0x41, 0x31, 0x35, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65,
168 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x38, 0x22, 0x2f, 0x3e,
169 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
170 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
171 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72,
172 0x74, 0x65, 0x78, 0x5f, 0x41, 0x31, 0x35, 0x5f, 0x63, 0x6e, 0x74, 0x31,
173 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31,
174 0x36, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66,
175 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f,
176 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x76, 0x37,
177 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x41, 0x31, 0x35, 0x5f,
178 0x63, 0x6e, 0x74, 0x32, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d,
179 0x22, 0x30, 0x78, 0x31, 0x30, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
180 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
181 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41,
182 0x52, 0x4d, 0x76, 0x37, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f,
183 0x41, 0x31, 0x35, 0x5f, 0x63, 0x6e, 0x74, 0x33, 0x22, 0x20, 0x65, 0x76,
184 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x39, 0x22, 0x2f, 0x3e,
185 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
186 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
187 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65,
188 0x78, 0x2d, 0x41, 0x35, 0x33, 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20,
189 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x31, 0x22,
190 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
191 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e,
192 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f, 0x72,
193 0x74, 0x65, 0x78, 0x2d, 0x41, 0x35, 0x33, 0x5f, 0x63, 0x6e, 0x74, 0x30,
194 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x38,
195 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69,
196 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75,
197 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f,
198 0x72, 0x74, 0x65, 0x78, 0x2d, 0x41, 0x35, 0x33, 0x5f, 0x63, 0x6e, 0x74,
199 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78,
200 0x31, 0x36, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e,
201 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,
202 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f,
203 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x2d, 0x41, 0x35, 0x33, 0x5f, 0x63,
204 0x6e, 0x74, 0x32, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22,
205 0x30, 0x78, 0x31, 0x30, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
206 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
207 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52,
208 0x4d, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x2d, 0x41, 0x35, 0x33,
209 0x5f, 0x63, 0x6e, 0x74, 0x33, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74,
210 0x3d, 0x22, 0x30, 0x78, 0x31, 0x39, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
211 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
212 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
213 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x2d, 0x41,
214 0x35, 0x37, 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20, 0x65, 0x76, 0x65,
215 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x31, 0x22, 0x2f, 0x3e, 0x0a,
216 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
217 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
218 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65, 0x78,
219 0x2d, 0x41, 0x35, 0x37, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65,
220 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x38, 0x22, 0x2f, 0x3e,
221 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
222 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
223 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f, 0x72, 0x74, 0x65,
224 0x78, 0x2d, 0x41, 0x35, 0x37, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20,
225 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x36, 0x22,
226 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
227 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e,
228 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x6f, 0x72,
229 0x74, 0x65, 0x78, 0x2d, 0x41, 0x35, 0x37, 0x5f, 0x63, 0x6e, 0x74, 0x32,
230 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31,
231 0x30, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66,
232 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f,
233 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x41, 0x52, 0x4d, 0x5f, 0x43,
234 0x6f, 0x72, 0x74, 0x65, 0x78, 0x2d, 0x41, 0x35, 0x37, 0x5f, 0x63, 0x6e,
235 0x74, 0x33, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30,
236 0x78, 0x31, 0x39, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f,
237 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
238 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x53, 0x63, 0x6f,
239 0x72, 0x70, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x63, 0x6e, 0x74, 0x22, 0x20,
240 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x66, 0x66, 0x22,
241 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
242 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e,
243 0x74, 0x65, 0x72, 0x3d, 0x22, 0x53, 0x63, 0x6f, 0x72, 0x70, 0x69, 0x6f,
244 0x6e, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e,
245 0x74, 0x3d, 0x22, 0x30, 0x78, 0x30, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20,
246 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
247 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d,
248 0x22, 0x53, 0x63, 0x6f, 0x72, 0x70, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6e,
249 0x74, 0x31, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30,
250 0x78, 0x31, 0x30, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f,
251 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
252 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x53, 0x63, 0x6f,
253 0x72, 0x70, 0x69, 0x6f, 0x6e, 0x4d, 0x50, 0x5f, 0x63, 0x63, 0x6e, 0x74,
254 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x66,
255 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66,
256 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f,
257 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x53, 0x63, 0x6f, 0x72, 0x70,
258 0x69, 0x6f, 0x6e, 0x4d, 0x50, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20,
259 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x30, 0x38, 0x22,
260 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
261 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e,
262 0x74, 0x65, 0x72, 0x3d, 0x22, 0x53, 0x63, 0x6f, 0x72, 0x70, 0x69, 0x6f,
263 0x6e, 0x4d, 0x50, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22, 0x20, 0x65, 0x76,
264 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x30, 0x22, 0x2f, 0x3e,
265 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
266 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65,
267 0x72, 0x3d, 0x22, 0x4b, 0x72, 0x61, 0x69, 0x74, 0x5f, 0x63, 0x63, 0x6e,
268 0x74, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78,
269 0x66, 0x66, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e,
270 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,
271 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x4b, 0x72, 0x61, 0x69,
272 0x74, 0x5f, 0x63, 0x6e, 0x74, 0x30, 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e,
273 0x74, 0x3d, 0x22, 0x30, 0x78, 0x30, 0x38, 0x22, 0x2f, 0x3e, 0x0a, 0x20,
274 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
275 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d,
276 0x22, 0x4b, 0x72, 0x61, 0x69, 0x74, 0x5f, 0x63, 0x6e, 0x74, 0x31, 0x22,
277 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31, 0x30,
278 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69,
279 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75,
280 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x5f,
281 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x71, 0x5f, 0x77, 0x72, 0x22,
282 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
283 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e,
284 0x74, 0x65, 0x72, 0x3d, 0x22, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x62,
285 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x71, 0x5f, 0x72, 0x64, 0x22, 0x2f,
286 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
287 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74,
288 0x65, 0x72, 0x3d, 0x22, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6d, 0x65,
289 0x6d, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x6d, 0x65, 0x6d, 0x75, 0x73, 0x65,
290 0x64, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x6f, 0x6e, 0x66,
291 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f,
292 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x4c, 0x69, 0x6e, 0x75, 0x78,
293 0x5f, 0x6d, 0x65, 0x6d, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x6d, 0x65, 0x6d,
294 0x66, 0x72, 0x65, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
295 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
296 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22, 0x4c, 0x69,
297 0x6e, 0x75, 0x78, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x63, 0x70,
298 0x75, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x22, 0x2f, 0x3e, 0x0a, 0x20, 0x20,
299 0x3c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
300 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x22,
301 0x4c, 0x32, 0x43, 0x2d, 0x33, 0x31, 0x30, 0x5f, 0x63, 0x6e, 0x74, 0x30,
302 0x22, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x30, 0x78, 0x31,
303 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
304 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3e, 0x0a, 0x00
305};
306static const unsigned int defaults_xml_len = 3634;
diff --git a/daemon/escape b/daemon/escape
new file mode 100644
index 0000000..99f38e8
--- /dev/null
+++ b/daemon/escape
Binary files differ
diff --git a/daemon/escape.c b/daemon/escape.c
index 2b0863a..c54aa1c 100644
--- a/daemon/escape.c
+++ b/daemon/escape.c
@@ -6,7 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9/* 9/*
10 * The Makefile in the daemon folder builds and executes 'escape' 10 * The Makefile in the daemon folder builds and executes 'escape'
11 * 'escape' creates configuration_xml.h from configuration.xml and events_xml.h from events-*.xml 11 * 'escape' creates configuration_xml.h from configuration.xml and events_xml.h from events-*.xml
12 * these genereated xml files are then #included and built as part of the gatord binary 12 * these genereated xml files are then #included and built as part of the gatord binary
diff --git a/daemon/events-CCI-400.xml b/daemon/events-CCI-400.xml
index 20002ef..4fa7711 100644
--- a/daemon/events-CCI-400.xml
+++ b/daemon/events-CCI-400.xml
@@ -1,6 +1,7 @@
1 <counter_set name="CCI_400_cnt" count="4"/> 1 <counter_set name="cci-400_cnt" count="4"/>
2 <category name="CCI-400" counter_set="CCI_400_cnt" per_cpu="no" supports_event_based_sampling="yes"> 2 <category name="CCI-400" counter_set="cci-400_cnt" per_cpu="no" supports_event_based_sampling="yes">
3 <event counter="CCI_400_ccnt" event="0xff" title="CCI-400 Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" description="The number of core clock cycles"/> 3 <event counter="cci-400_ccnt" event="0xff" title="CCI-400 Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" description="The number of core clock cycles"/>
4
4 <option_set name="Slave"> 5 <option_set name="Slave">
5 <option event_delta="0x00" name="S0" description="Slave interface 0"/> 6 <option event_delta="0x00" name="S0" description="Slave interface 0"/>
6 <option event_delta="0x20" name="S1" description="Slave interface 1"/> 7 <option event_delta="0x20" name="S1" description="Slave interface 1"/>
@@ -8,6 +9,7 @@
8 <option event_delta="0x60" name="S3" description="Slave interface 3"/> 9 <option event_delta="0x60" name="S3" description="Slave interface 3"/>
9 <option event_delta="0x80" name="S4" description="Slave interface 4"/> 10 <option event_delta="0x80" name="S4" description="Slave interface 4"/>
10 </option_set> 11 </option_set>
12
11 <event event="0x00" option_set="Slave" title="CCI-400" name="Read: any" description="Read request handshake: any"/> 13 <event event="0x00" option_set="Slave" title="CCI-400" name="Read: any" description="Read request handshake: any"/>
12 <event event="0x01" option_set="Slave" title="CCI-400" name="Read: transaction" description="Read request handshake: device transaction"/> 14 <event event="0x01" option_set="Slave" title="CCI-400" name="Read: transaction" description="Read request handshake: device transaction"/>
13 <event event="0x02" option_set="Slave" title="CCI-400" name="Read: normal" description="Read request handshake: normal, non-shareable or system-shareable, but not barrier or cache maintenance operation"/> 15 <event event="0x02" option_set="Slave" title="CCI-400" name="Read: normal" description="Read request handshake: normal, non-shareable or system-shareable, but not barrier or cache maintenance operation"/>
@@ -28,11 +30,13 @@
28 <event event="0x11" option_set="Slave" title="CCI-400" name="Write: WriteLineUnique" description="Write request handshake: WriteLineUnique"/> 30 <event event="0x11" option_set="Slave" title="CCI-400" name="Write: WriteLineUnique" description="Write request handshake: WriteLineUnique"/>
29 <event event="0x12" option_set="Slave" title="CCI-400" name="Write: Evict" description="Write request handshake: Evict"/> 31 <event event="0x12" option_set="Slave" title="CCI-400" name="Write: Evict" description="Write request handshake: Evict"/>
30 <event event="0x13" option_set="Slave" title="CCI-400" name="Write stall: tracker full" description="Write request stall cycle because the transaction tracker is full. Increase SIx_W_MAX to avoid this stall"/> 32 <event event="0x13" option_set="Slave" title="CCI-400" name="Write stall: tracker full" description="Write request stall cycle because the transaction tracker is full. Increase SIx_W_MAX to avoid this stall"/>
33
31 <option_set name="Master"> 34 <option_set name="Master">
32 <option event_delta="0xa0" name="M0" description="Master interface 0"/> 35 <option event_delta="0xa0" name="M0" description="Master interface 0"/>
33 <option event_delta="0xc0" name="M1" description="Master interface 1"/> 36 <option event_delta="0xc0" name="M1" description="Master interface 1"/>
34 <option event_delta="0xe0" name="M2" description="Master interface 2"/> 37 <option event_delta="0xe0" name="M2" description="Master interface 2"/>
35 </option_set> 38 </option_set>
39
36 <event event="0x14" option_set="Master" title="CCI-400" name="Retry fetch" description="RETRY of speculative fetch transaction"/> 40 <event event="0x14" option_set="Master" title="CCI-400" name="Retry fetch" description="RETRY of speculative fetch transaction"/>
37 <event event="0x15" option_set="Master" title="CCI-400" name="Read stall: address hazard" description="Read request stall cycle because of an address hazard"/> 41 <event event="0x15" option_set="Master" title="CCI-400" name="Read stall: address hazard" description="Read request stall cycle because of an address hazard"/>
38 <event event="0x16" option_set="Master" title="CCI-400" name="Read stall: ID hazard" description="Read request stall cycle because of an ID hazard"/> 42 <event event="0x16" option_set="Master" title="CCI-400" name="Read stall: ID hazard" description="Read request stall cycle because of an ID hazard"/>
@@ -41,9 +45,11 @@
41 <event event="0x19" option_set="Master" title="CCI-400" name="Write stall: barrier hazard" description="Write request stall cycle because of a barrier hazard"/> 45 <event event="0x19" option_set="Master" title="CCI-400" name="Write stall: barrier hazard" description="Write request stall cycle because of a barrier hazard"/>
42 <event event="0x1a" option_set="Master" title="CCI-400" name="Write stall: tracker full" description="Write request stall cycle because the transaction tracker is full. Increase MIx_W_MAX to avoid this stall. See the CoreLink CCI-400 Cache Coherent Interconnect Integration Manual"/> 46 <event event="0x1a" option_set="Master" title="CCI-400" name="Write stall: tracker full" description="Write request stall cycle because the transaction tracker is full. Increase MIx_W_MAX to avoid this stall. See the CoreLink CCI-400 Cache Coherent Interconnect Integration Manual"/>
43 </category> 47 </category>
44 <counter_set name="CCI_400-r1_cnt" count="4"/> 48
45 <category name="CCI-400" counter_set="CCI_400-r1_cnt" per_cpu="no" supports_event_based_sampling="yes"> 49 <counter_set name="cci-400-r1_cnt" count="4"/>
46 <event counter="CCI_400-r1_ccnt" event="0xff" title="CCI-400 Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" description="The number of core clock cycles"/> 50 <category name="CCI-400" counter_set="cci-400-r1_cnt" per_cpu="no" supports_event_based_sampling="yes">
51 <event counter="cci-400-r1_ccnt" event="0xff" title="CCI-400 Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" description="The number of core clock cycles"/>
52
47 <option_set name="Slave"> 53 <option_set name="Slave">
48 <option event_delta="0x00" name="S0" description="Slave interface 0"/> 54 <option event_delta="0x00" name="S0" description="Slave interface 0"/>
49 <option event_delta="0x20" name="S1" description="Slave interface 1"/> 55 <option event_delta="0x20" name="S1" description="Slave interface 1"/>
@@ -51,6 +57,7 @@
51 <option event_delta="0x60" name="S3" description="Slave interface 3"/> 57 <option event_delta="0x60" name="S3" description="Slave interface 3"/>
52 <option event_delta="0x80" name="S4" description="Slave interface 4"/> 58 <option event_delta="0x80" name="S4" description="Slave interface 4"/>
53 </option_set> 59 </option_set>
60
54 <event event="0x00" option_set="Slave" title="CCI-400" name="Read: any" description="Read request handshake: any"/> 61 <event event="0x00" option_set="Slave" title="CCI-400" name="Read: any" description="Read request handshake: any"/>
55 <event event="0x01" option_set="Slave" title="CCI-400" name="Read: transaction" description="Read request handshake: device transaction"/> 62 <event event="0x01" option_set="Slave" title="CCI-400" name="Read: transaction" description="Read request handshake: device transaction"/>
56 <event event="0x02" option_set="Slave" title="CCI-400" name="Read: normal" description="Read request handshake: normal, non-shareable or system-shareable, but not barrier or cache maintenance operation"/> 63 <event event="0x02" option_set="Slave" title="CCI-400" name="Read: normal" description="Read request handshake: normal, non-shareable or system-shareable, but not barrier or cache maintenance operation"/>
@@ -72,11 +79,13 @@
72 <event event="0x12" option_set="Slave" title="CCI-400" name="Write: Evict" description="Write request handshake: Evict"/> 79 <event event="0x12" option_set="Slave" title="CCI-400" name="Write: Evict" description="Write request handshake: Evict"/>
73 <event event="0x13" option_set="Slave" title="CCI-400" name="Write stall: tracker full" description="Write request stall cycle because the transaction tracker is full. Increase SIx_W_MAX to avoid this stall"/> 80 <event event="0x13" option_set="Slave" title="CCI-400" name="Write stall: tracker full" description="Write request stall cycle because the transaction tracker is full. Increase SIx_W_MAX to avoid this stall"/>
74 <event event="0x14" option_set="Slave" title="CCI-400" name="Read stall: slave hazard" description="Read request stall cycle because of a slave interface ID hazard"/> 81 <event event="0x14" option_set="Slave" title="CCI-400" name="Read stall: slave hazard" description="Read request stall cycle because of a slave interface ID hazard"/>
82
75 <option_set name="Master"> 83 <option_set name="Master">
76 <option event_delta="0xa0" name="M0" description="Master interface 0"/> 84 <option event_delta="0xa0" name="M0" description="Master interface 0"/>
77 <option event_delta="0xc0" name="M1" description="Master interface 1"/> 85 <option event_delta="0xc0" name="M1" description="Master interface 1"/>
78 <option event_delta="0xe0" name="M2" description="Master interface 2"/> 86 <option event_delta="0xe0" name="M2" description="Master interface 2"/>
79 </option_set> 87 </option_set>
88
80 <event event="0x00" option_set="Master" title="CCI-400" name="Retry fetch" description="RETRY of speculative fetch transaction"/> 89 <event event="0x00" option_set="Master" title="CCI-400" name="Retry fetch" description="RETRY of speculative fetch transaction"/>
81 <event event="0x01" option_set="Master" title="CCI-400" name="Read stall: address hazard" description="Stall cycle because of an address hazard. A read or write invalidation is stalled because of an outstanding transaction to an overlapping address"/> 90 <event event="0x01" option_set="Master" title="CCI-400" name="Read stall: address hazard" description="Stall cycle because of an address hazard. A read or write invalidation is stalled because of an outstanding transaction to an overlapping address"/>
82 <event event="0x02" option_set="Master" title="CCI-400" name="Read stall: ID hazard" description="Read request stall cycle because of a master interface ID hazard"/> 91 <event event="0x02" option_set="Master" title="CCI-400" name="Read stall: ID hazard" description="Read request stall cycle because of a master interface ID hazard"/>
diff --git a/daemon/events-CCN-504.xml b/daemon/events-CCN-504.xml
index 6ef3e64..cfabf65 100644
--- a/daemon/events-CCN-504.xml
+++ b/daemon/events-CCN-504.xml
@@ -1,6 +1,7 @@
1 <counter_set name="CCN-504_cnt" count="4"/> 1 <counter_set name="CCN-504_cnt" count="4"/>
2 <category name="CCN-504" counter_set="CCN-504_cnt"> 2 <category name="CCN-504" counter_set="CCN-504_cnt">
3 <event counter="CCN-504_ccnt" title="CCN-504 Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" description="The number of core clock cycles"/> 3 <event counter="CCN-504_ccnt" title="CCN-504 Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" description="The number of core clock cycles"/>
4
4 <option_set name="XP_Region"> 5 <option_set name="XP_Region">
5 <option event_delta="0x400000" name="XP 0" description="Crosspoint 0"/> 6 <option event_delta="0x400000" name="XP 0" description="Crosspoint 0"/>
6 <option event_delta="0x410000" name="XP 1" description="Crosspoint 1"/> 7 <option event_delta="0x410000" name="XP 1" description="Crosspoint 1"/>
@@ -14,6 +15,7 @@
14 <option event_delta="0x490000" name="XP 9" description="Crosspoint 9"/> 15 <option event_delta="0x490000" name="XP 9" description="Crosspoint 9"/>
15 <option event_delta="0x4A0000" name="XP 10" description="Crosspoint 10"/> 16 <option event_delta="0x4A0000" name="XP 10" description="Crosspoint 10"/>
16 </option_set> 17 </option_set>
18
17 <event event="0x0801" option_set="XP_Region" title="CCN-504" name="Bus 0: REQ: H-bit" description="Bus 0: REQ: Set H-bit, signaled when this XP sets the H-bit."/> 19 <event event="0x0801" option_set="XP_Region" title="CCN-504" name="Bus 0: REQ: H-bit" description="Bus 0: REQ: Set H-bit, signaled when this XP sets the H-bit."/>
18 <event event="0x0802" option_set="XP_Region" title="CCN-504" name="Bus 0: REQ: S-bit" description="Bus 0: REQ: Set S-bit, signaled when this XP sets the S-bit."/> 20 <event event="0x0802" option_set="XP_Region" title="CCN-504" name="Bus 0: REQ: S-bit" description="Bus 0: REQ: Set S-bit, signaled when this XP sets the S-bit."/>
19 <event event="0x0803" option_set="XP_Region" title="CCN-504" name="Bus 0: REQ: P-Cnt" description="Bus 0: REQ: Set P-Cnt, signaled when this XP sets the P-Cnt. This is not applicable for the SNP VC."/> 21 <event event="0x0803" option_set="XP_Region" title="CCN-504" name="Bus 0: REQ: P-Cnt" description="Bus 0: REQ: Set P-Cnt, signaled when this XP sets the P-Cnt. This is not applicable for the SNP VC."/>
@@ -54,6 +56,7 @@
54 <event event="0x087A" option_set="XP_Region" title="CCN-504" name="Bus 1: DATB: S-bit" description="Bus 1: DATB: Set S-bit, signaled when this XP sets the S-bit."/> 56 <event event="0x087A" option_set="XP_Region" title="CCN-504" name="Bus 1: DATB: S-bit" description="Bus 1: DATB: Set S-bit, signaled when this XP sets the S-bit."/>
55 <event event="0x087B" option_set="XP_Region" title="CCN-504" name="Bus 1: DATB: P-Cnt" description="Bus 1: DATB: Set P-Cnt, signaled when this XP sets the P-Cnt. This is not applicable for the SNP VC."/> 57 <event event="0x087B" option_set="XP_Region" title="CCN-504" name="Bus 1: DATB: P-Cnt" description="Bus 1: DATB: Set P-Cnt, signaled when this XP sets the P-Cnt. This is not applicable for the SNP VC."/>
56 <event event="0x087C" option_set="XP_Region" title="CCN-504" name="Bus 1: DATB: TknV" description="Bus 1: DATB: No TknV, signaled when this XP transmits a valid packet."/> 58 <event event="0x087C" option_set="XP_Region" title="CCN-504" name="Bus 1: DATB: TknV" description="Bus 1: DATB: No TknV, signaled when this XP transmits a valid packet."/>
59
57 <option_set name="HN-F_Region"> 60 <option_set name="HN-F_Region">
58 <option event_delta="0x200000" name="HN-F 3" description="Fully-coherent Home Node 3"/> 61 <option event_delta="0x200000" name="HN-F 3" description="Fully-coherent Home Node 3"/>
59 <option event_delta="0x210000" name="HN-F 5" description="Fully-coherent Home Node 5"/> 62 <option event_delta="0x210000" name="HN-F 5" description="Fully-coherent Home Node 5"/>
@@ -64,6 +67,7 @@
64 <option event_delta="0x260000" name="HN-F 17" description="Fully-coherent Home Node 17"/> 67 <option event_delta="0x260000" name="HN-F 17" description="Fully-coherent Home Node 17"/>
65 <option event_delta="0x270000" name="HN-F 18" description="Fully-coherent Home Node 18"/> 68 <option event_delta="0x270000" name="HN-F 18" description="Fully-coherent Home Node 18"/>
66 </option_set> 69 </option_set>
70
67 <event event="0x0401" option_set="HN-F_Region" title="CCN-504" name="Cache Miss" description="Counts the total cache misses. This is the first time lookup result, and is high priority."/> 71 <event event="0x0401" option_set="HN-F_Region" title="CCN-504" name="Cache Miss" description="Counts the total cache misses. This is the first time lookup result, and is high priority."/>
68 <event event="0x0402" option_set="HN-F_Region" title="CCN-504" name="L3 SF Cache Access" description="Counts the number of cache accesses. This is the first time access, and is high priority."/> 72 <event event="0x0402" option_set="HN-F_Region" title="CCN-504" name="L3 SF Cache Access" description="Counts the number of cache accesses. This is the first time access, and is high priority."/>
69 <event event="0x0403" option_set="HN-F_Region" title="CCN-504" name="Cache Fill" description="Counts the total allocations in the HN L3 cache, and all cache line allocations to the L3 cache."/> 73 <event event="0x0403" option_set="HN-F_Region" title="CCN-504" name="Cache Fill" description="Counts the total allocations in the HN L3 cache, and all cache line allocations to the L3 cache."/>
@@ -78,6 +82,7 @@
78 <event event="0x040C" option_set="HN-F_Region" title="CCN-504" name="MC Retries" description="Counts the number of transactions retried by the memory controller."/> 82 <event event="0x040C" option_set="HN-F_Region" title="CCN-504" name="MC Retries" description="Counts the number of transactions retried by the memory controller."/>
79 <event event="0x040D" option_set="HN-F_Region" title="CCN-504" name="MC Reqs" description="Counts the number of requests to the memory controller."/> 83 <event event="0x040D" option_set="HN-F_Region" title="CCN-504" name="MC Reqs" description="Counts the number of requests to the memory controller."/>
80 <event event="0x040E" option_set="HN-F_Region" title="CCN-504" name="QOS HH Retry" description="Counts the number of times a highest-priority QoS class was retried at the HN-F."/> 84 <event event="0x040E" option_set="HN-F_Region" title="CCN-504" name="QOS HH Retry" description="Counts the number of times a highest-priority QoS class was retried at the HN-F."/>
85
81 <option_set name="RN-I_Region"> 86 <option_set name="RN-I_Region">
82 <option event_delta="0x800000" name="RN-I 0" description="I/O-coherent Requesting Node 0"/> 87 <option event_delta="0x800000" name="RN-I 0" description="I/O-coherent Requesting Node 0"/>
83 <option event_delta="0x820000" name="RN-I 2" description="I/O-coherent Requesting Node 2"/> 88 <option event_delta="0x820000" name="RN-I 2" description="I/O-coherent Requesting Node 2"/>
@@ -86,6 +91,7 @@
86 <option event_delta="0x900000" name="RN-I 16" description="I/O-coherent Requesting Node 16"/> 91 <option event_delta="0x900000" name="RN-I 16" description="I/O-coherent Requesting Node 16"/>
87 <option event_delta="0x940000" name="RN-I 20" description="I/O-coherent Requesting Node 20"/> 92 <option event_delta="0x940000" name="RN-I 20" description="I/O-coherent Requesting Node 20"/>
88 </option_set> 93 </option_set>
94
89 <event event="0x1601" option_set="RN-I_Region" title="CCN-504" name="S0 RDataBeats" description="S0 RDataBeats."/> 95 <event event="0x1601" option_set="RN-I_Region" title="CCN-504" name="S0 RDataBeats" description="S0 RDataBeats."/>
90 <event event="0x1602" option_set="RN-I_Region" title="CCN-504" name="S1 RDataBeats" description="S1 RDataBeats."/> 96 <event event="0x1602" option_set="RN-I_Region" title="CCN-504" name="S1 RDataBeats" description="S1 RDataBeats."/>
91 <event event="0x1603" option_set="RN-I_Region" title="CCN-504" name="S2 RDataBeats" description="S2 RDataBeats."/> 97 <event event="0x1603" option_set="RN-I_Region" title="CCN-504" name="S2 RDataBeats" description="S2 RDataBeats."/>
@@ -96,12 +102,14 @@
96 <event event="0x1608" option_set="RN-I_Region" title="CCN-504" name="RRT full" description="RRT full."/> 102 <event event="0x1608" option_set="RN-I_Region" title="CCN-504" name="RRT full" description="RRT full."/>
97 <event event="0x1609" option_set="RN-I_Region" title="CCN-504" name="WRT full" description="WRT full."/> 103 <event event="0x1609" option_set="RN-I_Region" title="CCN-504" name="WRT full" description="WRT full."/>
98 <event event="0x160A" option_set="RN-I_Region" title="CCN-504" name="Replayed TXREQ Flits" description="Replayed TXREQ Flits."/> 104 <event event="0x160A" option_set="RN-I_Region" title="CCN-504" name="Replayed TXREQ Flits" description="Replayed TXREQ Flits."/>
105
99 <option_set name="SBAS_Region"> 106 <option_set name="SBAS_Region">
100 <option event_delta="0x810000" name="SBAS 1" description="ACE master to CHI protocol bridge 1"/> 107 <option event_delta="0x810000" name="SBAS 1" description="ACE master to CHI protocol bridge 1"/>
101 <option event_delta="0x890000" name="SBAS 9" description="ACE master to CHI protocol bridge 9"/> 108 <option event_delta="0x890000" name="SBAS 9" description="ACE master to CHI protocol bridge 9"/>
102 <option event_delta="0x8B0000" name="SBAS 11" description="ACE master to CHI protocol bridge 11"/> 109 <option event_delta="0x8B0000" name="SBAS 11" description="ACE master to CHI protocol bridge 11"/>
103 <option event_delta="0x930000" name="SBAS 19" description="ACE master to CHI protocol bridge 19"/> 110 <option event_delta="0x930000" name="SBAS 19" description="ACE master to CHI protocol bridge 19"/>
104 </option_set> 111 </option_set>
112
105 <event event="0x1001" option_set="SBAS_Region" title="CCN-504" name="S0 RDataBeats" description="S0 RDataBeats."/> 113 <event event="0x1001" option_set="SBAS_Region" title="CCN-504" name="S0 RDataBeats" description="S0 RDataBeats."/>
106 <event event="0x1004" option_set="SBAS_Region" title="CCN-504" name="RXDAT Flits received" description="RXDAT Flits received."/> 114 <event event="0x1004" option_set="SBAS_Region" title="CCN-504" name="RXDAT Flits received" description="RXDAT Flits received."/>
107 <event event="0x1005" option_set="SBAS_Region" title="CCN-504" name="TXDAT Flits sent" description="TXDAT Flits sent."/> 115 <event event="0x1005" option_set="SBAS_Region" title="CCN-504" name="TXDAT Flits sent" description="TXDAT Flits sent."/>
@@ -110,4 +118,5 @@
110 <event event="0x1008" option_set="SBAS_Region" title="CCN-504" name="RRT full" description="RRT full."/> 118 <event event="0x1008" option_set="SBAS_Region" title="CCN-504" name="RRT full" description="RRT full."/>
111 <event event="0x1009" option_set="SBAS_Region" title="CCN-504" name="WRT full" description="WRT full."/> 119 <event event="0x1009" option_set="SBAS_Region" title="CCN-504" name="WRT full" description="WRT full."/>
112 <event event="0x100A" option_set="SBAS_Region" title="CCN-504" name="Replayed TXREQ Flits" description="Replayed TXREQ Flits."/> 120 <event event="0x100A" option_set="SBAS_Region" title="CCN-504" name="Replayed TXREQ Flits" description="Replayed TXREQ Flits."/>
121
113 </category> 122 </category>
diff --git a/daemon/events-Cortex-A53.xml b/daemon/events-Cortex-A53.xml
index 5ba1790..577dcd9 100644
--- a/daemon/events-Cortex-A53.xml
+++ b/daemon/events-Cortex-A53.xml
@@ -1,87 +1,171 @@
1 <counter_set name="ARM_Cortex-A53_cnt" count="6"/> 1 <counter_set name="ARM_Cortex-A53_cnt" count="6"/>
2 <category name="Cortex-A53" counter_set="ARM_Cortex-A53_cnt" per_cpu="yes" supports_event_based_sampling="yes"> 2 <category name="Cortex-A53" counter_set="ARM_Cortex-A53_cnt" per_cpu="yes" supports_event_based_sampling="yes">
3 <!-- 0x11 CPU_CYCLES - Cycle -->
3 <event counter="ARM_Cortex-A53_ccnt" event="0x11" title="Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" average_cores="yes" description="The number of core clock cycles"/> 4 <event counter="ARM_Cortex-A53_ccnt" event="0x11" title="Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" average_cores="yes" description="The number of core clock cycles"/>
5 <!-- 0x00 SW_INCR - Instruction architecturally executed (condition check pass) - Software increment -->
4 <event event="0x00" title="Software" name="Increment" description="Incremented only on writes to the Software Increment Register"/> 6 <event event="0x00" title="Software" name="Increment" description="Incremented only on writes to the Software Increment Register"/>
7 <!-- 0x01 L1I_CACHE_REFILL - Level 1 instruction cache refill -->
5 <event event="0x01" title="Cache" name="Instruction refill" description="Instruction fetch that causes a refill of at least the level of instruction or unified cache closest to the processor"/> 8 <event event="0x01" title="Cache" name="Instruction refill" description="Instruction fetch that causes a refill of at least the level of instruction or unified cache closest to the processor"/>
9 <!-- 0x02 L1I_TLB_REFILL - Level 1 instruction TLB refill -->
6 <event event="0x02" title="Cache" name="Inst TLB refill" description="Instruction fetch that causes a TLB refill of at least the level of TLB closest to the processor"/> 10 <event event="0x02" title="Cache" name="Inst TLB refill" description="Instruction fetch that causes a TLB refill of at least the level of TLB closest to the processor"/>
11 <!-- 0x03 L1D_CACHE_REFILL - Level 1 data cache refill -->
7 <event event="0x03" title="Cache" name="Data refill" description="Memory Read or Write operation that causes a refill of at least the level of data or unified cache closest to the processor"/> 12 <event event="0x03" title="Cache" name="Data refill" description="Memory Read or Write operation that causes a refill of at least the level of data or unified cache closest to the processor"/>
13 <!-- 0x04 L1D_CACHE - Level 1 data cache access -->
8 <event event="0x04" title="Cache" name="Data access" description="Memory Read or Write operation that causes a cache access to at least the level of data or unified cache closest to the processor"/> 14 <event event="0x04" title="Cache" name="Data access" description="Memory Read or Write operation that causes a cache access to at least the level of data or unified cache closest to the processor"/>
15 <!-- 0x05 L1D_TLB_REFILL - Level 1 data TLB refill -->
9 <event event="0x05" title="Cache" name="Data TLB refill" description="Memory Read or Write operation that causes a TLB refill of at least the level of TLB closest to the processor"/> 16 <event event="0x05" title="Cache" name="Data TLB refill" description="Memory Read or Write operation that causes a TLB refill of at least the level of TLB closest to the processor"/>
17 <!-- 0x08 INST_RETIRED - Instruction architecturally executed -->
10 <event event="0x08" title="Instruction" name="Executed" description="Instruction architecturally executed"/> 18 <event event="0x08" title="Instruction" name="Executed" description="Instruction architecturally executed"/>
19 <!-- 0x09 EXC_TAKEN - Exception taken -->
11 <event event="0x09" title="Exception" name="Taken" description="Exceptions taken"/> 20 <event event="0x09" title="Exception" name="Taken" description="Exceptions taken"/>
21 <!-- 0x0A EXC_RETURN - Instruction architecturally executed (condition check pass) - Exception return -->
12 <event event="0x0a" title="Exception" name="Return" description="Exception return architecturally executed"/> 22 <event event="0x0a" title="Exception" name="Return" description="Exception return architecturally executed"/>
23 <!-- 0x0B CID_WRITE_RETIRED - Instruction architecturally executed (condition check pass) - Write to CONTEXTIDR -->
13 <event event="0x0b" title="Instruction" name="CONTEXTIDR" description="Instruction that writes to the CONTEXTIDR architecturally executed"/> 24 <event event="0x0b" title="Instruction" name="CONTEXTIDR" description="Instruction that writes to the CONTEXTIDR architecturally executed"/>
25 <!-- 0x10 BR_MIS_PRED - Mispredicted or not predicted branch speculatively executed -->
14 <event event="0x10" title="Branch" name="Mispredicted" description="Branch mispredicted or not predicted"/> 26 <event event="0x10" title="Branch" name="Mispredicted" description="Branch mispredicted or not predicted"/>
27 <!-- 0x12 BR_PRED - Predictable branch speculatively executed -->
15 <event event="0x12" title="Branch" name="Potential prediction" description="Branch or other change in program flow that could have been predicted by the branch prediction resources of the processor"/> 28 <event event="0x12" title="Branch" name="Potential prediction" description="Branch or other change in program flow that could have been predicted by the branch prediction resources of the processor"/>
29 <!-- 0x13 MEM_ACCESS - Data memory access -->
16 <event event="0x13" title="Memory" name="Memory access" description="Data memory access"/> 30 <event event="0x13" title="Memory" name="Memory access" description="Data memory access"/>
31 <!-- 0x14 L1I_CACHE - Level 1 instruction cache access -->
17 <event event="0x14" title="Cache" name="L1 inst access" description="Level 1 instruction cache access"/> 32 <event event="0x14" title="Cache" name="L1 inst access" description="Level 1 instruction cache access"/>
33 <!-- 0x15 L1D_CACHE_WB - Level 1 data cache Write-Back -->
18 <event event="0x15" title="Cache" name="L1 data write" description="Level 1 data cache Write-Back"/> 34 <event event="0x15" title="Cache" name="L1 data write" description="Level 1 data cache Write-Back"/>
35 <!-- 0x16 L2D_CACHE - Level 2 data cache access -->
19 <event event="0x16" title="Cache" name="L2 data access" description="Level 2 data cache access"/> 36 <event event="0x16" title="Cache" name="L2 data access" description="Level 2 data cache access"/>
37 <!-- 0x17 L2D_CACHE_REFILL - Level 2 data cache refill -->
20 <event event="0x17" title="Cache" name="L2 data refill" description="Level 2 data cache refill"/> 38 <event event="0x17" title="Cache" name="L2 data refill" description="Level 2 data cache refill"/>
39 <!-- 0x18 L2D_CACHE_WB - Level 2 data cache Write-Back -->
21 <event event="0x18" title="Cache" name="L2 data write" description="Level 2 data cache Write-Back"/> 40 <event event="0x18" title="Cache" name="L2 data write" description="Level 2 data cache Write-Back"/>
41 <!-- 0x19 BUS_ACCESS - Bus access -->
22 <event event="0x19" title="Bus" name="Access" description="Bus access"/> 42 <event event="0x19" title="Bus" name="Access" description="Bus access"/>
43 <!-- 0x1A MEMORY_ERROR - Local memory error -->
23 <event event="0x1A" title="Memory" name="Error" description="Local memory error"/> 44 <event event="0x1A" title="Memory" name="Error" description="Local memory error"/>
45 <!-- 0x1B INST_SPEC - Operation speculatively executed -->
24 <event event="0x1B" title="Instruction" name="Speculative" description="Operation speculatively executed"/> 46 <event event="0x1B" title="Instruction" name="Speculative" description="Operation speculatively executed"/>
47 <!-- 0x1C TTBR_WRITE_RETIRED - Instruction architecturally executed (condition check pass) - Write to translation table base -->
25 <event event="0x1C" title="Memory" name="Translation table" description="Instruction architecturally executed (condition check pass) - Write to translation table base"/> 48 <event event="0x1C" title="Memory" name="Translation table" description="Instruction architecturally executed (condition check pass) - Write to translation table base"/>
49 <!-- 0x1D BUS_CYCLES - Bus cycle -->
26 <event event="0x1D" title="Bus" name="Cycle" description="Bus cycle"/> 50 <event event="0x1D" title="Bus" name="Cycle" description="Bus cycle"/>
51 <!-- 0x1E CHAIN - Odd performance counter chain mode -->
27 <event event="0x1E" title="Counter chain" name="Odd Performance" description="Odd performance counter chain mode"/> 52 <event event="0x1E" title="Counter chain" name="Odd Performance" description="Odd performance counter chain mode"/>
53 <!-- 0x40 L1D_CACHE_LD - Level 1 data cache access - Read -->
28 <event event="0x40" title="Cache" name="L1 data read" description="Level 1 data cache access - Read"/> 54 <event event="0x40" title="Cache" name="L1 data read" description="Level 1 data cache access - Read"/>
55 <!-- 0x41 L1D_CACHE_ST - Level 1 data cache access - Write -->
29 <event event="0x41" title="Cache" name="L1 data access write" description="Level 1 data cache access - Write"/> 56 <event event="0x41" title="Cache" name="L1 data access write" description="Level 1 data cache access - Write"/>
57 <!-- 0x42 L1D_CACHE_REFILL_LD - Level 1 data cache refill - Read -->
30 <event event="0x42" title="Cache" name="L1 data refill read" description="Level 1 data cache refill - Read"/> 58 <event event="0x42" title="Cache" name="L1 data refill read" description="Level 1 data cache refill - Read"/>
59 <!-- 0x43 L1D_CACHE_REFILL_ST - Level 1 data cache refill - Write -->
31 <event event="0x43" title="Cache" name="L1 data refill write" description="Level 1 data cache refill - Write"/> 60 <event event="0x43" title="Cache" name="L1 data refill write" description="Level 1 data cache refill - Write"/>
61 <!-- 0x46 L1D_CACHE_WB_VICTIM - Level 1 data cache Write-back - Victim -->
32 <event event="0x46" title="Cache" name="L1 data victim" description="Level 1 data cache Write-back - Victim"/> 62 <event event="0x46" title="Cache" name="L1 data victim" description="Level 1 data cache Write-back - Victim"/>
63 <!-- 0x47 L1D_CACHE_WB_CLEAN - Level 1 data cache Write-back - Cleaning and coherency -->
33 <event event="0x47" title="Cache" name="L1 data clean" description="Level 1 data cache Write-back - Cleaning and coherency"/> 64 <event event="0x47" title="Cache" name="L1 data clean" description="Level 1 data cache Write-back - Cleaning and coherency"/>
65 <!-- 0x48 L1D_CACHE_INVAL - Level 1 data cache invalidate -->
34 <event event="0x48" title="Cache" name="L1 data invalidate" description="Level 1 data cache invalidate"/> 66 <event event="0x48" title="Cache" name="L1 data invalidate" description="Level 1 data cache invalidate"/>
67 <!-- 0x4C L1D_TLB_REFILL_LD - Level 1 data TLB refill - Read -->
35 <event event="0x4C" title="Cache" name="L1 data refill read" description="Level 1 data TLB refill - Read"/> 68 <event event="0x4C" title="Cache" name="L1 data refill read" description="Level 1 data TLB refill - Read"/>
69 <!-- 0x4D L1D_TLB_REFILL_ST - Level 1 data TLB refill - Write -->
36 <event event="0x4D" title="Cache" name="L1 data refill write" description="Level 1 data TLB refill - Write"/> 70 <event event="0x4D" title="Cache" name="L1 data refill write" description="Level 1 data TLB refill - Write"/>
71 <!-- 0x50 L2D_CACHE_LD - Level 2 data cache access - Read -->
37 <event event="0x50" title="Cache" name="L2 data read" description="Level 2 data cache access - Read"/> 72 <event event="0x50" title="Cache" name="L2 data read" description="Level 2 data cache access - Read"/>
73 <!-- 0x51 L2D_CACHE_ST - Level 2 data cache access - Write -->
38 <event event="0x51" title="Cache" name="L2 data access write" description="Level 2 data cache access - Write"/> 74 <event event="0x51" title="Cache" name="L2 data access write" description="Level 2 data cache access - Write"/>
75 <!-- 0x52 L2D_CACHE_REFILL_LD - Level 2 data cache refill - Read -->
39 <event event="0x52" title="Cache" name="L2 data refill read" description="Level 2 data cache refill - Read"/> 76 <event event="0x52" title="Cache" name="L2 data refill read" description="Level 2 data cache refill - Read"/>
77 <!-- 0x53 L2D_CACHE_REFILL_ST - Level 2 data cache refill - Write -->
40 <event event="0x53" title="Cache" name="L2 data refill write" description="Level 2 data cache refill - Write"/> 78 <event event="0x53" title="Cache" name="L2 data refill write" description="Level 2 data cache refill - Write"/>
79 <!-- 0x56 L2D_CACHE_WB_VICTIM - Level 2 data cache Write-back - Victim -->
41 <event event="0x56" title="Cache" name="L2 data victim" description="Level 2 data cache Write-back - Victim"/> 80 <event event="0x56" title="Cache" name="L2 data victim" description="Level 2 data cache Write-back - Victim"/>
81 <!-- 0x57 L2D_CACHE_WB_CLEAN - Level 2 data cache Write-back - Cleaning and coherency -->
42 <event event="0x57" title="Cache" name="L2 data clean" description="Level 2 data cache Write-back - Cleaning and coherency"/> 82 <event event="0x57" title="Cache" name="L2 data clean" description="Level 2 data cache Write-back - Cleaning and coherency"/>
83 <!-- 0x58 L2D_CACHE_INVAL - Level 2 data cache invalidate -->
43 <event event="0x58" title="Cache" name="L2 data invalidate" description="Level 2 data cache invalidate"/> 84 <event event="0x58" title="Cache" name="L2 data invalidate" description="Level 2 data cache invalidate"/>
85 <!-- 0x60 BUS_ACCESS_LD - Bus access - Read -->
44 <event event="0x60" title="Bus" name="Read" description="Bus access - Read"/> 86 <event event="0x60" title="Bus" name="Read" description="Bus access - Read"/>
87 <!-- 0x61 BUS_ACCESS_ST - Bus access - Write -->
45 <event event="0x61" title="Bus" name="Write" description="Bus access - Write"/> 88 <event event="0x61" title="Bus" name="Write" description="Bus access - Write"/>
89 <!-- 0x62 BUS_ACCESS_SHARED - Bus access - Normal -->
46 <event event="0x62" title="Bus" name="Access shared" description="Bus access - Normal"/> 90 <event event="0x62" title="Bus" name="Access shared" description="Bus access - Normal"/>
91 <!-- 0x63 BUS_ACCESS_NOT_SHARED - Bus access - Not normal -->
47 <event event="0x63" title="Bus" name="Access not shared" description="Bus access - Not normal"/> 92 <event event="0x63" title="Bus" name="Access not shared" description="Bus access - Not normal"/>
93 <!-- 0x64 BUS_ACCESS_NORMAL - Bus access - Normal -->
48 <event event="0x64" title="Bus" name="Access normal" description="Bus access - Normal"/> 94 <event event="0x64" title="Bus" name="Access normal" description="Bus access - Normal"/>
95 <!-- 0x65 BUS_ACCESS_PERIPH - Bus access - Peripheral -->
49 <event event="0x65" title="Bus" name="Peripheral" description="Bus access - Peripheral"/> 96 <event event="0x65" title="Bus" name="Peripheral" description="Bus access - Peripheral"/>
97 <!-- 0x66 MEM_ACCESS_LD - Data memory access - Read -->
50 <event event="0x66" title="Memory" name="Read" description="Data memory access - Read"/> 98 <event event="0x66" title="Memory" name="Read" description="Data memory access - Read"/>
99 <!-- 0x67 MEM_ACCESS_ST - Data memory access - Write -->
51 <event event="0x67" title="Memory" name="Write" description="Data memory access - Write"/> 100 <event event="0x67" title="Memory" name="Write" description="Data memory access - Write"/>
101 <!-- 0x68 UNALIGNED_LD_SPEC - Unaligned access - Read -->
52 <event event="0x68" title="Memory" name="Unaligned Read" description="Unaligned access - Read"/> 102 <event event="0x68" title="Memory" name="Unaligned Read" description="Unaligned access - Read"/>
103 <!-- 0x69 UNALIGNED_ST_SPEC - Unaligned access - Write -->
53 <event event="0x69" title="Memory" name="Unaligned Write" description="Unaligned access - Write"/> 104 <event event="0x69" title="Memory" name="Unaligned Write" description="Unaligned access - Write"/>
105 <!-- 0x6A UNALIGNED_LDST_SPEC - Unaligned access -->
54 <event event="0x6A" title="Memory" name="Unaligned" description="Unaligned access"/> 106 <event event="0x6A" title="Memory" name="Unaligned" description="Unaligned access"/>
107 <!-- 0x6C LDREX_SPEC - Exclusive operation speculatively executed - LDREX -->
55 <event event="0x6C" title="Intrinsic" name="LDREX" description="Exclusive operation speculatively executed - LDREX"/> 108 <event event="0x6C" title="Intrinsic" name="LDREX" description="Exclusive operation speculatively executed - LDREX"/>
109 <!-- 0x6D STREX_PASS_SPEC - Exclusive instruction speculatively executed - STREX pass -->
56 <event event="0x6D" title="Intrinsic" name="STREX pass" description="Exclusive instruction speculatively executed - STREX pass"/> 110 <event event="0x6D" title="Intrinsic" name="STREX pass" description="Exclusive instruction speculatively executed - STREX pass"/>
111 <!-- 0x6E STREX_FAIL_SPEC - Exclusive operation speculatively executed - STREX fail -->
57 <event event="0x6E" title="Intrinsic" name="STREX fail" description="Exclusive operation speculatively executed - STREX fail"/> 112 <event event="0x6E" title="Intrinsic" name="STREX fail" description="Exclusive operation speculatively executed - STREX fail"/>
113 <!-- 0x70 LD_SPEC - Operation speculatively executed - Load -->
58 <event event="0x70" title="Instruction" name="Load" description="Operation speculatively executed - Load"/> 114 <event event="0x70" title="Instruction" name="Load" description="Operation speculatively executed - Load"/>
115 <!-- 0x71 ST_SPEC - Operation speculatively executed - Store -->
59 <event event="0x71" title="Instruction" name="Store" description="Operation speculatively executed - Store"/> 116 <event event="0x71" title="Instruction" name="Store" description="Operation speculatively executed - Store"/>
117 <!-- 0x72 LDST_SPEC - Operation speculatively executed - Load or store -->
60 <event event="0x72" title="Instruction" name="Load/Store" description="Operation speculatively executed - Load or store"/> 118 <event event="0x72" title="Instruction" name="Load/Store" description="Operation speculatively executed - Load or store"/>
119 <!-- 0x73 DP_SPEC - Operation speculatively executed - Integer data processing -->
61 <event event="0x73" title="Instruction" name="Integer" description="Operation speculatively executed - Integer data processing"/> 120 <event event="0x73" title="Instruction" name="Integer" description="Operation speculatively executed - Integer data processing"/>
121 <!-- 0x74 ASE_SPEC - Operation speculatively executed - Advanced SIMD -->
62 <event event="0x74" title="Instruction" name="Advanced SIMD" description="Operation speculatively executed - Advanced SIMD"/> 122 <event event="0x74" title="Instruction" name="Advanced SIMD" description="Operation speculatively executed - Advanced SIMD"/>
123 <!-- 0x75 VFP_SPEC - Operation speculatively executed - VFP -->
63 <event event="0x75" title="Instruction" name="VFP" description="Operation speculatively executed - VFP"/> 124 <event event="0x75" title="Instruction" name="VFP" description="Operation speculatively executed - VFP"/>
125 <!-- 0x76 PC_WRITE_SPEC - Operation speculatively executed - Software change of the PC -->
64 <event event="0x76" title="Instruction" name="Software change" description="Operation speculatively executed - Software change of the PC"/> 126 <event event="0x76" title="Instruction" name="Software change" description="Operation speculatively executed - Software change of the PC"/>
127 <!-- 0x77 CRYPTO_SPEC - Operation speculatively executed, crypto data processing -->
65 <event event="0x77" title="Instruction" name="Crypto" description="Operation speculatively executed, crypto data processing"/> 128 <event event="0x77" title="Instruction" name="Crypto" description="Operation speculatively executed, crypto data processing"/>
129 <!-- 0x78 BR_IMMED_SPEC - Branch speculatively executed - Immediate branch -->
66 <event event="0x78" title="Instruction" name="Immediate branch" description="Branch speculatively executed - Immediate branch"/> 130 <event event="0x78" title="Instruction" name="Immediate branch" description="Branch speculatively executed - Immediate branch"/>
131 <!-- 0x79 BR_RETURN_SPEC - Branch speculatively executed - Procedure return -->
67 <event event="0x79" title="Instruction" name="Procedure return" description="Branch speculatively executed - Procedure return"/> 132 <event event="0x79" title="Instruction" name="Procedure return" description="Branch speculatively executed - Procedure return"/>
133 <!-- 0x7A BR_INDIRECT_SPEC - Branch speculatively executed - Indirect branch -->
68 <event event="0x7A" title="Instruction" name="Indirect branch" description="Branch speculatively executed - Indirect branch"/> 134 <event event="0x7A" title="Instruction" name="Indirect branch" description="Branch speculatively executed - Indirect branch"/>
135 <!-- 0x7C ISB_SPEC - Barrier speculatively executed - ISB -->
69 <event event="0x7C" title="Instruction" name="ISB" description="Barrier speculatively executed - ISB"/> 136 <event event="0x7C" title="Instruction" name="ISB" description="Barrier speculatively executed - ISB"/>
137 <!-- 0x7D DSB_SPEC - Barrier speculatively executed - DSB -->
70 <event event="0x7D" title="Instruction" name="DSB" description="Barrier speculatively executed - DSB"/> 138 <event event="0x7D" title="Instruction" name="DSB" description="Barrier speculatively executed - DSB"/>
139 <!-- 0x7E DMB_SPEC - Barrier speculatively executed - DMB -->
71 <event event="0x7E" title="Instruction" name="DMB" description="Barrier speculatively executed - DMB"/> 140 <event event="0x7E" title="Instruction" name="DMB" description="Barrier speculatively executed - DMB"/>
141 <!-- 0x81 EXC_UNDEF - Exception taken, other synchronous -->
72 <event event="0x81" title="Exception" name="Undefined" description="Exception taken, other synchronous"/> 142 <event event="0x81" title="Exception" name="Undefined" description="Exception taken, other synchronous"/>
143 <!-- 0x82 EXC_SVC - Exception taken, Supervisor Call -->
73 <event event="0x82" title="Exception" name="Supervisor" description="Exception taken, Supervisor Call"/> 144 <event event="0x82" title="Exception" name="Supervisor" description="Exception taken, Supervisor Call"/>
145 <!-- 0x83 EXC_PABORT - Exception taken, Instruction Abort -->
74 <event event="0x83" title="Exception" name="Instruction abort" description="Exception taken, Instruction Abort"/> 146 <event event="0x83" title="Exception" name="Instruction abort" description="Exception taken, Instruction Abort"/>
147 <!-- 0x84 EXC_DABORT - Exception taken, Data Abort or SError -->
75 <event event="0x84" title="Exception" name="Data abort" description="Exception taken, Data Abort or SError"/> 148 <event event="0x84" title="Exception" name="Data abort" description="Exception taken, Data Abort or SError"/>
149 <!-- 0x86 EXC_IRQ - Exception taken, IRQ -->
76 <event event="0x86" title="Interrupts" name="IRQ" description="Exception taken, IRQ"/> 150 <event event="0x86" title="Interrupts" name="IRQ" description="Exception taken, IRQ"/>
151 <!-- 0x87 EXC_FIQ - Exception taken, FIQ -->
77 <event event="0x87" title="Interrupts" name="FIQ" description="Exception taken, FIQ"/> 152 <event event="0x87" title="Interrupts" name="FIQ" description="Exception taken, FIQ"/>
153 <!-- 0x88 EXC_SMC - Exception taken, Secure Monitor Call -->
78 <event event="0x88" title="Exception" name="Secure monitor call" description="Exception taken, Secure Monitor Call"/> 154 <event event="0x88" title="Exception" name="Secure monitor call" description="Exception taken, Secure Monitor Call"/>
155 <!-- 0x8A EXC_HVC - Exception taken, Hypervisor Call -->
79 <event event="0x8A" title="Exception" name="Hypervisor call" description="Exception taken, Hypervisor Call"/> 156 <event event="0x8A" title="Exception" name="Hypervisor call" description="Exception taken, Hypervisor Call"/>
157 <!-- 0x8B EXC_TRAP_PABORT - Exception taken, Instruction Abort not taken locally -->
80 <event event="0x8B" title="Exception" name="Instruction abort non-local" description="Exception taken, Instruction Abort not taken locally"/> 158 <event event="0x8B" title="Exception" name="Instruction abort non-local" description="Exception taken, Instruction Abort not taken locally"/>
159 <!-- 0x8C EXC_TRAP_DABORT - Exception taken, Data Abort or SError not taken locally -->
81 <event event="0x8C" title="Exception" name="Data abort non-local" description="Exception taken, Data Abort or SError not taken locally"/> 160 <event event="0x8C" title="Exception" name="Data abort non-local" description="Exception taken, Data Abort or SError not taken locally"/>
161 <!-- 0x8D EXC_TRAP_OTHER - Exception taken - Other traps not taken locally -->
82 <event event="0x8D" title="Exception" name="Other non-local" description="Exception taken - Other traps not taken locally"/> 162 <event event="0x8D" title="Exception" name="Other non-local" description="Exception taken - Other traps not taken locally"/>
163 <!-- 0x8E EXC_TRAP_IRQ - Exception taken, IRQ not taken locally -->
83 <event event="0x8E" title="Exception" name="IRQ non-local" description="Exception taken, IRQ not taken locally"/> 164 <event event="0x8E" title="Exception" name="IRQ non-local" description="Exception taken, IRQ not taken locally"/>
165 <!-- 0x8F EXC_TRAP_FIQ - Exception taken, FIQ not taken locally -->
84 <event event="0x8F" title="Exception" name="FIQ non-local" description="Exception taken, FIQ not taken locally"/> 166 <event event="0x8F" title="Exception" name="FIQ non-local" description="Exception taken, FIQ not taken locally"/>
167 <!-- 0x90 RC_LD_SPEC - Release consistency instruction speculatively executed - Load Acquire -->
85 <event event="0x90" title="Release Consistency" name="Load" description="Release consistency instruction speculatively executed - Load Acquire"/> 168 <event event="0x90" title="Release Consistency" name="Load" description="Release consistency instruction speculatively executed - Load Acquire"/>
169 <!-- 0x91 RC_ST_SPEC - Release consistency instruction speculatively executed - Store Release -->
86 <event event="0x91" title="Release Consistency" name="Store" description="Release consistency instruction speculatively executed - Store Release"/> 170 <event event="0x91" title="Release Consistency" name="Store" description="Release consistency instruction speculatively executed - Store Release"/>
87 </category> 171 </category>
diff --git a/daemon/events-Cortex-A57.xml b/daemon/events-Cortex-A57.xml
index fbe96c2..b7178c0 100644
--- a/daemon/events-Cortex-A57.xml
+++ b/daemon/events-Cortex-A57.xml
@@ -1,87 +1,171 @@
1 <counter_set name="ARM_Cortex-A57_cnt" count="6"/> 1 <counter_set name="ARM_Cortex-A57_cnt" count="6"/>
2 <category name="Cortex-A57" counter_set="ARM_Cortex-A57_cnt" per_cpu="yes" supports_event_based_sampling="yes"> 2 <category name="Cortex-A57" counter_set="ARM_Cortex-A57_cnt" per_cpu="yes" supports_event_based_sampling="yes">
3 <!-- 0x11 CPU_CYCLES - Cycle -->
3 <event counter="ARM_Cortex-A57_ccnt" event="0x11" title="Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" average_cores="yes" description="The number of core clock cycles"/> 4 <event counter="ARM_Cortex-A57_ccnt" event="0x11" title="Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" average_cores="yes" description="The number of core clock cycles"/>
5 <!-- 0x00 SW_INCR - Instruction architecturally executed (condition check pass) - Software increment -->
4 <event event="0x00" title="Software" name="Increment" description="Incremented only on writes to the Software Increment Register"/> 6 <event event="0x00" title="Software" name="Increment" description="Incremented only on writes to the Software Increment Register"/>
7 <!-- 0x01 L1I_CACHE_REFILL - Level 1 instruction cache refill -->
5 <event event="0x01" title="Cache" name="Instruction refill" description="Instruction fetch that causes a refill of at least the level of instruction or unified cache closest to the processor"/> 8 <event event="0x01" title="Cache" name="Instruction refill" description="Instruction fetch that causes a refill of at least the level of instruction or unified cache closest to the processor"/>
9 <!-- 0x02 L1I_TLB_REFILL - Level 1 instruction TLB refill -->
6 <event event="0x02" title="Cache" name="Inst TLB refill" description="Instruction fetch that causes a TLB refill of at least the level of TLB closest to the processor"/> 10 <event event="0x02" title="Cache" name="Inst TLB refill" description="Instruction fetch that causes a TLB refill of at least the level of TLB closest to the processor"/>
11 <!-- 0x03 L1D_CACHE_REFILL - Level 1 data cache refill -->
7 <event event="0x03" title="Cache" name="Data refill" description="Memory Read or Write operation that causes a refill of at least the level of data or unified cache closest to the processor"/> 12 <event event="0x03" title="Cache" name="Data refill" description="Memory Read or Write operation that causes a refill of at least the level of data or unified cache closest to the processor"/>
13 <!-- 0x04 L1D_CACHE - Level 1 data cache access -->
8 <event event="0x04" title="Cache" name="Data access" description="Memory Read or Write operation that causes a cache access to at least the level of data or unified cache closest to the processor"/> 14 <event event="0x04" title="Cache" name="Data access" description="Memory Read or Write operation that causes a cache access to at least the level of data or unified cache closest to the processor"/>
15 <!-- 0x05 L1D_TLB_REFILL - Level 1 data TLB refill -->
9 <event event="0x05" title="Cache" name="Data TLB refill" description="Memory Read or Write operation that causes a TLB refill of at least the level of TLB closest to the processor"/> 16 <event event="0x05" title="Cache" name="Data TLB refill" description="Memory Read or Write operation that causes a TLB refill of at least the level of TLB closest to the processor"/>
17 <!-- 0x08 INST_RETIRED - Instruction architecturally executed -->
10 <event event="0x08" title="Instruction" name="Executed" description="Instruction architecturally executed"/> 18 <event event="0x08" title="Instruction" name="Executed" description="Instruction architecturally executed"/>
19 <!-- 0x09 EXC_TAKEN - Exception taken -->
11 <event event="0x09" title="Exception" name="Taken" description="Exceptions taken"/> 20 <event event="0x09" title="Exception" name="Taken" description="Exceptions taken"/>
21 <!-- 0x0A EXC_RETURN - Instruction architecturally executed (condition check pass) - Exception return -->
12 <event event="0x0a" title="Exception" name="Return" description="Exception return architecturally executed"/> 22 <event event="0x0a" title="Exception" name="Return" description="Exception return architecturally executed"/>
23 <!-- 0x0B CID_WRITE_RETIRED - Instruction architecturally executed (condition check pass) - Write to CONTEXTIDR -->
13 <event event="0x0b" title="Instruction" name="CONTEXTIDR" description="Instruction that writes to the CONTEXTIDR architecturally executed"/> 24 <event event="0x0b" title="Instruction" name="CONTEXTIDR" description="Instruction that writes to the CONTEXTIDR architecturally executed"/>
25 <!-- 0x10 BR_MIS_PRED - Mispredicted or not predicted branch speculatively executed -->
14 <event event="0x10" title="Branch" name="Mispredicted" description="Branch mispredicted or not predicted"/> 26 <event event="0x10" title="Branch" name="Mispredicted" description="Branch mispredicted or not predicted"/>
27 <!-- 0x12 BR_PRED - Predictable branch speculatively executed -->
15 <event event="0x12" title="Branch" name="Potential prediction" description="Branch or other change in program flow that could have been predicted by the branch prediction resources of the processor"/> 28 <event event="0x12" title="Branch" name="Potential prediction" description="Branch or other change in program flow that could have been predicted by the branch prediction resources of the processor"/>
29 <!-- 0x13 MEM_ACCESS - Data memory access -->
16 <event event="0x13" title="Memory" name="Memory access" description="Data memory access"/> 30 <event event="0x13" title="Memory" name="Memory access" description="Data memory access"/>
31 <!-- 0x14 L1I_CACHE - Level 1 instruction cache access -->
17 <event event="0x14" title="Cache" name="L1 inst access" description="Level 1 instruction cache access"/> 32 <event event="0x14" title="Cache" name="L1 inst access" description="Level 1 instruction cache access"/>
33 <!-- 0x15 L1D_CACHE_WB - Level 1 data cache Write-Back -->
18 <event event="0x15" title="Cache" name="L1 data write" description="Level 1 data cache Write-Back"/> 34 <event event="0x15" title="Cache" name="L1 data write" description="Level 1 data cache Write-Back"/>
35 <!-- 0x16 L2D_CACHE - Level 2 data cache access -->
19 <event event="0x16" title="Cache" name="L2 data access" description="Level 2 data cache access"/> 36 <event event="0x16" title="Cache" name="L2 data access" description="Level 2 data cache access"/>
37 <!-- 0x17 L2D_CACHE_REFILL - Level 2 data cache refill -->
20 <event event="0x17" title="Cache" name="L2 data refill" description="Level 2 data cache refill"/> 38 <event event="0x17" title="Cache" name="L2 data refill" description="Level 2 data cache refill"/>
39 <!-- 0x18 L2D_CACHE_WB - Level 2 data cache Write-Back -->
21 <event event="0x18" title="Cache" name="L2 data write" description="Level 2 data cache Write-Back"/> 40 <event event="0x18" title="Cache" name="L2 data write" description="Level 2 data cache Write-Back"/>
41 <!-- 0x19 BUS_ACCESS - Bus access -->
22 <event event="0x19" title="Bus" name="Access" description="Bus access"/> 42 <event event="0x19" title="Bus" name="Access" description="Bus access"/>
43 <!-- 0x1A MEMORY_ERROR - Local memory error -->
23 <event event="0x1A" title="Memory" name="Error" description="Local memory error"/> 44 <event event="0x1A" title="Memory" name="Error" description="Local memory error"/>
45 <!-- 0x1B INST_SPEC - Operation speculatively executed -->
24 <event event="0x1B" title="Instruction" name="Speculative" description="Operation speculatively executed"/> 46 <event event="0x1B" title="Instruction" name="Speculative" description="Operation speculatively executed"/>
47 <!-- 0x1C TTBR_WRITE_RETIRED - Instruction architecturally executed (condition check pass) - Write to translation table base -->
25 <event event="0x1C" title="Memory" name="Translation table" description="Instruction architecturally executed (condition check pass) - Write to translation table base"/> 48 <event event="0x1C" title="Memory" name="Translation table" description="Instruction architecturally executed (condition check pass) - Write to translation table base"/>
49 <!-- 0x1D BUS_CYCLES - Bus cycle -->
26 <event event="0x1D" title="Bus" name="Cycle" description="Bus cycle"/> 50 <event event="0x1D" title="Bus" name="Cycle" description="Bus cycle"/>
51 <!-- 0x1E CHAIN - Odd performance counter chain mode -->
27 <event event="0x1E" title="Counter chain" name="Odd Performance" description="Odd performance counter chain mode"/> 52 <event event="0x1E" title="Counter chain" name="Odd Performance" description="Odd performance counter chain mode"/>
53 <!-- 0x40 L1D_CACHE_LD - Level 1 data cache access - Read -->
28 <event event="0x40" title="Cache" name="L1 data read" description="Level 1 data cache access - Read"/> 54 <event event="0x40" title="Cache" name="L1 data read" description="Level 1 data cache access - Read"/>
55 <!-- 0x41 L1D_CACHE_ST - Level 1 data cache access - Write -->
29 <event event="0x41" title="Cache" name="L1 data access write" description="Level 1 data cache access - Write"/> 56 <event event="0x41" title="Cache" name="L1 data access write" description="Level 1 data cache access - Write"/>
57 <!-- 0x42 L1D_CACHE_REFILL_LD - Level 1 data cache refill - Read -->
30 <event event="0x42" title="Cache" name="L1 data refill read" description="Level 1 data cache refill - Read"/> 58 <event event="0x42" title="Cache" name="L1 data refill read" description="Level 1 data cache refill - Read"/>
59 <!-- 0x43 L1D_CACHE_REFILL_ST - Level 1 data cache refill - Write -->
31 <event event="0x43" title="Cache" name="L1 data refill write" description="Level 1 data cache refill - Write"/> 60 <event event="0x43" title="Cache" name="L1 data refill write" description="Level 1 data cache refill - Write"/>
61 <!-- 0x46 L1D_CACHE_WB_VICTIM - Level 1 data cache Write-back - Victim -->
32 <event event="0x46" title="Cache" name="L1 data victim" description="Level 1 data cache Write-back - Victim"/> 62 <event event="0x46" title="Cache" name="L1 data victim" description="Level 1 data cache Write-back - Victim"/>
63 <!-- 0x47 L1D_CACHE_WB_CLEAN - Level 1 data cache Write-back - Cleaning and coherency -->
33 <event event="0x47" title="Cache" name="L1 data clean" description="Level 1 data cache Write-back - Cleaning and coherency"/> 64 <event event="0x47" title="Cache" name="L1 data clean" description="Level 1 data cache Write-back - Cleaning and coherency"/>
65 <!-- 0x48 L1D_CACHE_INVAL - Level 1 data cache invalidate -->
34 <event event="0x48" title="Cache" name="L1 data invalidate" description="Level 1 data cache invalidate"/> 66 <event event="0x48" title="Cache" name="L1 data invalidate" description="Level 1 data cache invalidate"/>
67 <!-- 0x4C L1D_TLB_REFILL_LD - Level 1 data TLB refill - Read -->
35 <event event="0x4C" title="Cache" name="L1 data refill read" description="Level 1 data TLB refill - Read"/> 68 <event event="0x4C" title="Cache" name="L1 data refill read" description="Level 1 data TLB refill - Read"/>
69 <!-- 0x4D L1D_TLB_REFILL_ST - Level 1 data TLB refill - Write -->
36 <event event="0x4D" title="Cache" name="L1 data refill write" description="Level 1 data TLB refill - Write"/> 70 <event event="0x4D" title="Cache" name="L1 data refill write" description="Level 1 data TLB refill - Write"/>
71 <!-- 0x50 L2D_CACHE_LD - Level 2 data cache access - Read -->
37 <event event="0x50" title="Cache" name="L2 data read" description="Level 2 data cache access - Read"/> 72 <event event="0x50" title="Cache" name="L2 data read" description="Level 2 data cache access - Read"/>
73 <!-- 0x51 L2D_CACHE_ST - Level 2 data cache access - Write -->
38 <event event="0x51" title="Cache" name="L2 data access write" description="Level 2 data cache access - Write"/> 74 <event event="0x51" title="Cache" name="L2 data access write" description="Level 2 data cache access - Write"/>
75 <!-- 0x52 L2D_CACHE_REFILL_LD - Level 2 data cache refill - Read -->
39 <event event="0x52" title="Cache" name="L2 data refill read" description="Level 2 data cache refill - Read"/> 76 <event event="0x52" title="Cache" name="L2 data refill read" description="Level 2 data cache refill - Read"/>
77 <!-- 0x53 L2D_CACHE_REFILL_ST - Level 2 data cache refill - Write -->
40 <event event="0x53" title="Cache" name="L2 data refill write" description="Level 2 data cache refill - Write"/> 78 <event event="0x53" title="Cache" name="L2 data refill write" description="Level 2 data cache refill - Write"/>
79 <!-- 0x56 L2D_CACHE_WB_VICTIM - Level 2 data cache Write-back - Victim -->
41 <event event="0x56" title="Cache" name="L2 data victim" description="Level 2 data cache Write-back - Victim"/> 80 <event event="0x56" title="Cache" name="L2 data victim" description="Level 2 data cache Write-back - Victim"/>
81 <!-- 0x57 L2D_CACHE_WB_CLEAN - Level 2 data cache Write-back - Cleaning and coherency -->
42 <event event="0x57" title="Cache" name="L2 data clean" description="Level 2 data cache Write-back - Cleaning and coherency"/> 82 <event event="0x57" title="Cache" name="L2 data clean" description="Level 2 data cache Write-back - Cleaning and coherency"/>
83 <!-- 0x58 L2D_CACHE_INVAL - Level 2 data cache invalidate -->
43 <event event="0x58" title="Cache" name="L2 data invalidate" description="Level 2 data cache invalidate"/> 84 <event event="0x58" title="Cache" name="L2 data invalidate" description="Level 2 data cache invalidate"/>
85 <!-- 0x60 BUS_ACCESS_LD - Bus access - Read -->
44 <event event="0x60" title="Bus" name="Read" description="Bus access - Read"/> 86 <event event="0x60" title="Bus" name="Read" description="Bus access - Read"/>
87 <!-- 0x61 BUS_ACCESS_ST - Bus access - Write -->
45 <event event="0x61" title="Bus" name="Write" description="Bus access - Write"/> 88 <event event="0x61" title="Bus" name="Write" description="Bus access - Write"/>
89 <!-- 0x62 BUS_ACCESS_SHARED - Bus access - Normal -->
46 <event event="0x62" title="Bus" name="Access shared" description="Bus access - Normal"/> 90 <event event="0x62" title="Bus" name="Access shared" description="Bus access - Normal"/>
91 <!-- 0x63 BUS_ACCESS_NOT_SHARED - Bus access - Not normal -->
47 <event event="0x63" title="Bus" name="Access not shared" description="Bus access - Not normal"/> 92 <event event="0x63" title="Bus" name="Access not shared" description="Bus access - Not normal"/>
93 <!-- 0x64 BUS_ACCESS_NORMAL - Bus access - Normal -->
48 <event event="0x64" title="Bus" name="Access normal" description="Bus access - Normal"/> 94 <event event="0x64" title="Bus" name="Access normal" description="Bus access - Normal"/>
95 <!-- 0x65 BUS_ACCESS_PERIPH - Bus access - Peripheral -->
49 <event event="0x65" title="Bus" name="Peripheral" description="Bus access - Peripheral"/> 96 <event event="0x65" title="Bus" name="Peripheral" description="Bus access - Peripheral"/>
97 <!-- 0x66 MEM_ACCESS_LD - Data memory access - Read -->
50 <event event="0x66" title="Memory" name="Read" description="Data memory access - Read"/> 98 <event event="0x66" title="Memory" name="Read" description="Data memory access - Read"/>
99 <!-- 0x67 MEM_ACCESS_ST - Data memory access - Write -->
51 <event event="0x67" title="Memory" name="Write" description="Data memory access - Write"/> 100 <event event="0x67" title="Memory" name="Write" description="Data memory access - Write"/>
101 <!-- 0x68 UNALIGNED_LD_SPEC - Unaligned access - Read -->
52 <event event="0x68" title="Memory" name="Unaligned Read" description="Unaligned access - Read"/> 102 <event event="0x68" title="Memory" name="Unaligned Read" description="Unaligned access - Read"/>
103 <!-- 0x69 UNALIGNED_ST_SPEC - Unaligned access - Write -->
53 <event event="0x69" title="Memory" name="Unaligned Write" description="Unaligned access - Write"/> 104 <event event="0x69" title="Memory" name="Unaligned Write" description="Unaligned access - Write"/>
105 <!-- 0x6A UNALIGNED_LDST_SPEC - Unaligned access -->
54 <event event="0x6A" title="Memory" name="Unaligned" description="Unaligned access"/> 106 <event event="0x6A" title="Memory" name="Unaligned" description="Unaligned access"/>
107 <!-- 0x6C LDREX_SPEC - Exclusive operation speculatively executed - LDREX -->
55 <event event="0x6C" title="Intrinsic" name="LDREX" description="Exclusive operation speculatively executed - LDREX"/> 108 <event event="0x6C" title="Intrinsic" name="LDREX" description="Exclusive operation speculatively executed - LDREX"/>
109 <!-- 0x6D STREX_PASS_SPEC - Exclusive instruction speculatively executed - STREX pass -->
56 <event event="0x6D" title="Intrinsic" name="STREX pass" description="Exclusive instruction speculatively executed - STREX pass"/> 110 <event event="0x6D" title="Intrinsic" name="STREX pass" description="Exclusive instruction speculatively executed - STREX pass"/>
111 <!-- 0x6E STREX_FAIL_SPEC - Exclusive operation speculatively executed - STREX fail -->
57 <event event="0x6E" title="Intrinsic" name="STREX fail" description="Exclusive operation speculatively executed - STREX fail"/> 112 <event event="0x6E" title="Intrinsic" name="STREX fail" description="Exclusive operation speculatively executed - STREX fail"/>
113 <!-- 0x70 LD_SPEC - Operation speculatively executed - Load -->
58 <event event="0x70" title="Instruction" name="Load" description="Operation speculatively executed - Load"/> 114 <event event="0x70" title="Instruction" name="Load" description="Operation speculatively executed - Load"/>
115 <!-- 0x71 ST_SPEC - Operation speculatively executed - Store -->
59 <event event="0x71" title="Instruction" name="Store" description="Operation speculatively executed - Store"/> 116 <event event="0x71" title="Instruction" name="Store" description="Operation speculatively executed - Store"/>
117 <!-- 0x72 LDST_SPEC - Operation speculatively executed - Load or store -->
60 <event event="0x72" title="Instruction" name="Load/Store" description="Operation speculatively executed - Load or store"/> 118 <event event="0x72" title="Instruction" name="Load/Store" description="Operation speculatively executed - Load or store"/>
119 <!-- 0x73 DP_SPEC - Operation speculatively executed - Integer data processing -->
61 <event event="0x73" title="Instruction" name="Integer" description="Operation speculatively executed - Integer data processing"/> 120 <event event="0x73" title="Instruction" name="Integer" description="Operation speculatively executed - Integer data processing"/>
121 <!-- 0x74 ASE_SPEC - Operation speculatively executed - Advanced SIMD -->
62 <event event="0x74" title="Instruction" name="Advanced SIMD" description="Operation speculatively executed - Advanced SIMD"/> 122 <event event="0x74" title="Instruction" name="Advanced SIMD" description="Operation speculatively executed - Advanced SIMD"/>
123 <!-- 0x75 VFP_SPEC - Operation speculatively executed - VFP -->
63 <event event="0x75" title="Instruction" name="VFP" description="Operation speculatively executed - VFP"/> 124 <event event="0x75" title="Instruction" name="VFP" description="Operation speculatively executed - VFP"/>
125 <!-- 0x76 PC_WRITE_SPEC - Operation speculatively executed - Software change of the PC -->
64 <event event="0x76" title="Instruction" name="Software change" description="Operation speculatively executed - Software change of the PC"/> 126 <event event="0x76" title="Instruction" name="Software change" description="Operation speculatively executed - Software change of the PC"/>
127 <!-- 0x77 CRYPTO_SPEC - Operation speculatively executed, crypto data processing -->
65 <event event="0x77" title="Instruction" name="Crypto" description="Operation speculatively executed, crypto data processing"/> 128 <event event="0x77" title="Instruction" name="Crypto" description="Operation speculatively executed, crypto data processing"/>
129 <!-- 0x78 BR_IMMED_SPEC - Branch speculatively executed - Immediate branch -->
66 <event event="0x78" title="Instruction" name="Immediate branch" description="Branch speculatively executed - Immediate branch"/> 130 <event event="0x78" title="Instruction" name="Immediate branch" description="Branch speculatively executed - Immediate branch"/>
131 <!-- 0x79 BR_RETURN_SPEC - Branch speculatively executed - Procedure return -->
67 <event event="0x79" title="Instruction" name="Procedure return" description="Branch speculatively executed - Procedure return"/> 132 <event event="0x79" title="Instruction" name="Procedure return" description="Branch speculatively executed - Procedure return"/>
133 <!-- 0x7A BR_INDIRECT_SPEC - Branch speculatively executed - Indirect branch -->
68 <event event="0x7A" title="Instruction" name="Indirect branch" description="Branch speculatively executed - Indirect branch"/> 134 <event event="0x7A" title="Instruction" name="Indirect branch" description="Branch speculatively executed - Indirect branch"/>
135 <!-- 0x7C ISB_SPEC - Barrier speculatively executed - ISB -->
69 <event event="0x7C" title="Instruction" name="ISB" description="Barrier speculatively executed - ISB"/> 136 <event event="0x7C" title="Instruction" name="ISB" description="Barrier speculatively executed - ISB"/>
137 <!-- 0x7D DSB_SPEC - Barrier speculatively executed - DSB -->
70 <event event="0x7D" title="Instruction" name="DSB" description="Barrier speculatively executed - DSB"/> 138 <event event="0x7D" title="Instruction" name="DSB" description="Barrier speculatively executed - DSB"/>
139 <!-- 0x7E DMB_SPEC - Barrier speculatively executed - DMB -->
71 <event event="0x7E" title="Instruction" name="DMB" description="Barrier speculatively executed - DMB"/> 140 <event event="0x7E" title="Instruction" name="DMB" description="Barrier speculatively executed - DMB"/>
141 <!-- 0x81 EXC_UNDEF - Exception taken, other synchronous -->
72 <event event="0x81" title="Exception" name="Undefined" description="Exception taken, other synchronous"/> 142 <event event="0x81" title="Exception" name="Undefined" description="Exception taken, other synchronous"/>
143 <!-- 0x82 EXC_SVC - Exception taken, Supervisor Call -->
73 <event event="0x82" title="Exception" name="Supervisor" description="Exception taken, Supervisor Call"/> 144 <event event="0x82" title="Exception" name="Supervisor" description="Exception taken, Supervisor Call"/>
145 <!-- 0x83 EXC_PABORT - Exception taken, Instruction Abort -->
74 <event event="0x83" title="Exception" name="Instruction abort" description="Exception taken, Instruction Abort"/> 146 <event event="0x83" title="Exception" name="Instruction abort" description="Exception taken, Instruction Abort"/>
147 <!-- 0x84 EXC_DABORT - Exception taken, Data Abort or SError -->
75 <event event="0x84" title="Exception" name="Data abort" description="Exception taken, Data Abort or SError"/> 148 <event event="0x84" title="Exception" name="Data abort" description="Exception taken, Data Abort or SError"/>
149 <!-- 0x86 EXC_IRQ - Exception taken, IRQ -->
76 <event event="0x86" title="Interrupts" name="IRQ" description="Exception taken, IRQ"/> 150 <event event="0x86" title="Interrupts" name="IRQ" description="Exception taken, IRQ"/>
151 <!-- 0x87 EXC_FIQ - Exception taken, FIQ -->
77 <event event="0x87" title="Interrupts" name="FIQ" description="Exception taken, FIQ"/> 152 <event event="0x87" title="Interrupts" name="FIQ" description="Exception taken, FIQ"/>
153 <!-- 0x88 EXC_SMC - Exception taken, Secure Monitor Call -->
78 <event event="0x88" title="Exception" name="Secure monitor call" description="Exception taken, Secure Monitor Call"/> 154 <event event="0x88" title="Exception" name="Secure monitor call" description="Exception taken, Secure Monitor Call"/>
155 <!-- 0x8A EXC_HVC - Exception taken, Hypervisor Call -->
79 <event event="0x8A" title="Exception" name="Hypervisor call" description="Exception taken, Hypervisor Call"/> 156 <event event="0x8A" title="Exception" name="Hypervisor call" description="Exception taken, Hypervisor Call"/>
157 <!-- 0x8B EXC_TRAP_PABORT - Exception taken, Instruction Abort not taken locally -->
80 <event event="0x8B" title="Exception" name="Instruction abort non-local" description="Exception taken, Instruction Abort not taken locally"/> 158 <event event="0x8B" title="Exception" name="Instruction abort non-local" description="Exception taken, Instruction Abort not taken locally"/>
159 <!-- 0x8C EXC_TRAP_DABORT - Exception taken, Data Abort or SError not taken locally -->
81 <event event="0x8C" title="Exception" name="Data abort non-local" description="Exception taken, Data Abort or SError not taken locally"/> 160 <event event="0x8C" title="Exception" name="Data abort non-local" description="Exception taken, Data Abort or SError not taken locally"/>
161 <!-- 0x8D EXC_TRAP_OTHER - Exception taken - Other traps not taken locally -->
82 <event event="0x8D" title="Exception" name="Other non-local" description="Exception taken - Other traps not taken locally"/> 162 <event event="0x8D" title="Exception" name="Other non-local" description="Exception taken - Other traps not taken locally"/>
163 <!-- 0x8E EXC_TRAP_IRQ - Exception taken, IRQ not taken locally -->
83 <event event="0x8E" title="Exception" name="IRQ non-local" description="Exception taken, IRQ not taken locally"/> 164 <event event="0x8E" title="Exception" name="IRQ non-local" description="Exception taken, IRQ not taken locally"/>
165 <!-- 0x8F EXC_TRAP_FIQ - Exception taken, FIQ not taken locally -->