Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
815976a8
Unverified
Commit
815976a8
authored
Feb 17, 2021
by
chunhtai
Committed by
GitHub
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change stack size test to test arm device (#75814)
parent
a3dd5aea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
+30
-9
stack_size.dart
dev/benchmarks/macrobenchmarks/lib/src/stack_size.dart
+7
-7
android_stack_size_test.dart
dev/devicelab/bin/tasks/android_stack_size_test.dart
+1
-1
adb.dart
dev/devicelab/lib/framework/adb.dart
+11
-1
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+11
-0
No files found.
dev/benchmarks/macrobenchmarks/lib/src/stack_size.dart
View file @
815976a8
...
...
@@ -45,12 +45,12 @@ const int kExitCodeSuccess = 0;
final
GetStackPointerCallback
getStackPointer
=
()
{
// Makes sure we are running on an Android arm64 device.
if
(!
io
.
Platform
.
isAndroid
)
throw
'This benchmark test can only be run on Android arm
64
devices.'
;
throw
'This benchmark test can only be run on Android arm devices.'
;
final
io
.
ProcessResult
result
=
io
.
Process
.
runSync
(
'getprop'
,
<
String
>[
'ro.product.cpu.abi'
]);
if
(
result
.
exitCode
!=
0
)
throw
'Failed to retrieve CPU information.'
;
if
(!
result
.
stdout
.
toString
().
contains
(
'arm
64
'
))
throw
'This benchmark test can only be run on Android arm
64
devices.'
;
if
(!
result
.
stdout
.
toString
().
contains
(
'arm
eabi
'
))
throw
'This benchmark test can only be run on Android arm devices.'
;
// Creates a block of memory to store the assembly code.
final
ffi
.
Pointer
<
ffi
.
Void
>
region
=
mmap
(
ffi
.
nullptr
,
kMemorySize
,
kProtRead
|
kProtWrite
,
...
...
@@ -64,10 +64,10 @@ final GetStackPointerCallback getStackPointer = () {
region
.
cast
<
ffi
.
Uint8
>().
asTypedList
(
kMemorySize
).
setAll
(
kMemoryStartingIndex
,
<
int
>[
// "mov
x0, sp" in machine code: E003009
1.
0x
e0
,
0x03
,
0x00
,
0x9
1
,
// "
ret" in machine code: C0035FD6
.
0x
c0
,
0x03
,
0x5f
,
0xd6
// "mov
r0, sp" in machine code: 0D00A0E
1.
0x
0d
,
0x00
,
0xa0
,
0xe
1
,
// "
bx lr" in machine code: 1EFF2FE1
.
0x
1e
,
0xff
,
0x2f
,
0xe1
]
);
...
...
dev/devicelab/bin/tasks/android_stack_size_test.dart
View file @
815976a8
...
...
@@ -7,6 +7,6 @@ import 'package:flutter_devicelab/framework/adb.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
androidArm
64
;
deviceOperatingSystem
=
DeviceOperatingSystem
.
androidArm
;
await
task
(
createStackSizeTest
());
}
dev/devicelab/lib/framework/adb.dart
View file @
815976a8
...
...
@@ -52,7 +52,7 @@ String _findMatchId(List<String> idList, String idPattern) {
DeviceDiscovery
get
devices
=>
DeviceDiscovery
();
/// Device operating system the test is configured to test.
enum
DeviceOperatingSystem
{
android
,
androidArm64
,
ios
,
fuchsia
,
fake
}
enum
DeviceOperatingSystem
{
android
,
androidArm
,
androidArm
64
,
ios
,
fuchsia
,
fake
}
/// Device OS to test on.
DeviceOperatingSystem
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
...
...
@@ -63,6 +63,8 @@ abstract class DeviceDiscovery {
switch
(
deviceOperatingSystem
)
{
case
DeviceOperatingSystem
.
android
:
return
AndroidDeviceDiscovery
();
case
DeviceOperatingSystem
.
androidArm
:
return
AndroidDeviceDiscovery
(
cpu:
_AndroidCPU
.
arm
);
case
DeviceOperatingSystem
.
androidArm64
:
return
AndroidDeviceDiscovery
(
cpu:
_AndroidCPU
.
arm64
);
case
DeviceOperatingSystem
.
ios
:
...
...
@@ -158,6 +160,7 @@ abstract class Device {
}
enum
_AndroidCPU
{
arm
,
arm64
,
}
...
...
@@ -199,6 +202,8 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
switch
(
cpu
)
{
case
_AndroidCPU
.
arm64
:
return
device
.
isArm64
();
case
_AndroidCPU
.
arm
:
return
device
.
isArm
();
}
return
true
;
}
...
...
@@ -486,6 +491,11 @@ class AndroidDevice extends Device {
return
cpuInfo
.
contains
(
'arm64'
);
}
Future
<
bool
>
isArm
()
async
{
final
String
cpuInfo
=
await
shellEval
(
'getprop'
,
const
<
String
>[
'ro.product.cpu.abi'
]);
return
cpuInfo
.
contains
(
'armeabi'
);
}
Future
<
void
>
_updateDeviceInfo
()
async
{
String
info
;
try
{
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
815976a8
...
...
@@ -503,6 +503,15 @@ class StartupTest {
]);
applicationBinaryPath
=
'
$testDirectory
/build/app/outputs/flutter-apk/app-profile.apk'
;
break
;
case
DeviceOperatingSystem
.
androidArm
:
await
flutter
(
'build'
,
options:
<
String
>[
'apk'
,
'-v'
,
'--profile'
,
'--target-platform=android-arm'
,
]);
applicationBinaryPath
=
'
$testDirectory
/build/app/outputs/flutter-apk/app-profile.apk'
;
break
;
case
DeviceOperatingSystem
.
androidArm64
:
await
flutter
(
'build'
,
options:
<
String
>[
'apk'
,
...
...
@@ -1031,6 +1040,7 @@ class CompileTest {
metrics
.
addAll
(
await
getSizesFromIosApp
(
appPath
));
break
;
case
DeviceOperatingSystem
.
android
:
case
DeviceOperatingSystem
.
androidArm
:
options
.
insert
(
0
,
'apk'
);
options
.
add
(
'--target-platform=android-arm'
);
options
.
add
(
'--tree-shake-icons'
);
...
...
@@ -1081,6 +1091,7 @@ class CompileTest {
options
.
insert
(
0
,
'ios'
);
break
;
case
DeviceOperatingSystem
.
android
:
case
DeviceOperatingSystem
.
androidArm
:
options
.
insert
(
0
,
'apk'
);
options
.
add
(
'--target-platform=android-arm'
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment