summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gator/daemon/Android.mk2
-rw-r--r--tools/gator/daemon/AtraceDriver.cpp19
-rw-r--r--tools/gator/daemon/Buffer.cpp42
-rw-r--r--tools/gator/daemon/Buffer.h2
-rw-r--r--tools/gator/daemon/ConfigurationXML.cpp23
-rw-r--r--tools/gator/daemon/ConfigurationXML.h2
-rw-r--r--tools/gator/daemon/Driver.cpp3
-rw-r--r--tools/gator/daemon/Driver.h2
-rw-r--r--tools/gator/daemon/DriverSource.cpp4
-rw-r--r--tools/gator/daemon/DynBuf.cpp24
-rw-r--r--tools/gator/daemon/DynBuf.h1
-rw-r--r--tools/gator/daemon/ExternalSource.cpp120
-rw-r--r--tools/gator/daemon/ExternalSource.h2
-rw-r--r--tools/gator/daemon/FtraceDriver.cpp359
-rw-r--r--tools/gator/daemon/FtraceDriver.h26
-rw-r--r--tools/gator/daemon/Logging.cpp3
-rw-r--r--tools/gator/daemon/PerfDriver.cpp40
-rw-r--r--tools/gator/daemon/PerfSource.cpp6
-rw-r--r--tools/gator/daemon/PmuXML.cpp14
-rw-r--r--tools/gator/daemon/Proc.cpp23
-rw-r--r--tools/gator/daemon/Proc.h3
-rw-r--r--tools/gator/daemon/SessionData.cpp29
-rw-r--r--tools/gator/daemon/SessionData.h15
-rw-r--r--tools/gator/daemon/SessionXML.cpp2
-rw-r--r--tools/gator/daemon/Setup.cpp332
-rw-r--r--tools/gator/daemon/Setup.h18
-rw-r--r--tools/gator/daemon/TtraceDriver.cpp132
-rw-r--r--tools/gator/daemon/TtraceDriver.h38
-rw-r--r--tools/gator/daemon/defaults.xml5
-rw-r--r--tools/gator/daemon/events-Cortex-A35.xml68
-rw-r--r--tools/gator/daemon/events-Mali-Midgard_hw.xml4
-rw-r--r--tools/gator/daemon/events-Mali-T60x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T62x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T72x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T76x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T82x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T83x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T86x_hw.xml8
-rw-r--r--tools/gator/daemon/events-Mali-T88x_hw.xml8
-rw-r--r--tools/gator/daemon/events-ttrace.xml17
-rw-r--r--tools/gator/daemon/main.cpp42
-rw-r--r--tools/gator/daemon/mxml/config.h2
-rw-r--r--tools/gator/daemon/mxml/mxml-file.c8
-rw-r--r--tools/gator/daemon/pmus.xml1
44 files changed, 963 insertions, 534 deletions
diff --git a/tools/gator/daemon/Android.mk b/tools/gator/daemon/Android.mk
index 96a2d1e61e62..dc7b5fcbca8b 100644
--- a/tools/gator/daemon/Android.mk
+++ b/tools/gator/daemon/Android.mk
@@ -43,10 +43,10 @@ LOCAL_SRC_FILES := \
Sender.cpp \
SessionData.cpp \
SessionXML.cpp \
- Setup.cpp \
Source.cpp \
SrcMd5.cpp \
StreamlineSetup.cpp \
+ TtraceDriver.cpp \
UEvent.cpp \
UserSpaceSource.cpp \
libsensors/access.c \
diff --git a/tools/gator/daemon/AtraceDriver.cpp b/tools/gator/daemon/AtraceDriver.cpp
index 8894c92fa5ba..2ee7aadf80d1 100644
--- a/tools/gator/daemon/AtraceDriver.cpp
+++ b/tools/gator/daemon/AtraceDriver.cpp
@@ -10,16 +10,6 @@
#include <unistd.h>
-/*
-#include <regex.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "DriverSource.h"
-#include "Setup.h"
-*/
-
#include "Logging.h"
#include "OlyUtility.h"
#include "SessionData.h"
@@ -52,12 +42,13 @@ AtraceDriver::~AtraceDriver() {
}
void AtraceDriver::readEvents(mxml_node_t *const xml) {
- if (!gSessionData.mFtraceDriver.isSupported()) {
- logg.logSetup("Atrace Disabled\nftrace support is required");
+ if (access("/system/bin/setprop", X_OK) != 0) {
+ // Reduce warning noise
+ //logg.logSetup("Atrace Disabled\nsetprop is not found, this is not an Android target");
return;
}
- if (access("/system/bin/setprop", X_OK) != 0) {
- logg.logSetup("Atrace Disabled\nsetprop is not found, this is not an Android target");
+ if (!gSessionData.mFtraceDriver.isSupported()) {
+ logg.logSetup("Atrace Disabled\nftrace support is required");
return;
}
diff --git a/tools/gator/daemon/Buffer.cpp b/tools/gator/daemon/Buffer.cpp
index 4ff4cb439030..de42232bca86 100644
--- a/tools/gator/daemon/Buffer.cpp
+++ b/tools/gator/daemon/Buffer.cpp
@@ -16,16 +16,18 @@
#define FRAME_HEADER_SIZE 3
enum {
- CODE_PEA = 1,
- CODE_KEYS = 2,
- CODE_FORMAT = 3,
- CODE_MAPS = 4,
- CODE_COMM = 5,
- CODE_KEYS_OLD = 6,
- CODE_ONLINE_CPU = 7,
- CODE_OFFLINE_CPU = 8,
- CODE_KALLSYMS = 9,
- CODE_COUNTERS = 10,
+ CODE_PEA = 1,
+ CODE_KEYS = 2,
+ CODE_FORMAT = 3,
+ CODE_MAPS = 4,
+ CODE_COMM = 5,
+ CODE_KEYS_OLD = 6,
+ CODE_ONLINE_CPU = 7,
+ CODE_OFFLINE_CPU = 8,
+ CODE_KALLSYMS = 9,
+ CODE_COUNTERS = 10,
+ CODE_HEADER_PAGE = 11,
+ CODE_HEADER_EVENT = 12,
};
// Summary Frame Messages
@@ -467,6 +469,26 @@ void Buffer::perfCounterFooter(const uint64_t currTime) {
check(currTime);
}
+void Buffer::marshalHeaderPage(const uint64_t currTime, const char *const headerPage) {
+ const int headerPageLen = strlen(headerPage) + 1;
+ while (!checkSpace(MAXSIZE_PACK32 + headerPageLen)) {
+ sem_wait(&mWriterSem);
+ }
+ packInt(CODE_HEADER_PAGE);
+ writeBytes(headerPage, headerPageLen);
+ check(currTime);
+}
+
+void Buffer::marshalHeaderEvent(const uint64_t currTime, const char *const headerEvent) {
+ const int headerEventLen = strlen(headerEvent) + 1;
+ while (!checkSpace(MAXSIZE_PACK32 + headerEventLen)) {
+ sem_wait(&mWriterSem);
+ }
+ packInt(CODE_HEADER_EVENT);
+ writeBytes(headerEvent, headerEventLen);
+ check(currTime);
+}
+
void Buffer::setDone() {
mIsDone = true;
commit(0);
diff --git a/tools/gator/daemon/Buffer.h b/tools/gator/daemon/Buffer.h
index d4020d08b3a1..7dd83494c357 100644
--- a/tools/gator/daemon/Buffer.h
+++ b/tools/gator/daemon/Buffer.h
@@ -63,6 +63,8 @@ public:
void perfCounterHeader(const uint64_t time);
void perfCounter(const int core, const int key, const int64_t value);
void perfCounterFooter(const uint64_t currTime);
+ void marshalHeaderPage(const uint64_t currTime, const char *const headerPage);
+ void marshalHeaderEvent(const uint64_t currTime, const char *const headerEvent);
void setDone();
bool isDone() const;
diff --git a/tools/gator/daemon/ConfigurationXML.cpp b/tools/gator/daemon/ConfigurationXML.cpp
index 8639374c8fb1..eda487b40e9f 100644
--- a/tools/gator/daemon/ConfigurationXML.cpp
+++ b/tools/gator/daemon/ConfigurationXML.cpp
@@ -24,6 +24,11 @@ static const char ATTR_COUNT[] = "count";
static const char ATTR_CORES[] = "cores";
ConfigurationXML::ConfigurationXML() {
+ if (gSessionData.mCountersError != NULL) {
+ free(gSessionData.mCountersError);
+ gSessionData.mCountersError = NULL;
+ }
+
const char * configuration_xml;
unsigned int configuration_xml_len;
getDefaultConfigurationXml(configuration_xml, configuration_xml_len);
@@ -68,10 +73,6 @@ int ConfigurationXML::parse(const char* configurationXML) {
mxml_node_t *tree, *node;
int ret;
- if (gSessionData.mCountersError != NULL) {
- free(gSessionData.mCountersError);
- gSessionData.mCountersError = NULL;
- }
gSessionData.mIsEBS = false;
mIndex = 0;
@@ -116,8 +117,11 @@ void ConfigurationXML::validate(void) {
const Counter & counter = gSessionData.mCounters[i];
if (counter.isEnabled()) {
if (strcmp(counter.getType(), "") == 0) {
- logg.logError("Invalid required attribute in configuration.xml:\n counter=\"%s\"\n event=%d", counter.getType(), counter.getEvent());
- handleException();
+ if (gSessionData.mCountersError == NULL && asprintf(&gSessionData.mCountersError, "Invalid required attribute in configuration.xml:\n counter=\"%s\"\n event=%d", counter.getType(), counter.getEvent()) <= 0) {
+ logg.logError("asprintf failed");
+ handleException();
+ }
+ return;
}
// iterate through the remaining enabled performance counters
@@ -126,8 +130,11 @@ void ConfigurationXML::validate(void) {
if (counter2.isEnabled()) {
// check if the types are the same
if (strcmp(counter.getType(), counter2.getType()) == 0) {
- logg.logError("Duplicate performance counter type in configuration.xml: %s", counter.getType());
- handleException();
+ if (gSessionData.mCountersError == NULL && asprintf(&gSessionData.mCountersError, "Duplicate performance counter type in configuration.xml: %s", counter.getType()) <= 0) {
+ logg.logError("asprintf failed");
+ handleException();
+ }
+ return;
}
}
}
diff --git a/tools/gator/daemon/ConfigurationXML.h b/tools/gator/daemon/ConfigurationXML.h
index a986ce99381b..2677660ae3a3 100644
--- a/tools/gator/daemon/ConfigurationXML.h
+++ b/tools/gator/daemon/ConfigurationXML.h
@@ -20,12 +20,12 @@ public:
ConfigurationXML();
~ConfigurationXML();
const char* getConfigurationXML() {return mConfigurationXML;}
- void validate(void);
private:
char* mConfigurationXML;
int mIndex;
+ void validate(void);
int parse(const char* xmlFile);
int configurationsTag(mxml_node_t *node);
void configurationTag(mxml_node_t *node);
diff --git a/tools/gator/daemon/Driver.cpp b/tools/gator/daemon/Driver.cpp
index 72c731424bde..872ab7b02d6a 100644
--- a/tools/gator/daemon/Driver.cpp
+++ b/tools/gator/daemon/Driver.cpp
@@ -43,6 +43,9 @@ DriverCounter *SimpleDriver::findCounter(const Counter &counter) const {
return NULL;
}
+Driver::~Driver() {
+}
+
bool SimpleDriver::claimCounter(const Counter &counter) const {
return findCounter(counter) != NULL;
}
diff --git a/tools/gator/daemon/Driver.h b/tools/gator/daemon/Driver.h
index 19ec12775a39..fe20471f3f33 100644
--- a/tools/gator/daemon/Driver.h
+++ b/tools/gator/daemon/Driver.h
@@ -43,7 +43,7 @@ class Driver {
public:
static Driver *getHead() { return head; }
- virtual ~Driver() {}
+ virtual ~Driver();
// Returns true if this driver can manage the counter
virtual bool claimCounter(const Counter &counter) const = 0;
diff --git a/tools/gator/daemon/DriverSource.cpp b/tools/gator/daemon/DriverSource.cpp
index 7473d2858297..92cc0d981a7c 100644
--- a/tools/gator/daemon/DriverSource.cpp
+++ b/tools/gator/daemon/DriverSource.cpp
@@ -106,8 +106,8 @@ void DriverSource::bootstrapThread() {
// MonotonicStarted may not be not assigned yet
const uint64_t currTime = 0;//getTime() - gSessionData.mMonotonicStarted;
- if (!readProcComms(currTime, mBuffer, &printb, &b1, &b2)) {
- logg.logError("readProcComms failed");
+ if (!readProcSysDependencies(currTime, mBuffer, &printb, &b1, &b2)) {
+ logg.logError("readProcSysDependencies failed");
handleException();
}
diff --git a/tools/gator/daemon/DynBuf.cpp b/tools/gator/daemon/DynBuf.cpp
index b997e7ce7e06..c5cc60de09f6 100644
--- a/tools/gator/daemon/DynBuf.cpp
+++ b/tools/gator/daemon/DynBuf.cpp
@@ -11,6 +11,7 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#include "Logging.h"
@@ -159,3 +160,26 @@ bool DynBuf::append(const char *format, va_list ap) {
return true;
}
+
+bool DynBuf::appendStr(const char *str) {
+ if (capacity <= 0) {
+ if (resize(2 * MIN_BUFFER_FREE) != 0) {
+ logg.logMessage("DynBuf::resize failed");
+ return false;
+ }
+ }
+
+ size_t bytes = strlen(str);
+ if (length + bytes >= capacity) {
+ if (resize(length + bytes + 1) != 0) {
+ logg.logMessage("DynBuf::resize failed");
+ return false;
+ }
+ }
+
+ memcpy(buf + length, str, bytes + 1);
+
+ length += bytes;
+
+ return true;
+}
diff --git a/tools/gator/daemon/DynBuf.h b/tools/gator/daemon/DynBuf.h
index 2a5e7b0ed53c..67c06ba4a409 100644
--- a/tools/gator/daemon/DynBuf.h
+++ b/tools/gator/daemon/DynBuf.h
@@ -36,6 +36,7 @@ public:
__attribute__ ((format(printf, 2, 3)))
bool append(const char *format, ...);
bool append(const char *format, va_list ap);
+ bool appendStr(const char *str);
size_t getLength() const { return length; }
const char *getBuf() const { return buf; }
diff --git a/tools/gator/daemon/ExternalSource.cpp b/tools/gator/daemon/ExternalSource.cpp
index a390e08a69ca..c6626ce0939f 100644
--- a/tools/gator/daemon/ExternalSource.cpp
+++ b/tools/gator/daemon/ExternalSource.cpp
@@ -28,8 +28,9 @@ static const char MALI_GRAPHICS_STARTUP[] = "\0mali_thirdparty_client";
static const char MALI_GRAPHICS_V1[] = "MALI_GRAPHICS 1\n";
static const char MALI_UTGARD_STARTUP[] = "\0mali-utgard-startup";
static const char FTRACE_V1[] = "FTRACE 1\n";
+static const char FTRACE_V2[] = "FTRACE 2\n";
-ExternalSource::ExternalSource(sem_t *senderSem) : mBuffer(0, FRAME_EXTERNAL, 128*1024, senderSem), mMonitor(), mMveStartupUds(MALI_VIDEO_STARTUP, sizeof(MALI_VIDEO_STARTUP)), mMidgardStartupUds(MALI_GRAPHICS_STARTUP, sizeof(MALI_GRAPHICS_STARTUP)), mUtgardStartupUds(MALI_UTGARD_STARTUP, sizeof(MALI_UTGARD_STARTUP)), mAnnotate(8083), mAnnotateUds(STREAMLINE_ANNOTATE, sizeof(STREAMLINE_ANNOTATE), true), mInterruptFd(-1), mMidgardUds(-1), mMveUds(-1), mFtraceFd(-1) {
+ExternalSource::ExternalSource(sem_t *senderSem) : mBuffer(0, FRAME_EXTERNAL, 128*1024, senderSem), mMonitor(), mMveStartupUds(MALI_VIDEO_STARTUP, sizeof(MALI_VIDEO_STARTUP)), mMidgardStartupUds(MALI_GRAPHICS_STARTUP, sizeof(MALI_GRAPHICS_STARTUP)), mUtgardStartupUds(MALI_UTGARD_STARTUP, sizeof(MALI_UTGARD_STARTUP)), mAnnotate(8083), mAnnotateUds(STREAMLINE_ANNOTATE, sizeof(STREAMLINE_ANNOTATE), true), mInterruptFd(-1), mMidgardUds(-1), mMveUds(-1) {
sem_init(&mBufferSem, 0, 0);
}
@@ -103,15 +104,20 @@ void ExternalSource::connectFtrace() {
return;
}
- gSessionData.mFtraceDriver.prepare();
-
- mFtraceFd = open(TRACING_PATH "/trace_pipe", O_RDONLY | O_CLOEXEC);
- if (mFtraceFd < 0) {
- logg.logError("Unable to open trace_pipe");
- handleException();
+ int ftraceFds[NR_CPUS + 1];
+ const char *handshake;
+ size_t size;
+ if (gSessionData.mFtraceDriver.prepare(ftraceFds)) {
+ handshake = FTRACE_V1;
+ size = sizeof(FTRACE_V1);
+ } else {
+ handshake = FTRACE_V2;
+ size = sizeof(FTRACE_V2);
}
- configureConnection(mFtraceFd, FTRACE_V1, sizeof(FTRACE_V1));
+ for (int i = 0; i < ARRAY_LENGTH(ftraceFds) && ftraceFds[i] >= 0; ++i) {
+ configureConnection(ftraceFds[i], handshake, size);
+ }
}
bool ExternalSource::prepare() {
@@ -155,13 +161,10 @@ void ExternalSource::run() {
logg.logMessage("Writing to annotate pipe failed");
}
- if (mFtraceFd >= 0) {
+ if (gSessionData.mFtraceDriver.isSupported()) {
gSessionData.mAtraceDriver.start();
-
- if (DriverSource::writeDriver(TRACING_PATH "/tracing_on", "1") != 0) {
- logg.logError("Unable to turn ftrace on");
- handleException();
- }
+ gSessionData.mTtraceDriver.start();
+ gSessionData.mFtraceDriver.start();
}
// Wait until monotonicStarted is set before sending data
@@ -239,40 +242,7 @@ void ExternalSource::run() {
* starve out the gator data.
*/
while (gSessionData.mSessionIsActive) {
- // Wait until there is enough room for the fd, two headers and two ints
- waitFor(7*Buffer::MAXSIZE_PACK32 + 2*sizeof(uint32_t));
- mBuffer.packInt(fd);
- const int contiguous = mBuffer.contiguousSpaceAvailable();
- const int bytes = read(fd, mBuffer.getWritePos(), contiguous);
- if (bytes < 0) {
- if (errno == EAGAIN) {
- // Nothing left to read
- mBuffer.commit(currTime, true);
- break;
- }
- // Something else failed, close the socket
- mBuffer.commit(currTime, true);
- mBuffer.packInt(-1);
- mBuffer.packInt(fd);
- // Here and other commits, always force-flush the buffer as this frame don't work like others
- mBuffer.commit(currTime, true);
- close(fd);
- break;
- } else if (bytes == 0) {
- // The other side is closed
- mBuffer.commit(currTime, true);
- mBuffer.packInt(-1);
- mBuffer.packInt(fd);
- mBuffer.commit(currTime, true);
- close(fd);
- break;
- }
-
- mBuffer.advanceWrite(bytes);
- mBuffer.commit(currTime, true);
-
- // Short reads also mean nothing is left to read
- if (bytes < contiguous) {
+ if (!transfer(currTime, fd)) {
break;
}
}
@@ -280,14 +250,21 @@ void ExternalSource::run() {
}
}
- mBuffer.setDone();
-
- if (mFtraceFd >= 0) {
- gSessionData.mFtraceDriver.stop();
+ if (gSessionData.mFtraceDriver.isSupported()) {
+ int ftraceFds[NR_CPUS + 1];
+ gSessionData.mFtraceDriver.stop(ftraceFds);
+ // Read any slop
+ const uint64_t currTime = getTime() - gSessionData.mMonotonicStarted;
+ for (int i = 0; i < ARRAY_LENGTH(ftraceFds) && ftraceFds[i] >= 0; ++i) {
+ transfer(currTime, ftraceFds[i]);
+ close(ftraceFds[i]);
+ }
+ gSessionData.mTtraceDriver.stop();
gSessionData.mAtraceDriver.stop();
- close(mFtraceFd);
}
+ mBuffer.setDone();
+
if (mMveUds >= 0) {
gSessionData.mMaliVideo.stop(mMveUds);
}
@@ -297,6 +274,43 @@ void ExternalSource::run() {
close(pipefd[1]);
}
+bool ExternalSource::transfer(const uint64_t currTime, const int fd) {
+ // Wait until there is enough room for the fd, two headers and two ints
+ waitFor(7*Buffer::MAXSIZE_PACK32 + 2*sizeof(uint32_t));
+ mBuffer.packInt(fd);
+ const int contiguous = mBuffer.contiguousSpaceAvailable();
+ const int bytes = read(fd, mBuffer.getWritePos(), contiguous);
+ if (bytes < 0) {
+ if (errno == EAGAIN) {
+ // Nothing left to read
+ mBuffer.commit(currTime, true);
+ return false;
+ }
+ // Something else failed, close the socket
+ mBuffer.commit(currTime, true);
+ mBuffer.packInt(-1);
+ mBuffer.packInt(fd);
+ // Here and other commits, always force-flush the buffer as this frame don't work like others
+ mBuffer.commit(currTime, true);
+ close(fd);
+ return false;
+ } else if (bytes == 0) {
+ // The other side is closed
+ mBuffer.commit(currTime, true);
+ mBuffer.packInt(-1);
+ mBuffer.packInt(fd);
+ mBuffer.commit(currTime, true);
+ close(fd);
+ return false;
+ }
+
+ mBuffer.advanceWrite(bytes);
+ mBuffer.commit(currTime, true);
+
+ // Short reads also mean nothing is left to read
+ return bytes >= contiguous;
+}
+
void ExternalSource::interrupt() {
if (mInterruptFd >= 0) {
int8_t c = 0;
diff --git a/tools/gator/daemon/ExternalSource.h b/tools/gator/daemon/ExternalSource.h
index 2831ec83f10a..210be63876d9 100644
--- a/tools/gator/daemon/ExternalSource.h
+++ b/tools/gator/daemon/ExternalSource.h
@@ -35,6 +35,7 @@ private:
bool connectMidgard();
bool connectMve();
void connectFtrace();
+ bool transfer(const uint64_t currTime, const int fd);
sem_t mBufferSem;
Buffer mBuffer;
@@ -47,7 +48,6 @@ private:
int mInterruptFd;
int mMidgardUds;
int mMveUds;
- int mFtraceFd;
// Intentionally unimplemented
ExternalSource(const ExternalSource &);
diff --git a/tools/gator/daemon/FtraceDriver.cpp b/tools/gator/daemon/FtraceDriver.cpp
index b2d0ba1688b6..4ea3bf1b4072 100644
--- a/tools/gator/daemon/FtraceDriver.cpp
+++ b/tools/gator/daemon/FtraceDriver.cpp
@@ -8,23 +8,62 @@
#include "FtraceDriver.h"
+#include <dirent.h>
+#include <fcntl.h>
#include <regex.h>
-#include <unistd.h>
-#include <sys/types.h>
+#include <signal.h>
+#include <sys/prctl.h>
#include <sys/stat.h>
-#include <fcntl.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "Buffer.h"
#include "Config.h"
#include "DriverSource.h"
#include "Logging.h"
+#include "Proc.h"
#include "SessionData.h"
-#include "Setup.h"
+
+Barrier::Barrier() : mCount(0) {
+ pthread_mutex_init(&mMutex, NULL);
+ pthread_cond_init(&mCond, NULL);
+}
+
+Barrier::~Barrier() {
+ pthread_cond_destroy(&mCond);
+ pthread_mutex_destroy(&mMutex);
+}
+
+void Barrier::init(unsigned int count) {
+ mCount = count;
+}
+
+void Barrier::wait() {
+ pthread_mutex_lock(&mMutex);
+
+ mCount--;
+ if (mCount == 0) {
+ pthread_cond_broadcast(&mCond);
+ } else {
+ // Loop in case of spurious wakeups
+ for (;;) {
+ pthread_cond_wait(&mCond, &mMutex);
+ if (mCount <= 0) {
+ break;
+ }
+ }
+ }
+
+ pthread_mutex_unlock(&mMutex);
+}
class FtraceCounter : public DriverCounter {
public:
FtraceCounter(DriverCounter *next, char *name, const char *enable);
~FtraceCounter();
+ bool readTracepointFormat(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b);
+
void prepare();
void stop();
@@ -48,6 +87,10 @@ FtraceCounter::~FtraceCounter() {
void FtraceCounter::prepare() {
if (mEnable == NULL) {
+ if (gSessionData.mFtraceRaw) {
+ logg.logError("The ftrace counter %s is not compatible with the more efficient ftrace collection as it is missing the enable attribute. Please either add the enable attribute to the counter in events XML or disable the counter in counter configuration.", getName());
+ handleException();
+ }
return;
}
@@ -70,6 +113,172 @@ void FtraceCounter::stop() {
DriverSource::writeDriver(buf, mWasEnabled);
}
+bool FtraceCounter::readTracepointFormat(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b) {
+ return ::readTracepointFormat(currTime, buffer, mEnable, printb, b);
+}
+
+static void handlerUsr1(int signum)
+{
+ (void)signum;
+
+ // Although this signal handler does nothing, SIG_IGN doesn't interrupt splice in all cases
+}
+
+static int pageSize;
+
+class FtraceReader {
+public:
+ FtraceReader(Barrier *const barrier, int cpu, int tfd, int pfd0, int pfd1) : mNext(mHead), mBarrier(barrier), mCpu(cpu), mTfd(tfd), mPfd0(pfd0), mPfd1(pfd1) {
+ mHead = this;
+ }
+
+ void start();
+ bool interrupt();
+ bool join();
+
+ static FtraceReader *getHead() { return mHead; }
+ FtraceReader *getNext() const { return mNext; }
+ int getPfd0() const { return mPfd0; }
+
+private:
+ static FtraceReader *mHead;
+ FtraceReader *const mNext;
+ Barrier *const mBarrier;
+ pthread_t mThread;
+ const int mCpu;
+ const int mTfd;
+ const int mPfd0;
+ const int mPfd1;
+
+ static void *runStatic(void *arg);
+ void run();
+};
+
+FtraceReader *FtraceReader::mHead;
+
+void FtraceReader::start() {
+ if (pthread_create(&mThread, NULL, runStatic, this) != 0) {
+ logg.logError("Unable to start the ftraceReader thread");
+ handleException();
+ }
+}
+
+bool FtraceReader::interrupt() {
+ return pthread_kill(mThread, SIGUSR1) == 0;
+}
+
+bool FtraceReader::join() {
+ return pthread_join(mThread, NULL) == 0;
+}
+
+void *FtraceReader::runStatic(void *arg) {
+ FtraceReader *const ftraceReader = static_cast<FtraceReader *>(arg);
+ ftraceReader->run();
+ return NULL;
+}
+
+#ifndef SPLICE_F_MOVE
+
+#include <sys/syscall.h>
+
+// Pre Android-21 does not define splice
+#define SPLICE_F_MOVE 1
+
+static ssize_t sys_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags) {
+ return syscall(__NR_splice, fd_in, off_in, fd_out, off_out, len, flags);
+}
+
+#define splice(fd_in, off_in, fd_out, off_out, len, flags) sys_splice(fd_in, off_in, fd_out, off_out, len, flags)
+
+#endif
+
+void FtraceReader::run() {
+ {
+ char buf[16];
+ snprintf(buf, sizeof(buf), "gatord-reader%02i", mCpu);
+ prctl(PR_SET_NAME, (unsigned long)&buf, 0, 0, 0);
+ }
+
+ mBarrier->wait();
+
+ while (gSessionData.mSessionIsActive) {
+ const ssize_t bytes = splice(mTfd, NULL, mPfd1, NULL, pageSize, SPLICE_F_MOVE);
+ if (bytes == 0) {
+ logg.logError("ftrace splice unexpectedly returned 0");
+ handleException();
+ } else if (bytes < 0) {
+ if (errno != EINTR) {
+ logg.logError("splice failed");
+ handleException();
+ }
+ } else {
+ // Can there be a short splice read?
+ if (bytes != pageSize) {
+ logg.logError("splice short read");
+ handleException();
+ }
+ // Will be read by gatord-external
+ }
+ }
+
+ if (!setNonblock(mTfd)) {
+ logg.logError("setNonblock failed");
+ handleException();
+ }
+
+ for (;;) {
+ ssize_t bytes;
+
+ bytes = splice(mTfd, NULL, mPfd1, NULL, pageSize, SPLICE_F_MOVE);
+ if (bytes <= 0) {
+ break;
+ } else {
+ // Can there be a short splice read?
+ if (bytes != pageSize) {
+ logg.logError("splice short read");
+ handleException();
+ }
+ // Will be read by gatord-external
+ }
+ }
+
+ {
+ // Read any slop
+ ssize_t bytes;
+ size_t size;
+ char buf[1<<16];
+
+ if (sizeof(buf) < (size_t)pageSize) {
+ logg.logError("ftrace slop buffer is too small");
+ handleException();
+ }
+ for (;;) {
+ bytes = read(mTfd, buf, sizeof(buf));
+ if (bytes == 0) {
+ logg.logError("ftrace read unexpectedly returned 0");
+ handleException();
+ } else if (bytes < 0) {
+ if (errno != EAGAIN) {
+ logg.logError("reading slop from ftrace failed");
+ handleException();
+ }
+ break;
+ } else {
+ size = bytes;
+ bytes = write(mPfd1, buf, size);
+ if (bytes != (ssize_t)size) {
+ logg.logError("writing slop to ftrace pipe failed");
+ handleException();
+ }
+ }
+ }
+ }
+
+ close(mTfd);
+ close(mPfd1);
+ // Intentionally don't close mPfd0 as it is used after this thread is exited to read the slop
+}
+
FtraceDriver::FtraceDriver() : mValues(NULL), mSupported(false), mMonotonicRawSupport(false), mTracingOn(0) {
}
@@ -151,7 +360,15 @@ void FtraceDriver::readEvents(mxml_node_t *const xml) {
mValues = new int64_t[2*count];
}
-void FtraceDriver::prepare() {
+bool FtraceDriver::prepare(int *const ftraceFds) {
+ if (gSessionData.mFtraceRaw) {
+ // Don't want the performace impact of sending all formats so gator only sends it for the enabled counters. This means other counters need to be disabled
+ if (DriverSource::writeDriver(TRACING_PATH "/events/enable", "0") != 0) {
+ logg.logError("Unable to turn off all events");
+ handleException();
+ }
+ }
+
for (FtraceCounter *counter = static_cast<FtraceCounter *>(getCounters()); counter != NULL; counter = static_cast<FtraceCounter *>(counter->getNext())) {
if (!counter->isEnabled()) {
continue;
@@ -184,11 +401,65 @@ void FtraceDriver::prepare() {
logg.logError("Unable to switch ftrace to the %s clock, please ensure you are running Linux %s or later", clock, mMonotonicRawSupport ? "4.2" : "3.10");
handleException();
}
+
+ if (!gSessionData.mFtraceRaw) {
+ ftraceFds[0] = open(TRACING_PATH "/trace_pipe", O_RDONLY | O_CLOEXEC);
+ if (ftraceFds[0] < 0) {
+ logg.logError("Unable to open trace_pipe");
+ handleException();
+ }
+ ftraceFds[1] = -1;
+ return true;
+ }
+
+ struct sigaction act;
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = handlerUsr1;
+ if (sigaction(SIGUSR1, &act, NULL) != 0) {
+ logg.logError("sigaction failed");
+ handleException();
+ }
+
+ pageSize = sysconf(_SC_PAGESIZE);
+ if (pageSize <= 0) {
+ logg.logError("sysconf PAGESIZE failed");
+ handleException();
+ }
+
+ mBarrier.init(gSessionData.mCores + 1);
+
+ int cpu;
+ for (cpu = 0; cpu < gSessionData.mCores; ++cpu) {
+ int pfd[2];
+ if (pipe2(pfd, O_CLOEXEC) != 0) {
+ logg.logError("pipe2 failed, %s (%i)", strerror(errno), errno);
+ handleException();
+ }
+
+ char buf[64];
+ snprintf(buf, sizeof(buf), TRACING_PATH "/per_cpu/cpu%i/trace_pipe_raw", cpu);
+ const int tfd = open(buf, O_RDONLY | O_CLOEXEC);
+ (new FtraceReader(&mBarrier, cpu, tfd, pfd[0], pfd[1]))->start();
+ ftraceFds[cpu] = pfd[0];
+ }
+ ftraceFds[cpu] = -1;
+
+ return false;
+}
+
+void FtraceDriver::start() {
+ if (DriverSource::writeDriver(TRACING_PATH "/tracing_on", "1") != 0) {
+ logg.logError("Unable to turn ftrace on");
+ handleException();
+ }
+
+ if (gSessionData.mFtraceRaw) {
+ mBarrier.wait();
+ }
}
-void FtraceDriver::stop() {
+void FtraceDriver::stop(int *const ftraceFds) {
DriverSource::writeDriver(TRACING_PATH "/tracing_on", mTracingOn);
- DriverSource::writeDriver(TRACING_PATH "/trace_clock", "local");
for (FtraceCounter *counter = static_cast<FtraceCounter *>(getCounters()); counter != NULL; counter = static_cast<FtraceCounter *>(counter->getNext())) {
if (!counter->isEnabled()) {
@@ -196,4 +467,78 @@ void FtraceDriver::stop() {
}
counter->stop();
}
+
+ if (!gSessionData.mFtraceRaw) {
+ ftraceFds[0] = -1;
+ } else {
+ int i = 0;
+ for (FtraceReader *reader = FtraceReader::getHead(); reader != NULL; reader = reader->getNext(), ++i) {
+ reader->interrupt();
+ ftraceFds[i] = reader->getPfd0();
+ }
+ ftraceFds[i] = -1;
+ for (FtraceReader *reader = FtraceReader::getHead(); reader != NULL; reader = reader->getNext(), ++i) {
+ reader->join();
+ }
+ }
+
+ // Reset back to local after joining with the reader threads as otherwise any remaining ftrace data is purged
+ DriverSource::writeDriver(TRACING_PATH "/trace_clock", "local");
+}
+
+bool FtraceDriver::readTracepointFormats(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b) {
+ if (!gSessionData.mFtraceRaw) {
+ return true;
+ }
+
+ if (!printb->printf(EVENTS_PATH "/header_page")) {
+ logg.logMessage("DynBuf::printf failed");
+ return false;
+ }
+ if (!b->read(printb->getBuf())) {
+ logg.logMessage("DynBuf::read failed");
+ return false;
+ }
+ buffer->marshalHeaderPage(currTime, b->getBuf());
+
+ if (!printb->printf(EVENTS_PATH "/header_event")) {
+ logg.logMessage("DynBuf::printf failed");
+ return false;
+ }
+ if (!b->read(printb->getBuf())) {
+ logg.logMessage("DynBuf::read failed");
+ return false;
+ }
+ buffer->marshalHeaderEvent(currTime, b->getBuf());
+
+ DIR *dir = opendir(EVENTS_PATH "/ftrace");
+ if (dir == NULL) {
+ logg.logError("Unable to open events ftrace folder");
+ handleException();
+ }
+ struct dirent *dirent;
+ while ((dirent = readdir(dir)) != NULL) {
+ if (dirent->d_name[0] == '.' || dirent->d_type != DT_DIR) {
+ continue;
+ }
+ if (!printb->printf(EVENTS_PATH "/ftrace/%s/format", dirent->d_name)) {
+ logg.logMessage("DynBuf::printf failed");
+ return false;
+ }
+ if (!b->read(printb->getBuf())) {
+ logg.logMessage("DynBuf::read failed");
+ return false;
+ }
+ buffer->marshalFormat(currTime, b->getLength(), b->getBuf());
+ }
+ closedir(dir);
+
+ for (FtraceCounter *counter = static_cast<FtraceCounter *>(getCounters()); counter != NULL; counter = static_cast<FtraceCounter *>(counter->getNext())) {
+ if (!counter->isEnabled()) {
+ continue;
+ }
+ counter->readTracepointFormat(currTime, buffer, printb, b);
+ }
+
+ return true;
}
diff --git a/tools/gator/daemon/FtraceDriver.h b/tools/gator/daemon/FtraceDriver.h
index 12b2d5d4afe2..2da5808ed1aa 100644
--- a/tools/gator/daemon/FtraceDriver.h
+++ b/tools/gator/daemon/FtraceDriver.h
@@ -9,8 +9,27 @@
#ifndef FTRACEDRIVER_H
#define FTRACEDRIVER_H
+#include <pthread.h>
+
#include "Driver.h"
+class DynBuf;
+
+// The Android NDK doesn't provide an implementation of pthread_barrier_t, so implement our own
+class Barrier {
+public:
+ Barrier();
+ ~Barrier();
+
+ void init(unsigned int count);
+ void wait();
+
+private:
+ pthread_mutex_t mMutex;
+ pthread_cond_t mCond;
+ unsigned int mCount;
+};
+
class FtraceDriver : public SimpleDriver {
public:
FtraceDriver();
@@ -18,13 +37,16 @@ public:
void readEvents(mxml_node_t *const xml);
- void prepare();
- void stop();
+ bool prepare(int *const ftraceFds);
+ void start();
+ void stop(int *const ftraceFds);
+ bool readTracepointFormats(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b);
bool isSupported() const { return mSupported; }
private:
int64_t *mValues;
+ Barrier mBarrier;
int mSupported : 1,
mMonotonicRawSupport : 1,
mUnused0 : 30;
diff --git a/tools/gator/daemon/Logging.cpp b/tools/gator/daemon/Logging.cpp
index a800c4be2320..ba5e315e548c 100644
--- a/tools/gator/daemon/Logging.cpp
+++ b/tools/gator/daemon/Logging.cpp
@@ -59,7 +59,8 @@ void Logging::_logSetup(const char *function, const char *file, int line, const
va_end(args);
pthread_mutex_lock(&mLoggingMutex);
- mSetup.append("%s|", logBuf);
+ mSetup.appendStr(logBuf);
+ mSetup.appendStr("|");
pthread_mutex_unlock(&mLoggingMutex);
if (mDebug) {
diff --git a/tools/gator/daemon/PerfDriver.cpp b/tools/gator/daemon/PerfDriver.cpp
index 4c7da11b86dd..2c78cbfe22ef 100644
--- a/tools/gator/daemon/PerfDriver.cpp
+++ b/tools/gator/daemon/PerfDriver.cpp
@@ -21,8 +21,8 @@
#include "DynBuf.h"
#include "Logging.h"
#include "PerfGroup.h"
+#include "Proc.h"
#include "SessionData.h"
-#include "Setup.h"
#define PERF_DEVICES "/sys/bus/event_source/devices"
@@ -257,14 +257,12 @@ bool PerfDriver::setup() {
}
}
-#if defined(__arm__) || defined(__aarch64__)
if (!foundCpu) {
- logg.logSetup("CPU is not recognized\nUsing the ARM architected counters");
+ logCpuNotFound();
+#if defined(__arm__) || defined(__aarch64__)
addCpuCounters("Other", PERF_TYPE_RAW, 6);
- }
-#else
- logg.logSetup("CPU is not recognized\nOmitting CPU counters");
#endif
+ }
// Add supported software counters
long long id;
@@ -300,6 +298,14 @@ bool PerfDriver::setup() {
return true;
}
+void logCpuNotFound() {
+#if defined(__arm__) || defined(__aarch64__)
+ logg.logSetup("CPU is not recognized\nUsing the ARM architected counters");
+#else
+ logg.logSetup("CPU is not recognized\nOmitting CPU counters");
+#endif
+}
+
bool PerfDriver::summary(Buffer *const buffer) {
struct utsname utsname;
if (uname(&utsname) != 0) {
@@ -400,31 +406,17 @@ void PerfDriver::read(Buffer *const buffer, const int cpu) {
}
}
-static bool sendTracepointFormat(const uint64_t currTime, Buffer *const buffer, const char *const name, DynBuf *const printb, DynBuf *const b) {
- if (!printb->printf(EVENTS_PATH "/%s/format", name)) {
- logg.logMessage("DynBuf::printf failed");
- return false;
- }
- if (!b->read(printb->getBuf())) {
- logg.logMessage("DynBuf::read failed");
- return false;
- }
- buffer->marshalFormat(currTime, b->getLength(), b->getBuf());
-
- return true;
-}
-
bool PerfDriver::sendTracepointFormats(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b) {
if (
- !sendTracepointFormat(currTime, buffer, SCHED_SWITCH, printb, b) ||
- !sendTracepointFormat(currTime, buffer, CPU_IDLE, printb, b) ||
- !sendTracepointFormat(currTime, buffer, CPU_FREQUENCY, printb, b) ||
+ !readTracepointFormat(currTime, buffer, SCHED_SWITCH, printb, b) ||
+ !readTracepointFormat(currTime, buffer, CPU_IDLE, printb, b) ||
+ !readTracepointFormat(currTime, buffer, CPU_FREQUENCY, printb, b) ||
false) {
return false;
}
for (PerfTracepoint *tracepoint = mTracepoints; tracepoint != NULL; tracepoint = tracepoint->getNext()) {
- if (tracepoint->getCounter()->isEnabled() && !sendTracepointFormat(currTime, buffer, tracepoint->getTracepoint(), printb, b)) {
+ if (tracepoint->getCounter()->isEnabled() && !readTracepointFormat(currTime, buffer, tracepoint->getTracepoint(), printb, b)) {
return false;
}
}
diff --git a/tools/gator/daemon/PerfSource.cpp b/tools/gator/daemon/PerfSource.cpp
index 3c89a9ef05d4..75783961b6b8 100644
--- a/tools/gator/daemon/PerfSource.cpp
+++ b/tools/gator/daemon/PerfSource.cpp
@@ -212,7 +212,7 @@ struct ProcThreadArgs {
bool mIsDone;
};
-void *procFunc(void *arg) {
+static void *procFunc(void *arg) {
DynBuf printb;
DynBuf b;
const ProcThreadArgs *const args = (ProcThreadArgs *)arg;
@@ -273,8 +273,8 @@ void PerfSource::run() {
}
mBuffer->perfCounterFooter(currTime);
- if (!readProcComms(currTime, mBuffer, &printb, &b1, &b2)) {
- logg.logError("readProcComms failed");
+ if (!readProcSysDependencies(currTime, mBuffer, &printb, &b1, &b2)) {
+ logg.logError("readProcSysDependencies failed");
handleException();
}
mBuffer->commit(currTime);
diff --git a/tools/gator/daemon/PmuXML.cpp b/tools/gator/daemon/PmuXML.cpp
index 68599920afad..4a4575e34446 100644
--- a/tools/gator/daemon/PmuXML.cpp
+++ b/tools/gator/daemon/PmuXML.cpp
@@ -135,4 +135,18 @@ void PmuXML::writeToKernel() {
}
DriverSource::writeDriver("/dev/gator/pmu_init", "1");
+
+ // Was any CPU detected?
+ bool foundCpu = false;
+ for (GatorCpu *gatorCpu = GatorCpu::getHead(); gatorCpu != NULL; gatorCpu = gatorCpu->getNext()) {
+ snprintf(buf, sizeof(buf), "/dev/gator/events/%s_cnt0", gatorCpu->getPmncName());
+ if (access(buf, X_OK) == 0) {
+ foundCpu = true;
+ break;
+ }
+ }
+
+ if (!foundCpu) {
+ logCpuNotFound();
+ }
}
diff --git a/tools/gator/daemon/Proc.cpp b/tools/gator/daemon/Proc.cpp
index 6bea90c67e84..a9f9a51442cc 100644
--- a/tools/gator/daemon/Proc.cpp
+++ b/tools/gator/daemon/Proc.cpp
@@ -151,7 +151,7 @@ static bool readProcTask(const uint64_t currTime, Buffer *const buffer, const in
return result;
}
-bool readProcComms(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2) {
+bool readProcSysDependencies(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2) {
bool result = false;
DIR *proc = opendir("/proc");
@@ -195,6 +195,13 @@ bool readProcComms(const uint64_t currTime, Buffer *const buffer, DynBuf *const
}
}
+ if (gSessionData.mFtraceRaw) {
+ if (!gSessionData.mFtraceDriver.readTracepointFormats(currTime, buffer, printb, b1)) {
+ logg.logMessage("FtraceDriver::readTracepointFormats failed");
+ goto fail;
+ }
+ }
+
result = true;
fail:
@@ -305,3 +312,17 @@ bool readKallsyms(const uint64_t currTime, Buffer *const buffer, const bool *con
return true;
}
+
+bool readTracepointFormat(const uint64_t currTime, Buffer *const buffer, const char *const name, DynBuf *const printb, DynBuf *const b) {
+ if (!printb->printf(EVENTS_PATH "/%s/format", name)) {
+ logg.logMessage("DynBuf::printf failed");
+ return false;
+ }
+ if (!b->read(printb->getBuf())) {
+ logg.logMessage("DynBuf::read failed");
+ return false;
+ }
+ buffer->marshalFormat(currTime, b->getLength(), b->getBuf());
+
+ return true;
+}
diff --git a/tools/gator/daemon/Proc.h b/tools/gator/daemon/Proc.h
index fcc48c546d05..e1c2968e01bc 100644
--- a/tools/gator/daemon/Proc.h
+++ b/tools/gator/daemon/Proc.h
@@ -14,8 +14,9 @@
class Buffer;
class DynBuf;
-bool readProcComms(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2);
+bool readProcSysDependencies(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b1, DynBuf *const b2);
bool readProcMaps(const uint64_t currTime, Buffer *const buffer, DynBuf *const printb, DynBuf *const b);
bool readKallsyms(const uint64_t currTime, Buffer *const buffer, const bool *const isDone);
+bool readTracepointFormat(const uint64_t currTime, Buffer *const buffer, const char *const name, DynBuf *const printb, DynBuf *const b);
#endif // PROC_H
diff --git a/tools/gator/daemon/SessionData.cpp b/tools/gator/daemon/SessionData.cpp
index b81e66b0a6d8..8f61b096b00a 100644
--- a/tools/gator/daemon/SessionData.cpp
+++ b/tools/gator/daemon/SessionData.cpp
@@ -11,6 +11,7 @@
#include <fcntl.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/utsname.h>
#include <unistd.h>
#include "DiskIODriver.h"
@@ -117,6 +118,7 @@ void SessionData::initialize() {
mOneShot = false;
mSentSummary = false;
mAllowCommands = false;
+ mFtraceRaw = false;
strcpy(mCoreName, CORE_NAME_UNKNOWN);
readModel();
readCpuInfo();
@@ -402,3 +404,30 @@ bool readAll(const int fd, void *const buf, const size_t count) {
return true;
}
+
+bool getLinuxVersion(int version[3]) {
+ // Check the kernel version
+ struct utsname utsname;
+ if (uname(&utsname) != 0) {
+ logg.logMessage("uname failed");
+ return false;
+ }
+
+ version[0] = 0;
+ version[1] = 0;
+ version[2] = 0;
+
+ int part = 0;
+ char *ch = utsname.release;
+ while (*ch >= '0' && *ch <= '9' && part < 3) {
+ version[part] = 10*version[part] + *ch - '0';
+
+ ++ch;
+ if (*ch == '.') {
+ ++part;
+ ++ch;
+ }
+ }
+
+ return true;
+}
diff --git a/tools/gator/daemon/SessionData.h b/tools/gator/daemon/SessionData.h
index c3547039ac2e..38e8163d1f64 100644
--- a/tools/gator/daemon/SessionData.h
+++ b/tools/gator/daemon/SessionData.h
@@ -21,10 +21,11 @@
#include "MaliVideoDriver.h"
#include "MidgardDriver.h"
#include "PerfDriver.h"
+#include "TtraceDriver.h"
-#define PROTOCOL_VERSION 23
+#define PROTOCOL_VERSION 231
// Differentiates development versions (timestamp) from release versions
-#define PROTOCOL_DEV 1000
+#define PROTOCOL_DEV 10000000
#define NS_PER_S 1000000000LL
#define NS_PER_MS 1000000LL
@@ -158,8 +159,9 @@ public:
PerfDriver mPerf;
MaliVideoDriver mMaliVideo;
MidgardDriver mMidgard;
- // Intentionally above FtraceDriver as drivers are initialized in reverse order AtraceDriver references AtraceDriver
+ // Intentionally above FtraceDriver as drivers are initialized in reverse order AtraceDriver and TtraceDriver references FtraceDriver
AtraceDriver mAtraceDriver;
+ TtraceDriver mTtraceDriver;
FtraceDriver mFtraceDriver;
ExternalDriver mExternalDriver;
CCNDriver mCcnDriver;
@@ -184,6 +186,7 @@ public:
bool mIsEBS;
bool mSentSummary;
bool mAllowCommands;
+ bool mFtraceRaw;
int64_t mMonotonicStarted;
int mBacktraceDepth;
@@ -217,5 +220,11 @@ FILE *fopen_cloexec(const char *path, const char *mode);
bool setNonblock(const int fd);
bool writeAll(const int fd, const void *const buf, const size_t pos);
bool readAll(const int fd, void *const buf, const size_t count);
+void logCpuNotFound();
+
+// From include/generated/uapi/linux/version.h
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+bool getLinuxVersion(int version[3]);
#endif // SESSION_DATA_H
diff --git a/tools/gator/daemon/SessionXML.cpp b/tools/gator/daemon/SessionXML.cpp
index cf8f8c7510b0..742f0c49cc86 100644
--- a/tools/gator/daemon/SessionXML.cpp
+++ b/tools/gator/daemon/SessionXML.cpp
@@ -24,6 +24,7 @@ static const char ATTR_CALL_STACK_UNWINDING[] = "call_stack_unwinding";
static const char ATTR_BUFFER_MODE[] = "buffer_mode";
static const char ATTR_SAMPLE_RATE[] = "sample_rate";
static const char ATTR_DURATION[] = "duration";
+static const char USE_EFFICIENT_FTRACE[] = "use_efficient_ftrace";
static const char ATTR_PATH[] = "path";
static const char ATTR_LIVE_RATE[] = "live_rate";
static const char ATTR_CAPTURE_WORKING_DIR[] = "capture_working_dir";
@@ -83,6 +84,7 @@ void SessionXML::sessionTag(mxml_node_t *tree, mxml_node_t *node) {
// integers/bools
parameters.call_stack_unwinding = stringToBool(mxmlElementGetAttr(node, ATTR_CALL_STACK_UNWINDING), false);
if (mxmlElementGetAttr(node, ATTR_DURATION)) gSessionData.mDuration = strtol(mxmlElementGetAttr(node, ATTR_DURATION), NULL, 10);
+ gSessionData.mFtraceRaw = stringToBool(mxmlElementGetAttr(node, USE_EFFICIENT_FTRACE), false);
if (mxmlElementGetAttr(node, ATTR_LIVE_RATE)) parameters.live_rate = strtol(mxmlElementGetAttr(node, ATTR_LIVE_RATE), NULL, 10);
// parse subtags
diff --git a/tools/gator/daemon/Setup.cpp b/tools/gator/daemon/Setup.cpp
deleted file mode 100644
index 0d39572e9b12..000000000000
--- a/tools/gator/daemon/Setup.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-/**
- * Copyright (C) ARM Limited 2014-2015. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include "Setup.h"
-
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include "Config.h"
-#include "DynBuf.h"
-#include "Logging.h"
-#include "SessionData.h"
-
-#define GATOR_MSG "gator: "
-#define GATOR_ERROR "gator: error: "
-#define GATOR_CONFIRM "gator: confirm: "
-
-bool getLinuxVersion(int version[3]) {
- // Check the kernel version
- struct utsname utsname;
- if (uname(&utsname) != 0) {
- logg.logMessage("uname failed");
- return false;
- }
-
- version[0] = 0;
- version[1] = 0;
- version[2] = 0;
-
- int part = 0;
- char *ch = utsname.release;
- while (*ch >= '0' && *ch <= '9' && part < 3) {
- version[part] = 10*version[part] + *ch - '0';
-
- ++ch;
- if (*ch == '.') {
- ++part;
- ++ch;
- }
- }
-
- return true;
-}
-
-static int pgrep_gator(DynBuf *const printb) {
- DynBuf b;
-
- DIR *proc = opendir("/proc");
- if (proc == NULL) {
- logg.logError(GATOR_ERROR "opendir failed");
- handleException();
- }
-
- int self = getpid();
-
- struct dirent *dirent;
- while ((dirent = readdir(proc)) != NULL) {
- char *endptr;
- const int pid = strtol(dirent->d_name, &endptr, 10);
- if (*endptr != '\0' || (pid == self)) {
- // Ignore proc items that are not integers like ., cpuinfo, etc...
- continue;
- }
-
- if (!printb->printf("/proc/%i/stat", pid)) {
- logg.logError(GATOR_ERROR "DynBuf::printf failed");
- handleException();
- }
-
- if (!b.read(printb->getBuf())) {
- // This is not a fatal error - the thread just doesn't exist any more
- continue;
- }
-
- char *comm = strchr(b.getBuf(), '(');
- if (comm == NULL) {
- logg.logError(GATOR_ERROR "parsing stat comm begin failed");
- handleException();
- }
- ++comm;
- char *const str = strrchr(comm, ')');
- if (str == NULL) {
- logg.logError(GATOR_ERROR "parsing stat comm end failed");
- handleException();
- }
- *str = '\0';
-
- if (strncmp(comm, "gator", 5) != 0) {
- continue;
- }
-
- char state;
- const int count = sscanf(str + 2, " %c ", &state);
- if (count != 1) {
- logg.logError(GATOR_ERROR "parsing stat state failed");
- handleException();
- }
-
- if (state == 'Z') {
- // This gator is a zombie, ignore
- continue;
- }
-
- // Assume there is only one gator process
- return pid;
- }
-
- closedir(proc);
-
- return -1;
-}
-
-static bool confirm(const char *const message) {
- char buf[1<<10];
-
- printf(GATOR_CONFIRM "%s\n", message);
- while (fgets(buf, sizeof(buf), stdin) != NULL) {
- if (strcmp(buf, "y\n") == 0) {
- return true;
- }
- if (strcmp(buf, "n\n") == 0) {
- return false;
- }
- // Ignore unrecognized input
- }
-
- return false;
-}
-
-void update(const char *const gatorPath) {
- printf(GATOR_MSG "starting\n");
-
- int version[3];
- if (!getLinuxVersion(version)) {
- logg.logError(GATOR_ERROR "getLinuxVersion failed");
- handleException();
- }
-
- if (KERNEL_VERSION(version[0], version[1], version[2]) < KERNEL_VERSION(3, 4, 0)) {
- logg.logError(GATOR_ERROR "Streamline can't automatically setup gator as this kernel version is not supported. Please upgrade the kernel on your device.");
- handleException();
- }
-
- if (geteuid() != 0) {
- char buf[1<<10];
- snprintf(buf, sizeof(buf),
- "which sudo &&"
- "("
- "sudo -n %1$s -u ||"
- "("
- "echo " GATOR_MSG "trying sudo;"
- // Streamline will provide the password
- "sudo %1$s -u"
- ")"
- ") || ("
- "echo " GATOR_MSG "trying su;"
- /*
- * Different versions of su handle additional -c command line options differently and expect the
- * arguments in different ways. Try both ways wrapped in a shell.
- *
- * Then invoke another shell after su as it avoids odd failures on some Android systems
- */
- "su -c \"sh -c '%1$s -u'\" ||"
- "su -c sh -c '%1$s -u'"
- ")",
- gatorPath);
- execlp("sh", "sh", "-c", buf, NULL);
- // Streamline will provide the password if needed
-
- logg.logError(GATOR_ERROR "Streamline was unable to sudo to root on your device. Please double check passwords, ensure sudo or su work with this user or try a different username.");
- handleException();
- }
- printf(GATOR_MSG "now root\n");
-
- if (access("/sys/module/gator", F_OK) == 0) {
- if (!confirm("Streamline has detected that the gator kernel module is loaded on your device. Click yes to switch to user space gator, click no to abort the install.")) {
- printf("gator: cancel\n");
- exit(-1);
- }
- }
-
- // setenforce 0 not needed for userspace gator
-
- // Kill existing gator
- DynBuf printb;
- int gator_main = pgrep_gator(&printb);
- if (gator_main > 0) {
- if (kill(gator_main, SIGTERM) != 0) {
- logg.logError(GATOR_ERROR "kill SIGTERM failed");
- handleException();
- }
- if (!printb.printf("/proc/%i/exe", gator_main)) {
- logg.logError(GATOR_ERROR "DynBuf::printf failed");
- handleException();
- }
- for (int i = 0; ; ++i) {
- // /proc/<pid>/exe exists but will not be accessible for zombies
- if (access(printb.getBuf(), F_OK) != 0) {
- break;
- }
- if (i == 5) {
- if (kill(gator_main, SIGKILL) != 0) {
- logg.logError(GATOR_ERROR "kill SIGKILL failed");
- handleException();
- }
- } else if (i >= 10) {
- logg.logError(GATOR_ERROR "unable to kill running gator");
- handleException();
- }
- sleep(1);
- }
- }
- printf(GATOR_MSG "no gatord running\n");
-
- umount("/dev/gator");
- syscall(__NR_delete_module, "gator", O_NONBLOCK);
-
- if (access("/sys/module/gator", F_OK) == 0) {
- logg.logError(GATOR_ERROR "Unable to unload gator.ko, the gator module may be built into the kernel or gator.ko cannot be unloaded. Rebooting the device may resolve the issue.");
- handleException();
- }
-
- rename("gatord", "gatord.old");
- rename("gator.ko", "gator.ko.old");
-
- // Rename gatord.YYYYMMDDHHMMSSMMMM to gatord
- char *newGatorPath = strdup(gatorPath);
- char *dot = strrchr(newGatorPath, '.');
- if (dot != NULL) {
- *dot = '\0';
- if (rename(gatorPath, newGatorPath) != 0) {
- logg.logError(GATOR_ERROR "rename failed");
- handleException();
- }
- }
-
- char buf[128];
- int pipefd[2];
- if (pipe_cloexec(pipefd) != 0) {
- logg.logError(GATOR_ERROR "pipe failed");
- handleException();
- }
-
- // Fork and start gatord (redirect stdin, stdout and stderr so shell can close)
- int child = fork();
- if (child < 0) {
- logg.logError(GATOR_ERROR "fork failed");
- handleException();
- } else if (child == 0) {
- int inFd;
- int outFd;
- int errFd;
- int result = -1;
-
- buf[0] = '\0';
- close(pipefd[0]);
-
- inFd = open("/dev/null", O_RDONLY | O_CLOEXEC);
- if (inFd < 0) {
- snprintf(buf, sizeof(buf), GATOR_ERROR "open of /dev/null failed");
- goto fail_exit;
- }
- outFd = open("gatord.out", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
- if (outFd < 0) {
- snprintf(buf, sizeof(buf), GATOR_ERROR "open of gatord.out failed");
- goto fail_exit;
- }
- errFd = open("gatord.err", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
- if (errFd < 0) {
- snprintf(buf, sizeof(buf), GATOR_ERROR "open of gatord.err failed");
- goto fail_exit;
- }
- if (dup2(inFd, STDIN_FILENO) < 0) {
- snprintf(buf, sizeof(buf), GATOR_ERROR "dup2 for stdin failed");
- goto fail_exit;
- }
- fflush(stdout);
- if (dup2(outFd, STDOUT_FILENO) < 0) {
- snprintf(buf, sizeof(buf), GATOR_ERROR "dup2 for stdout failed");
- goto fail_exit;
- }
- fflush(stderr);
- if (dup2(errFd, STDERR_FILENO) < 0) {
- snprintf(buf, sizeof(buf), GATOR_ERROR "dup2 for stderr failed");
- goto fail_exit;
- }
-
- snprintf(buf, sizeof(buf), GATOR_MSG "done");
- result = 0;
-
- fail_exit:
- if (buf[0] != '\0') {
- const ssize_t bytes = write(pipefd[1], buf, sizeof(buf));
- // Can't do anything if this fails
- (void)bytes;
- }
- close(pipefd[1]);
-
- if (result == 0) {
- // Continue to execute gator normally
- return;
- }
- exit(-1);
- }
-
- close(pipefd[1]);
- const ssize_t bytes = read(pipefd[0], buf, sizeof(buf));
- if (bytes > 0) {
- printf("%s\n", buf);
- }
- close(pipefd[0]);
-
- // Exit so parent shell can move on
- exit(0);
-}
diff --git a/tools/gator/daemon/Setup.h b/tools/gator/daemon/Setup.h
deleted file mode 100644
index 427e71788c36..000000000000
--- a/tools/gator/daemon/Setup.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Copyright (C) ARM Limited 2014-2015. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef SETUP_H
-#define SETUP_H
-
-// From include/generated/uapi/linux/version.h
-#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-bool getLinuxVersion(int version[3]);
-void update(const char *const gatorPath);
-
-#endif // SETUP_H
diff --git a/tools/gator/daemon/TtraceDriver.cpp b/tools/gator/daemon/TtraceDriver.cpp
new file mode 100644
index 000000000000..e1ce83313765
--- /dev/null
+++ b/tools/gator/daemon/TtraceDriver.cpp
@@ -0,0 +1,132 @@
+/**
+ * Copyright (C) ARM Limited 2014-2015. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "TtraceDriver.h"
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "Logging.h"
+#include "OlyUtility.h"
+#include "SessionData.h"
+
+class TtraceCounter : public DriverCounter {
+public:
+ TtraceCounter(DriverCounter *next, char *name, int flag);
+ ~TtraceCounter();
+
+ int getFlag() const { return mFlag; }
+
+private:
+ const int mFlag;
+
+ // Intentionally unimplemented
+ TtraceCounter(const TtraceCounter &);
+ TtraceCounter &operator=(const TtraceCounter &);
+};
+
+TtraceCounter::TtraceCounter(DriverCounter *next, char *name, int flag) : DriverCounter(next, name), mFlag(flag) {
+}
+
+TtraceCounter::~TtraceCounter() {
+}
+
+TtraceDriver::TtraceDriver() : mSupported(false) {
+}
+
+TtraceDriver::~TtraceDriver() {
+}
+
+void TtraceDriver::readEvents(mxml_node_t *const xml) {
+ if (access("/etc/tizen-release", R_OK) != 0) {
+ // Reduce warning noise
+ //logg.logSetup("Ttrace Disabled\n/etc/tizen-release is not found, this is not a Tizen target");
+ return;
+ }
+ if (!gSessionData.mFtraceDriver.isSupported()) {
+ logg.logSetup("Ttrace Disabled\nftrace support is required");
+ return;
+ }
+
+ mSupported = true;
+
+ mxml_node_t *node = xml;
+ while (true) {
+ node = mxmlFindElement(node, xml, "event", NULL, NULL, MXML_DESCEND);
+ if (node == NULL) {
+ break;
+ }
+ const char *counter = mxmlElementGetAttr(node, "counter");
+ if (counter == NULL) {
+ continue;
+ }
+
+ if (strncmp(counter, "ttrace_", 7) != 0) {
+ continue;
+ }
+
+ const char *flag = mxmlElementGetAttr(node, "flag");
+ if (flag == NULL) {
+ logg.logError("The ttrace counter %s is missing the required flag attribute", counter);
+ handleException();
+ }
+ setCounters(new TtraceCounter(getCounters(), strdup(counter), strtol(flag, NULL, 16)));
+ }
+}
+
+void TtraceDriver::setTtrace(const int flags) {
+ logg.logMessage("Setting ttrace flags to %i", flags);
+
+ const int fd = open("/tmp/ttrace_tag", O_CREAT | O_RDWR | O_CLOEXEC, 0666);
+ if (fd < 0) {
+ logg.logError("Unable to open /tmp/ttrace_tag");
+ handleException();
+ }
+ if (ftruncate(fd, sizeof(uint64_t)) != 0) {
+ logg.logError("ftruncate failed");
+ handleException();
+ }
+
+ uint64_t *const buf = (uint64_t *)mmap(NULL, sizeof(uint64_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (buf == MAP_FAILED) {
+ logg.logError("mmap failed");
+ handleException();
+ }
+ close(fd);
+
+ *buf = flags;
+
+ munmap(buf, sizeof(uint64_t));
+}
+
+void TtraceDriver::start() {
+ if (!mSupported) {
+ return;
+ }
+
+ int flags = 0;
+ for (TtraceCounter *counter = static_cast<TtraceCounter *>(getCounters()); counter != NULL; counter = static_cast<TtraceCounter *>(counter->getNext())) {
+ if (!counter->isEnabled()) {
+ continue;
+ }
+ flags |= counter->getFlag();
+ }
+
+ setTtrace(flags);
+}
+
+void TtraceDriver::stop() {
+ if (!mSupported) {
+ return;
+ }
+
+ setTtrace(0);
+}
diff --git a/tools/gator/daemon/TtraceDriver.h b/tools/gator/daemon/TtraceDriver.h
new file mode 100644
index 000000000000..86a0630f14c4
--- /dev/null
+++ b/tools/gator/daemon/TtraceDriver.h
@@ -0,0 +1,38 @@
+/**
+ * Copyright (C) ARM Limited 2015. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef TTRACEDRIVER_H
+#define TTRACEDRIVER_H
+
+#include "mxml/mxml.h"
+
+#include "Driver.h"
+
+class TtraceDriver : public SimpleDriver {
+public:
+ TtraceDriver();
+ ~TtraceDriver();
+
+ void readEvents(mxml_node_t *const xml);
+
+ void start();
+ void stop();
+
+ bool isSupported() const { return mSupported; }
+
+private:
+ void setTtrace(const int flags);
+
+ bool mSupported;
+
+ // Intentionally unimplemented
+ TtraceDriver(const TtraceDriver &);
+ TtraceDriver &operator=(const TtraceDriver &);
+};
+
+#endif // TTRACEDRIVER_H
diff --git a/tools/gator/daemon/defaults.xml b/tools/gator/daemon/defaults.xml
index 06f307d4d4ff..5d0d62005e0b 100644
--- a/tools/gator/daemon/defaults.xml
+++ b/tools/gator/daemon/defaults.xml
@@ -34,6 +34,11 @@
<configuration counter="ARMv7_Cortex_A17_cnt1" event="0x16"/>
<configuration counter="ARMv7_Cortex_A17_cnt2" event="0x10"/>
<configuration counter="ARMv7_Cortex_A17_cnt3" event="0x19"/>
+ <configuration counter="ARMv8_Cortex_A35_ccnt" event="0x11"/>
+ <configuration counter="ARMv8_Cortex_A35_cnt0" event="0x8"/>
+ <configuration counter="ARMv8_Cortex_A35_cnt1" event="0x16"/>
+ <configuration counter="ARMv8_Cortex_A35_cnt2" event="0x10"/>
+ <configuration counter="ARMv8_Cortex_A35_cnt3" event="0x19"/>
<configuration counter="ARMv8_Cortex_A53_ccnt" event="0x11"/>
<configuration counter="ARMv8_Cortex_A53_cnt0" event="0x8"/>
<configuration counter="ARMv8_Cortex_A53_cnt1" event="0x16"/>
diff --git a/tools/gator/daemon/events-Cortex-A35.xml b/tools/gator/daemon/events-Cortex-A35.xml
new file mode 100644
index 000000000000..dc4fad96aac0
--- /dev/null
+++ b/tools/gator/daemon/events-Cortex-A35.xml
@@ -0,0 +1,68 @@
+ <counter_set name="ARMv8_Cortex_A35_cnt" count="6"/>
+ <category name="Cortex-A35" counter_set="ARMv8_Cortex_A35_cnt" per_cpu="yes" supports_event_based_sampling="yes">
+ <event counter="ARMv8_Cortex_A35_ccnt" event="0x11" title="Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" average_cores="yes" description="The number of core clock cycles"/>
+ <event event="0x00" title="Software" name="Increment" description="Software increment. The register is incremented only on writes to the Software Increment Register."/>
+ <event event="0x01" title="Cache" name="Instruction refill" description="L1 Instruction cache refill"/>
+ <event event="0x02" title="Cache" name="Inst TLB refill" description="L1 Instruction TLB refill"/>
+ <event event="0x03" title="Cache" name="Data refill" description="L1 Data cache refill"/>
+ <event event="0x04" title="Cache" name="Data access" description="L1 Data cache access"/>
+ <event event="0x05" title="Cache" name="Data TLB refill" description="L1 Data TLB refill"/>
+ <event event="0x06" title="Instruction" name="Data Read" description="Instruction that is architecturally executed, condition check pass - load"/>
+ <event event="0x07" title="Instruction" name="Memory write" description="Instruction that is architecturally executed, condition check pass - store"/>
+ <event event="0x08" title="Instruction" name="Executed" description="Instruction that is architecturally executed"/>
+ <event event="0x09" title="Exception" name="Taken" description="Exception taken"/>
+ <event event="0x0a" title="Exception" name="Return" description="Exception return"/>
+ <event event="0x0b" title="Instruction" name="CONTEXTIDR" description="Change to Context ID retired"/>
+ <event event="0x0c" title="Branch" name="PC change" description="Instruction that is architecturally executed, condition check pass, software change of the PC"/>
+ <event event="0x0d" title="Branch" name="Immediate" description="Instruction that is architecturally executed, immediate branch"/>
+ <event event="0x0e" title="Procedure" name="Return" description="Instruction that is architecturally executed, condition code check pass, procedure return"/>
+ <event event="0x0f" title="Memory" name="Unaligned access" description="Instruction that is architecturally executed, condition check pass, unaligned load or store"/>
+ <event event="0x10" title="Branch" name="Mispredicted" description="Mispredicted or not predicted branch that is speculatively executed"/>
+ <event event="0x12" title="Branch" name="Potential prediction" description="Predictable branch that is speculatively executed"/>
+ <event event="0x13" title="Memory" name="Memory access" description="Data memory access"/>
+ <event event="0x14" title="Cache" name="L1 inst access" description="L1 Instruction cache access"/>
+ <event event="0x15" title="Cache" name="L1 data write" description="L1 Data cache writeback"/>
+ <event event="0x16" title="Cache" name="L2 data access" description="L2 Data cache access"/>
+ <event event="0x17" title="Cache" name="L2 data refill" description="L2 Data cache refill"/>
+ <event event="0x18" title="Cache" name="L2 data write" description="L2 Data cache write-back"/>
+ <event event="0x19" title="Bus" name="Access" description="Bus access"/>
+ <event event="0x1a" title="Memory" name="Error" description="Local memory error"/>
+ <event event="0x1b" title="Instruction" name="Speculative" description="Operation speculatively executed"/>
+ <event event="0x1d" title="Bus" name="Cycle" description="Bus cycle"/>
+ <event event="0x1e" title="Counter chain" name="Odd Performance" description="Odd performance counter chain mode"/>
+ <event event="0x60" title="Bus" name="Read" description="Bus access - Read"/>
+ <event event="0x61" title="Bus" name="Write" description="Bus access - Write"/>
+ <event event="0x73" title="Instruction" name="Integer" description="Operation speculatively executed, integer dataprocessing"/>
+ <event event="0x74" title="Instruction" name="Advanced SIMD" description="Operation speculatively executed, Advanced SIMD instruction"/>
+ <event event="0x75" title="Instruction" name="VFP" description="Operation speculatively executed, floating-point instruction"/>
+ <event event="0x77" title="Instruction" name="Crypto" description="Operation speculatively executed, Cryptographic instruction"/>
+ <event event="0x7a" title="Branch" name="Indirect" description="Branch that is speculatively executed - Indirect branch"/>
+ <event event="0x86" title="Interrupts" name="IRQ" description="Exception taken, IRQ"/>
+ <event event="0x87" title="Interrupts" name="FIQ" description="Exception taken, FIQ"/>
+ <event event="0xc0" title="Memory" name="External request" description="External memory request"/>
+ <event event="0xc1" title="Memory" name="Non-cacheable ext req" description="Non-cacheable external memory request"/>
+ <event event="0xc2" title="Cache" name="Linefill" description="Linefill because of prefetch"/>
+ <event event="0xc4" title="Cache" name="Allocate mode enter" description="Entering read allocate mode"/>
+ <event event="0xc5" title="Cache" name="Allocate mode" description="Read allocate mode"/>
+ <event event="0xc6" title="Pre-decode" name="error" description="Pre-decode error"/>
+ <event event="0xc7" title="Memory" name="Write stall" description="Data Write operation that stalls the pipeline because the store buffer is full"/>
+ <event event="0xc8" title="Memory" name="Snoop" description="SCU Snooped data from another core for this core"/>
+ <event event="0xc9" title="Branch" name="Taken" description="Conditional branch that is executed"/>
+ <!--
+ <event event="0xca" title="Branch" name="Mispredicted a" description="Indirect branch that is mispredicted"/>
+ <event event="0xcb" title="Branch" name="Mispredicted b" description="Indirect branch that is mispredicted because of address miscompare"/>
+ <event event="0xcc" title="Branch" name="Mispredicted c" description="Conditional branch that is mispredicted"/>
+ -->
+ <event event="0xd0" title="Cache" name="L1 inst error" description="L1 Instruction Cache (data or tag) memory error"/>
+ <event event="0xd1" title="Cache" name="L1 data error" description="L1 Data Cache (data, tag, or dirty) memory error, correctable or non-correctable"/>
+ <event event="0xd2" title="Cache" name="TLB error" description="TLB memory error"/>
+ <event event="0xe0" title="Stall" name="DPU IP empty" description="Attributable Performance Impact Event. Counts every cycle that the DPU IQ is empty and that is not because of a recent micro-TLB miss, an instruction cache miss or a pre-decode error."/>
+ <event event="0xe1" title="Stall" name="Cache miss" description="Attributable Performance Impact Event. Counts every cycle the DPU IQ is empty and there is an instruction cache miss being processed."/>
+ <event event="0xe2" title="Stall" name="TLB miss" description="Attributable Performance Impact Event. Counts every cycle the DPU IQ is empty and there is an instruction micro-TLB miss being processed."/>
+ <event event="0xe3" title="Stall" name="Pre-decode error" description="Attributable Performance Impact Event. Counts every cycle the DPU IQ is empty and there is a pre-decode error being processed."/>
+ <event event="0xe4" title="Stall" name="Interlock other" description="Attributable Performance Impact Event. Counts every cycle there is an interlock that is not because of an Advanced SIMD or floating-point instruction, and not because of a load/store instruction waiting for data to calculate the address in the AGU. Stall cycles because of a stall in Wr, typically awaiting load data, are excluded."/>
+ <event event="0xe5" title="Stall" name="Interlock address" description="Attributable Performance Impact Event. Counts every cycle there is an interlock that is because of a load/store instruction waiting for data to calculate the address in the AGU. Stall cycles because of a stall in Wr, typically awaiting load data, are excluded."/>
+ <event event="0xe6" title="Stall" name="Interlock SIMD/FPU" description="Attributable Performance Impact Event. Counts every cycle there is an interlock that is because of an Advanced SIMD or floating-point instruction. Stall cycles because of a stall in the Wr stage, typically awaiting load data, are excluded."/>
+ <event event="0xe7" title="Stall" name="Load miss" description="Attributable Performance Impact Event Counts every cycle there is a stall in the Wr stage because of a load miss"/>
+ <event event="0xe8" title="Stall" name="Store" description="Attributable Performance Impact Event. Counts every cycle there is a stall in the Wr stage because of a store."/>
+ </category>
diff --git a/tools/gator/daemon/events-Mali-Midgard_hw.xml b/tools/gator/daemon/events-Mali-Midgard_hw.xml
index 802db8b68a29..fc4e7461bc96 100644
--- a/tools/gator/daemon/events-Mali-Midgard_hw.xml
+++ b/tools/gator/daemon/events-Mali-Midgard_hw.xml
@@ -85,10 +85,10 @@
<event counter="ARM_Mali-Midgard_LSC_SNOOPS" title="Mali Load/Store Cache Bus" name="Snoops in to LSC" description="Number of coherent memory snoops in to the Load/Store cache"/>
</category>
<category name="Mali-Midgard L2 and MMU" per_cpu="no">
- <event counter="ARM_Mali-Midgard_L2_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-Midgard_L2_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-Midgard_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
- <event counter="ARM_Mali-Midgard_L2_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-Midgard_L2_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-Midgard_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-Midgard_L2_READ_SNOOP" title="Mali L2 Cache Reads" name="Read snoops" description="Number of read transaction snoops"/>
diff --git a/tools/gator/daemon/events-Mali-T60x_hw.xml b/tools/gator/daemon/events-Mali-T60x_hw.xml
index fc3f56289598..abd8ec1668ac 100644
--- a/tools/gator/daemon/events-Mali-T60x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T60x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T60x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T60x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T60x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T60x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T60x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="256"/>
<event counter="ARM_Mali-T60x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T60x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -48,7 +48,7 @@
<event counter="ARM_Mali-T60x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T60x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T60x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T60x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T60x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="256"/>
<event counter="ARM_Mali-T60x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T60x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of instructions completed by the the A-pipe (normalized per pipeline)"/>
<event counter="ARM_Mali-T60x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -73,11 +73,11 @@
<event counter="ARM_Mali-T60x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T60x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T60x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T60x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T60x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T60x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T60x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T60x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T60x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T60x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T60x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T60x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T62x_hw.xml b/tools/gator/daemon/events-Mali-T62x_hw.xml
index a98a70b05e54..d2e34a9baa02 100644
--- a/tools/gator/daemon/events-Mali-T62x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T62x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T62x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T62x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T62x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T62x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T62x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="256"/>
<event counter="ARM_Mali-T62x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T62x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -49,7 +49,7 @@
<event counter="ARM_Mali-T62x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T62x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T62x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T62x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T62x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="256"/>
<event counter="ARM_Mali-T62x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T62x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of instructions completed by the the A-pipe (normalized per pipeline)"/>
<event counter="ARM_Mali-T62x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -74,11 +74,11 @@
<event counter="ARM_Mali-T62x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T62x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T62x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T62x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T62x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T62x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T62x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T62x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T62x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T62x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T62x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T62x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T72x_hw.xml b/tools/gator/daemon/events-Mali-T72x_hw.xml
index b66bfef5c44c..cb52c437c036 100644
--- a/tools/gator/daemon/events-Mali-T72x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T72x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T72x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T72x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T72x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T72x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T72x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="256"/>
<event counter="ARM_Mali-T72x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T72x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -40,7 +40,7 @@
<event counter="ARM_Mali-T72x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T72x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T72x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T72x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T72x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="256"/>
<event counter="ARM_Mali-T72x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T72x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of batched instructions executed by the A-pipe"/>
<event counter="ARM_Mali-T72x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -62,8 +62,8 @@
<event counter="ARM_Mali-T72x_L2_READ_HIT" title="Mali L2 Cache Reads" name="L2 read hits" description="Number of reads hitting in the L2 cache"/>
<event counter="ARM_Mali-T72x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T72x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
- <event counter="ARM_Mali-T72x_L2_EXT_READ_BEAT" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T72x_L2_EXT_READ_BEAT" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T72x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
- <event counter="ARM_Mali-T72x_L2_EXT_WRITE_BEAT" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T72x_L2_EXT_WRITE_BEAT" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T72x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T76x_hw.xml b/tools/gator/daemon/events-Mali-T76x_hw.xml
index 9a1bd8dbc1c3..d88af17ec88b 100644
--- a/tools/gator/daemon/events-Mali-T76x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T76x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T76x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T76x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T76x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T76x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T76x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="1024"/>
<event counter="ARM_Mali-T76x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T76x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -49,7 +49,7 @@
<event counter="ARM_Mali-T76x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T76x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T76x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T76x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T76x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="1024"/>
<event counter="ARM_Mali-T76x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T76x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of instructions completed by the the A-pipe (normalized per pipeline)"/>
<event counter="ARM_Mali-T76x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -74,11 +74,11 @@
<event counter="ARM_Mali-T76x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T76x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T76x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T76x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T76x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T76x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T76x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T76x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T76x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T76x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T76x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T76x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T82x_hw.xml b/tools/gator/daemon/events-Mali-T82x_hw.xml
index 4aa35627638a..b637f3f09e80 100644
--- a/tools/gator/daemon/events-Mali-T82x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T82x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T82x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T82x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T82x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T82x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T82x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="1024"/>
<event counter="ARM_Mali-T82x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T82x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -41,7 +41,7 @@
<event counter="ARM_Mali-T82x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T82x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T82x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T82x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T82x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="1024"/>
<event counter="ARM_Mali-T82x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T82x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of batched instructions executed by the A-pipe (normalized per pipe)"/>
<event counter="ARM_Mali-T82x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -66,11 +66,11 @@
<event counter="ARM_Mali-T82x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T82x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T82x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T82x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T82x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T82x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T82x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T82x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T82x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T82x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T82x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T82x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T83x_hw.xml b/tools/gator/daemon/events-Mali-T83x_hw.xml
index a71eb03d6bd0..70c30a143628 100644
--- a/tools/gator/daemon/events-Mali-T83x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T83x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T83x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T83x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T83x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T83x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T83x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="1024"/>
<event counter="ARM_Mali-T83x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T83x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -41,7 +41,7 @@
<event counter="ARM_Mali-T83x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T83x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T83x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T83x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T83x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="1024"/>
<event counter="ARM_Mali-T83x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T83x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of batched instructions executed by the A-pipe (normalized per pipe)"/>
<event counter="ARM_Mali-T83x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -66,11 +66,11 @@
<event counter="ARM_Mali-T83x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T83x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T83x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T83x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T83x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T83x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T83x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T83x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T83x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T83x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T83x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T83x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T86x_hw.xml b/tools/gator/daemon/events-Mali-T86x_hw.xml
index 4f74051f5936..04b5734ab630 100644
--- a/tools/gator/daemon/events-Mali-T86x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T86x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T86x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T86x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T86x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T86x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T86x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="1024"/>
<event counter="ARM_Mali-T86x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T86x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -49,7 +49,7 @@
<event counter="ARM_Mali-T86x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T86x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T86x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T86x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T86x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="1024"/>
<event counter="ARM_Mali-T86x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T86x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of instructions completed by the the A-pipe (normalized per pipeline)"/>
<event counter="ARM_Mali-T86x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -74,11 +74,11 @@
<event counter="ARM_Mali-T86x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T86x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T86x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T86x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T86x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T86x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T86x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T86x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T86x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T86x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T86x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T86x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-Mali-T88x_hw.xml b/tools/gator/daemon/events-Mali-T88x_hw.xml
index a9173f2b780e..f83ca0636634 100644
--- a/tools/gator/daemon/events-Mali-T88x_hw.xml
+++ b/tools/gator/daemon/events-Mali-T88x_hw.xml
@@ -7,7 +7,7 @@
<event counter="ARM_Mali-T88x_JS0_JOBS" title="Mali Job Manager Jobs" name="JS0 jobs" description="Number of Jobs (fragment) completed in JS0"/>
<event counter="ARM_Mali-T88x_JS1_JOBS" title="Mali Job Manager Jobs" name="JS1 jobs" description="Number of Jobs (vertex/tiler/compute) completed in JS1"/>
<event counter="ARM_Mali-T88x_JS2_JOBS" title="Mali Job Manager Jobs" name="JS2 jobs" description="Number of Jobs (vertex/compute) completed in JS2"/>
- <event counter="ARM_Mali-T88x_JS0_TASKS" title="Mali Job Manager Tasks" name="JS0 tasks" description="Number of Tasks completed in JS0"/>
+ <event counter="ARM_Mali-T88x_JS0_TASKS" title="Mali Job Manager" name="Pixels" description="Number of Pixels completed in JS0" multiplier="1024"/>
<event counter="ARM_Mali-T88x_JS1_TASKS" title="Mali Job Manager Tasks" name="JS1 tasks" description="Number of Tasks completed in JS1"/>
<event counter="ARM_Mali-T88x_JS2_TASKS" title="Mali Job Manager Tasks" name="JS2 tasks" description="Number of Tasks completed in JS2"/>
</category>
@@ -49,7 +49,7 @@
<event counter="ARM_Mali-T88x_FRAG_QUADS_RAST" title="Mali Fragment Quads" name="Quads rasterized" description="Number of quads rasterized"/>
<event counter="ARM_Mali-T88x_FRAG_QUADS_EZS_TEST" title="Mali Fragment Quads" name="Quads doing early ZS" description="Number of quads doing early ZS test"/>
<event counter="ARM_Mali-T88x_FRAG_QUADS_EZS_KILLED" title="Mali Fragment Quads" name="Quads killed early Z" description="Number of quads killed by early ZS test"/>
- <event counter="ARM_Mali-T88x_FRAG_NUM_TILES" title="Mali Fragment Tasks" name="Tiles rendered" description="Number of tiles rendered"/>
+ <event counter="ARM_Mali-T88x_FRAG_NUM_TILES" title="Mali Fragment" name="Pixels" description="Number of pixels rendered" multiplier="1024"/>
<event counter="ARM_Mali-T88x_FRAG_TRANS_ELIM" title="Mali Fragment Tasks" name="Tile writes killed by TE" description="Number of tile writes skipped by transaction elimination"/>
<event counter="ARM_Mali-T88x_ARITH_WORDS" title="Mali Arithmetic Pipe" name="A instructions" description="Number of instructions completed by the the A-pipe (normalized per pipeline)"/>
<event counter="ARM_Mali-T88x_LS_WORDS" title="Mali Load/Store Pipe" name="LS instructions" description="Number of instructions completed by the LS-pipe"/>
@@ -74,11 +74,11 @@
<event counter="ARM_Mali-T88x_L2_WRITE_SNOOP" title="Mali L2 Cache Writes" name="Write snoops" description="Number of write transaction snoops"/>
<event counter="ARM_Mali-T88x_L2_WRITE_HIT" title="Mali L2 Cache Writes" name="L2 write hits" description="Number of writes hitting in the L2 cache"/>
<event counter="ARM_Mali-T88x_L2_WRITE_LOOKUP" title="Mali L2 Cache Writes" name="L2 write lookups" description="Number of writes into the L2 cache"/>
- <event counter="ARM_Mali-T88x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read beats" description="Number of external bus read beats"/>
+ <event counter="ARM_Mali-T88x_L2_EXT_READ_BEATS" title="Mali L2 Cache Ext Reads" name="External read bytes" description="Number of external bus read bytes" multiplier="16"/>
<event counter="ARM_Mali-T88x_L2_EXT_AR_STALL" title="Mali L2 Cache Ext Reads" name="External bus stalls (AR)" description="Number of cycles a valid read address (AR) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T88x_L2_EXT_R_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus response buffer full" description="Number of cycles a valid request is blocked by a full response buffer"/>
<event counter="ARM_Mali-T88x_L2_EXT_RD_BUF_FULL" title="Mali L2 Cache Ext Reads" name="External bus read data buffer full" description="Number of cycles a valid request is blocked by a full read data buffer"/>
- <event counter="ARM_Mali-T88x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write beats" description="Number of external bus write beats"/>
+ <event counter="ARM_Mali-T88x_L2_EXT_WRITE_BEATS" title="Mali L2 Cache Ext Writes" name="External write bytes" description="Number of external bus write bytes" multiplier="16"/>
<event counter="ARM_Mali-T88x_L2_EXT_W_STALL" title="Mali L2 Cache Ext Writes" name="External bus stalls (W)" description="Number of cycles a valid write data (W channel) is stalled by the external interconnect"/>
<event counter="ARM_Mali-T88x_L2_EXT_W_BUF_FULL" title="Mali L2 Cache Ext Writes" name="External bus write buffer full" description="Number of cycles a valid request is blocked by a full write buffer"/>
</category>
diff --git a/tools/gator/daemon/events-ttrace.xml b/tools/gator/daemon/events-ttrace.xml
new file mode 100644
index 000000000000..229c1b576ed4
--- /dev/null
+++ b/tools/gator/daemon/events-ttrace.xml
@@ -0,0 +1,17 @@
+ <category name="Ttrace">
+ <event counter="ttrace_graphics" flag="0x2" title="Ttrace" name="Graphics" description="Graphics"/>
+ <event counter="ttrace_input" flag="0x4" title="Ttrace" name="Input" description="Input"/>
+ <event counter="ttrace_view" flag="0x8" title="Ttrace" name="View" description="View"/>
+ <event counter="ttrace_web" flag="0x10" title="Ttrace" name="Web" description="Web"/>
+ <event counter="ttrace_window_manager" flag="0x20" title="Ttrace" name="Window Manager" description="Window Manager"/>
+ <event counter="ttrace_application_manager" flag="0x40" title="Ttrace" name="Application Manager" description="Application Manager"/>
+ <event counter="ttrace_image" flag="0x80" title="Ttrace" name="Image" description="Image"/>
+ <event counter="ttrace_audio" flag="0x100" title="Ttrace" name="Audio" description="Audio"/>
+ <event counter="ttrace_video" flag="0x200" title="Ttrace" name="Video" description="Video"/>
+ <event counter="ttrace_camera" flag="0x400" title="Ttrace" name="Camera" description="Camera"/>
+ <event counter="ttrace_hal" flag="0x800" title="Ttrace" name="Hal" description="Hal"/>
+ <event counter="ttrace_media_content" flag="0x1000" title="Ttrace" name="Media Content" description="Media Content"/>
+ <event counter="ttrace_media_db" flag="0x2000" title="Ttrace" name="Media DB" description="Media DB"/>
+ <event counter="ttrace_screen_mirroring" flag="0x4000" title="Ttrace" name="Screen Mirroring" description="Screen Mirroring"/>
+ <event counter="ttrace_app" flag="0x8000" title="Ttrace" name="App" description="App"/>
+ </category>
diff --git a/tools/gator/daemon/main.cpp b/tools/gator/daemon/main.cpp
index e9223b9a0163..211066fcb10d 100644
--- a/tools/gator/daemon/main.cpp
+++ b/tools/gator/daemon/main.cpp
@@ -16,6 +16,7 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
+#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -29,7 +30,6 @@
#include "OlyUtility.h"
#include "PmuXML.h"
#include "SessionData.h"
-#include "Setup.h"
extern Child* child;
static int shutdownFilesystem();
@@ -44,7 +44,6 @@ struct cmdline_t {
char *module;
char *pmuPath;
int port;
- bool update;
};
#define DEFAULT_PORT 8080
@@ -57,6 +56,7 @@ void cleanUp() {
}
// CTRL C Signal Handler
+__attribute__((noreturn))
static void handler(int signum) {
logg.logMessage("Received signal %d, gator daemon exiting", signum);
@@ -324,7 +324,7 @@ static int shutdownFilesystem() {
return 0; // success
}
-static const char OPTSTRING[] = "hvVudap:s:c:e:E:P:m:o:";
+static const char OPTSTRING[] = "hvVdap:s:c:e:E:P:m:o:";
static bool hasDebugFlag(int argc, char** argv) {
int c;
@@ -344,16 +344,22 @@ static struct cmdline_t parseCommandLine(int argc, char** argv) {
struct cmdline_t cmdline;
memset(&cmdline, 0, sizeof(cmdline));
cmdline.port = DEFAULT_PORT;
- cmdline.update = false;
char version_string[256]; // arbitrary length to hold the version information
int c;
// build the version string
if (PROTOCOL_VERSION < PROTOCOL_DEV) {
- snprintf(version_string, sizeof(version_string), "Streamline gatord version %d (DS-5 v5.%d)", PROTOCOL_VERSION, PROTOCOL_VERSION);
+ const int majorVersion = PROTOCOL_VERSION/10;
+ const int minorVersion = PROTOCOL_VERSION%10;
+ if (minorVersion == 0) {
+ snprintf(version_string, sizeof(version_string), "Streamline gatord version %d (DS-5 v5.%d)", PROTOCOL_VERSION, majorVersion);
+ } else {
+ snprintf(version_string, sizeof(version_string), "Streamline gatord version %d (DS-5 v5.%d.%d)", PROTOCOL_VERSION, majorVersion, minorVersion);
+ }
} else {
snprintf(version_string, sizeof(version_string), "Streamline gatord development version %d", PROTOCOL_VERSION);
}
+ logg.logMessage("%s", version_string);
optind = 1;
opterr = 1;
@@ -390,9 +396,6 @@ static struct cmdline_t parseCommandLine(int argc, char** argv) {
case 'o':
gSessionData.mTargetPath = optarg;
break;
- case 'u':
- cmdline.update = true;
- break;
case 'a':
gSessionData.mAllowCommands = true;
break;
@@ -510,15 +513,26 @@ int main(int argc, char** argv) {
logg.logMessage("setpriority() failed");
}
+ // Try to increase the maximum number of file descriptors
+ {
+ struct rlimit rlim;
+ memset(&rlim, 0, sizeof(rlim));
+ if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) {
+ logg.logMessage("Unable to get the maximum number of files");
+ // Not good, but not a fatal error either
+ } else {
+ rlim.rlim_cur = max(((rlim_t)1)<<15, rlim.rlim_cur);
+ rlim.rlim_max = max(rlim.rlim_cur, rlim.rlim_max);
+ if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) {
+ logg.logMessage("Unable to increase the maximum number of files");
+ // Not good, but not a fatal error either
+ }
+ }
+ }
+
// Parse the command line parameters
struct cmdline_t cmdline = parseCommandLine(argc, argv);
- if (cmdline.update) {
- update(argv[0]);
- cmdline.update = false;
- gSessionData.mAllowCommands = true;
- }
-
// Verify root permissions
uid_t euid = geteuid();
if (euid) {
diff --git a/tools/gator/daemon/mxml/config.h b/tools/gator/daemon/mxml/config.h
index ad6df1d7debe..443ca6ab6f90 100644
--- a/tools/gator/daemon/mxml/config.h
+++ b/tools/gator/daemon/mxml/config.h
@@ -30,7 +30,7 @@
* Version number...
*/
-#define MXML_VERSION "Mini-XML v2.8"
+#define MXML_VERSION "Mini-XML v2.9"
/*
diff --git a/tools/gator/daemon/mxml/mxml-file.c b/tools/gator/daemon/mxml/mxml-file.c
index 3812c253fc3e..fa540edf20cd 100644
--- a/tools/gator/daemon/mxml/mxml-file.c
+++ b/tools/gator/daemon/mxml/mxml-file.c
@@ -1,5 +1,5 @@
/*
- * "$Id: mxml-file.c 455 2014-01-05 03:28:03Z msweet $"
+ * "$Id: mxml-file.c 459 2014-10-19 17:21:48Z msweet $"
*
* File loading code for Mini-XML, a small XML-like file parsing library.
*
@@ -1801,6 +1801,8 @@ mxml_load_data(
if (cb)
type = (*cb)(parent);
+ else
+ type = MXML_TEXT;
}
}
}
@@ -1887,6 +1889,8 @@ mxml_load_data(
if (cb)
type = (*cb)(parent);
+ else
+ type = MXML_TEXT;
}
}
}
@@ -3052,5 +3056,5 @@ mxml_write_ws(mxml_node_t *node, /* I - Current node */
/*
- * End of "$Id: mxml-file.c 455 2014-01-05 03:28:03Z msweet $".
+ * End of "$Id: mxml-file.c 459 2014-10-19 17:21:48Z msweet $".
*/
diff --git a/tools/gator/daemon/pmus.xml b/tools/gator/daemon/pmus.xml
index a6198dfbe24b..77dc9071f192 100644
--- a/tools/gator/daemon/pmus.xml
+++ b/tools/gator/daemon/pmus.xml
@@ -25,6 +25,7 @@
<pmu pmnc_name="Krait" cpuid="0x51049" core_name="KraitSIM" pmnc_counters="4"/>
<pmu pmnc_name="Krait" cpuid="0x5104d" core_name="Krait" pmnc_counters="4"/>
<pmu pmnc_name="Krait" cpuid="0x5106f" core_name="Krait S4 Pro" pmnc_counters="4"/>
+ <pmu pmnc_name="ARMv8_Cortex_A35" cpuid="0x41d04" core_name="Cortex-A35" dt_name="arm,cortex-a35" pmnc_counters="6"/>
<pmu pmnc_name="ARMv8_Cortex_A53" cpuid="0x41d03" core_name="Cortex-A53" dt_name="arm,cortex-a53" pmnc_counters="6"/>
<pmu pmnc_name="ARMv8_Cortex_A57" cpuid="0x41d07" core_name="Cortex-A57" dt_name="arm,cortex-a57" pmnc_counters="6"/>
<pmu pmnc_name="ARMv8_Cortex_A72" cpuid="0x41d08" core_name="Cortex-A72" dt_name="arm,cortex-a72" pmnc_counters="6"/>