Bug 1690406 - Update AVIF telemetry probes. r=chutten

Differential Revision: https://phabricator.services.mozilla.com/D104448
This commit is contained in:
Jon Bauman 2021-02-09 21:28:41 +00:00
parent 4c2a389e9a
commit 8974dd5426
6 changed files with 100 additions and 63 deletions

View File

@ -17,17 +17,18 @@
#include "SurfacePipeFactory.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TelemetryComms.h"
using namespace mozilla::gfx;
namespace mozilla {
namespace image {
using Telemetry::LABELS_AVIF_AOM_DECODE_ERROR;
using Telemetry::LABELS_AVIF_BIT_DEPTH;
using Telemetry::LABELS_AVIF_DECODE_RESULT;
using Telemetry::LABELS_AVIF_DECODER;
using Telemetry::LABELS_AVIF_YUV_COLOR_SPACE;
using Telemetry::ScalarID;
static LazyLogModule sAVIFLog("AVIFDecoder");
@ -270,12 +271,20 @@ class Dav1dDecoder final : AVIFDecoderInterface {
MOZ_LOG(sAVIFLog, r == 0 ? LogLevel::Debug : LogLevel::Error,
("[this=%p] dav1d_get_picture -> %d", this, r));
// Discard the value outside of the range of uint32
if (!aIsMetadataDecode && std::numeric_limits<int>::digits <= 31) {
// De-negate POSIX error code returned from DAV1D. This must be sync with
// DAV1D_ERR macro.
uint32_t value = r < 0 ? -r : r;
ScalarSet(ScalarID::AVIF_DAV1D_DECODE_ERROR, value);
// When bug 1682662 is fixed, revise this assert and subsequent condition
MOZ_ASSERT(aIsMetadataDecode || r == 0);
// We already have the AVIF_DECODE_RESULT histogram to record all the
// successful calls, so only bother recording what type of errors we see
// via events. Unlike AOM, dav1d returns an int, not an enum, so this is the
// easiest way to see if we're getting unexpected behavior to investigate.
if (aIsMetadataDecode && r != 0) {
// Uncomment once bug 1691156 is fixed
// mozilla::Telemetry::SetEventRecordingEnabled("avif"_ns, true);
mozilla::Telemetry::RecordEvent(
mozilla::Telemetry::EventID::Avif_Dav1dGetPicture_ReturnValue,
Some(nsPrintfCString("%d", r)), Nothing());
}
return r;
@ -422,8 +431,38 @@ class AOMDecoder final : AVIFDecoderInterface {
("[this=%p] aom_codec_decode -> %d", this, r));
if (aIsMetadataDecode) {
uint32_t value = static_cast<uint32_t>(r);
ScalarSet(ScalarID::AVIF_AOM_DECODE_ERROR, value);
switch (r) {
case AOM_CODEC_OK:
// No need to record any telemetry for the common case
break;
case AOM_CODEC_ERROR:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::error);
break;
case AOM_CODEC_MEM_ERROR:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::mem_error);
break;
case AOM_CODEC_ABI_MISMATCH:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::abi_mismatch);
break;
case AOM_CODEC_INCAPABLE:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::incapable);
break;
case AOM_CODEC_UNSUP_BITSTREAM:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::unsup_bitstream);
break;
case AOM_CODEC_UNSUP_FEATURE:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::unsup_feature);
break;
case AOM_CODEC_CORRUPT_FRAME:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::corrupt_frame);
break;
case AOM_CODEC_INVALID_PARAM:
AccumulateCategorical(LABELS_AVIF_AOM_DECODE_ERROR::invalid_param);
break;
default:
MOZ_ASSERT_UNREACHABLE(
"Unknown aom_codec_err_t value from aom_codec_decode");
}
}
if (r != AOM_CODEC_OK) {

View File

@ -2621,6 +2621,20 @@ dom.quota.try:
source_file: The name of the source code file where the error occured.
source_line: The line within source_file where the error occured.
avif:
dav1d_get_picture:
objects: ["return_value"]
bug_numbers: [1690406]
description: Return value from dav1d_get_picture
products:
- firefox # event telemetry is not supported on fenix
record_in_processes: ["all"]
release_channel_collection: opt-out
expiry_version: never
notification_emails:
- cchang@mozilla.com
- jbauman@mozilla.com
installation:
first_seen:
description: >

View File

@ -1637,6 +1637,26 @@
"description": "Decode result of AVIF image",
"bug_numbers": [1670827]
},
"AVIF_AOM_DECODE_ERROR": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "geckoview_streaming"],
"alert_emails": ["cchang@mozilla.com", "jbauman@mozilla.com"],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "categorical",
"labels": [
"error",
"mem_error",
"abi_mismatch",
"incapable",
"unsup_bitstream",
"unsup_feature",
"corrupt_frame",
"invalid_param"
],
"description": "Error code from aom_codec_decode when decoding AVIF image",
"bug_numbers": [1690406]
},
"AVIF_DECODER": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "geckoview_streaming"],

View File

@ -2241,41 +2241,6 @@ media:
record_in_processes:
- 'content'
avif:
dav1d_decode_error:
bug_numbers:
- 1670827
description: >
Image-decode Error from dav1d decoder
kind: uint
expires: "never"
notification_emails:
- cchang@mozilla.com
- jbauman@mozilla.com
products:
- 'firefox'
- 'geckoview_streaming'
record_in_processes:
- 'main'
- 'content'
aom_decode_error:
bug_numbers:
- 1670827
description: >
Image-decode Error from aom decoder
kind: uint
expires: "never"
notification_emails:
- cchang@mozilla.com
- jbauman@mozilla.com
products:
- 'firefox'
- 'geckoview_streaming'
record_in_processes:
- 'main'
- 'content'
# The following section contains content process base counters.
dom.contentprocess:
buildID_mismatch:

View File

@ -712,6 +712,9 @@ void TelemetryEvent::InitializeGlobalState(bool aCanRecordBase,
gCategoryNames.PutEntry(info.common_info.category());
}
// A hack until bug 1691156 is fixed
gEnabledCategories.PutEntry("avif"_ns);
gInitDone = true;
}

View File

@ -836,34 +836,30 @@ avif:
expires: never
aom_decode_error:
type: quantity
unit: error code
gecko_datapoint: avif.aom_decode_error
type: labeled_counter
labels:
- error
- mem_error
- abi_mismatch
- incapable
- unsup_bitstream
- unsup_feature
- corrupt_frame
- invalid_param
gecko_datapoint: AVIF_AOM_DECODE_ERROR
description: >
Image-decode Error from AOM decoder
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
- https://bugzilla.mozilla.org/show_bug.cgi?id=1690406
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
- https://bugzilla.mozilla.org/show_bug.cgi?id=1690406#c3
notification_emails:
- cchang@mozilla.com
- jbauman@mozilla.com
expires: never
dav1d_decode_error:
type: quantity
unit: error code
gecko_datapoint: avif.dav1d_decode_error
description: >
Image-decode Error from dav1d decoder
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
notification_emails:
- cchang@mozilla.com
- jbauman@mozilla.com
expires: never
# dav1d_decode_error is replaced by avif.dav1d_get_picture in Events.yaml
# Unfortunately, events are not currently supported for geckoview
yuv_color_space:
type: labeled_counter