Commit e91e2538 authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

Vaapi decoder: use TRACE_COUNTER_ID2 for "Vaapi frames at client"

This CL addresses two issues:
- Extends "Vaapi frames at client" to show used vs available, where ToT
 only shows the currently used ones, without any reference to its max.
- TRACE_COUNTER1/2 is global per-process, which means that when there
 are multiple Vaapi decoders working, each will update the counter as if
 in isolation, rendering the measurement meaningless. This CL uses
 TRACE_COUNTER_ID2 to add an id to each counter, allowing for counter
 separation [1].

[1] https://i.imgur.com/qq60Xqw.png (https://imgur.com/a/AOcwh78)

Bug: 909926, 721674
Change-Id: If7089d8e9ca614912b3965eb46dc552b8c63928f
Reviewed-on: https://chromium-review.googlesource.com/c/1356884
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612819}
parent f8cde095
...@@ -285,7 +285,9 @@ void VaapiVideoDecodeAccelerator::OutputPicture( ...@@ -285,7 +285,9 @@ void VaapiVideoDecodeAccelerator::OutputPicture(
} }
// Notify the client a picture is ready to be displayed. // Notify the client a picture is ready to be displayed.
++num_frames_at_client_; ++num_frames_at_client_;
TRACE_COUNTER1("media,gpu", "Vaapi frames at client", num_frames_at_client_); TRACE_COUNTER_ID2("media,gpu", "Vaapi frames at client", this, "used",
num_frames_at_client_, "available",
pictures_.size() - num_frames_at_client_);
DVLOGF(4) << "Notifying output picture id " << output_id << " for input " DVLOGF(4) << "Notifying output picture id " << output_id << " for input "
<< input_id << input_id
<< " is ready. visible rect: " << visible_rect.ToString(); << " is ready. visible rect: " << visible_rect.ToString();
...@@ -729,8 +731,9 @@ void VaapiVideoDecodeAccelerator::ReusePictureBuffer( ...@@ -729,8 +731,9 @@ void VaapiVideoDecodeAccelerator::ReusePictureBuffer(
} }
--num_frames_at_client_; --num_frames_at_client_;
TRACE_COUNTER1("media,gpu", "Vaapi frames at client", num_frames_at_client_); TRACE_COUNTER_ID2("media,gpu", "Vaapi frames at client", this, "used",
num_frames_at_client_, "available",
pictures_.size() - num_frames_at_client_);
{ {
base::AutoLock auto_lock(lock_); base::AutoLock auto_lock(lock_);
available_picture_buffers_.push_back(picture_buffer_id); available_picture_buffers_.push_back(picture_buffer_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment