summaryrefslogtreecommitdiff
path: root/libc/system_properties/system_properties.cpp
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
committerJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
commit7e4fe6a28b718ab97c08811566238af2893ca65b (patch)
tree5413a5ec890b5a1ac4fbbe4548b5014e41a2591b /libc/system_properties/system_properties.cpp
parentdcdcb3fa15004669823a3a118189d9d72ff30852 (diff)
parentab08b955a34423d53b28a6210e7530e67241af4a (diff)
Merge SP1A.200921.001
Change-Id: Id2ab019914bb555dadf52c46b8403c0d5fb3c20a
Diffstat (limited to 'libc/system_properties/system_properties.cpp')
-rw-r--r--libc/system_properties/system_properties.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 840477858..3fd20b749 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -46,6 +46,7 @@
#include "system_properties/context_node.h"
#include "system_properties/prop_area.h"
#include "system_properties/prop_info.h"
+#include "system_properties/prop_trace.h"
#define SERIAL_DIRTY(serial) ((serial)&1)
#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
@@ -127,6 +128,9 @@ const prop_info* SystemProperties::Find(const char* name) {
return nullptr;
}
+ SyspropTrace trace(name, nullptr /* prop_value */, nullptr /* prop_info */,
+ PropertyAction::kPropertyFind);
+
prop_area* pa = contexts_->GetPropAreaForName(name);
if (!pa) {
async_safe_format_log(ANDROID_LOG_ERROR, "libc", "Access denied finding property \"%s\"", name);
@@ -201,6 +205,10 @@ void SystemProperties::ReadCallback(const prop_info* pi,
// Read only properties don't need to copy the value to a temporary buffer, since it can never
// change. We use relaxed memory order on the serial load for the same reason.
if (is_read_only(pi->name)) {
+ // The 2nd argument is not required for read-only property tracing, as the
+ // value can be obtained via pi->value or pi->long_value().
+ SyspropTrace trace(pi->name, nullptr /* prop_value */, pi /* prop_info */,
+ PropertyAction::kPropertyGetReadOnly);
uint32_t serial = load_const_atomic(&pi->serial, memory_order_relaxed);
if (pi->is_long()) {
callback(cookie, pi->name, pi->long_value(), serial);
@@ -211,6 +219,8 @@ void SystemProperties::ReadCallback(const prop_info* pi,
}
char value_buf[PROP_VALUE_MAX];
+ SyspropTrace trace(pi->name, value_buf, pi /* prop_info */,
+ PropertyAction::kPropertyGetReadWrite);
uint32_t serial = ReadMutablePropertyValue(pi, value_buf);
callback(cookie, pi->name, value_buf, serial);
}