Lines Matching refs:attr

79   perf_event_attr attr;  in CreateDefaultPerfEventAttr()  local
80 memset(&attr, 0, sizeof(attr)); in CreateDefaultPerfEventAttr()
81 attr.size = sizeof(perf_event_attr); in CreateDefaultPerfEventAttr()
82 attr.type = event_type.type; in CreateDefaultPerfEventAttr()
83 attr.config = event_type.config; in CreateDefaultPerfEventAttr()
84 attr.disabled = 0; in CreateDefaultPerfEventAttr()
87 attr.read_format = in CreateDefaultPerfEventAttr()
89 attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | PERF_SAMPLE_PERIOD | in CreateDefaultPerfEventAttr()
92 if (attr.type == PERF_TYPE_TRACEPOINT) { in CreateDefaultPerfEventAttr()
95 attr.sample_type |= PERF_SAMPLE_RAW; in CreateDefaultPerfEventAttr()
98 return attr; in CreateDefaultPerfEventAttr()
101 void DumpPerfEventAttr(const perf_event_attr& attr, size_t indent) { in DumpPerfEventAttr() argument
102 std::string event_name = GetEventNameByAttr(attr); in DumpPerfEventAttr()
105 PrintIndented(indent + 1, "type %u, size %u, config %llu\n", attr.type, attr.size, attr.config); in DumpPerfEventAttr()
107 if (attr.freq != 0) { in DumpPerfEventAttr()
108 PrintIndented(indent + 1, "sample_freq %llu\n", attr.sample_freq); in DumpPerfEventAttr()
110 PrintIndented(indent + 1, "sample_period %llu\n", attr.sample_period); in DumpPerfEventAttr()
113 PrintIndented(indent + 1, "sample_type (0x%llx) %s\n", attr.sample_type, in DumpPerfEventAttr()
114 SampleTypeToString(attr.sample_type).c_str()); in DumpPerfEventAttr()
116 PrintIndented(indent + 1, "read_format (0x%llx) %s\n", attr.read_format, in DumpPerfEventAttr()
117 ReadFormatToString(attr.read_format).c_str()); in DumpPerfEventAttr()
119 PrintIndented(indent + 1, "disabled %u, inherit %u, pinned %u, exclusive %u\n", attr.disabled, in DumpPerfEventAttr()
120 attr.inherit, attr.pinned, attr.exclusive); in DumpPerfEventAttr()
123 attr.exclude_user, attr.exclude_kernel, attr.exclude_hv); in DumpPerfEventAttr()
126 attr.exclude_idle, attr.mmap, attr.mmap2, attr.comm, attr.freq); in DumpPerfEventAttr()
128 PrintIndented(indent + 1, "inherit_stat %u, enable_on_exec %u, task %u\n", attr.inherit_stat, in DumpPerfEventAttr()
129 attr.enable_on_exec, attr.task); in DumpPerfEventAttr()
131 PrintIndented(indent + 1, "watermark %u, precise_ip %u, mmap_data %u\n", attr.watermark, in DumpPerfEventAttr()
132 attr.precise_ip, attr.mmap_data); in DumpPerfEventAttr()
135 attr.sample_id_all, attr.exclude_host, attr.exclude_guest); in DumpPerfEventAttr()
136 PrintIndented(indent + 1, "config2 0x%llx\n", attr.config2); in DumpPerfEventAttr()
137 PrintIndented(indent + 1, "branch_sample_type 0x%" PRIx64 "\n", attr.branch_sample_type); in DumpPerfEventAttr()
139 attr.exclude_callchain_kernel, attr.exclude_callchain_user); in DumpPerfEventAttr()
140 PrintIndented(indent + 1, "sample_regs_user 0x%" PRIx64 "\n", attr.sample_regs_user); in DumpPerfEventAttr()
141 PrintIndented(indent + 1, "sample_stack_user 0x%" PRIx64 "\n", attr.sample_stack_user); in DumpPerfEventAttr()
151 for (const auto& attr : attrs) { in GetCommonEventIdPositionsForAttrs() local
152 sample_types.push_back(attr.sample_type); in GetCommonEventIdPositionsForAttrs()
190 for (const auto& attr : attrs) { in GetCommonEventIdPositionsForAttrs() local
191 if (attr.sample_id_all == 0) { in GetCommonEventIdPositionsForAttrs()
223 bool IsTimestampSupported(const perf_event_attr& attr) { in IsTimestampSupported() argument
224 return attr.sample_id_all && (attr.sample_type & PERF_SAMPLE_TIME); in IsTimestampSupported()
227 bool IsCpuSupported(const perf_event_attr& attr) { in IsCpuSupported() argument
228 return attr.sample_id_all && (attr.sample_type & PERF_SAMPLE_CPU); in IsCpuSupported()
231 std::string GetEventNameByAttr(const perf_event_attr& attr) { in GetEventNameByAttr() argument
235 if (event_type.type == attr.type && in GetEventNameByAttr()
236 (event_type.config == attr.config || IsEtmEventType(event_type.type))) { in GetEventNameByAttr()
238 if (attr.exclude_user && !attr.exclude_kernel) { in GetEventNameByAttr()
240 } else if (attr.exclude_kernel && !attr.exclude_user) { in GetEventNameByAttr()