Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c44fdafd authored by Kean Mariotti's avatar Kean Mariotti
Browse files

Traces with real-to-elapsed time offset

Add real_to_elapsed_time_offset_nanos field to protobuf traces:
- SF layers
- SF transactions

Bug: 235196806
Test: record and view SF + transaction traces with winscope
Change-Id: I5f4d2a2b4e2ceaacf75c43d01f866fe1e2b76532
parent 74c2e1f4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -89,6 +89,9 @@ LayersTraceFileProto LayerTracing::createTraceFileProto() const {
    LayersTraceFileProto fileProto;
    fileProto.set_magic_number(uint64_t(LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_H) << 32 |
                               LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_L);
    auto timeOffsetNs = static_cast<std::uint64_t>(systemTime(SYSTEM_TIME_REALTIME) -
                                                   systemTime(SYSTEM_TIME_MONOTONIC));
    fileProto.set_real_to_elapsed_time_offset_nanos(timeOffsetNs);
    return fileProto;
}

+3 −0
Original line number Diff line number Diff line
@@ -134,6 +134,9 @@ proto::TransactionTraceFile TransactionTracing::createTraceFileProto() const {
    proto::TransactionTraceFile proto;
    proto.set_magic_number(uint64_t(proto::TransactionTraceFile_MagicNumber_MAGIC_NUMBER_H) << 32 |
                           proto::TransactionTraceFile_MagicNumber_MAGIC_NUMBER_L);
    auto timeOffsetNs = static_cast<std::uint64_t>(systemTime(SYSTEM_TIME_REALTIME) -
                                                   systemTime(SYSTEM_TIME_MONOTONIC));
    proto.set_real_to_elapsed_time_offset_nanos(timeOffsetNs);
    return proto;
}

+4 −0
Original line number Diff line number Diff line
@@ -38,6 +38,10 @@ message LayersTraceFileProto {

    optional fixed64 magic_number = 1;  /* Must be the first field, set to value in MagicNumber */
    repeated LayersTraceProto entry = 2;

    /* offset between real-time clock and elapsed time clock in nanoseconds.
       Calculated as: systemTime(SYSTEM_TIME_REALTIME) - systemTime(SYSTEM_TIME_MONOTONIC) */
    optional fixed64 real_to_elapsed_time_offset_nanos = 3;
}

/* one layers trace entry. */
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,10 @@ message TransactionTraceFile {

    fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */
    repeated TransactionTraceEntry entry = 2;

    /* offset between real-time clock and elapsed time clock in nanoseconds.
       Calculated as: systemTime(SYSTEM_TIME_REALTIME) - systemTime(SYSTEM_TIME_MONOTONIC) */
    fixed64 real_to_elapsed_time_offset_nanos = 3;
}

message TransactionTraceEntry {