header = perf_header__new();
if (raw_samples) {
- perf_header__feat_trace_info(header);
+ perf_header__set_feat(header, HEADER_TRACE_INFO);
} else {
for (i = 0; i < nr_counters; i++) {
if (attrs[i].sample_type & PERF_SAMPLE_RAW) {
- perf_header__feat_trace_info(header);
+ perf_header__set_feat(header, HEADER_TRACE_INFO);
break;
}
}
DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
};
-void perf_header__feat_trace_info(struct perf_header *header)
-{
- set_bit(HEADER_TRACE_INFO, header->adds_features);
-}
-
void perf_header__set_feat(struct perf_header *self, int feat)
{
set_bit(feat, self->adds_features);
{
struct perf_file_section trace_sec;
u64 cur_offset = lseek(fd, 0, SEEK_CUR);
- unsigned long *feat_mask = self->adds_features;
- if (test_bit(HEADER_TRACE_INFO, feat_mask)) {
+ if (perf_header__has_feat(self, HEADER_TRACE_INFO)) {
/* Write trace info */
trace_sec.offset = lseek(fd, sizeof(trace_sec), SEEK_CUR);
read_tracing_data(fd, attrs, nr_counters);
static void perf_header__adds_read(struct perf_header *self, int fd)
{
- const unsigned long *feat_mask = self->adds_features;
-
- if (test_bit(HEADER_TRACE_INFO, feat_mask)) {
+ if (perf_header__has_feat(self, HEADER_TRACE_INFO)) {
struct perf_file_section trace_sec;
do_read(fd, &trace_sec, sizeof(trace_sec));
u64 perf_header__sample_type(struct perf_header *header);
struct perf_event_attr *
perf_header__find_attr(u64 id, struct perf_header *header);
-void perf_header__feat_trace_info(struct perf_header *header);
void perf_header__set_feat(struct perf_header *self, int feat);
bool perf_header__has_feat(const struct perf_header *self, int feat);