Snap for 8808387 from d85b69a13e9500910d715be5348dedb5f3fbe002 to tm-qpr1-release

Change-Id: I7d080745b4281ebb9d92f50c712cb2740ea7e356
diff --git a/Android.bp b/Android.bp
index 5373c69..5aa519f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -530,6 +530,7 @@
         ":perfetto_src_protozero_filtering_message_filter",
         ":perfetto_src_protozero_protozero",
         ":perfetto_src_traced_probes_android_log_android_log",
+        ":perfetto_src_traced_probes_android_system_property_android_system_property",
         ":perfetto_src_traced_probes_common_common",
         ":perfetto_src_traced_probes_data_source",
         ":perfetto_src_traced_probes_filesystem_filesystem",
@@ -1099,6 +1100,7 @@
         ":perfetto_src_protozero_filtering_message_filter",
         ":perfetto_src_protozero_protozero",
         ":perfetto_src_traced_probes_android_log_android_log",
+        ":perfetto_src_traced_probes_android_system_property_android_system_property",
         ":perfetto_src_traced_probes_common_common",
         ":perfetto_src_traced_probes_data_source",
         ":perfetto_src_traced_probes_filesystem_filesystem",
@@ -1362,6 +1364,7 @@
         ":perfetto_src_protozero_filtering_message_filter",
         ":perfetto_src_protozero_protozero",
         ":perfetto_src_traced_probes_android_log_android_log",
+        ":perfetto_src_traced_probes_android_system_property_android_system_property",
         ":perfetto_src_traced_probes_common_common",
         ":perfetto_src_traced_probes_data_source",
         ":perfetto_src_traced_probes_filesystem_filesystem",
@@ -1806,6 +1809,7 @@
         ":perfetto_src_trace_processor_util_protozero_to_text",
         ":perfetto_src_trace_processor_util_util",
         ":perfetto_src_traced_probes_android_log_android_log",
+        ":perfetto_src_traced_probes_android_system_property_android_system_property",
         ":perfetto_src_traced_probes_common_common",
         ":perfetto_src_traced_probes_data_source",
         ":perfetto_src_traced_probes_filesystem_filesystem",
