lin
2025-08-01 633231e833e21d5b8b1c00cb15aedb62b3b78e8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{
  'target_defaults': {
    'variables': {
      'deps': [
        'libchrome-<(libbase_ver)',
        'openssl',
        'protobuf',
      ],
    },
    'include_dirs': [
      'compat/cros',
      '.',
    ],
  },
  'targets': [
    {
      'target_name': 'common',
      'type': 'static_library',
      'sources': [
        'address_mapper.cc',
        'binary_data_utils.cc',
        'buffer_reader.cc',
        'buffer_writer.cc',
        'compat/log_level.cc',
        'data_reader.cc',
        'data_writer.cc',
        'dso.cc',
        'file_reader.cc',
        'file_utils.cc',
        'huge_page_deducer.cc',
        'perf_data_utils.cc',
        'perf_option_parser.cc',
        'perf_parser.cc',
        'perf_protobuf_io.cc',
        'perf_reader.cc',
        'perf_recorder.cc',
        'perf_serializer.cc',
        'perf_stat_parser.cc',
        'run_command.cc',
        'sample_info_reader.cc',
        'scoped_temp_path.cc',
        'string_utils.cc',
      ],
      'dependencies': [
        'perf_data_proto',
        'perf_stat_proto',
      ],
      'export_dependent_settings': [
        'perf_data_proto',
        'perf_stat_proto',
      ],
      'link_settings': {
        'libraries': ['-lelf'],
      },
    },
    {
      'target_name': 'conversion_utils',
      'type': 'static_library',
      'sources': [
        'conversion_utils.cc',
      ],
      'dependencies': [
        'common',
      ],
    },
    {
      'target_name': 'common_test',
      'type': 'static_library',
      'sources': [
        'dso_test_utils.cc',
        'perf_test_files.cc',
        'test_perf_data.cc',
        'test_utils.cc',
      ],
      'dependencies': [
        'common',
      ],
      'export_dependent_settings': [
        'common',
      ],
    },
    {
      'target_name': 'perf_data_proto',
      'type': 'static_library',
      'variables': {
        'proto_in_dir': '.',
        'proto_out_dir': 'include',
      },
      'sources': [
        '<(proto_in_dir)/perf_data.proto',
      ],
      'includes': ['../common-mk/protoc.gypi'],
    },
    {
      'target_name': 'perf_stat_proto',
      'type': 'static_library',
      'variables': {
        'proto_in_dir': '.',
        'proto_out_dir': 'include',
      },
      'sources': [
        '<(proto_in_dir)/perf_stat.proto',
      ],
      'includes': ['../common-mk/protoc.gypi'],
    },
    {
      'target_name': 'quipper',
      'type': 'executable',
      'dependencies': [
        'common',
      ],
      'sources': [
        'quipper.cc',
      ],
    },
    {
      'target_name': 'perf_converter',
      'type': 'executable',
      'dependencies': [
        'common',
        'conversion_utils',
      ],
      'sources': [
        'perf_converter.cc',
      ],
    },
  ],
  'conditions': [
    ['USE_test == 1', {
      'targets': [
        {
          'target_name': 'integration_tests',
          'type': 'executable',
          'dependencies': [
            'common',
            'common_test',
            'conversion_utils',
          ],
          'includes': ['../common-mk/common_test.gypi'],
          'sources': [
            'conversion_utils_test.cc',
            'test_runner.cc',
          ],
        },
        {
          'target_name': 'perf_recorder_test',
          'type': 'executable',
          'dependencies': [
            'common',
            'common_test',
          ],
          'includes': ['../common-mk/common_test.gypi'],
          'sources': [
            'perf_recorder_test.cc',
          ],
        },
        {
          'target_name': 'unit_tests',
          'type': 'executable',
          'dependencies': [
            'common',
            'common_test',
          ],
          'includes': ['../common-mk/common_test.gypi'],
          'sources': [
            'address_mapper_test.cc',
            'binary_data_utils_test.cc',
            'buffer_reader_test.cc',
            'buffer_writer_test.cc',
            'dso_test.cc',
            'file_reader_test.cc',
            'huge_page_deducer_test.cc',
            'perf_data_utils_test.cc',
            'perf_option_parser_test.cc',
            'perf_parser_test.cc',
            'perf_reader_test.cc',
            'perf_serializer_test.cc',
            'perf_stat_parser_test.cc',
            'run_command_test.cc',
            'sample_info_reader_test.cc',
            'scoped_temp_path_test.cc',
            'test_runner.cc',
          ],
          'variables': {
            'deps': [
              'libcap',
            ],
          },
        },
      ],
    }],
  ],
}