Collect Errors and Warnings In OEMCrypto Initialize

As a large number of provisioning errors can come from failures
initializing OEMCrypto we need to collect these  messages.
Errors and warnings were only printed to the log. This
change takes those messages and puts them into the oemcrypto
intialization mode metric.

"Mode" was chosen as most messages were about how oemcrypto
was initialized (e.g. into L3 because no L1 library was found).

Test: Ran all GTS Media Tests

Bug: 34782934
Change-Id: I1fcdd74c99011d53bdffe9609d2f4c46c222e2f6
This commit is contained in:
Aaron Vaage
2017-01-28 11:55:59 -08:00
parent edb9f00df7
commit be448ed24a
4 changed files with 131 additions and 5 deletions

View File

@@ -38,9 +38,11 @@ class MetricsFrontEnd {
#define MFE wvcdm::metrics::MetricsFrontEnd::Instance()
#define M_RECORD(GROUP, METRIC, ...) \
#define NO_TIME 0
#define M_RECORD(GROUP, METRIC, TIME, ...) \
if ( GROUP ) { \
( GROUP ) -> METRIC . Record( __VA_ARGS__ ); \
( GROUP ) -> METRIC . Record( TIME, ##__VA_ARGS__ ); \
}
#define M_TIME(CALL, GROUP, METRIC, ...) \

View File

@@ -14,6 +14,25 @@
namespace wvcdm {
namespace metrics {
typedef enum OEMCryptoInitializationMode {
OEMCrypto_INITIALIZED_USING_IN_APP = 0,
OEMCrypto_INITIALIZED_FORCING_L3 = 1,
OEMCrypto_INITIALIZED_USING_L3_NO_L1_LIBRARY_PATH = 2,
OEMCrypto_INITIALIZED_USING_L3_L1_OPEN_FAILED = 3,
OEMCrypto_INITIALIZED_USING_L3_L1_LOAD_FAILED = 4,
OEMCrypto_INITIALIZED_USING_L3_COULD_NOT_INITIALIZE_L1 = 5,
OEMCrypto_INITIALIZED_USING_L3_WRONG_L1_VERSION = 6,
OEMCrypto_INITIALIZED_USING_L1_WITH_KEYBOX = 7,
OEMCrypto_INITIALIZED_USING_L1_WITH_CERTIFICATE = 8,
OEMCrypto_INITIALIZED_USING_L1_CERTIFICATE_MIX = 9,
OEMCrypto_INITIALIZED_USING_L3_BAD_KEYBOX = 10,
OEMCrypto_INITIALIZED_USING_L3_COULD_NOT_OPEN_FACTORY_KEYBOX = 11,
OEMCrypto_INITIALIZED_USING_L3_COULD_NOT_INSTALL_KEYBOX = 12,
OEMCrypto_INITIALIZED_USING_L1_INSTALLED_KEYBOX = 13,
OEMCrypto_INITIALIZED_USING_L3_INVALID_L1 = 14,
OEMCrypto_INITIALIZED_USING_L1_WITH_PROVISIONING_3_0 = 15
} OEMCryptoInitializationMode;
/*
* The metrics group is the group of all metrics that be be recorded. They
* are kept together to allow calls to be correlated to one another.
@@ -138,6 +157,10 @@ class MetricsGroup {
EventMetric<OEMCryptoResult> oemcrypto_update_usage_table_;
EventMetric<OEMCryptoResult> oemcrypto_wrap_keybox_;
/* Internal OEMCrypto Metrics */
EventMetric<OEMCryptoInitializationMode> oemcrypto_initialization_mode_;
EventMetric<uint32_t, uint32_t> oemcrypto_l1_api_version_;
MetricsGroup();
~MetricsGroup();

View File

@@ -383,7 +383,14 @@ MetricsGroup::MetricsGroup() :
"error"),
oemcrypto_wrap_keybox_(
"/drm/widevine/oemcrypto/wrap_keybox/time",
"error") { }
"error"),
oemcrypto_initialization_mode_(
"/drm/widevine/oemcrypto/initialization_mode",
"message"),
oemcrypto_l1_api_version_(
"/drm/widevine/oemcrypto/l1_api_version",
"version",
"min_version") { }
MetricsGroup::~MetricsGroup() {
MetricNotification* subscriber = MFE.CreateSubscriber();
@@ -506,6 +513,8 @@ void MetricsGroup::Publish(MetricNotification* subscriber) {
oemcrypto_supports_usage_table_.Publish(subscriber);
oemcrypto_update_usage_table_.Publish(subscriber);
oemcrypto_wrap_keybox_.Publish(subscriber);
oemcrypto_initialization_mode_.Publish(subscriber);
oemcrypto_l1_api_version_.Publish(subscriber);
}
} // metrics
} // wvcdm