diff options
author | ncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-27 02:53:59 +0000 |
---|---|---|
committer | ncbray@chromium.org <ncbray@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-27 02:53:59 +0000 |
commit | 0ae52b4b3a8d79389b6e7b42b5ffe810826b5fdb (patch) | |
tree | 59cd3d8d2e6bb77be14de9aad3eb89b2c9eef315 /chrome/browser/nacl_host | |
parent | 51631f03ee0dcc4cfca195e5a6b64fce1a73679b (diff) | |
download | chromium_src-0ae52b4b3a8d79389b6e7b42b5ffe810826b5fdb.zip chromium_src-0ae52b4b3a8d79389b6e7b42b5ffe810826b5fdb.tar.gz chromium_src-0ae52b4b3a8d79389b6e7b42b5ffe810826b5fdb.tar.bz2 |
Instrument NaCl validation caching with UMA histograms.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2515
TEST= Run NaCl w/ NACL_VALIDATION_CACHE=1
Review URL: http://codereview.chromium.org/9866011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/nacl_host')
-rw-r--r-- | chrome/browser/nacl_host/nacl_process_host.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index c4c602e..8a668b4 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -11,6 +11,7 @@ #include "base/command_line.h" #include "base/memory/mru_cache.h" #include "base/memory/singleton.h" +#include "base/metrics/histogram.h" #include "base/path_service.h" #include "base/string_util.h" #include "base/stringprintf.h" @@ -856,17 +857,22 @@ void NaClProcessHost::SendStart(base::PlatformFile irt_file) { } bool NaClBrowser::QueryKnownToValidate(const std::string& signature) { + bool result = false; ValidationCacheType::iterator iter = validation_cache_.Get(signature); - if (iter == validation_cache_.end()) { - // Not found. - return false; - } else { - return iter->second; + if (iter != validation_cache_.end()) { + result = iter->second; } + UMA_HISTOGRAM_ENUMERATION("NaCl.ValidationCache.Query", + result ? 1 : 0, 2); + return result; } void NaClBrowser::SetKnownToValidate(const std::string& signature) { validation_cache_.Put(signature, true); + // The number of sets should be equal to the number of cache misses, minus + // validation failures and successful validations where stubout occurs. + // Bucket zero is reserved for future use. + UMA_HISTOGRAM_ENUMERATION("NaCl.ValidationCache.Set", 1, 2); } void NaClProcessHost::OnQueryKnownToValidate(const std::string& signature, |