Skip to content

Commit e96ff2c

Browse files
Merge branch 'main' of github.com:google/perfetto into dev/etiennep/state_proto_changes
2 parents fa41d4c + 80ccf2c commit e96ff2c

24 files changed

Lines changed: 2546 additions & 2405 deletions

File tree

Android.bp

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ cc_library {
10581058
"perfetto_defaults",
10591059
],
10601060
cflags: [
1061+
"-DPERFETTO_FORCE_DISABLE_ZLIB",
10611062
"-DPERFETTO_REGEX_FORCE_STD",
10621063
"-DPERFETTO_SHLIB_SDK_IMPLEMENTATION",
10631064
"-DZLIB_IMPLEMENTATION",
@@ -1067,7 +1068,6 @@ cc_library {
10671068
android: {
10681069
shared_libs: [
10691070
"liblog",
1070-
"libz",
10711071
],
10721072
static_libs: [
10731073
"perfetto_flags_c_lib",
@@ -1076,7 +1076,6 @@ cc_library {
10761076
host: {
10771077
static_libs: [
10781078
"liblog",
1079-
"libz",
10801079
],
10811080
},
10821081
windows: {
@@ -1362,6 +1361,7 @@ cc_library_static {
13621361
"perfetto_defaults",
13631362
],
13641363
cflags: [
1364+
"-DPERFETTO_FORCE_DISABLE_ZLIB",
13651365
"-DPERFETTO_REGEX_FORCE_STD",
13661366
"-DZLIB_IMPLEMENTATION",
13671367
],
@@ -1372,18 +1372,10 @@ cc_library_static {
13721372
min_sdk_version: "30",
13731373
target: {
13741374
android: {
1375-
shared_libs: [
1376-
"libz",
1377-
],
13781375
static_libs: [
13791376
"perfetto_flags_c_lib",
13801377
],
13811378
},
1382-
host: {
1383-
static_libs: [
1384-
"libz",
1385-
],
1386-
},
13871379
},
13881380
}
13891381

@@ -2224,18 +2216,10 @@ cc_library_static {
22242216
],
22252217
target: {
22262218
android: {
2227-
shared_libs: [
2228-
"libz",
2229-
],
22302219
static_libs: [
22312220
"perfetto_flags_c_lib",
22322221
],
22332222
},
2234-
host: {
2235-
static_libs: [
2236-
"libz",
2237-
],
2238-
},
22392223
},
22402224
}
22412225

@@ -3495,18 +3479,10 @@ cc_test {
34953479
test_config: "PerfettoIntegrationTests.xml",
34963480
target: {
34973481
android: {
3498-
shared_libs: [
3499-
"libz",
3500-
],
35013482
static_libs: [
35023483
"perfetto_flags_c_lib",
35033484
],
35043485
},
3505-
host: {
3506-
static_libs: [
3507-
"libz",
3508-
],
3509-
},
35103486
},
35113487
}
35123488

include/perfetto/base/build_config.h

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,30 @@
238238
#endif
239239
#endif
240240

241-
#undef PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB
242-
#if defined(PERFETTO_SDK_ENABLE_ZLIB) && (PERFETTO_SDK_ENABLE_ZLIB == 1)
243-
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() 1
244-
#else
245-
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() 0
246-
#endif
247-
248241
#undef PERFETTO_BUILDFLAG_DEFINE_PERFETTO_RE2
249242
#if defined(PERFETTO_SDK_ENABLE_RE2) && (PERFETTO_SDK_ENABLE_RE2 == 1)
250243
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_RE2() 1
251244
#else
252245
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_RE2() 0
253246
#endif
254247

248+
#undef PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB
249+
#if defined(PERFETTO_SDK_ENABLE_ZLIB) && (PERFETTO_SDK_ENABLE_ZLIB == 1)
250+
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() 1
251+
#else
252+
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() 0
253+
#endif
254+
255255
#endif // PERFETTO_BUILDFLAG(PERFETTO_AMALGAMATED_SDK)
256256

257+
// Unlike PERFETTO_SDK_ENABLE_ZLIB above (amalgamated SDK opt-in), this is a
258+
// file-scope opt-out that applies to every build. Define it to compile out the
259+
// optional zlib compressor. Static libs like libperfetto_client_experimental
260+
// get linked into many binaries, so keeping the compressor out means those
261+
// binaries don't have to link libz. See tools/gen_android_bp.
262+
#if defined(PERFETTO_FORCE_DISABLE_ZLIB)
263+
#undef PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB
264+
#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() 0
265+
#endif
266+
257267
#endif // INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_

protos/perfetto/config/etw/etw_config.proto

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ message EtwConfig {
3232
// The kernel_flags determines the flags that will be used by the etw tracing
3333
// session. These kernel flags have been built to expose the useful events
3434
// captured from the kernel mode only.
35-
repeated KernelFlag kernel_flags = 1;
35+
repeated KernelFlag kernel_flags = 1 [deprecated = true];
3636

3737
// See the list of keywords for for individual providers.
3838
// https://learn.microsoft.com/en-us/windows/win32/etw/system-providers
@@ -44,7 +44,10 @@ message EtwConfig {
4444
// Provides events relating to file I/O.
4545
repeated string file_provider_events = 4;
4646
// Events for which stacks should be collected.
47-
repeated string stack_sampling_events = 5;
47+
repeated string stack_sampling_events = 5 [deprecated = true];
4848
// Provides events relating to disk I/O.
49-
repeated string disk_provider_events = 6;
49+
repeated string disk_provider_events = 6 [deprecated = true];
50+
// Provides events relating to multiple kinds of IO including disk, cache, and
51+
// network.
52+
repeated string system_io_provider_events = 7;
5053
}

protos/perfetto/config/perfetto_config.proto

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ message EtwConfig {
13841384
// The kernel_flags determines the flags that will be used by the etw tracing
13851385
// session. These kernel flags have been built to expose the useful events
13861386
// captured from the kernel mode only.
1387-
repeated KernelFlag kernel_flags = 1;
1387+
repeated KernelFlag kernel_flags = 1 [deprecated = true];
13881388

13891389
// See the list of keywords for for individual providers.
13901390
// https://learn.microsoft.com/en-us/windows/win32/etw/system-providers
@@ -1396,9 +1396,12 @@ message EtwConfig {
13961396
// Provides events relating to file I/O.
13971397
repeated string file_provider_events = 4;
13981398
// Events for which stacks should be collected.
1399-
repeated string stack_sampling_events = 5;
1399+
repeated string stack_sampling_events = 5 [deprecated = true];
14001400
// Provides events relating to disk I/O.
1401-
repeated string disk_provider_events = 6;
1401+
repeated string disk_provider_events = 6 [deprecated = true];
1402+
// Provides events relating to multiple kinds of IO including disk, cache, and
1403+
// network.
1404+
repeated string system_io_provider_events = 7;
14021405
}
14031406

14041407
// End of protos/perfetto/config/etw/etw_config.proto

protos/perfetto/trace/perfetto_trace.proto

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ message EtwConfig {
13841384
// The kernel_flags determines the flags that will be used by the etw tracing
13851385
// session. These kernel flags have been built to expose the useful events
13861386
// captured from the kernel mode only.
1387-
repeated KernelFlag kernel_flags = 1;
1387+
repeated KernelFlag kernel_flags = 1 [deprecated = true];
13881388

13891389
// See the list of keywords for for individual providers.
13901390
// https://learn.microsoft.com/en-us/windows/win32/etw/system-providers
@@ -1396,9 +1396,12 @@ message EtwConfig {
13961396
// Provides events relating to file I/O.
13971397
repeated string file_provider_events = 4;
13981398
// Events for which stacks should be collected.
1399-
repeated string stack_sampling_events = 5;
1399+
repeated string stack_sampling_events = 5 [deprecated = true];
14001400
// Provides events relating to disk I/O.
1401-
repeated string disk_provider_events = 6;
1401+
repeated string disk_provider_events = 6 [deprecated = true];
1402+
// Provides events relating to multiple kinds of IO including disk, cache, and
1403+
// network.
1404+
repeated string system_io_provider_events = 7;
14021405
}
14031406

14041407
// End of protos/perfetto/config/etw/etw_config.proto
@@ -17326,6 +17329,8 @@ message ArtProcessMetadata {
1732617329
optional uint64 oom_free_bytes_until_oom = 7;
1732717330
// Stacktrace for the thread doing the failing allocation
1732817331
optional JavaStack oom_thread_java_stack = 8;
17332+
// Full OOME exception message
17333+
optional string oom_error_msg = 9;
1732917334
}
1733017335

1733117336
// End of protos/perfetto/trace/profiling/art_process_metadata.proto

protos/perfetto/trace/profiling/art_process_metadata.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ message ArtProcessMetadata {
4545
optional uint64 oom_free_bytes_until_oom = 7;
4646
// Stacktrace for the thread doing the failing allocation
4747
optional JavaStack oom_thread_java_stack = 8;
48+
// Full OOME exception message
49+
optional string oom_error_msg = 9;
4850
}

python/perfetto/protos/perfetto/trace/perfetto_trace_pb2.py

Lines changed: 2344 additions & 2338 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/perfetto/protos/perfetto/trace/perfetto_trace_pb2.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3757,7 +3757,7 @@ class V8Config(_message.Message):
37573757
def __init__(self, log_script_sources: bool = ..., log_instructions: bool = ...) -> None: ...
37583758

37593759
class EtwConfig(_message.Message):
3760-
__slots__ = ("kernel_flags", "scheduler_provider_events", "memory_provider_events", "file_provider_events", "stack_sampling_events", "disk_provider_events")
3760+
__slots__ = ("kernel_flags", "scheduler_provider_events", "memory_provider_events", "file_provider_events", "stack_sampling_events", "disk_provider_events", "system_io_provider_events")
37613761
class KernelFlag(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
37623762
__slots__ = ()
37633763
CSWITCH: _ClassVar[EtwConfig.KernelFlag]
@@ -3770,13 +3770,15 @@ class EtwConfig(_message.Message):
37703770
FILE_PROVIDER_EVENTS_FIELD_NUMBER: _ClassVar[int]
37713771
STACK_SAMPLING_EVENTS_FIELD_NUMBER: _ClassVar[int]
37723772
DISK_PROVIDER_EVENTS_FIELD_NUMBER: _ClassVar[int]
3773+
SYSTEM_IO_PROVIDER_EVENTS_FIELD_NUMBER: _ClassVar[int]
37733774
kernel_flags: _containers.RepeatedScalarFieldContainer[EtwConfig.KernelFlag]
37743775
scheduler_provider_events: _containers.RepeatedScalarFieldContainer[str]
37753776
memory_provider_events: _containers.RepeatedScalarFieldContainer[str]
37763777
file_provider_events: _containers.RepeatedScalarFieldContainer[str]
37773778
stack_sampling_events: _containers.RepeatedScalarFieldContainer[str]
37783779
disk_provider_events: _containers.RepeatedScalarFieldContainer[str]
3779-
def __init__(self, kernel_flags: _Optional[_Iterable[_Union[EtwConfig.KernelFlag, str]]] = ..., scheduler_provider_events: _Optional[_Iterable[str]] = ..., memory_provider_events: _Optional[_Iterable[str]] = ..., file_provider_events: _Optional[_Iterable[str]] = ..., stack_sampling_events: _Optional[_Iterable[str]] = ..., disk_provider_events: _Optional[_Iterable[str]] = ...) -> None: ...
3780+
system_io_provider_events: _containers.RepeatedScalarFieldContainer[str]
3781+
def __init__(self, kernel_flags: _Optional[_Iterable[_Union[EtwConfig.KernelFlag, str]]] = ..., scheduler_provider_events: _Optional[_Iterable[str]] = ..., memory_provider_events: _Optional[_Iterable[str]] = ..., file_provider_events: _Optional[_Iterable[str]] = ..., stack_sampling_events: _Optional[_Iterable[str]] = ..., disk_provider_events: _Optional[_Iterable[str]] = ..., system_io_provider_events: _Optional[_Iterable[str]] = ...) -> None: ...
37803782

37813783
class FrozenFtraceConfig(_message.Message):
37823784
__slots__ = ("instance_name",)
@@ -19494,7 +19496,7 @@ class JavaStack(_message.Message):
1949419496
def __init__(self, frames: _Optional[_Iterable[_Union[JavaFrame, _Mapping]]] = ...) -> None: ...
1949519497

1949619498
class ArtProcessMetadata(_message.Message):
19497-
__slots__ = ("pid", "uid", "process_name", "package_name", "oom_allocation_size", "oom_total_bytes_free", "oom_free_bytes_until_oom", "oom_thread_java_stack")
19499+
__slots__ = ("pid", "uid", "process_name", "package_name", "oom_allocation_size", "oom_total_bytes_free", "oom_free_bytes_until_oom", "oom_thread_java_stack", "oom_error_msg")
1949819500
PID_FIELD_NUMBER: _ClassVar[int]
1949919501
UID_FIELD_NUMBER: _ClassVar[int]
1950019502
PROCESS_NAME_FIELD_NUMBER: _ClassVar[int]
@@ -19503,6 +19505,7 @@ class ArtProcessMetadata(_message.Message):
1950319505
OOM_TOTAL_BYTES_FREE_FIELD_NUMBER: _ClassVar[int]
1950419506
OOM_FREE_BYTES_UNTIL_OOM_FIELD_NUMBER: _ClassVar[int]
1950519507
OOM_THREAD_JAVA_STACK_FIELD_NUMBER: _ClassVar[int]
19508+
OOM_ERROR_MSG_FIELD_NUMBER: _ClassVar[int]
1950619509
pid: int
1950719510
uid: int
1950819511
process_name: str
@@ -19511,7 +19514,8 @@ class ArtProcessMetadata(_message.Message):
1951119514
oom_total_bytes_free: int
1951219515
oom_free_bytes_until_oom: int
1951319516
oom_thread_java_stack: JavaStack
19514-
def __init__(self, pid: _Optional[int] = ..., uid: _Optional[int] = ..., process_name: _Optional[str] = ..., package_name: _Optional[str] = ..., oom_allocation_size: _Optional[int] = ..., oom_total_bytes_free: _Optional[int] = ..., oom_free_bytes_until_oom: _Optional[int] = ..., oom_thread_java_stack: _Optional[_Union[JavaStack, _Mapping]] = ...) -> None: ...
19517+
oom_error_msg: str
19518+
def __init__(self, pid: _Optional[int] = ..., uid: _Optional[int] = ..., process_name: _Optional[str] = ..., package_name: _Optional[str] = ..., oom_allocation_size: _Optional[int] = ..., oom_total_bytes_free: _Optional[int] = ..., oom_free_bytes_until_oom: _Optional[int] = ..., oom_thread_java_stack: _Optional[_Union[JavaStack, _Mapping]] = ..., oom_error_msg: _Optional[str] = ...) -> None: ...
1951519519

1951619520
class ObfuscatedMember(_message.Message):
1951719521
__slots__ = ("obfuscated_name", "deobfuscated_name", "obfuscated_line_start", "obfuscated_line_end", "source_line_start", "source_line_end")

src/base/regex/regex_pcre2.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919

2020
#include "perfetto/base/build_config.h"
2121

22-
// See note in regex_re2.h.
23-
#if PERFETTO_BUILDFLAG(PERFETTO_PCRE2)
22+
// See note in regex_re2.h. Also honor PERFETTO_REGEX_FORCE_STD: targets that
23+
// define it (e.g. libperfetto_client_experimental) opt out of the optional
24+
// backends and must not pull in <pcre2.h>, even when PERFETTO_PCRE2 is set.
25+
#if PERFETTO_BUILDFLAG(PERFETTO_PCRE2) && !defined(PERFETTO_REGEX_FORCE_STD)
2426

2527
#include <limits>
2628
#include <memory>
@@ -198,6 +200,7 @@ class RegexPcre2 {
198200
} // namespace base
199201
} // namespace perfetto
200202

201-
#endif // PERFETTO_BUILDFLAG(PERFETTO_PCRE2)
203+
#endif // PERFETTO_BUILDFLAG(PERFETTO_PCRE2) &&
204+
// !defined(PERFETTO_REGEX_FORCE_STD)
202205

203206
#endif // SRC_BASE_REGEX_REGEX_PCRE2_H_

src/base/regex/regex_re2.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
#include "perfetto/base/build_config.h"
2121

2222
// Guarded because gen_amalgamated inlines the body even when the include
23-
// site in regex.cc is preprocessed out.
24-
#if PERFETTO_BUILDFLAG(PERFETTO_RE2)
23+
// site in regex.cc is preprocessed out. Also honor PERFETTO_REGEX_FORCE_STD:
24+
// targets that define it opt out of the optional backends and must not pull in
25+
// <re2/re2.h>, even when PERFETTO_RE2 is set.
26+
#if PERFETTO_BUILDFLAG(PERFETTO_RE2) && !defined(PERFETTO_REGEX_FORCE_STD)
2527

2628
#include <memory>
2729
#include <string>
@@ -124,6 +126,7 @@ class RegexRe2 {
124126
} // namespace base
125127
} // namespace perfetto
126128

127-
#endif // PERFETTO_BUILDFLAG(PERFETTO_RE2)
129+
#endif // PERFETTO_BUILDFLAG(PERFETTO_RE2) &&
130+
// !defined(PERFETTO_REGEX_FORCE_STD)
128131

129132
#endif // SRC_BASE_REGEX_REGEX_RE2_H_

0 commit comments

Comments
 (0)