Add some end to end tests to the CTS test suite

There are a bunch of end to end tests in test:integrationtests
(android_integrationtest.cc, cmdline_integrationtest.cc,
ftrace_integrationtest.cc, traced_integrationtest.cc).

These tests are linked in perfetto_integrationtests, which is run in CI
on a couple of devices.

I think the intention in the code base was for these tests to be
included in CtsPerfettoTestCases. All devices have to pass CTS, so that
gives us a better guarantee that perfetto is working.

Unfortunately, our build files did not include these tests correctly
into the CtsPerfettoTestCases.

Before this commit

GN:

```
//test/cts:
static_library("perfetto_cts_deps") {
  deps = [ "test:integrationtests" ],
}

//test:
source_set("integrationtests") {
  sources = [
    "android_integrationtest.cc",
    "cmdline_integrationtest.cc",
    "ftrace_integrationtest.cc",
    "traced_integrationtest.cc",
  ]
}
```

BP:

```
//test/cts/Android.bp (NOT autogenerated)
cc_test {
  name: "CtsPerfettoTestCases"
  static_libs: ["perfetto_cts_deps"]
}
//Android.bp (autogenerated from GN)
cc_library_static {
  name: "perfetto_cts_deps"
  srcs: [ "perfetto_test_integrationtests" ]
}
filegroup {
  name: "perfetto_test_integrationtests"
  srcs: [
    "android_integrationtest.cc",
    "cmdline_integrationtest.cc",
    "ftrace_integrationtest.cc",
    "traced_integrationtest.cc",
  ]
}
```

The files in the filegroup `perfetto_test_integrationtests` were
included into the cc_library_static `perfetto_cts_deps`. When
CtsPerfettoTestCases links `perfetto_cts_deps`, it doesn't include all
the objects, it includes only the one that strictly needs and it
excludes the one that only register initializers (i.e. there's no
--whole-archive).

This commit fixes the problem by listing the _integrationtest.cc
explicitly in `CtsPerfettoTestCases`.

In order to do that, this commit:
* Renames end_to_end_integrationtest_cts.cc to
  producer_to_consumer_integrationtest_cts.cc so that the name
  end_to_end can be reused later.
* Renames the source_set //test:integrationtests to
  perfetto_end_to_end_integrationtests, so that it can be exported to
  Android.bp (exported targets are not prefixed with their path).

Before this change CtsPerfettoTestCases was taking ~2 minutes and 30
seconds on my redfin. After this change CtsPerfettoTestCases is taking
2 minutex and 40 seconds, so this commit also updates the timeout in the
XML.

This is the diff between the old CTS test list and the new one:

```
 HeapprofdJavaCtsTest.
   DebuggableAppRuntime
   ProfileableAppRuntime
   ReleaseAppRuntime
   DebuggableAppRuntimeByPid
   DebuggableAppOom
   ProfileableAppOom
   ReleaseAppOom
   DebuggableAppOomNotSelected
 HeapprofdCtsTest.
   DebuggableAppRuntime
   DebuggableAppStartup
   ProfileableAppRuntime
   ProfileableAppStartup
   ReleaseAppRuntime
   ReleaseAppStartup
   NonProfileableAppRuntime
   NonProfileableAppStartup
   JavaHeapRuntime
   JavaHeapStartup
   ProfilePlatformProcess
 TracedPerfCtsTest.
   SystemWideDebuggableApp
   SystemWideProfileableApp
   SystemWideNonProfileableApp
   SystemWideReleaseApp
   ProfilePlatformProcess
 PerfettoDeviceFeatureTest.
   TestMaxCpusForAtraceChmod
 PerfettoCtsTest.
   TestProducerActivity
   TestProducerService
   TestProducerIsolatedService
+PerfettoAndroidIntegrationTest.
+  TestKmemActivity
+  TestBatteryTracing
+PerfettoCmdlineTest.
+  InvalidCases
+  Version
+  TxtConfig
+  SimpleConfig
+  DetachAndAttach
+  StartTracingTrigger
+  StopTracingTrigger
+  NoDataNoFileWithoutTrigger
+  StopTracingTriggerFromConfig
+  TriggerFromConfigStopsFileOpening
+  Query
+  CmdTriggerWithUploadFlag
+  TriggerCloneSnapshot
+  SaveForBugreport
+  SaveForBugreport_WriteIntoFile
+  Clone
+  UnavailableBugreportLeavesNoEmptyFiles
+  DISABLED_SaveForBugreport_Triggers
+PerfettoFtraceIntegrationTest.
+  TestFtraceProducer
+  TestFtraceFlush
+  KernelAddressSymbolization
+  ReportFtraceFailuresInStats
+PerfettoTracedIntegrationTest.
+  TestFakeProducer
+  VeryLargePackets
+  UnresponsiveProducer
+  DetachAndReattach
+  ReattachFailsAfterTimeout
+  TestProducerProvidedSMB
+  QueryServiceStateLargeResponse
+  TraceFilterLargePackets
```

Change-Id: Idcd04d6239f276b95abeca09ebb0891d5cf98a3f
8 files changed
tree: 99e773d80148300bbff86c5f988437b740babf16
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. python/
  13. src/
  14. test/
  15. third_party/
  16. tools/
  17. ui/
  18. .clang-format
  19. .clang-tidy
  20. .git-blame-ignore-revs
  21. .gitattributes
  22. .gitignore
  23. .gn
  24. .style.yapf
  25. Android.bp
  26. Android.bp.extras
  27. BUILD
  28. BUILD.extras
  29. BUILD.gn
  30. CHANGELOG
  31. codereview.settings
  32. DIR_METADATA
  33. heapprofd.rc
  34. LICENSE
  35. meson.build
  36. METADATA
  37. MODULE_LICENSE_APACHE2
  38. OWNERS
  39. perfetto.rc
  40. PerfettoIntegrationTests.xml
  41. PRESUBMIT.py
  42. README.chromium
  43. README.md
  44. TEST_MAPPING
  45. traced_perf.rc
  46. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.

See https://perfetto.dev/docs or the /docs/ directory for documentation.