OEMCrypto Profiler - Merge of Widevine Updates
This change is a merge of the following changes: 1. Remove MultipleSessions (go/wvgerrit/16763) 2. Increase Memory Budget (go/wvgerrit/16764) 3. Fixing Possible Integer Overflow (go/wvgerrit/16765) 4. Creating Call Table (go/wvgerrit/16766) 5. Creating Call History (go/wvgerrit/16767) 6. Connecting Profiled Scope (go/wvgerrit/16768) 7. Adding Call Table Version Number (go/wvgerrit/16780) 8. Add Version Number to Call History (go/wvgerrit/16781) bug: 27157796 Change-Id: Ia3f088a1714f3f5b426fee6141daa4ea8d832cf4
This commit is contained in:
@@ -4,53 +4,31 @@
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "profiler_session.h"
|
||||
#include "profiler.h"
|
||||
|
||||
namespace wvcdm {
|
||||
namespace oemprofiler {
|
||||
|
||||
ProfiledScope::ProfiledScope(OEM_FUNCTION fid) :
|
||||
meta_data_(),
|
||||
sid_(kGlobalSID),
|
||||
fid_(fid),
|
||||
start_time_(GetNowUS()) {
|
||||
|
||||
}
|
||||
|
||||
// Only allow a user provided sid to be a positive integer
|
||||
// to prevent a user provided sid from conflicting with the
|
||||
// global sid
|
||||
ProfiledScope::ProfiledScope(uint32_t sid, OEM_FUNCTION fid) :
|
||||
meta_data_(),
|
||||
sid_(static_cast<int64_t>(sid)),
|
||||
fid_(fid),
|
||||
start_time_(GetNowUS()) {
|
||||
|
||||
}
|
||||
|
||||
ProfiledScope::~ProfiledScope() {
|
||||
const uint64_t end_time = GetNowUS();
|
||||
|
||||
if (sid_ != kGlobalSID) {
|
||||
Submit(sid_, end_time);
|
||||
}
|
||||
|
||||
// Always save a copy to the global session so that all other sessions
|
||||
// are subsets of the global session
|
||||
Submit(kGlobalSID, end_time);
|
||||
Submit(GetNowUS());
|
||||
}
|
||||
|
||||
void ProfiledScope::Submit(int64_t sid, uint64_t end_time) const {
|
||||
ProfilerSession* const session = ProfilerSession::Find(sid);
|
||||
void ProfiledScope::Submit(uint64_t end_time) const {
|
||||
Profiler::GetTable().Write(fid_, end_time - start_time_);
|
||||
|
||||
if (session != NULL) {
|
||||
session->Submit(
|
||||
Profiler::GetHistory().Write(
|
||||
fid_,
|
||||
start_time_,
|
||||
end_time,
|
||||
meta_data_.GetData(),
|
||||
meta_data_.GetSize());
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t ProfiledScope::GetNowUS() const {
|
||||
|
||||
Reference in New Issue
Block a user