Commit Graph

3051 Commits

Author SHA1 Message Date
Christian Oder
1ee526c938 privapp_permissions: Check product privapp_permissions
* permission whitelists need to get placed on the same partition as the apps themselves
* check product and system individually and generate XMLs accordingly

Test: Verify missing entries for system and product get generated on hotdog
Test: Verify missing entries for system and system/product get generated on taimen and maple
Change-Id: I37bd5c7b738caaab93019688c6a944dc6bbffa75
2020-02-25 22:48:25 +01:00
Vishnu Nair
c49c2698ec [DO NOT MERGE] Add aosp config for winscope
- config redirects searches to stub folder for unavailable traces

Bug: 148409169
Test: builds and opens traces in AOSP
Change-Id: I5775d732de64c2e66ed35a04bf868f2aee883add
2020-01-27 15:12:29 -08:00
Vishnu Nair
92dccb506d Create stub proto definitions for traces that are not available in AOSP
Also add a readme for winscope development.

Bug: 148409169
Test: builds and opens traces in AOSP

Change-Id: I2767301734bcd90410e0f97bc3da22a647bf195c
2020-01-27 15:12:27 -08:00
chaviw
0fa0953237 Added visibility check for missing relativeOf
When the layer has the flag isRelativeOf but the relativeOf is -1, that
means the relativeOf layer has been removed. This would prevent the
layer from showing up on screen, but still be in memory. Added this
reason to list of reasons why layer wouldn't be visible.

Also added fix for BufferLayer check to instead check for BufferQueueLayer
and BufferStateLayer.

Test: winscope shows "RelativeOf layer has been removed"
Change-Id: Id1d59bd71a5aac7a011204ba345d694f67c28a29
Merged-In: Id1d59bd71a5aac7a011204ba345d694f67c28a29
2020-01-27 10:20:14 -08:00
chaviw
0d8808df5e Added format for ColorTransform matrix
ColorTransform is a 4x4 matrix so formated the values to be more
readable.

Also changed code where determines if the buffer is null to check if the
layer type is BufferStateLayer or BufferQueueLayer

Test: go/winscope with color transform
Change-Id: Ief46f2f3260e0736ffced8c233ab375e162d4228
Merged-In: Ief46f2f3260e0736ffced8c233ab375e162d4228
2020-01-27 10:20:05 -08:00
Adam Pardyl
819c345c1e Update Winscope with ProtoLog changes
Winscope side changes for ag/9225809 and ag/9447040.

Bug:
Test: yarn run dev
Change-Id: I2e34edd244996124fa894ee5ee5a57f554fe771e
Merged-In: I29db4770065ffc5bcced5d4cb17a51d2b9924f06
2020-01-27 10:19:57 -08:00
Adam Pardyl
2a94ec6dba Download trace files from Winscope
Added a download file button to DataView.

Bug:
Test: yarn run dev
Change-Id: I203f3f19168c43a0dbefb3ec00237c021380f89f
Merged-In: I203f3f19168c43a0dbefb3ec00237c021380f89f
2020-01-27 10:19:43 -08:00
Adam Pardyl
c5708b2f83 Support ProtoLog in Winscope
Added a new view for displaying logs, ProtoLog decoding and tracing
with ADB Connect.
Fixed a vertical scrolling bug.

Bug:
Test: yarn run dev
Change-Id: I756b596c10242ff919c0d7053813fa0b9f1f88fd
Merged-In: I756b596c10242ff919c0d7053813fa0b9f1f88fd
2020-01-27 10:19:32 -08:00
Adam Pardyl
7c3b2d568f Support WM & SF dumps with ADB Connect, minor fixes
Added support for capturing WindowManager and SurfaceFlinger dumps
directly from the browser.

Fixed DataFilter errors on non-transaction data files.
Fixed Timeline behaviour on empty data list.

