Lines Matching defs:recordSample

362 void VirtualRuntime::DedupFromRecord(PerfRecordSample *recordSample)
364 CHECK_TRUE(recordSample == nullptr, NO_RETVAL, 0, "");
365 u64 nr = recordSample->data_.nr;
367 collectSymbolCallBack_(recordSample);
370 u32 pid = recordSample->data_.pid;
371 u64 *ips = recordSample->data_.ips;
387 collectSymbolCallBack_(recordSample);
392 recordSample->stackId_.value = stackId.value;
393 recordSample->header.size -= (sizeof(u64) * nr - sizeof(stackId));
394 recordSample->data_.nr = 0;
395 recordSample->data_.ips = nullptr;
396 recordSample->removeStack_ = true;
441 auto recordSample = static_cast<PerfRecordSample *>(&record);
442 UpdateFromRecord(*recordSample);
490 void VirtualRuntime::SymbolicCallFrame(PerfRecordSample &recordSample, uint64_t ip,
493 pid_t pid = static_cast<pid_t>(recordSample.data_.pid);
494 pid_t tid = static_cast<pid_t>(recordSample.data_.tid);
499 MakeCallFrame(symbol, recordSample.callFrames_.emplace_back(ip, 0));
500 HLOGV(" (%zu)unwind symbol: %*s%s", recordSample.callFrames_.size(),
501 static_cast<int>(recordSample.callFrames_.size()), "",
502 recordSample.callFrames_.back().ToSymbolString().c_str());
505 bool VirtualRuntime::RecoverCallStack(PerfRecordSample &recordSample)
507 auto StackTable = processStackMap_.find(recordSample.data_.pid);
508 CHECK_TRUE(StackTable == processStackMap_.end(), false, 1, "not found %" PRIu32 " pid", recordSample.data_.pid);
509 recordSample.ips_.clear();
511 StackTable->second->GetIpsByStackId(recordSample.stackId_, recordSample.ips_);
513 recordSample.RecoverCallStack();
517 void VirtualRuntime::SymbolicRecord(PerfRecordSample &recordSample)
523 recordSample.callFrames_.clear();
526 if (recordSample.data_.nr == 0) {
527 serverPid = recordSample.GetServerPidof(0);
528 SymbolicCallFrame(recordSample, recordSample.data_.ip, serverPid, PERF_CONTEXT_MAX);
530 for (u64 i = 0; i < recordSample.data_.nr; i++) {
531 uint64_t ip = recordSample.data_.ips[i];
540 serverPid = recordSample.GetServerPidof(i);
541 SymbolicCallFrame(recordSample, ip, serverPid, context);
581 void VirtualRuntime::UnwindFromRecord(PerfRecordSample &recordSample)
587 HLOGV("unwind record (time:%llu)", recordSample.data_.time);
589 if (recordSample.data_.stack_size > 0) {
590 pid_t serverPid = recordSample.GetUstackServerPid();
591 pid_t pid = static_cast<pid_t>(recordSample.data_.pid);
592 pid_t tid = static_cast<pid_t>(recordSample.data_.tid);
597 callstack_.UnwindCallStack(thread, recordSample.data_.user_abi == PERF_SAMPLE_REGS_ABI_32,
598 recordSample.data_.user_regs, recordSample.data_.reg_nr,
599 recordSample.data_.stack_data, recordSample.data_.dyn_size,
600 recordSample.callFrames_);
604 size_t oldSize = recordSample.callFrames_.size();
605 HLOGV("unwind %zu", recordSample.callFrames_.size());
606 callstack_.ExpandCallStack(thread.tid_, recordSample.callFrames_, callstackMergeLevel_);
607 HLOGV("expand %zu (+%zu)", recordSample.callFrames_.size(),
608 recordSample.callFrames_.size() - oldSize);
610 recordSample.ReplaceWithCallStack(oldSize);
617 NeedDropKernelCallChain(recordSample);
620 DedupFromRecord(&recordSample);
626 if (dedupStack_ && recordSample.stackId_.section.id > 0 && recordSample.data_.nr == 0) {
627 RecoverCallStack(recordSample);
630 SymbolicRecord(recordSample);
639 void VirtualRuntime::UpdateFromRecord(PerfRecordSample &recordSample)
641 UpdateThread(recordSample.data_.pid, recordSample.data_.tid);
642 if (recordSample.data_.server_nr) {
644 for (size_t i = 0; i < recordSample.data_.server_nr; i++) {
645 pid_t pid = static_cast<pid_t>(recordSample.data_.server_pids[i]);
653 UnwindFromRecord(recordSample);