@@ -2239,6 +2243,7 @@
     srcs: [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     tools: [
@@ -2249,6 +2254,7 @@
     out: [
         "external/perfetto/protos/perfetto/config/android/android_log_config.gen.cc",
         "external/perfetto/protos/perfetto/config/android/android_polled_state_config.gen.cc",
+        "external/perfetto/protos/perfetto/config/android/android_system_property_config.gen.cc",
         "external/perfetto/protos/perfetto/config/android/packages_list_config.gen.cc",
     ],
 }
@@ -2259,6 +2265,7 @@
     srcs: [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     tools: [
@@ -2269,6 +2276,7 @@
     out: [
         "external/perfetto/protos/perfetto/config/android/android_log_config.gen.h",
         "external/perfetto/protos/perfetto/config/android/android_polled_state_config.gen.h",
+        "external/perfetto/protos/perfetto/config/android/android_system_property_config.gen.h",
         "external/perfetto/protos/perfetto/config/android/packages_list_config.gen.h",
     ],
     export_include_dirs: [
@@ -2283,6 +2291,7 @@
     srcs: [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     tools: [
@@ -2292,6 +2301,7 @@
     out: [
         "external/perfetto/protos/perfetto/config/android/android_log_config.pb.cc",
         "external/perfetto/protos/perfetto/config/android/android_polled_state_config.pb.cc",
+        "external/perfetto/protos/perfetto/config/android/android_system_property_config.pb.cc",
         "external/perfetto/protos/perfetto/config/android/packages_list_config.pb.cc",
     ],
 }
@@ -2302,6 +2312,7 @@
     srcs: [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     tools: [
@@ -2311,6 +2322,7 @@
     out: [
         "external/perfetto/protos/perfetto/config/android/android_log_config.pb.h",
         "external/perfetto/protos/perfetto/config/android/android_polled_state_config.pb.h",
+        "external/perfetto/protos/perfetto/config/android/android_system_property_config.pb.h",
         "external/perfetto/protos/perfetto/config/android/packages_list_config.pb.h",
     ],
     export_include_dirs: [
@@ -2325,6 +2337,7 @@
     srcs: [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     tools: [
@@ -2335,6 +2348,7 @@
     out: [
         "external/perfetto/protos/perfetto/config/android/android_log_config.pbzero.cc",
         "external/perfetto/protos/perfetto/config/android/android_polled_state_config.pbzero.cc",
+        "external/perfetto/protos/perfetto/config/android/android_system_property_config.pbzero.cc",
         "external/perfetto/protos/perfetto/config/android/packages_list_config.pbzero.cc",
     ],
 }
@@ -2345,6 +2359,7 @@
     srcs: [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     tools: [
@@ -2355,6 +2370,7 @@
     out: [
         "external/perfetto/protos/perfetto/config/android/android_log_config.pbzero.h",
         "external/perfetto/protos/perfetto/config/android/android_polled_state_config.pbzero.h",
+        "external/perfetto/protos/perfetto/config/android/android_system_property_config.pbzero.h",
         "external/perfetto/protos/perfetto/config/android/packages_list_config.pbzero.h",
     ],
     export_include_dirs: [
@@ -2441,6 +2457,7 @@
         "protos/perfetto/common/track_event_descriptor.proto",
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
         "protos/perfetto/config/chrome/chrome_config.proto",
         "protos/perfetto/config/data_source_config.proto",
@@ -3812,6 +3829,7 @@
     name: "perfetto_protos_perfetto_trace_android_cpp_gen",
     srcs: [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -3826,6 +3844,7 @@
     cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --plugin=protoc-gen-plugin=$(location perfetto_src_protozero_protoc_plugin_cppgen_plugin) --plugin_out=wrapper_namespace=gen:$(genDir)/external/perfetto/ $(in)",
     out: [
         "external/perfetto/protos/perfetto/trace/android/android_log.gen.cc",
+        "external/perfetto/protos/perfetto/trace/android/android_system_property.gen.cc",
         "external/perfetto/protos/perfetto/trace/android/camera_event.gen.cc",
         "external/perfetto/protos/perfetto/trace/android/frame_timeline_event.gen.cc",
         "external/perfetto/protos/perfetto/trace/android/gpu_mem_event.gen.cc",
@@ -3840,6 +3859,7 @@
     name: "perfetto_protos_perfetto_trace_android_cpp_gen_headers",
     srcs: [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -3854,6 +3874,7 @@
     cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --plugin=protoc-gen-plugin=$(location perfetto_src_protozero_protoc_plugin_cppgen_plugin) --plugin_out=wrapper_namespace=gen:$(genDir)/external/perfetto/ $(in)",
     out: [
         "external/perfetto/protos/perfetto/trace/android/android_log.gen.h",
+        "external/perfetto/protos/perfetto/trace/android/android_system_property.gen.h",
         "external/perfetto/protos/perfetto/trace/android/camera_event.gen.h",
         "external/perfetto/protos/perfetto/trace/android/frame_timeline_event.gen.h",
         "external/perfetto/protos/perfetto/trace/android/gpu_mem_event.gen.h",
@@ -3872,6 +3893,7 @@
     name: "perfetto_protos_perfetto_trace_android_lite_gen",
     srcs: [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -3885,6 +3907,7 @@
     cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --cpp_out=lite=true:$(genDir)/external/perfetto/ $(in)",
     out: [
         "external/perfetto/protos/perfetto/trace/android/android_log.pb.cc",
+        "external/perfetto/protos/perfetto/trace/android/android_system_property.pb.cc",
         "external/perfetto/protos/perfetto/trace/android/camera_event.pb.cc",
         "external/perfetto/protos/perfetto/trace/android/frame_timeline_event.pb.cc",
         "external/perfetto/protos/perfetto/trace/android/gpu_mem_event.pb.cc",
@@ -3899,6 +3922,7 @@
     name: "perfetto_protos_perfetto_trace_android_lite_gen_headers",
     srcs: [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -3912,6 +3936,7 @@
     cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --cpp_out=lite=true:$(genDir)/external/perfetto/ $(in)",
     out: [
         "external/perfetto/protos/perfetto/trace/android/android_log.pb.h",
+        "external/perfetto/protos/perfetto/trace/android/android_system_property.pb.h",
         "external/perfetto/protos/perfetto/trace/android/camera_event.pb.h",
         "external/perfetto/protos/perfetto/trace/android/frame_timeline_event.pb.h",
         "external/perfetto/protos/perfetto/trace/android/gpu_mem_event.pb.h",
@@ -3930,6 +3955,7 @@
     name: "perfetto_protos_perfetto_trace_android_zero_gen",
     srcs: [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -3944,6 +3970,7 @@
     cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --plugin=protoc-gen-plugin=$(location protozero_plugin) --plugin_out=wrapper_namespace=pbzero:$(genDir)/external/perfetto/ $(in)",
     out: [
         "external/perfetto/protos/perfetto/trace/android/android_log.pbzero.cc",
+        "external/perfetto/protos/perfetto/trace/android/android_system_property.pbzero.cc",
         "external/perfetto/protos/perfetto/trace/android/camera_event.pbzero.cc",
         "external/perfetto/protos/perfetto/trace/android/frame_timeline_event.pbzero.cc",
         "external/perfetto/protos/perfetto/trace/android/gpu_mem_event.pbzero.cc",
@@ -3958,6 +3985,7 @@
     name: "perfetto_protos_perfetto_trace_android_zero_gen_headers",
     srcs: [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -3972,6 +4000,7 @@
     cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --plugin=protoc-gen-plugin=$(location protozero_plugin) --plugin_out=wrapper_namespace=pbzero:$(genDir)/external/perfetto/ $(in)",
     out: [
         "external/perfetto/protos/perfetto/trace/android/android_log.pbzero.h",
+        "external/perfetto/protos/perfetto/trace/android/android_system_property.pbzero.h",
         "external/perfetto/protos/perfetto/trace/android/camera_event.pbzero.h",
         "external/perfetto/protos/perfetto/trace/android/frame_timeline_event.pbzero.h",
         "external/perfetto/protos/perfetto/trace/android/gpu_mem_event.pbzero.h",
@@ -4137,6 +4166,7 @@
         "protos/perfetto/common/track_event_descriptor.proto",
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
         "protos/perfetto/config/chrome/chrome_config.proto",
         "protos/perfetto/config/data_source_config.proto",
@@ -4157,6 +4187,7 @@
         "protos/perfetto/config/trace_config.proto",
         "protos/perfetto/config/track_event/track_event_config.proto",
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -8788,6 +8819,22 @@
     ],
 }
 
+// GN: //src/traced/probes/android_system_property:android_system_property
+filegroup {
+    name: "perfetto_src_traced_probes_android_system_property_android_system_property",
+    srcs: [
+        "src/traced/probes/android_system_property/android_system_property_data_source.cc",
+    ],
+}
+
+// GN: //src/traced/probes/android_system_property:unittests
+filegroup {
+    name: "perfetto_src_traced_probes_android_system_property_unittests",
+    srcs: [
+        "src/traced/probes/android_system_property/android_system_property_data_source_unittest.cc",
+    ],
+}
+
 // GN: //src/traced/probes/common:common
 filegroup {
     name: "perfetto_src_traced_probes_common_common",
@@ -9507,6 +9554,7 @@
         "protos/perfetto/common/track_event_descriptor.proto",
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
         "protos/perfetto/config/chrome/chrome_config.proto",
         "protos/perfetto/config/data_source_config.proto",
@@ -9527,6 +9575,7 @@
         "protos/perfetto/config/trace_config.proto",
         "protos/perfetto/config/track_event/track_event_config.proto",
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
@@ -9974,6 +10023,8 @@
         ":perfetto_src_trace_processor_util_util",
         ":perfetto_src_traced_probes_android_log_android_log",
         ":perfetto_src_traced_probes_android_log_unittests",
+        ":perfetto_src_traced_probes_android_system_property_android_system_property",
+        ":perfetto_src_traced_probes_android_system_property_unittests",
         ":perfetto_src_traced_probes_common_common",
         ":perfetto_src_traced_probes_common_test_support",
         ":perfetto_src_traced_probes_common_unittests",
diff --git a/BUILD b/BUILD
index 8fa7874..784ea1b 100644
--- a/BUILD
+++ b/BUILD
@@ -223,6 +223,7 @@
         ":src_protozero_filtering_bytecode_parser",
         ":src_protozero_filtering_message_filter",
         ":src_traced_probes_android_log_android_log",
+        ":src_traced_probes_android_system_property_android_system_property",
         ":src_traced_probes_common_common",
         ":src_traced_probes_data_source",
         ":src_traced_probes_filesystem_filesystem",
@@ -1594,6 +1595,15 @@
     ],
 )
 
+# GN target: //src/traced/probes/android_system_property:android_system_property
+perfetto_filegroup(
+    name = "src_traced_probes_android_system_property_android_system_property",
+    srcs = [
+        "src/traced/probes/android_system_property/android_system_property_data_source.cc",
+        "src/traced/probes/android_system_property/android_system_property_data_source.h",
+    ],
+)
+
 # GN target: //src/traced/probes/common:common
 perfetto_filegroup(
     name = "src_traced_probes_common_common",
@@ -2332,6 +2342,7 @@
     srcs = [
         "protos/perfetto/config/android/android_log_config.proto",
         "protos/perfetto/config/android/android_polled_state_config.proto",
+        "protos/perfetto/config/android/android_system_property_config.proto",
         "protos/perfetto/config/android/packages_list_config.proto",
     ],
     visibility = [
@@ -2907,6 +2918,7 @@
     name = "protos_perfetto_trace_android_protos",
     srcs = [
         "protos/perfetto/trace/android/android_log.proto",
+        "protos/perfetto/trace/android/android_system_property.proto",
         "protos/perfetto/trace/android/camera_event.proto",
         "protos/perfetto/trace/android/frame_timeline_event.proto",
         "protos/perfetto/trace/android/gpu_mem_event.proto",
diff --git a/protos/perfetto/config/android/BUILD.gn b/protos/perfetto/config/android/BUILD.gn
index e7180d5..f448eb5 100644
--- a/protos/perfetto/config/android/BUILD.gn
+++ b/protos/perfetto/config/android/BUILD.gn
@@ -20,6 +20,7 @@
   sources = [
     "android_log_config.proto",
     "android_polled_state_config.proto",
+    "android_system_property_config.proto",
     "packages_list_config.proto",
   ]
 }
diff --git a/protos/perfetto/config/android/android_polled_state_config.proto b/protos/perfetto/config/android/android_polled_state_config.proto
index bd32c2c..21e25c2 100644
--- a/protos/perfetto/config/android/android_polled_state_config.proto
+++ b/protos/perfetto/config/android/android_polled_state_config.proto
@@ -18,7 +18,8 @@
 
 package perfetto.protos;
 
-// Data source that polls for display state.
+// Data source that polls for display state. This should only be used for
+// backward-compatibility; AndroidSystemPropertyConfig should be preferred.
 message AndroidPolledStateConfig {
   // Frequency of polling. If absent the state will be recorded once, at the
   // start of the trace.
diff --git a/protos/perfetto/config/android/android_system_property_config.proto b/protos/perfetto/config/android/android_system_property_config.proto
new file mode 100644
index 0000000..fbf1062
--- /dev/null
+++ b/protos/perfetto/config/android/android_system_property_config.proto
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2022 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 perfetto.protos;
+
+// Data source that polls for system properties.
+message AndroidSystemPropertyConfig {
+  // Frequency of polling. If absent the state will be recorded once, at the
+  // start of the trace.
+  // This is required to be > 100ms to avoid excessive CPU usage.
+  optional uint32 poll_ms = 1;
+
+  // Properties to poll. All property names must start with "debug.tracing.".
+  repeated string property_name = 2;
+}
diff --git a/protos/perfetto/config/data_source_config.proto b/protos/perfetto/config/data_source_config.proto
index 22b18e3..f8265a6 100644
--- a/protos/perfetto/config/data_source_config.proto
+++ b/protos/perfetto/config/data_source_config.proto
@@ -20,6 +20,7 @@
 
 import "protos/perfetto/config/android/android_log_config.proto";
 import "protos/perfetto/config/android/android_polled_state_config.proto";
+import "protos/perfetto/config/android/android_system_property_config.proto";
 import "protos/perfetto/config/android/packages_list_config.proto";
 import "protos/perfetto/config/chrome/chrome_config.proto";
 import "protos/perfetto/config/ftrace/ftrace_config.proto";
@@ -37,7 +38,7 @@
 import "protos/perfetto/config/track_event/track_event_config.proto";
 
 // The configuration that is passed to each data source when starting tracing.
-// Next id: 116
+// Next id: 119
 message DataSourceConfig {
   enum SessionInitiator {
     SESSION_INITIATOR_UNSPECIFIED = 0;
@@ -124,6 +125,9 @@
   // Data source name: android.polled_state
   optional AndroidPolledStateConfig android_polled_state_config = 114
       [lazy = true];
+  // Data source name: android.system_property
+  optional AndroidSystemPropertyConfig android_system_property_config = 118
+      [lazy = true];
 
   // Chrome is special as it doesn't use the perfetto IPC layer. We want to
   // avoid proto serialization and de-serialization there because that would
diff --git a/protos/perfetto/config/perfetto_config.proto b/protos/perfetto/config/perfetto_config.proto
index 5c354e8..00fee90 100644
--- a/protos/perfetto/config/perfetto_config.proto
+++ b/protos/perfetto/config/perfetto_config.proto
@@ -381,7 +381,8 @@
 
 // Begin of protos/perfetto/config/android/android_polled_state_config.proto
 
-// Data source that polls for display state.
+// Data source that polls for display state. This should only be used for
+// backward-compatibility; AndroidSystemPropertyConfig should be preferred.
 message AndroidPolledStateConfig {
   // Frequency of polling. If absent the state will be recorded once, at the
   // start of the trace.
@@ -391,6 +392,21 @@
 
 // End of protos/perfetto/config/android/android_polled_state_config.proto
 
+// Begin of protos/perfetto/config/android/android_system_property_config.proto
+
+// Data source that polls for system properties.
+message AndroidSystemPropertyConfig {
+  // Frequency of polling. If absent the state will be recorded once, at the
+  // start of the trace.
+  // This is required to be > 100ms to avoid excessive CPU usage.
+  optional uint32 poll_ms = 1;
+
+  // Properties to poll. All property names must start with "debug.tracing.".
+  repeated string property_name = 2;
+}
+
+// End of protos/perfetto/config/android/android_system_property_config.proto
+
 // Begin of protos/perfetto/config/android/packages_list_config.proto
 
 // Data source that lists details (such as version code) about packages on an
@@ -1588,7 +1604,7 @@
 // Begin of protos/perfetto/config/data_source_config.proto
 
 // The configuration that is passed to each data source when starting tracing.
-// Next id: 116
+// Next id: 119
 message DataSourceConfig {
   enum SessionInitiator {
     SESSION_INITIATOR_UNSPECIFIED = 0;
@@ -1675,6 +1691,9 @@
   // Data source name: android.polled_state
   optional AndroidPolledStateConfig android_polled_state_config = 114
       [lazy = true];
+  // Data source name: android.system_property
+  optional AndroidSystemPropertyConfig android_system_property_config = 118
+      [lazy = true];
 
   // Chrome is special as it doesn't use the perfetto IPC layer. We want to
   // avoid proto serialization and de-serialization there because that would
diff --git a/protos/perfetto/trace/android/BUILD.gn b/protos/perfetto/trace/android/BUILD.gn
index 3643427..010ae32 100644
--- a/protos/perfetto/trace/android/BUILD.gn
+++ b/protos/perfetto/trace/android/BUILD.gn
@@ -19,6 +19,7 @@
 
   sources = [
     "android_log.proto",
+    "android_system_property.proto",
     "camera_event.proto",
     "frame_timeline_event.proto",
     "gpu_mem_event.proto",
diff --git a/protos/perfetto/trace/android/android_system_property.proto b/protos/perfetto/trace/android/android_system_property.proto
new file mode 100644
index 0000000..5f5ada1
--- /dev/null
+++ b/protos/perfetto/trace/android/android_system_property.proto
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 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 perfetto.protos;
+
+message AndroidSystemProperty {
+  message PropertyValue {
+    optional string name = 1;
+    optional string value = 2;
+  }
+
+  repeated PropertyValue values = 1;
+}
diff --git a/protos/perfetto/trace/perfetto_trace.proto b/protos/perfetto/trace/perfetto_trace.proto
index 63b058f..2e56060 100644
--- a/protos/perfetto/trace/perfetto_trace.proto
+++ b/protos/perfetto/trace/perfetto_trace.proto
@@ -381,7 +381,8 @@
 
 // Begin of protos/perfetto/config/android/android_polled_state_config.proto
 
-// Data source that polls for display state.
+// Data source that polls for display state. This should only be used for
+// backward-compatibility; AndroidSystemPropertyConfig should be preferred.
 message AndroidPolledStateConfig {
   // Frequency of polling. If absent the state will be recorded once, at the
   // start of the trace.
@@ -391,6 +392,21 @@
 
 // End of protos/perfetto/config/android/android_polled_state_config.proto
 
+// Begin of protos/perfetto/config/android/android_system_property_config.proto
+
+// Data source that polls for system properties.
+message AndroidSystemPropertyConfig {
+  // Frequency of polling. If absent the state will be recorded once, at the
+  // start of the trace.
+  // This is required to be > 100ms to avoid excessive CPU usage.
+  optional uint32 poll_ms = 1;
+
+  // Properties to poll. All property names must start with "debug.tracing.".
+  repeated string property_name = 2;
+}
+
+// End of protos/perfetto/config/android/android_system_property_config.proto
+
 // Begin of protos/perfetto/config/android/packages_list_config.proto
 
 // Data source that lists details (such as version code) about packages on an
@@ -1588,7 +1604,7 @@
 // Begin of protos/perfetto/config/data_source_config.proto
 
 // The configuration that is passed to each data source when starting tracing.
-// Next id: 116
+// Next id: 119
 message DataSourceConfig {
   enum SessionInitiator {
     SESSION_INITIATOR_UNSPECIFIED = 0;
@@ -1675,6 +1691,9 @@
   // Data source name: android.polled_state
   optional AndroidPolledStateConfig android_polled_state_config = 114
       [lazy = true];
+  // Data source name: android.system_property
+  optional AndroidSystemPropertyConfig android_system_property_config = 118
+      [lazy = true];
 
   // Chrome is special as it doesn't use the perfetto IPC layer. We want to
   // avoid proto serialization and de-serialization there because that would
@@ -2427,6 +2446,19 @@
 
 // End of protos/perfetto/trace/android/android_log.proto
 
+// Begin of protos/perfetto/trace/android/android_system_property.proto
+
+message AndroidSystemProperty {
+  message PropertyValue {
+    optional string name = 1;
+    optional string value = 2;
+  }
+
+  repeated PropertyValue values = 1;
+}
+
+// End of protos/perfetto/trace/android/android_system_property.proto
+
 // Begin of protos/perfetto/trace/android/camera_event.proto
 
 // A profiling event corresponding to a single camera frame. This message
@@ -10073,7 +10105,7 @@
 // See the [Buffers and Dataflow](/docs/concepts/buffers.md) doc for details.
 //
 // Next reserved id: 14 (up to 15).
-// Next id: 83.
+// Next id: 86.
 message TracePacket {
   // The timestamp of the TracePacket.
   // By default this timestamps refers to the trace clock (CLOCK_BOOTTIME on
@@ -10138,6 +10170,7 @@
     AndroidCameraFrameEvent android_camera_frame_event = 80;
     AndroidCameraSessionStats android_camera_session_stats = 81;
     TranslationTable translation_table = 82;
+    AndroidSystemProperty android_system_property = 86;
 
     // Only used in profile packets.
     ProfiledFrameSymbols profiled_frame_symbols = 55;
diff --git a/protos/perfetto/trace/trace_packet.proto b/protos/perfetto/trace/trace_packet.proto
index b08ec4e..c46e6fd 100644
--- a/protos/perfetto/trace/trace_packet.proto
+++ b/protos/perfetto/trace/trace_packet.proto
@@ -20,6 +20,7 @@
 import "protos/perfetto/config/trace_config.proto";
 import "protos/perfetto/trace/extension_descriptor.proto";
 import "protos/perfetto/trace/android/android_log.proto";
+import "protos/perfetto/trace/android/android_system_property.proto";
 import "protos/perfetto/trace/android/camera_event.proto";
 import "protos/perfetto/trace/android/frame_timeline_event.proto";
 import "protos/perfetto/trace/android/gpu_mem_event.proto";
@@ -87,7 +88,7 @@
 // See the [Buffers and Dataflow](/docs/concepts/buffers.md) doc for details.
 //
 // Next reserved id: 14 (up to 15).
-// Next id: 83.
+// Next id: 86.
 message TracePacket {
   // The timestamp of the TracePacket.
   // By default this timestamps refers to the trace clock (CLOCK_BOOTTIME on
@@ -152,6 +153,7 @@
     AndroidCameraFrameEvent android_camera_frame_event = 80;
     AndroidCameraSessionStats android_camera_session_stats = 81;
     TranslationTable translation_table = 82;
+    AndroidSystemProperty android_system_property = 86;
 
     // Only used in profile packets.
     ProfiledFrameSymbols profiled_frame_symbols = 55;
diff --git a/src/traced/probes/BUILD.gn b/src/traced/probes/BUILD.gn
index 4c4b65a..8a56dca 100644
--- a/src/traced/probes/BUILD.gn
+++ b/src/traced/probes/BUILD.gn
@@ -58,6 +58,7 @@
     "../../tracing/core",
     "../../tracing/ipc/producer",
     "android_log",
+    "android_system_property",
     "common",
     "filesystem",
     "initial_display_state",
@@ -97,6 +98,7 @@
     "../../../gn:gtest_and_gmock",
     "../../tracing/test:test_support",
     "android_log:unittests",
+    "android_system_property:unittests",
     "common:unittests",
     "filesystem:unittests",
     "initial_display_state:unittests",
diff --git a/src/traced/probes/android_system_property/BUILD.gn b/src/traced/probes/android_system_property/BUILD.gn
new file mode 100644
index 0000000..201961f
--- /dev/null
+++ b/src/traced/probes/android_system_property/BUILD.gn
@@ -0,0 +1,48 @@
+# Copyright (C) 2022 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("../../../../gn/test.gni")
+
+source_set("android_system_property") {
+  public_deps = [ "../../../tracing/core" ]
+  deps = [
+    "..:data_source",
+    "../../../../gn:default_deps",
+    "../../../../include/perfetto/ext/traced",
+    "../../../../protos/perfetto/config/android:zero",
+    "../../../../protos/perfetto/trace:zero",
+    "../../../../protos/perfetto/trace/android:zero",
+    "../../../base",
+    "../common",
+  ]
+  sources = [
+    "android_system_property_data_source.cc",
+    "android_system_property_data_source.h",
+  ]
+}
+
+perfetto_unittest_source_set("unittests") {
+  testonly = true
+  deps = [
+    ":android_system_property",
+    "../../../../gn:default_deps",
+    "../../../../gn:gtest_and_gmock",
+    "../../../../protos/perfetto/config/android:cpp",
+    "../../../../protos/perfetto/trace/android:cpp",
+    "../../../../src/base:test_support",
+    "../../../../src/tracing/test:test_support",
+    "../common:test_support",
+  ]
+  sources = [ "android_system_property_data_source_unittest.cc" ]
+}
diff --git a/src/traced/probes/android_system_property/android_system_property_data_source.cc b/src/traced/probes/android_system_property/android_system_property_data_source.cc
new file mode 100644
index 0000000..650aa46
--- /dev/null
+++ b/src/traced/probes/android_system_property/android_system_property_data_source.cc
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#include "src/traced/probes/android_system_property/android_system_property_data_source.h"
+
+#include "perfetto/base/task_runner.h"
+#include "perfetto/base/time.h"
+#include "perfetto/ext/base/android_utils.h"
+#include "perfetto/ext/base/optional.h"
+#include "perfetto/ext/base/string_utils.h"
+#include "perfetto/tracing/core/data_source_config.h"
+
+#include "protos/perfetto/config/android/android_system_property_config.pbzero.h"
+#include "protos/perfetto/trace/android/android_system_property.pbzero.h"
+#include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+namespace perfetto {
+
+// static
+const AndroidSystemPropertyDataSource::Descriptor
+    AndroidSystemPropertyDataSource::descriptor = {
+        /* name */ "android.system_property",
+        /* flags */ Descriptor::kFlagsNone,
+        /*fill_descriptor_func*/ nullptr,
+};
+
+constexpr const char* REQUIRED_NAME_PREFIX = "debug.tracing.";
+
+AndroidSystemPropertyDataSource::AndroidSystemPropertyDataSource(
+    base::TaskRunner* task_runner,
+    const DataSourceConfig& ds_config,
+    TracingSessionID session_id,
+    std::unique_ptr<TraceWriter> writer)
+    : ProbesDataSource(session_id, &descriptor),
+      task_runner_(task_runner),
+      writer_(std::move(writer)),
+      weak_factory_(this) {
+  protos::pbzero::AndroidSystemPropertyConfig::Decoder cfg(
+      ds_config.android_system_property_config_raw());
+  poll_period_ms_ = cfg.poll_ms();
+  if (poll_period_ms_ > 0 && poll_period_ms_ < 100) {
+    PERFETTO_ILOG("poll_ms %" PRIu32
+                  " is less than minimum of 100ms. Increasing to 100ms.",
+                  poll_period_ms_);
+    poll_period_ms_ = 100;
+  }
+  for (auto name_chars = cfg.property_name(); name_chars; ++name_chars) {
+    auto name = (*name_chars).ToStdString();
+    if (base::StartsWith(name, REQUIRED_NAME_PREFIX)) {
+      property_names_.push_back(name);
+    } else {
+      PERFETTO_ELOG("Property %s lacks required prefix %s", name.c_str(),
+                    REQUIRED_NAME_PREFIX);
+    }
+  }
+}
+
+void AndroidSystemPropertyDataSource::Start() {
+  Tick();
+}
+
+base::WeakPtr<AndroidSystemPropertyDataSource>
+AndroidSystemPropertyDataSource::GetWeakPtr() const {
+  return weak_factory_.GetWeakPtr();
+}
+
+void AndroidSystemPropertyDataSource::Tick() {
+  if (poll_period_ms_) {
+    auto weak_this = GetWeakPtr();
+
+    uint32_t delay_ms =
+        poll_period_ms_ -
+        static_cast<uint32_t>(base::GetWallTimeMs().count() % poll_period_ms_);
+    task_runner_->PostDelayedTask(
+        [weak_this]() -> void {
+          if (weak_this) {
+            weak_this->Tick();
+          }
+        },
+        delay_ms);
+  }
+  WriteState();
+}
+
+void AndroidSystemPropertyDataSource::WriteState() {
+  auto packet = writer_->NewTracePacket();
+  packet->set_timestamp(static_cast<uint64_t>(base::GetBootTimeNs().count()));
+  auto* properties = packet->set_android_system_property();
+  for (const auto& name : property_names_) {
+    const base::Optional<std::string> value = ReadProperty(name);
+    if (value) {
+      auto* property = properties->add_values();
+      property->set_name(name);
+      property->set_value(*value);
+    }
+  }
+  packet->Finalize();
+}
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+const base::Optional<std::string> AndroidSystemPropertyDataSource::ReadProperty(
+    const std::string& name) {
+  std::string value = base::GetAndroidProp(name.c_str());
+  if (value.empty()) {
+    PERFETTO_LOG("Unable to read %s", name.c_str());
+    return base::nullopt;
+  }
+  return base::make_optional(value);
+}
+#else
+const base::Optional<std::string> AndroidSystemPropertyDataSource::ReadProperty(
+    const std::string&) {
+  PERFETTO_ELOG("Android System Properties only supported on Android.");
+  return base::nullopt;
+}
+#endif
+
+void AndroidSystemPropertyDataSource::Flush(FlushRequestID,
+                                            std::function<void()> callback) {
+  writer_->Flush(callback);
+}
+
+}  // namespace perfetto
diff --git a/src/traced/probes/android_system_property/android_system_property_data_source.h b/src/traced/probes/android_system_property/android_system_property_data_source.h
new file mode 100644
index 0000000..ec7db0e
--- /dev/null
+++ b/src/traced/probes/android_system_property/android_system_property_data_source.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#ifndef SRC_TRACED_PROBES_ANDROID_SYSTEM_PROPERTY_ANDROID_SYSTEM_PROPERTY_DATA_SOURCE_H_
+#define SRC_TRACED_PROBES_ANDROID_SYSTEM_PROPERTY_ANDROID_SYSTEM_PROPERTY_DATA_SOURCE_H_
+
+#include <memory>
+#include <vector>
+
+#include "perfetto/ext/base/optional.h"
+#include "perfetto/ext/base/weak_ptr.h"
+#include "perfetto/ext/tracing/core/trace_writer.h"
+#include "src/traced/probes/probes_data_source.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}
+
+class AndroidSystemPropertyDataSource : public ProbesDataSource {
+ public:
+  static const ProbesDataSource::Descriptor descriptor;
+
+  AndroidSystemPropertyDataSource(base::TaskRunner* task_runner,
+                                  const DataSourceConfig& ds_config,
+                                  TracingSessionID session_id,
+                                  std::unique_ptr<TraceWriter> writer);
+
+  // ProbesDataSource implementation.
+  void Start() override;
+  void Flush(FlushRequestID, std::function<void()> callback) override;
+
+  // Virtual for testing.
+  virtual const base::Optional<std::string> ReadProperty(
+      const std::string& name);
+
+ private:
+  void Tick();
+  base::WeakPtr<AndroidSystemPropertyDataSource> GetWeakPtr() const;
+  void WriteState();
+
+  base::TaskRunner* const task_runner_;
+  std::unique_ptr<TraceWriter> writer_;
+  uint32_t poll_period_ms_ = 0;
+  std::vector<std::string> property_names_;
+  base::WeakPtrFactory<AndroidSystemPropertyDataSource>
+      weak_factory_;  // Keep last.
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACED_PROBES_ANDROID_SYSTEM_PROPERTY_ANDROID_SYSTEM_PROPERTY_DATA_SOURCE_H_
diff --git a/src/traced/probes/android_system_property/android_system_property_data_source_unittest.cc b/src/traced/probes/android_system_property/android_system_property_data_source_unittest.cc
new file mode 100644
index 0000000..89d89e6
--- /dev/null
+++ b/src/traced/probes/android_system_property/android_system_property_data_source_unittest.cc
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#include "src/traced/probes/android_system_property/android_system_property_data_source.h"
+#include "perfetto/tracing/core/data_source_config.h"
+#include "src/base/test/test_task_runner.h"
+#include "src/tracing/core/trace_writer_for_testing.h"
+#include "test/gtest_and_gmock.h"
+
+#include "protos/perfetto/config/android/android_system_property_config.gen.h"
+#include "protos/perfetto/trace/android/android_system_property.gen.h"
+#include "protos/perfetto/trace/trace_packet.gen.h"
+
+using ::perfetto::protos::gen::AndroidSystemPropertyConfig;
+
+using ::testing::AnyOf;
+using ::testing::ElementsAre;
+using ::testing::Return;
+
+namespace perfetto {
+namespace {
+
+class TestAndroidSystemPropertyDataSource
+    : public AndroidSystemPropertyDataSource {
+ public:
+  TestAndroidSystemPropertyDataSource(base::TaskRunner* task_runner,
+                                      const DataSourceConfig& config,
+                                      std::unique_ptr<TraceWriter> writer)
+      : AndroidSystemPropertyDataSource(task_runner,
+                                        config,
+                                        /* session_id */ 0,
+                                        std::move(writer)) {}
+
+  MOCK_METHOD1(ReadProperty,
+               const base::Optional<std::string>(const std::string&));
+};
+
+class AndroidSystemPropertyDataSourceTest : public ::testing::Test {
+ protected:
+  std::unique_ptr<TestAndroidSystemPropertyDataSource>
+  CreateAndroidSystemPropertyDataSource(const DataSourceConfig& config) {
+    auto writer =
+        std::unique_ptr<TraceWriterForTesting>(new TraceWriterForTesting());
+    writer_raw_ = writer.get();
+    auto instance = std::unique_ptr<TestAndroidSystemPropertyDataSource>(
+        new TestAndroidSystemPropertyDataSource(&task_runner_, config,
+                                                std::move(writer)));
+    return instance;
+  }
+
+  base::TestTaskRunner task_runner_;
+  TraceWriterForTesting* writer_raw_ = nullptr;
+};
+
+DataSourceConfig BuildConfig(const std::vector<std::string>& property_names) {
+  DataSourceConfig ds_config;
+  AndroidSystemPropertyConfig cfg;
+  for (auto name : property_names) {
+    cfg.add_property_name(name);
+  }
+  ds_config.set_android_system_property_config_raw(cfg.SerializeAsString());
+  return ds_config;
+}
+
+TEST_F(AndroidSystemPropertyDataSourceTest, Success) {
+  auto data_source = CreateAndroidSystemPropertyDataSource(BuildConfig(
+      {"debug.tracing.screen_state", "debug.tracing.screen_brightness"}));
+  EXPECT_CALL(*data_source, ReadProperty("debug.tracing.screen_state"))
+      .WillOnce(Return(base::make_optional("2")));
+  EXPECT_CALL(*data_source, ReadProperty("debug.tracing.screen_brightness"))
+      .WillOnce(Return(base::make_optional("0.123456")));
+  data_source->Start();
+
+  protos::gen::TracePacket packet = writer_raw_->GetOnlyTracePacket();
+  EXPECT_TRUE(packet.has_android_system_property());
+  auto properties = packet.android_system_property();
+  EXPECT_EQ(properties.values_size(), 2);
+
+  EXPECT_EQ(properties.values()[0].name(), "debug.tracing.screen_state");
+  EXPECT_EQ(properties.values()[0].value(), "2");
+  EXPECT_EQ(properties.values()[1].name(), "debug.tracing.screen_brightness");
+  EXPECT_EQ(properties.values()[1].value(), "0.123456");
+}
+
+TEST_F(AndroidSystemPropertyDataSourceTest, NotPermitted) {
+  auto data_source = CreateAndroidSystemPropertyDataSource(
+      BuildConfig({"something.with.wrong.prefix"}));
+  EXPECT_CALL(*data_source, ReadProperty("something.with.wrong.prefix"))
+      .Times(0);
+  data_source->Start();
+
+  protos::gen::TracePacket packet = writer_raw_->GetOnlyTracePacket();
+  EXPECT_TRUE(packet.has_android_system_property());
+  auto properties = packet.android_system_property();
+  EXPECT_EQ(properties.values_size(), 0);
+}
+
+TEST_F(AndroidSystemPropertyDataSourceTest, Failure) {
+  auto data_source = CreateAndroidSystemPropertyDataSource(BuildConfig(
+      {"debug.tracing.screen_state", "debug.tracing.screen_brightness"}));
+  EXPECT_CALL(*data_source, ReadProperty("debug.tracing.screen_state"))
+      .WillOnce(Return(base::nullopt));
+  EXPECT_CALL(*data_source, ReadProperty("debug.tracing.screen_brightness"))
+      .WillOnce(Return(base::nullopt));
+  data_source->Start();
+
+  protos::gen::TracePacket packet = writer_raw_->GetOnlyTracePacket();
+  auto properties = packet.android_system_property();
+  EXPECT_EQ(properties.values_size(), 0);
+}
+
+// TODO(simonmacm) test poll_ms
+}  // namespace
+}  // namespace perfetto
diff --git a/src/traced/probes/probes_producer.cc b/src/traced/probes/probes_producer.cc
index 8b9fc46..955f35d 100644
--- a/src/traced/probes/probes_producer.cc
+++ b/src/traced/probes/probes_producer.cc
@@ -36,6 +36,7 @@
 #include "perfetto/tracing/core/trace_config.h"
 #include "src/android_stats/statsd_logging_helper.h"
 #include "src/traced/probes/android_log/android_log_data_source.h"
+#include "src/traced/probes/android_system_property/android_system_property_data_source.h"
 #include "src/traced/probes/common/cpu_freq_info.h"
 #include "src/traced/probes/filesystem/inode_file_data_source.h"
 #include "src/traced/probes/ftrace/ftrace_data_source.h"
@@ -262,6 +263,17 @@
       endpoint_->CreateTraceWriter(buffer_id)));
 }
 
+template <>
+std::unique_ptr<ProbesDataSource>
+ProbesProducer::CreateDSInstance<AndroidSystemPropertyDataSource>(
+    TracingSessionID session_id,
+    const DataSourceConfig& config) {
+  auto buffer_id = static_cast<BufferID>(config.target_buffer());
+  return std::unique_ptr<ProbesDataSource>(new AndroidSystemPropertyDataSource(
+      task_runner_, config, session_id,
+      endpoint_->CreateTraceWriter(buffer_id)));
+}
+
 // Another anonymous namespace. This cannot be moved into the anonymous
 // namespace on top (it would fail to compile), because the CreateDSInstance
 // methods need to be fully declared before.
@@ -286,6 +298,7 @@
     Ds<InodeFileDataSource>(),    Ds<LinuxPowerSysfsDataSource>(),
     Ds<MetatraceDataSource>(),    Ds<PackagesListDataSource>(),
     Ds<ProcessStatsDataSource>(), Ds<SysStatsDataSource>(),
+    Ds<AndroidSystemPropertyDataSource>(),
     Ds<SystemInfoDataSource>(),
 };