Bug: 140374376
Test: yarn run dev & python3 adb_proxy/winscope_proxy.py
Change-Id: I0d47ec36e1e769b856365d2a36c91bfb1f831b71
Merged-In: I0d47ec36e1e769b856365d2a36c91bfb1f831b71
2020-01-27 10:19:23 -08:00
Adam Pardyl
f9e219ce1d Add transaction tracing support, fix device id regex.
Added support for recording SF transactions with ADB Connect,
Fixed device regex not matching emulated devices.

Bug:
Test: yarn run dev & python3 adb_proxy/winscope_proxy.py
Change-Id: I43b45b978841309d3f011df919df69ae7ebc905a
Merged-In: I43b45b978841309d3f011df919df69ae7ebc905a
2020-01-27 10:19:13 -08:00
Vishnu Nair
a1262475d3 Introduced filters to winscope for transaction files.
Test: Launch winscope and upload a transaction file. Verify that the
filter checklist at the top left corner will filter each of the eight
increment types.

Change-Id: I3e2506bdbe32dbcda59b6f263e2bc13e8403ae38
Merged-In: I3e2506bdbe32dbcda59b6f263e2bc13e8403ae38
2020-01-27 10:19:02 -08:00
Adam Pardyl
ab03a005c0 Fix variable name in DataAdb
A typo in a variable name caused the exception handling to fail.

Bug:
Test: yarn run dev
Change-Id: Id02495fe323bbb7f6ccbb973fbe6091a3d518523
Merged-In: Id02495fe323bbb7f6ccbb973fbe6091a3d518523
2020-01-27 10:18:51 -08:00
Adam Pardyl
cbe7c4e5ed Limit the height of Hierarchy and Properties views.
Bug:
Test: yarn run dev
Change-Id: I50d4c9ebe7c376cd7595ffddc092b8d3c760c629
Merged-In: I50d4c9ebe7c376cd7595ffddc092b8d3c760c629
2020-01-27 10:18:39 -08:00
Evan Rosky
e1f3d5d92b Add support for Wayland traces
This adds support for wayland traces, but it isn't complete.
Specifically the rects are ordered funny. However, it is enough
to help with debugging and can be improved over time.

Bug: 129502361
Test: Open a wayland trace and a wayland dump
Change-Id: Iee327f2fee2651ff492d56ee0b06935b5ed57de7
Merged-In: Iee327f2fee2651ff492d56ee0b06935b5ed57de7
2020-01-27 10:18:28 -08:00
Vishnu Nair
33009d144c Winscope: prefix layer id to surface flinger layer name
Also fixes exception on startup in App.vue

Test: open sf trace in winscope
Test: open winscope with debugger and check for exceptions

Change-Id: I2b0e1fad5f26258e7f2ca5c47f82ad11037a84d2
Merged-In: I2b0e1fad5f26258e7f2ca5c47f82ad11037a84d2
2020-01-27 10:18:19 -08:00
Robert Delgado
2c4be1fc8d Fixed bug when clearing file, winscope could not allow up/down arrows.
Test: run yarn dev. First launch a file on winscope, clear, then launch a
second, different file. Now, the up/down arrows will be able to function again.
Change-Id: I4140a1a8f8e1c4d9d2cef054456003aec5661412
Merged-In: I4140a1a8f8e1c4d9d2cef054456003aec5661412
2020-01-27 10:18:09 -08:00
Robert Delgado
a14866b210 Changed shell script for capturing traces.
Captures both transaction and surfaceflinger trace files.

Test: bash capture_transaction.sh then upload transactiontrace.pb and
layerstrace.pb files to the winscope server.

Change-Id: I4461afa4048a504a158e5837af7c75fbedafeb0f
Merged-In: I4461afa4048a504a158e5837af7c75fbedafeb0f
2020-01-27 10:17:59 -08:00
Adam Pardyl
8b38ea8f8d Implement Winscope ADB connect.
The objective of this feature is to simplify the process
of debugging window transition issues by implementing
an automated trace capture flow for the WindowManager
and SurfaceFlinger trace analysis tool - Winscope.
By creating a bridge between the browser-based Winscope
and locally running ADB server traces can be captured
with a single click.

