Show noop transactions in viewer am: 89570faf2c

Original change: https://googleplex-android-review.googlesource.com/c/platform/development/+/23631337

Change-Id: Ic10c3ef0d7421fa9664d6d234310d57982b09ff0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Pablo Gamito
2023-06-09 14:18:31 +00:00
committed by Automerger Merge Worker
3 changed files with 39 additions and 3 deletions

View File

@@ -283,6 +283,26 @@ export class Presenter {
)
);
}
if (
transactionStateProto.layerChanges.length === 0 &&
transactionStateProto.displayChanges.length === 0
) {
entries.push(
new UiDataEntry(
originalIndex,
TimeUtils.format(entry.getTimestamp()),
Number(entryProto.vsyncId),
transactionStateProto.pid.toString(),
transactionStateProto.uid.toString(),
UiDataEntryType.NO_OP,
'',
transactionStateProto.transactionId.toString(),
'',
{}
)
);
}
}
for (const layerCreationArgsProto of entryProto.addedLayers) {

View File

@@ -32,7 +32,7 @@ describe('PresenterTransactions', () => {
let traces: Traces;
let presenter: Presenter;
let outputUiData: undefined | UiData;
const TOTAL_OUTPUT_ENTRIES = 1504;
const TOTAL_OUTPUT_ENTRIES = 1647;
beforeAll(async () => {
parser = await UnitTestUtils.getParser('traces/elapsed_and_real_timestamp/Transactions.pb');
@@ -75,10 +75,11 @@ describe('PresenterTransactions', () => {
'LAYER_CHANGED',
'LAYER_DESTROYED',
'LAYER_HANDLE_DESTROYED',
'NO_OP',
]);
expect(outputUiData?.allTransactionIds.length).toEqual(1152);
expect(outputUiData?.allLayerAndDisplayIds.length).toEqual(116);
expect(outputUiData?.allTransactionIds.length).toEqual(1295);
expect(outputUiData?.allLayerAndDisplayIds.length).toEqual(117);
expect(outputUiData?.entries.length).toEqual(TOTAL_OUTPUT_ENTRIES);
@@ -158,6 +159,7 @@ describe('PresenterTransactions', () => {
UiDataEntryType.LAYER_CHANGED,
UiDataEntryType.LAYER_DESTROYED,
UiDataEntryType.LAYER_HANDLE_DESTROYED,
UiDataEntryType.NO_OP,
])
);
@@ -189,6 +191,19 @@ describe('PresenterTransactions', () => {
);
});
it('includes no op transitions', () => {
presenter.onTypeFilterChanged([UiDataEntryType.NO_OP]);
expect(new Set(outputUiData!.entries.map((entry) => entry.type))).toEqual(
new Set([UiDataEntryType.NO_OP])
);
for (const entry of outputUiData!.entries) {
expect(entry.layerOrDisplayId).toEqual('');
expect(entry.what).toEqual('');
expect(entry.propertiesTree).toEqual({});
}
});
it('filters entries according to "what" search string', () => {
expect(outputUiData!.entries.length).toEqual(TOTAL_OUTPUT_ENTRIES);

View File

@@ -56,6 +56,7 @@ class UiDataEntryType {
static LAYER_DESTROYED = 'LAYER_DESTROYED';
static LAYER_CHANGED = 'LAYER_CHANGED';
static LAYER_HANDLE_DESTROYED = 'LAYER_HANDLE_DESTROYED';
static NO_OP = 'NO_OP';
}
export {UiData, UiDataEntry, UiDataEntryType};