Commit 7094e2f
committed
sdk: honor TraceConfig.compression_type on the in-process backend
Mirror what `src/traced/service/service.cc` does for the system
backend: when the SDK is built with `enable_perfetto_zlib=true`,
construct the in-process backend's TracingService with
`init_opts.compressor_fn = &ZlibCompressFn` so that
`TraceConfig.compression_type = COMPRESSION_TYPE_DEFLATE` actually
takes effect. Without this, the in-process service is created with
default `init_opts` (compressor_fn == nullptr) and the
`compression_type` field on the TraceConfig is silently ignored —
embedders writing a local `.pftrace` via `TracingSession::Setup(cfg, fd)`
got an uncompressed file regardless of what they set in the config.
The compressor is wired only when PERFETTO_ZLIB is enabled, matching
the existing pattern in `service.cc:136-139`. No new public API; the
behavior is opt-in via the TraceConfig field that already exists.1 parent 5dba463 commit 7094e2f
4 files changed
Lines changed: 56 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| 957 | + | |
957 | 958 | | |
958 | 959 | | |
959 | 960 | | |
| |||
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
| 1037 | + | |
1036 | 1038 | | |
1037 | 1039 | | |
1038 | 1040 | | |
1039 | 1041 | | |
1040 | 1042 | | |
1041 | 1043 | | |
| 1044 | + | |
1042 | 1045 | | |
1043 | 1046 | | |
1044 | 1047 | | |
1045 | 1048 | | |
1046 | 1049 | | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1047 | 1055 | | |
1048 | 1056 | | |
1049 | 1057 | | |
| |||
1168 | 1176 | | |
1169 | 1177 | | |
1170 | 1178 | | |
| 1179 | + | |
1171 | 1180 | | |
1172 | 1181 | | |
1173 | 1182 | | |
| |||
1317 | 1326 | | |
1318 | 1327 | | |
1319 | 1328 | | |
| 1329 | + | |
1320 | 1330 | | |
1321 | 1331 | | |
1322 | 1332 | | |
| |||
1325 | 1335 | | |
1326 | 1336 | | |
1327 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1328 | 1341 | | |
1329 | 1342 | | |
1330 | 1343 | | |
1331 | 1344 | | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1332 | 1350 | | |
1333 | 1351 | | |
1334 | 1352 | | |
| |||
2135 | 2153 | | |
2136 | 2154 | | |
2137 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
2138 | 2159 | | |
2139 | 2160 | | |
2140 | 2161 | | |
2141 | 2162 | | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
2142 | 2168 | | |
2143 | 2169 | | |
2144 | 2170 | | |
| |||
3134 | 3160 | | |
3135 | 3161 | | |
3136 | 3162 | | |
| 3163 | + | |
3137 | 3164 | | |
3138 | 3165 | | |
3139 | 3166 | | |
| |||
3348 | 3375 | | |
3349 | 3376 | | |
3350 | 3377 | | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
3351 | 3381 | | |
3352 | 3382 | | |
3353 | 3383 | | |
3354 | 3384 | | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
3355 | 3390 | | |
3356 | 3391 | | |
3357 | 3392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| |||
9505 | 9506 | | |
9506 | 9507 | | |
9507 | 9508 | | |
| 9509 | + | |
9508 | 9510 | | |
9509 | 9511 | | |
9510 | 9512 | | |
| |||
9595 | 9597 | | |
9596 | 9598 | | |
9597 | 9599 | | |
9598 | | - | |
| 9600 | + | |
9599 | 9601 | | |
9600 | 9602 | | |
9601 | 9603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| |||
0 commit comments