summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2017-07-04 11:27:52 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-05-02 14:05:33 +0000
commita156067e69c6066538286521effb6587144803f6 (patch)
tree7594446f96a0692acba77f36baa1dd5fcab08a90
parent4478ce2b6daf19bd1cb74d20bfe6b9dbf5df6c50 (diff)
Forward information on sampling frequency/period for events
This allows us to reconstruct the sample period for data files generated with the following command: perf record -c 100000 ... Without the explicit `-P` flag, the above data file has no periods for the samples. By forwarding the event attribute configuration, clients can reconstruct the data as needed. Change-Id: I098e1f14cc66e97daaceffb288080868693c2d95 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r--app/perfattributes.h2
-rw-r--r--app/perfunwind.cpp3
-rw-r--r--app/perfunwind.h3
3 files changed, 6 insertions, 2 deletions
diff --git a/app/perfattributes.h b/app/perfattributes.h
index 5d60852..85fd7ae 100644
--- a/app/perfattributes.h
+++ b/app/perfattributes.h
@@ -48,6 +48,8 @@ public:
quint32 type() const { return m_type; }
quint64 config() const { return m_config; }
int sampleIdOffset() const;
+ bool usesFrequency() const { return m_freq; };
+ quint64 frequenyOrPeriod() const { return m_sampleFreq; }
QByteArray name() const;
diff --git a/app/perfunwind.cpp b/app/perfunwind.cpp
index 90d3f8c..3eef7d8 100644
--- a/app/perfunwind.cpp
+++ b/app/perfunwind.cpp
@@ -260,7 +260,8 @@ void PerfUnwind::sendAttributes(qint32 id, const PerfEventAttributes &attributes
QByteArray buffer;
QDataStream(&buffer, QIODevice::WriteOnly) << static_cast<quint8>(AttributesDefinition)
<< id << attributes.type()
- << attributes.config() << attrNameId;
+ << attributes.config() << attrNameId
+ << attributes.usesFrequency() << attributes.frequenyOrPeriod();
sendBuffer(buffer);
}
diff --git a/app/perfunwind.h b/app/perfunwind.h
index 4779544..304534d 100644
--- a/app/perfunwind.h
+++ b/app/perfunwind.h
@@ -50,7 +50,7 @@ public:
Command,
LocationDefinition,
SymbolDefinition,
- AttributesDefinition,
+ AttributesDefinition49,
StringDefinition,
LostDefinition,
FeaturesDefinition,
@@ -59,6 +59,7 @@ public:
Progress,
TracePointFormat,
TracePointSample,
+ AttributesDefinition,
InvalidType
};