Move perfetto capture and protos to benchmark-common

Test: ./gradlew benchmark:benchmark-common:cC benchmark:benchmark-macro:cC benchmark:benchmark-macro-junit4:cC benchmark:benchmark-junit4:cC
Bug: 196115387
Bug: 145598917
Relnote: N/A

PerfettoTraceProcessor and its binary will stay in benchmark-macro.

Moves PerfettoRule to benchmark-junit, so that microbenchmarks don't
need to depend on benchmark-macro-junit4. Eventually, this
functionality can be merged into BenchmarkRule, as long as
in-process/app tag tracing is configurable, and off by
default. UserspaceTracing will enable us to still capture
BenchmarkState lifecycle events, like different modes (warmup /
measure / allocation count).

This unblocks raising the minAPI of Macrobench to the long-term goal
of API 21, which is the lowest that can support shell commands, as
well as perfetto capture.

This change also moves a few supporting classes, such as DeviceInfo
and ConfigurationError, which were always intended to gradually
replace benchmark-common's error / device state querying. This starts
that process.

As testutils-ktx is used by benchmark-common now, add to all project
config flavors.

Change-Id: I6559b6735d0106e38ec5d8eaeddcac9297d0c431
diff --git a/development/build_log_simplifier/messages.ignore b/development/build_log_simplifier/messages.ignore
index f2684a0..af2600d 100644
--- a/development/build_log_simplifier/messages.ignore
+++ b/development/build_log_simplifier/messages.ignore
@@ -540,7 +540,7 @@
 # https://youtrack.jetbrains.com/issue/KT-30589
 WARNING: Illegal reflective access by org\.jetbrains\.kotlin\.kapt3\.base\.javac\.KaptJavaFileManager .* to method com\.sun\.tools\.javac\.file\.BaseFileManager\.handleOption\(com\.sun\.tools\.javac\.main\.Option,java\.lang\.String\)
 # > Task :benchmark:benchmark-macro:compileReleaseKotlin
-Execution optimizations have been disabled for task ':benchmark:benchmark\-macro:.*' to ensure correctness due to the following reasons:
+Execution optimizations have been disabled for task ':benchmark:benchmark\-common:.*' to ensure correctness due to the following reasons:
 \- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark\-macro/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark\-macro:.*' uses this output of task ':benchmark:benchmark\-macro:.*' without declaring an explicit or implicit dependency\. This can lead to incorrect results being produced, depending on what order the tasks are executed\. Please refer to https://docs\.gradle\.org/[0-9]+\.[0-9]+/userguide/validation_problems\.html\#implicit_dependency for more details about this problem\.
 # > Task :profileinstaller:profileinstaller:processDebugUnitTestManifest
 Scanning .+: \.*
@@ -603,5 +603,5 @@
 WARNING\:The option setting \'android\.dependencyResolutionAtConfigurationTime\.disallow\=true\' is experimental\.
 # b/195025261
 Unable to detect AGP versions for included builds\. All projects in the build should use the same AGP version\. Class name for the included build .*
-\- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark-macro/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark-macro:.*' uses this output of task ':benchmark:benchmark-macro:generate(Debug|Release)Protos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to .*
+\- Gradle detected a problem with the following location: '\$OUT_DIR/androidx/benchmark/benchmark-common/build/generated/source/wire'\. Reason: Task ':benchmark:benchmark-common:.*' uses this output of task ':benchmark:benchmark-common:generate(Debug|Release)Protos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to .*
 To honour the JVM settings for this build a single\-use Daemon process will be forked.*