File tree 2 files changed +350
-87
lines changed
benchmark-macro/src/main/java/androidx/benchmark/macro
integration-tests/baselineprofile-consumer/src/release/generated/baselineProfiles
2 files changed +350
-87
lines changed Original file line number Diff line number Diff line change @@ -302,18 +302,14 @@ private fun reportResults(
302
302
private fun extractProfile (packageName : String ): String {
303
303
304
304
val dumpCommand = " pm dump-profiles --dump-classes-and-methods $packageName "
305
- if (BuildCompat .isAtLeastU()) {
306
- // On api 34 this will produce an output like:
307
- // Profile saved to '/data/misc/profman/<PACKAGE_NAME>-primary.prof.txt'
308
- val stdout = Shell .executeScriptCaptureStdout(dumpCommand).trim()
309
- val expected = " Profile saved to '/data/misc/profman/$packageName -primary.prof.txt'"
310
- check(stdout == expected) {
311
- " Expected `pm dump-profiles` stdout to be $expected but was $stdout "
312
- }
313
- } else {
314
- // On api 33 and below this command does not produce any output
315
- Shell .executeScriptSilent(dumpCommand)
305
+ val stdout = Shell .executeScriptCaptureStdout(dumpCommand).trim()
306
+ val expected = " Profile saved to '/data/misc/profman/$packageName -primary.prof.txt'"
307
+
308
+ // Output of profman was empty in previous version and can be `expected` on newer versions.
309
+ check(stdout.isBlank() || stdout == expected) {
310
+ " Expected `pm dump-profiles` stdout to be either black or `$expected ` but was $stdout "
316
311
}
312
+
317
313
val fileName = " $packageName -primary.prof.txt"
318
314
Shell .executeScriptSilent(
319
315
" mv /data/misc/profman/$fileName ${Outputs .dirUsableByAppAndShell} /"
You can’t perform that action at this time.
0 commit comments