Design doc: https://goto.google.com/winscope-adb-connect

Bug:
Test: yarn run dev & python3 adb_proxy/winscope_proxy.py
Change-Id: I13ee2274566de5e63c89a9e292708416b654fc65
Merged-In: I13ee2274566de5e63c89a9e292708416b654fc65
2020-01-27 10:17:49 -08:00
Robert Delgado
b6eb992807 Added transaction support for winscope.
Test: yarn run dev for a transaction file.
Change-Id: Icfc672e2ab8423da35602d6d3d2e174c53c0154a
Merged-In: Icfc672e2ab8423da35602d6d3d2e174c53c0154a
2020-01-27 10:17:39 -08:00
Adam Pardyl
10884cd134 Update vue-material, regenerate yarn.lock
Version update of vue-material is required by a future CL.

Bug:
Test: yarn run dev

Change-Id: I355720677530066f8bceeb4b36b3841186a67ac1
Merged-In: I355720677530066f8bceeb4b36b3841186a67ac1
2020-01-27 10:17:27 -08:00
Adam Pardyl
f33d616849 Refactor file decoding, implement video view
File decoding code has been refactored to support non-trace files.
Implemented displaying device screen recordings frame-by-frame,
synced to SurfaceFlinger and WindowManager traces.

Design doc: http://go/winscope-video-sync

Test: yarn run dev
Bug:
Change-Id: Ibaa4746a74ecab4ff158cb8bffb346e1f90f8306
Merged-In: Ibaa4746a74ecab4ff158cb8bffb346e1f90f8306
2020-01-27 10:17:15 -08:00
Robert Delgado
0258452674 Fixed visibility check in winscope.
Changed visibility reasoning to check for bufferTransform validity only
when activeBuffer is valid. Also separated reasoning for
transforms and bufferTransforms.

Test: yarn run dev then run a trace file.
Change-Id: I6ed2065c2f316019d9dde41a613b02c311c705e4
Merged-In: I6ed2065c2f316019d9dde41a613b02c311c705e4
2020-01-27 10:17:05 -08:00
Robert Delgado
92b922ac24 Added check for invalid transform.
Test: A transform whose matrix is not invertible.
Change-Id: I6b0b5b9a1c890c8a8694f17a4fbe52a2e875b51a
Merged-In: I6b0b5b9a1c890c8a8694f17a4fbe52a2e875b51a
2020-01-27 10:16:54 -08:00
Robert Delgado
37a206b10b Added reasons for invisibility of a layer.
Test: Create an SFTrace that opens an app, then closes. Then test the
wide variety of layers created by this file.

Change-Id: Idd198cc6507c67a03f38cf3e34d737d319295c16
Merged-In: Idd198cc6507c67a03f38cf3e34d737d319295c16
2020-01-27 10:16:43 -08:00
Adam Pardyl
d49db4cbfb Fix overlapping timeline indicator
The selected data point indicator on timeline was often hidden behind
other data points. This CL changes its behaviour to ensure it is always
visible.

Test: yarn run dev
Bug:
Change-Id: Ide13e97ac7ab54e20cc6213be2ccdadce3d567a7
Merged-In: Ide13e97ac7ab54e20cc6213be2ccdadce3d567a7
2020-01-27 10:16:31 -08:00
Adam Pardyl
813431292c Support multiple trace files.
This commit allows to view trace for both SurfaceFlinger and
WindowManager at the same time using one timeline.

Test: yarn run dev
Bug:
Change-Id: I11abcf8b6423a03ca9af63e56a7b992958d21175
Merged-In: I11abcf8b6423a03ca9af63e56a7b992958d21175
2020-01-27 10:16:29 -08:00
Robert Delgado
8bd2346edf Improved logic for error detection.
Test: Ran windump, winlayer, surfacedump, surfacelayer, and a txt file
on winscope's autodetect file upload feature.
Change-Id: Ia638bb4fbd9c5ad24ac7c84814205eaa8d429824
Merged-In: Ia638bb4fbd9c5ad24ac7c84814205eaa8d429824
2020-01-27 10:16:25 -08:00
Martin Stjernholm
c611ab31bf Merge "Support <include> directives in manifests."
am: ed31855802

Change-Id: I31034b5f65fa75bfbcd18f26464510e88e470b10
2019-08-29 14:26:17 -07:00
Martin Stjernholm
0c28099695 Support <include> directives in manifests.
Test: "development/tools/repo_pull/repo_pull.py pull ..." on a large topic
  from a manifest with includes.
Bug: 140113116
Change-Id: I781c9a3ca0bcdf53cc8ed1896b3ec12389e4e797
2019-08-27 18:45:46 +01:00
Vishnu Nair
b5568bfcc8 WinScope: Support missing layers
The new sf layer transform changes breaks when missing layers are added since they do not contain transform
data. Fix this is by adding a transform when creating missing layers.

Also set the transform type when populating transform matrices so they are displayed as IDENTITY.

Test: Open trace from bug
Fixes: 130886882
Merged-In: I85f52bd3dc9174499c4a4840c6b5e80555f28fc7
Change-Id: I85f52bd3dc9174499c4a4840c6b5e80555f28fc7
2019-06-18 12:59:15 +00:00
Vishnu Nair
7f45d5d5ec Winscope: Fix how layers with transforms and positions are rendered
Currently position is applied to the layer bounds before applying the transform. The bounds
are also not bounded by parent bounds.

Change the logic to use the calculated layer bounds and apply the transform with position when
rendering the layer on screen.
Keep existing logic to view traces before layer bounds were added.

Bug: 128925841
Test: open winscope with old (P) and new trace (Q ToT). Check if layers are rendered correctly when rotated.
Merged-In: Ia91262e4dfe3e8ad647acf8e0cf961e270441cde
Change-Id: Ia91262e4dfe3e8ad647acf8e0cf961e270441cde
2019-06-18 12:59:07 +00:00
Vishnu Nair
47c7571f0b WinScope: Modify instead of replacing proto objects
Converting the proto object inorder to set the enum string values
or display default values replaces existing proto objects and its
properties which maybe used by the formatter function.

Instead replace toObject method with a custom one that limits
modifications to the existing proto objects.

Test: run WinScope and check WM and SF traces

Merged-In: Ie084d288aaf569476f1e9284c3a9c8a06364a61a
Change-Id: Ie084d288aaf569476f1e9284c3a9c8a06364a61a
2019-06-18 12:58:28 +00:00
Nataniel Borges
4e524b0b78 Support SF traces without any layers (needed when booting SF)
When using continuous logging and having the trace enabled by default,
the first entries have no layers and crash Winscope.

Test: Flash a device with SF tracing enabled by default. Record the
initial trace. Open trace in Winscope.

Merged-In: I693815ff3e6468291770d3e8197e21bf75a2a87a
Change-Id: I693815ff3e6468291770d3e8197e21bf75a2a87a
2019-06-18 12:58:09 +00:00
Vishnu Nair
5c006d104a Winscope: Translate layer flags in Surface flinger dump
Test: Open sf trace and check if flags are translated
Fixes: 127436444
Merged-In: If696d33054ae566d209b769427f5681d4e1ff876
Change-Id: If696d33054ae566d209b769427f5681d4e1ff876
2019-06-18 12:58:02 +00:00
Nataniel Borges
d122ad83ff Update Display default checkbox label
Replace label for `Show default properties` and add tooltip explaining
what this checkbox is used for

