本文整理汇总了C++中std::unique_ptr::AttrSection方法的典型用法代码示例。如果您正苦于以下问题:C++ unique_ptr::AttrSection方法的具体用法?C++ unique_ptr::AttrSection怎么用?C++ unique_ptr::AttrSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::unique_ptr
的用法示例。
在下文中一共展示了unique_ptr::AttrSection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadEventAttrFromRecordFile
bool ReportCommand::ReadEventAttrFromRecordFile() {
std::vector<const PerfFileFormat::FileAttr*> attrs = record_file_reader_->AttrSection();
if (attrs.size() != 1) {
LOG(ERROR) << "record file contains " << attrs.size() << " attrs";
return false;
}
event_attr_ = attrs[0]->attr;
if (use_branch_address_ && (event_attr_.sample_type & PERF_SAMPLE_BRANCH_STACK) == 0) {
LOG(ERROR) << record_filename_ << " is not recorded with branch stack sampling option.";
return false;
}
return true;
}
示例2: DumpAttrSection
void DumpRecordCommandImpl::DumpAttrSection() {
std::vector<const FileAttr*> attrs = record_file_reader_->AttrSection();
for (size_t i = 0; i < attrs.size(); ++i) {
auto& attr = attrs[i];
printf("file_attr %zu:\n", i + 1);
DumpPerfEventAttr(attr->attr, 1);
printf(" ids[file_section]: offset %" PRId64 ", size %" PRId64 "\n", attr->ids.offset,
attr->ids.size);
std::vector<uint64_t> ids = record_file_reader_->IdsForAttr(attr);
if (ids.size() > 0) {
printf(" ids:");
for (auto& id : ids) {
printf(" %" PRId64, id);
}
printf("\n");
}
}
}
示例3: DumpAttrSection
void DumpRecordCommand::DumpAttrSection() {
const std::vector<FileAttr>& attrs = record_file_reader_->AttrSection();
for (size_t i = 0; i < attrs.size(); ++i) {
const auto& attr = attrs[i];
printf("file_attr %zu:\n", i + 1);
DumpPerfEventAttr(attr.attr, 1);
printf(" ids[file_section]: offset %" PRId64 ", size %" PRId64 "\n", attr.ids.offset,
attr.ids.size);
std::vector<uint64_t> ids;
if (!record_file_reader_->ReadIdsForAttr(attr, &ids)) {
return;
}
if (!ids.empty()) {
printf(" ids:");
for (const auto& id : ids) {
printf(" %" PRId64, id);
}
printf("\n");
}
}
}