OEMCrypto Profiler
This CL is a merge from the widevine repo of: http://go/wvgerrit/16491 Circular Buffer http://go/wvgerrit/16512 Circular Buffer Tests http://go/wvgerrit/16493 Entry Writer http://go/wvgerrit/16495 Profiled Scope http://go/wvgerrit/16500 Stats Collection http://go/wvgerrit/16543 Disallow Stats Copy or Assign http://go/wvgerrit/16514 Moving OEM Function Enum http://go/wvgerrit/16501 Defining Session Interface http://go/wvgerrit/16502 Session Definitions http://go/wvgerrit/16573 Remove code to num bytes table http://go/wvgerrit/16556 Connecting Profiler to Profiled Scope http://go/wvgerrit/16557 Android Reading Profiler History http://go/wvgerrit/16574 Adding Get Stats Method http://go/wvgerrit/16606 Seperating Session Parsing http://go/wvgerrit/16607 Adding get stats method to DRMPlugin http://go/wvgerrit/16608 Fixing Linux Build Failure http://go/wvgerrit/16612 Stop Clearing History http://go/wvgerrit/16613 Accessing profiler information using session id http://go/wvgerrit/16614 Making All Session Subsets of Global Session BUG: 25123303 BUG: 26027857 Change-Id: Ie2422e644aa631871852ea0e461695aeb7060f88
This commit is contained in:
46
libwvdrmengine/cdm/profiler/include/profiled_scope.h
Normal file
46
libwvdrmengine/cdm/profiler/include/profiled_scope.h
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright 2016 Google Inc. All Rights Reserved.
|
||||
|
||||
#ifndef WVCDM_PROFILER_PROFILED_SCOPE_H_
|
||||
#define WVCDM_PROFILER_PROFILED_SCOPE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "entry_writer.h"
|
||||
#include "oem_functions.h"
|
||||
|
||||
namespace wvcdm {
|
||||
namespace oemprofiler {
|
||||
|
||||
class ProfiledScope {
|
||||
public:
|
||||
explicit ProfiledScope(OEM_FUNCTION fid);
|
||||
explicit ProfiledScope(uint32_t sid, OEM_FUNCTION fid);
|
||||
~ProfiledScope();
|
||||
|
||||
EntryWriter meta_data_;
|
||||
|
||||
// All profiling data must be assigned to a session but some oem
|
||||
// crypto calls are not associated with crypto sessions. To gather
|
||||
// those functions' data, the global session id is used. Crypto.Session
|
||||
// Ids are unsigned 32 bit integers. To use those as a profiling session
|
||||
// id but also allow for a global id that won't conflict with them,
|
||||
// we use a -1 as the a proifiling session id is a signed 64 bit integer.
|
||||
static const int64_t kGlobalSID = -1;
|
||||
|
||||
private:
|
||||
int64_t sid_;
|
||||
OEM_FUNCTION fid_;
|
||||
|
||||
uint64_t start_time_;
|
||||
|
||||
void Submit(int64_t sid, uint64_t end_time) const;
|
||||
uint64_t GetNowUS() const;
|
||||
|
||||
// disallow copy and assign
|
||||
ProfiledScope(const ProfiledScope&);
|
||||
void operator=(const ProfiledScope&);
|
||||
};
|
||||
|
||||
} // namespace oemprofiler
|
||||
} // namespace wvcdm
|
||||
#endif
|
||||
Reference in New Issue
Block a user