Test: Open winscope
Merged-In: I39de3e1d7c203d5273084bd54c4d2f749e8e6f5f
Change-Id: I39de3e1d7c203d5273084bd54c4d2f749e8e6f5f
2019-06-18 12:57:56 +00:00
Nataniel Borges
7f63847ec5 Add Type to transform objects.
Add a type, based on the framework/native definitions, to the transform
objects.

If the transform matrix can be reconstructed from the type (identity,
translate, rotate 0/90/180/270) it should not be stored on the protobuf,
but should instead be reconstructed on Winscope.

Test: Record a Proto3 SF trace. Open it without displaying default
values in Winscope. Check if it is correct. Select a legacy trace. Open
it in Winscope. Check is it is also correct.

Merged-In: I03744efba2c8740d7c543f6793bce0ba7bf6d975
Change-Id: I03744efba2c8740d7c543f6793bce0ba7bf6d975
2019-06-18 12:57:47 +00:00
Nataniel Borges
eacb719985 Fix visibility rule for SF traces on Winscope
When traces don't have a visible region object assigned winscope crashes
while loading a SF trace.

Test: Open a SF trace without a visible region object on winscope. It
should no longer crash

Merged-In: I7919a0301ccfb6a0811fd15feb718c8ac0b210b1
Change-Id: I7919a0301ccfb6a0811fd15feb718c8ac0b210b1
2019-06-18 12:57:40 +00:00
Nataniel Borges
f1e0f50a01 Allow SF traces to omit default values on the property list
The C++ proto2 implementation write the default values ot the file.
Until the surface flinger dump is updated to proto3, this implementation
will not have any effect.

Test: (Un)Check the `display defaults` checkbox. Load a file. If the
checkbox is unchecked, default values should not appear on winscope,
otherwise they should appear.

Merged-In: I2432966f3e14aba5fc1dee26d5a09c743406b417
Change-Id: I2432966f3e14aba5fc1dee26d5a09c743406b417
2019-06-18 12:57:33 +00:00
Nataniel Borges
10ef665c58 Fix "TypeError: Cannot read property 'x' of null" on SF traces
The protobuf definition allows the position attribute not to be defined.
Winscope crashes if the position is not defined, instead of assuming it
as (x: 0, y: 0)

Test: Load a SF protobuf object without the position attribute. Check if
Winscope does't crash while loading it.

Merged-In: Ib12ba7875f1e7b22819274c1cd9961a1dbfe82cf
Change-Id: Ib12ba7875f1e7b22819274c1cd9961a1dbfe82cf
2019-06-18 12:57:26 +00:00
Nataniel Borges
31e6237fdb Display only elements actually visible on the screen as "Visible"
Use the visibleRegion property to determine if a layer is visible on
the screen or not. Elements may have a size and a crop but be displayed
below another.

While the visible option cannot be used to render the elements due to
transforms, it only has a value if the element is displayed on the
screen.

Note that elements may still not appear on the screen as all their
visible regions are below the screen (right < 0 or bottom < 0)

Test: Open trace in winscope, check if only layers visible on the screen have a visible chip and are displayed.
Merged-In: I75137a5057a5bda96db887b110b053e64b49f885
Change-Id: I75137a5057a5bda96db887b110b053e64b49f885
2019-06-18 12:57:19 +00:00
Nataniel Borges
38a1bf9a7b Display SF layer based on size, crop & parent instead of buffer size
It is no longer possible to use only the size property because Color
layers do not set a buffer size.

Use the following rule to highlight the selected layers on the UI:
- If the layer has a size and a crop, use their intersection.
- Else, if the layer has no size, but has crop, use the crop as size
- Else, use the parent size

Bug: 121198524
Test: Open trace in winscope, select visible layer, check if highlighted
Merged-In: I55298f20efa31830097a41d45d8d8b1c6b4ed2e6
Change-Id: I55298f20efa31830097a41d45d8d8b1c6b4ed2e6
2019-06-18 12:57:11 +00:00
Vishnu Nair
f27cb3c0b4 WinScope: Support boundless surfaces in WinScope
SurfaceFlinger trace relies on Display Root#0 layer size to set the display bounds. This layer will
no longer have a size once b/114413815 is fixed. Instead, sf transform will set the bounds to undefined and the
bounds be calculated to be the union of the layer sizes.
see: http://x20web/teams/android-window-manager/winscope/winscope-staging-vishnun.html
Bug: 114413815
Test: build winscope and open trace

