Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1eafe08a authored by Tianyu Jiang's avatar Tianyu Jiang
Browse files

Reduce debug level log from libbufferhub

Logs that indicates possible racing between consumers and producers of
a buffer are removed because they are expected to race each other.
Log that indicates possible racing in bufferhubd is moved from info
level to verbose level.

Test: vega runs without libbufferhub log spam
Bug: 129544259
Change-Id: I9307602797ff9c1bbc774264682a83bf4ddd0240
(cherry picked from commit b9d077f9be584114c39ac8417452cd20817c0236)
parent b138bb21
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -52,12 +52,6 @@ int ConsumerBuffer::LocalAcquire(DvrNativeBufferMetadata* out_meta,
  while (!buffer_state_->compare_exchange_weak(
      current_buffer_state, updated_buffer_state, std::memory_order_acq_rel,
      std::memory_order_acquire)) {
    ALOGD(
        "%s Failed to acquire the buffer. Current buffer state was changed to "
        "%" PRIx32
        " when trying to acquire the buffer and modify the buffer state to "
        "%" PRIx32 ". About to try again if the buffer is still posted.",
        __FUNCTION__, current_buffer_state, updated_buffer_state);
    if (!BufferHubDefs::isClientPosted(current_buffer_state,
                                       client_state_mask())) {
      ALOGE(
@@ -152,12 +146,6 @@ int ConsumerBuffer::LocalRelease(const DvrNativeBufferMetadata* meta,
  while (!buffer_state_->compare_exchange_weak(
      current_buffer_state, updated_buffer_state, std::memory_order_acq_rel,
      std::memory_order_acquire)) {
    ALOGD(
        "%s: Failed to release the buffer. Current buffer state was changed to "
        "%" PRIx32
        " when trying to release the buffer and modify the buffer state to "
        "%" PRIx32 ". About to try again.",
        __FUNCTION__, current_buffer_state, updated_buffer_state);
    // The failure of compare_exchange_weak updates current_buffer_state.
    updated_buffer_state = current_buffer_state & (~client_state_mask());
  }
+0 −16
Original line number Diff line number Diff line
@@ -96,13 +96,6 @@ int ProducerBuffer::LocalPost(const DvrNativeBufferMetadata* meta,
  while (!buffer_state_->compare_exchange_weak(
      current_buffer_state, updated_buffer_state, std::memory_order_acq_rel,
      std::memory_order_acquire)) {
    ALOGD(
        "%s: Failed to post the buffer. Current buffer state was changed to "
        "%" PRIx32
        " when trying to post the buffer and modify the buffer state to "
        "%" PRIx32
        ". About to try again if the buffer is still gained by this client.",
        __FUNCTION__, current_buffer_state, updated_buffer_state);
    if (!BufferHubDefs::isClientGained(current_buffer_state,
                                       client_state_mask())) {
      ALOGE(
@@ -186,15 +179,6 @@ int ProducerBuffer::LocalGain(DvrNativeBufferMetadata* out_meta,
  while (!buffer_state_->compare_exchange_weak(
      current_buffer_state, updated_buffer_state, std::memory_order_acq_rel,
      std::memory_order_acquire)) {
    ALOGD(
        "%s: Failed to gain the buffer. Current buffer state was changed to "
        "%" PRIx32
        " when trying to gain the buffer and modify the buffer state to "
        "%" PRIx32
        ". About to try again if the buffer is still not read by other "
        "clients.",
        __FUNCTION__, current_buffer_state, updated_buffer_state);

    if (BufferHubDefs::isAnyClientAcquired(current_buffer_state) ||
        BufferHubDefs::isAnyClientGained(current_buffer_state) ||
        (BufferHubDefs::isAnyClientPosted(
+1 −1
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ Status<RemoteChannelHandle> ProducerChannel::CreateConsumer(
    while (!buffer_state_->compare_exchange_weak(
        current_buffer_state, updated_buffer_state, std::memory_order_acq_rel,
        std::memory_order_acquire)) {
      ALOGI(
      ALOGV(
          "%s: Failed to post to the new consumer. "
          "Current buffer state was changed to %" PRIx32
          " when trying to acquire the buffer and modify the buffer state to "