Merge changes I5775d732,I27673017
* changes: [DO NOT MERGE] Add aosp config for winscope Create stub proto definitions for traces that are not available in AOSP
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
Tool for visualizing window manager traces
|
|
||||||
19
tools/winscope/README.md
Normal file
19
tools/winscope/README.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Tool for visualizing window manager traces
|
||||||
|
|
||||||
|
## Developing WinScope
|
||||||
|
When the trace is enabled, Window Manager and Surface Flinger capture and
|
||||||
|
save current state to a file at each point of interest.
|
||||||
|
`frameworks/base/core/proto/android/server/windowmanagertrace.proto`
|
||||||
|
and `frameworks/native/services/surfaceflinger/layerproto/layerstrace.proto`
|
||||||
|
contain the proto definitions for their internal states.
|
||||||
|
|
||||||
|
### Checking out code and setting up environment
|
||||||
|
* Install [Yarn](https://yarnpkg.com), a JS package manager
|
||||||
|
* [Download Android source](https://source.android.com/setup/build/downloading)
|
||||||
|
* Navigate to `development/tools/winscope`
|
||||||
|
* Run `yarn install`
|
||||||
|
|
||||||
|
### Building & testing changes
|
||||||
|
* Navigate to `development/tools/winscope`
|
||||||
|
* Run `yarn run dev`
|
||||||
|
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
"author": "Adrian Roos <roosa@google.com>",
|
"author": "Adrian Roos <roosa@google.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
|
"dev": "cross-env AOSP=true NODE_ENV=development webpack-dev-server --open --hot",
|
||||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
"build": "cross-env AOSP=true NODE_ENV=production webpack --progress --hide-modules"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue": "^2.3.3",
|
"vue": "^2.3.3",
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
|
|
||||||
import jsonProtoDefs from 'frameworks/base/core/proto/android/server/windowmanagertrace.proto'
|
import jsonProtoDefs from 'frameworks/base/core/proto/android/server/windowmanagertrace.proto'
|
||||||
import jsonProtoLogDefs from 'frameworks/base/core/proto/android/server/protolog.proto'
|
import jsonProtoLogDefs from 'ProtoLogSafePath/protolog.proto'
|
||||||
import jsonProtoDefsSF from 'frameworks/native/services/surfaceflinger/layerproto/layerstrace.proto'
|
import jsonProtoDefsSF from 'frameworks/native/services/surfaceflinger/layerproto/layerstrace.proto'
|
||||||
import jsonProtoDefsTrans from 'frameworks/native/cmds/surfacereplayer/proto/src/trace.proto'
|
import jsonProtoDefsTrans from 'frameworks/native/cmds/surfacereplayer/proto/src/trace.proto'
|
||||||
import jsonProtoDefsWL from 'vendor/google_arc/libs/wayland_service/waylandtrace.proto'
|
import jsonProtoDefsWL from 'WaylandSafePath/waylandtrace.proto'
|
||||||
import protobuf from 'protobufjs'
|
import protobuf from 'protobufjs'
|
||||||
import { transform_layers, transform_layers_trace } from './transform_sf.js'
|
import { transform_layers, transform_layers_trace } from './transform_sf.js'
|
||||||
import { transform_window_service, transform_window_trace } from './transform_wm.js'
|
import { transform_window_service, transform_window_trace } from './transform_wm.js'
|
||||||
|
|||||||
21
tools/winscope/src/stubs/protolog.proto
Normal file
21
tools/winscope/src/stubs/protolog.proto
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
|
package com.android.server.protolog;
|
||||||
|
|
||||||
|
message ProtoLogMessage {}
|
||||||
|
message ProtoLogFileProto {}
|
||||||
3
tools/winscope/src/stubs/services.core.protolog.json
Normal file
3
tools/winscope/src/stubs/services.core.protolog.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0"
|
||||||
|
}
|
||||||
21
tools/winscope/src/stubs/waylandtrace.proto
Normal file
21
tools/winscope/src/stubs/waylandtrace.proto
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
|
package org.chromium.arc.wayland_composer;
|
||||||
|
|
||||||
|
message TraceFileProto {}
|
||||||
|
message OutputStateProto {}
|
||||||
@@ -1,4 +1,20 @@
|
|||||||
import viewerConfig from "../../../../frameworks/base/data/etc/services.core.protolog.json"
|
/*
|
||||||
|
* Copyright 2020, The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import viewerConfig from "ProtoLogJsonSafePath/services.core.protolog.json"
|
||||||
|
|
||||||
import { nanos_to_string } from './transform.js'
|
import { nanos_to_string } from './transform.js'
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,29 @@ var webpack = require('webpack')
|
|||||||
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
var HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin')
|
var HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin')
|
||||||
|
|
||||||
|
function getWaylandSafePath() {
|
||||||
|
if (process.env.AOSP) {
|
||||||
|
return path.resolve(__dirname, 'src/stubs');
|
||||||
|
}
|
||||||
|
return path.resolve(__dirname, '../../../vendor/google_arc/libs/wayland_service');
|
||||||
|
}
|
||||||
|
|
||||||
|
// b/148409169 remove once proto log support is in AOSP.
|
||||||
|
function getProtoLogSafePath() {
|
||||||
|
if (process.env.AOSP) {
|
||||||
|
return path.resolve(__dirname, 'src/stubs');
|
||||||
|
}
|
||||||
|
return path.resolve(__dirname, '../../../frameworks/base/core/proto/android/server');
|
||||||
|
}
|
||||||
|
|
||||||
|
// b/148409169 remove once proto log support is in AOSP.
|
||||||
|
function getProtoLogJsonSafePath() {
|
||||||
|
if (process.env.AOSP) {
|
||||||
|
return path.resolve(__dirname, 'src/stubs');
|
||||||
|
}
|
||||||
|
return path.resolve(__dirname, '../../../frameworks/base/data/etc');
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/main.js',
|
entry: './src/main.js',
|
||||||
output: {
|
output: {
|
||||||
@@ -61,6 +84,11 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
WaylandSafePath: getWaylandSafePath(),
|
||||||
|
ProtoLogSafePath: getProtoLogSafePath(),
|
||||||
|
ProtoLogJsonSafePath: getProtoLogJsonSafePath(),
|
||||||
|
},
|
||||||
modules: [
|
modules: [
|
||||||
'node_modules',
|
'node_modules',
|
||||||
path.resolve(__dirname, '../../..')
|
path.resolve(__dirname, '../../..')
|
||||||
|
|||||||
Reference in New Issue
Block a user