Merged-In: Ic04d524f0e095374321ef818f0d0ff420a2d3827
Change-Id: Ic04d524f0e095374321ef818f0d0ff420a2d3827
2019-06-18 12:57:04 +00:00
Vishnu Nair
38ed9eb5d7 Winscope: Use a unique stableId for all layers and wm entries
Top level of the hierarchy contains the entry with a timestamp. When
navigating the timeline with arrow keys, entry loses focus since
the timestamp changes.

See: https://android-window-manager.teams.x20web.corp.google.com/winscope/winscope-staging-vishnun.html

Test: Open trace in winscope, click on entry & navigate timeline with arrow keys
Merged-In: Ifbd88da717354c66d96a05d25a9d619fa5209e26
Change-Id: Ifbd88da717354c66d96a05d25a9d619fa5209e26
2019-06-18 12:56:57 +00:00
Adrian Roos
80ad0baa5b Winscope: keep backwards compatibility prior to windowFrames
We should still be able to properly render traces taken prior to the WindowFrames
refactor - if the property is not available, use the legacy property instead.

Test: yarn run dev
Merged-In: Ie10f7d14ac5673e8be844d2d5a4fa752d502b9df
Change-Id: Ie10f7d14ac5673e8be844d2d5a4fa752d502b9df
2019-06-18 12:56:49 +00:00
chaviw
c3ab197057 Use windowFrames.frame instead of frame to draw the area.
The code is changed so the frame protobuf is now under another class
called windowFrames. Update the js code so it can properly draw the
frame with the new code change.

Test: Ran on localhost with updated protobuf file
Bug: 111359087
Merged-In: I072daae54601120de5b6eaa0a64ee7c3096e4a43
Change-Id: I072daae54601120de5b6eaa0a64ee7c3096e4a43
2019-06-18 12:56:42 +00:00
Kevin DuBois
d8fcba313b Winscope: fix .pb location for sf traces
Trace location was incorrect. Changing to correct location.

Test: run capture_sf_trace.sh, upload to winscope, see trace

Merged-In: Ia84501014e6cf83d2fb1d167c1a7aac8b64a06d4
Change-Id: Ia84501014e6cf83d2fb1d167c1a7aac8b64a06d4
Fixes: b/110715663
2019-06-18 12:56:35 +00:00
Adrian Roos
a6e652ac81 Winscope: apply surface transforms in preview
Test: capture surface trace of screen rotation animation, verify it shows correctly.
Merged-In: Ia9528401a0d8542266a7898be6d032a6cf166946
Change-Id: Ia9528401a0d8542266a7898be6d032a6cf166946
2019-06-18 12:56:27 +00:00
Vishnu Nair
1a59a9b592 WinScope: Show IME windows
Test: Check trace with IME windows shown

Merged-In: If69e1bc340c0c79a5fb07385cc6921dd093e8fc2
Change-Id: If69e1bc340c0c79a5fb07385cc6921dd093e8fc2
2019-06-18 12:56:16 +00:00
Adrian Roos
2af3a86382 WinScope: Properly show child windows.
Merged-In: I188bb2c327bc61c309f7e3e3746f0af4241a94a9
Change-Id: I188bb2c327bc61c309f7e3e3746f0af4241a94a9
2019-06-18 12:51:23 +00:00
Vishnu Nair
aace7b7129 Merge "WinScope: Support missing layers" into qt-dev
am: ceaa4b38bb

Change-Id: I766685ceeec30373a32c43e0af9ae43f03f4a2b8
2019-04-19 15:12:13 -07:00