2 * Copyright (C) 2015 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef SIMPLE_PERF_RECORD_FILE_FORMAT_H_
18 #define SIMPLE_PERF_RECORD_FILE_FORMAT_H_
20 #include "perf_event.h"
23 The file structure of perf.data:
30 The feature section has the following structure:
31 a section descriptor array, each element contains the section information of one add_feature.
32 data section of feature 1
33 data section of feature 2
40 uint32_t size; // size of rest fields in file_struct
44 uint32_t symbol_count;
52 meta_info feature section:
59 keys in meta_info feature section include:
64 namespace PerfFileFormat {
68 FEAT_FIRST_FEATURE = 1,
69 FEAT_TRACING_DATA = 1,
88 FEAT_SIMPLEPERF_START = 128,
89 FEAT_FILE = FEAT_SIMPLEPERF_START,
99 constexpr char PERF_MAGIC[] = "PERFILE2";
103 uint64_t header_size;
107 SectionDesc event_types;
108 unsigned char features[FEAT_MAX_NUM / 8];
112 perf_event_attr attr;
116 } // namespace PerfFileFormat
118 #endif // SIMPLE_PERF_RECORD_FILE_FORMAT_H_