Remove statsd enable check when logging

statsd should now be enabled on all devices and this check is
unnnecessarily adding a check for each time there's a call into the
socket, which is inefficient.

Bug: 157082130
Test: make, statsd_test
Change-Id: I0bb0ae0c93516c3a02cb971742c3eba602668a09
This commit is contained in:
Howard Ro 2020-05-18 23:19:13 -07:00
parent 8de46ae39d
commit 516b632ff4

View file

@ -50,24 +50,16 @@ int stats_log_is_closed() {
int write_buffer_to_statsd(void* buffer, size_t size, uint32_t atomId) {
int ret = 1;
#ifdef __ANDROID__
bool statsdEnabled = property_get_bool("ro.statsd.enable", true);
#else
bool statsdEnabled = false;
#endif
struct iovec vecs[2];
vecs[0].iov_base = (void*)&kStatsEventTag;
vecs[0].iov_len = sizeof(kStatsEventTag);
vecs[1].iov_base = buffer;
vecs[1].iov_len = size;
if (statsdEnabled) {
struct iovec vecs[2];
vecs[0].iov_base = (void*)&kStatsEventTag;
vecs[0].iov_len = sizeof(kStatsEventTag);
vecs[1].iov_base = buffer;
vecs[1].iov_len = size;
ret = __write_to_statsd(vecs, 2);
ret = __write_to_statsd(vecs, 2);
if (ret < 0) {
note_log_drop(ret, atomId);
}
if (ret < 0) {
note_log_drop(ret, atomId);
}
return ret;