diff --git a/CMakeLists.txt b/CMakeLists.txt index 20f8ff3..5ceb1b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,12 +160,33 @@ function(calf_set_default_log_dir target) endfunction() function(calf_enable_log target ENABLE) + if (${ARGC} GREATER 3) + message(FATAL_ERROR "calf_enable_log accepts target, ENABLE, and optional JSON or PROTOBUF format") + endif() + if (ENABLE) target_compile_definitions(${target} PRIVATE CALF_LOG) - target_link_libraries(${target} PRIVATE calf_headers) + if(${ARGC} EQUAL 3) + string(TOUPPER "${ARGV2}" format) + elseif(CALF_PROTOBUF) + set(format "PROTOBUF") + else() + set(format "JSON") + endif() + + if(format STREQUAL "PROTOBUF") + if(NOT TARGET calf::protobuf) + message(FATAL_ERROR "calf_enable_log(${target}) requested PROTOBUF but CALF_PROTOBUF is OFF") + endif() + target_link_libraries(${target} PRIVATE calf::protobuf) + elseif(format STREQUAL "JSON") + target_link_libraries(${target} PRIVATE calf_headers) + else() + message(FATAL_ERROR "calf_enable_log format must be JSON or PROTOBUF, got: ${ARGV2}") + endif() endif () target_include_directories(${target} PRIVATE "${CMAKE_CURRENT_FUNCTION_LIST_DIR}") - message(STATUS "calf_enable_log(${target}) -> include dir: ${CMAKE_CURRENT_FUNCTION_LIST_DIR}") + message(STATUS "calf_enable_log(${target}) -> ${format} include dir: ${CMAKE_CURRENT_FUNCTION_LIST_DIR}") endfunction() function(calf_enable_warnings_as_errors target) @@ -197,14 +218,14 @@ if(CALF_TESTS) include(GoogleTest) add_executable(calf_core_tests tests/core_tests.cpp) - calf_enable_log(calf_core_tests ON) + calf_enable_log(calf_core_tests ON JSON) calf_enable_warnings_as_errors(calf_core_tests) target_compile_features(calf_core_tests PRIVATE cxx_std_17) target_link_libraries(calf_core_tests PRIVATE GTest::gtest_main nlohmann_json::nlohmann_json) gtest_discover_tests(calf_core_tests) add_executable(calf_stl_tests tests/stl_tests.cpp) - calf_enable_log(calf_stl_tests ON) + calf_enable_log(calf_stl_tests ON JSON) calf_enable_warnings_as_errors(calf_stl_tests) target_compile_features(calf_stl_tests PRIVATE cxx_std_17) target_link_libraries(calf_stl_tests PRIVATE GTest::gtest_main nlohmann_json::nlohmann_json) @@ -212,25 +233,26 @@ if(CALF_TESTS) if(CALF_PROTOBUF) add_executable(calf_protobuf_tests tests/protobuf_tests.cpp) + calf_enable_log(calf_protobuf_tests ON) calf_enable_warnings_as_errors(calf_protobuf_tests) target_compile_features(calf_protobuf_tests PRIVATE cxx_std_17) - target_link_libraries(calf_protobuf_tests PRIVATE GTest::gtest_main calf::protobuf) + target_link_libraries(calf_protobuf_tests PRIVATE GTest::gtest_main) gtest_discover_tests(calf_protobuf_tests) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") add_executable(calf_syscall_protobuf_tests tests/syscall_protobuf_tests.cpp) + calf_enable_log(calf_syscall_protobuf_tests ON) calf_enable_warnings_as_errors(calf_syscall_protobuf_tests) target_compile_definitions(calf_syscall_protobuf_tests PRIVATE __CALF_POSIX) target_compile_features(calf_syscall_protobuf_tests PRIVATE cxx_std_17) - target_link_libraries(calf_syscall_protobuf_tests PRIVATE GTest::gtest_main - calf::protobuf) + target_link_libraries(calf_syscall_protobuf_tests PRIVATE GTest::gtest_main) gtest_discover_tests(calf_syscall_protobuf_tests) endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") add_executable(calf_syscall_tests tests/syscall_tests.cpp) - calf_enable_log(calf_syscall_tests ON) + calf_enable_log(calf_syscall_tests ON JSON) calf_enable_warnings_as_errors(calf_syscall_tests) target_compile_definitions(calf_syscall_tests PRIVATE __CALF_POSIX) target_compile_features(calf_syscall_tests PRIVATE cxx_std_17) diff --git a/README.md b/README.md index e78e7d1..b4721d6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![C++ tests](https://github.com/High-Performance-IO/CALF/actions/workflows/cpp-tests.yml/badge.svg?branch=main)](https://github.com/High-Performance-IO/CALF/actions/workflows/cpp-tests.yml?query=branch%3Amain) [![Python tests](https://github.com/High-Performance-IO/CALF/actions/workflows/python-tests.yml/badge.svg?branch=main)](https://github.com/High-Performance-IO/CALF/actions/workflows/python-tests.yml?query=branch%3Amain) -Calf is a structured, header-only C++17 logging library for the [CAPIO](https://github.com/High-Performance-IO/capio) ecosystem. It supports indented JSON output and an opt-in streaming protobuf format for lower-overhead trace creation. +Calf is a structured, header-only C++17 logging library for the [CAPIO](https://github.com/High-Performance-IO/capio) ecosystem. It supports indented JSON output and opt-in streaming Perfetto traces for lower-overhead trace creation. Calf is designed to work in two distinct environments: @@ -19,12 +19,11 @@ Calf is designed to work in two distinct environments: - **NON STL safe processes**: uses raw syscalls whenever STL is not safe (`SyscallLogger`) Both backends share the same JSON structure and produce identical output formats. -The C++ protobuf format works with both `StlLogger` and `SyscallLogger`. It uses -Google's generated Protobuf C++ classes and writes `.pb` files matching -`calf/protobuf/calf_trace.proto`. -Each file is a valid `calf.proto.TraceFile`; flat -scope-enter, event, and scope-exit records can be streamed and reconstructed -through `scope_id` and `parent_scope_id`. +The C++ Perfetto format works with both `StlLogger` and `SyscallLogger`. It +writes standard `.perfetto-trace` protobuf streams that open directly in the +[Perfetto UI](https://ui.perfetto.dev/). Scopes are nested TrackEvent slices, +while `LOG` messages are instant TrackEvents with source locations and an +`args` debug annotation. ## CALF Inspector @@ -84,17 +83,23 @@ Each log scope opened by `START_LOG` becomes one JSON object in a root array. In ] ``` -Each thread writes to its own log file under the log directory, named after the thread ID. +JSON output writes one file per thread. Perfetto output combines all threads in +one process into +`$CALF_LOG_DIR//_.perfetto-trace`. -### Protobuf output +### Perfetto output -Select protobuf by linking the application target with `calf::protobuf`. The +Select Perfetto output by linking the application target with `calf::protobuf`. The existing logger include and macro interface remain unchanged: ```cmake target_link_libraries(my_server PRIVATE calf::protobuf) ``` +Projects using `calf_enable_log(target ON)` select Perfetto automatically when +`CALF_PROTOBUF=ON`. Use `calf_enable_log(target ON JSON)` only for targets that +intentionally require JSON output. + ```cpp #include @@ -104,11 +109,14 @@ void handle_request(const char *path) { } ``` -CMake uses an installed Google Protobuf package when available and otherwise -downloads it from source through `FetchContent`. Without the `calf::protobuf` -link dependency, `StlLogger.h` and `SyscallLogger.h` produce JSON. The syscall -backend writes serialized protobuf bytes through raw syscalls; constructing the -generated messages still uses Google's C++ runtime and its allocations. +CMake uses an installed Google Protobuf package for its minimal Perfetto schema +and tests, and otherwise downloads it through `FetchContent`. Without the +`calf::protobuf` link dependency, `StlLogger.h` and `SyscallLogger.h` produce +JSON. The syscall backend writes Perfetto protobuf bytes directly through raw +syscalls without constructing generated messages or allocating per event. +STL writes are synchronized across threads, while syscall writes use file locks +so packets cannot interleave. A process truncates its trace on the first write; +different processes always write separate files. ## Integration @@ -150,7 +158,7 @@ target_link_libraries(my_interceptor PRIVATE calf::syscall) | `CALF_TESTS` | `OFF` | Build and register the GoogleTest suites with CTest. | | `CALF_PYTHON_TESTS` | Value of `CALF_TESTS` | Build the Python extension and register its binding tests. | | `CALF_BUILD_PYTHON_BINDINGS` | `OFF` | Build and install the private `calf._py_calf` Python extension. | -| `CALF_PROTOBUF` | `ON` | Build the Google Protobuf C++ logger and `calf::protobuf` target. | +| `CALF_PROTOBUF` | `ON` | Build the Perfetto trace logger and `calf::protobuf` target. | | `CALF_DEFAULT_COMPONENT_NAME` | `calf` | Component directory and CLI header name used by configured targets. | | `CALF_DEFAULT_LOG_DIR_NAME` | `./calf_logs` | Default log root when `CALF_LOG_DIR` is unset. | @@ -333,6 +341,8 @@ void internal_op() { | Variable | Description | Default | |----------------------|---------------------------------------------------------------|------------------| | `CALF_LOG_DIR` | Root directory for all log output. | `./calf_logs` | -| `CALF_LOG_PREFIX` | Filename prefix for per-thread log files. | Backend-specific | +| `CALF_LOG_PREFIX` | Filename prefix for per-thread JSON files; ignored by Perfetto output. | Backend-specific | -Log files are written to `$CALF_LOG_DIR///.log`. +JSON files are written to +`$CALF_LOG_DIR///.log`. Perfetto files are +written to `$CALF_LOG_DIR//_.perfetto-trace`. diff --git a/bindings/calf/protobuf/calf_trace_pb2.py b/bindings/calf/protobuf/calf_trace_pb2.py index 878437d..49e3fbc 100644 --- a/bindings/calf/protobuf/calf_trace_pb2.py +++ b/bindings/calf/protobuf/calf_trace_pb2.py @@ -24,17 +24,27 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1e\x63\x61lf/protobuf/calf_trace.proto\x12\ncalf.proto\"\xe9\x01\n\x0bTraceRecord\x12\x14\n\x0ctimestamp_ms\x18\x01 \x01(\x04\x12\x10\n\x08scope_id\x18\x02 \x01(\x04\x12\x17\n\x0fparent_scope_id\x18\x03 \x01(\x04\x12*\n\x04kind\x18\x04 \x01(\x0e\x32\x1c.calf.proto.TraceRecord.Kind\x12\x0f\n\x07invoker\x18\x05 \x01(\t\x12\x0c\n\x04\x66ile\x18\x06 \x01(\t\x12\x0c\n\x04line\x18\x07 \x01(\r\x12\x0c\n\x04\x61rgs\x18\x08 \x01(\t\"2\n\x04Kind\x12\x0f\n\x0bSCOPE_ENTER\x10\x00\x12\t\n\x05\x45VENT\x10\x01\x12\x0e\n\nSCOPE_EXIT\x10\x02\"5\n\tTraceFile\x12(\n\x07records\x18\x01 \x03(\x0b\x32\x17.calf.proto.TraceRecordb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1e\x63\x61lf/protobuf/calf_trace.proto\x12\x0fperfetto.protos\"5\n\x05Trace\x12,\n\x06packet\x18\x01 \x03(\x0b\x32\x1c.perfetto.protos.TracePacket\"\xce\x01\n\x0bTracePacket\x12\x11\n\ttimestamp\x18\x08 \x01(\x04\x12\"\n\x1atrusted_packet_sequence_id\x18\n \x01(\r\x12\x30\n\x0btrack_event\x18\x0b \x01(\x0b\x32\x1b.perfetto.protos.TrackEvent\x12\x1a\n\x12timestamp_clock_id\x18: \x01(\r\x12:\n\x10track_descriptor\x18< \x01(\x0b\x32 .perfetto.protos.TrackDescriptor\"\xc3\x02\n\nTrackEvent\x12;\n\x11\x64\x65\x62ug_annotations\x18\x04 \x03(\x0b\x32 .perfetto.protos.DebugAnnotation\x12.\n\x04type\x18\t \x01(\x0e\x32 .perfetto.protos.TrackEvent.Type\x12\x12\n\ntrack_uuid\x18\x0b \x01(\x04\x12\x12\n\ncategories\x18\x16 \x03(\t\x12\x0c\n\x04name\x18\x17 \x01(\t\x12\x38\n\x0fsource_location\x18! \x01(\x0b\x32\x1f.perfetto.protos.SourceLocation\"X\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10TYPE_SLICE_BEGIN\x10\x01\x12\x12\n\x0eTYPE_SLICE_END\x10\x02\x12\x10\n\x0cTYPE_INSTANT\x10\x03\"5\n\x0f\x44\x65\x62ugAnnotation\x12\x14\n\x0cstring_value\x18\x06 \x01(\t\x12\x0c\n\x04name\x18\n \x01(\t\"O\n\x0eSourceLocation\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x15\n\rfunction_name\x18\x03 \x01(\t\x12\x13\n\x0bline_number\x18\x04 \x01(\r\"`\n\x0fTrackDescriptor\x12\x0c\n\x04uuid\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x31\n\x06thread\x18\x04 \x01(\x0b\x32!.perfetto.protos.ThreadDescriptor\"A\n\x10ThreadDescriptor\x12\x0b\n\x03pid\x18\x01 \x01(\x05\x12\x0b\n\x03tid\x18\x02 \x01(\x03\x12\x13\n\x0bthread_name\x18\x05 \x01(\t') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'calf.protobuf.calf_trace_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: DESCRIPTOR._loaded_options = None - _globals['_TRACERECORD']._serialized_start=47 - _globals['_TRACERECORD']._serialized_end=280 - _globals['_TRACERECORD_KIND']._serialized_start=230 - _globals['_TRACERECORD_KIND']._serialized_end=280 - _globals['_TRACEFILE']._serialized_start=282 - _globals['_TRACEFILE']._serialized_end=335 + _globals['_TRACE']._serialized_start=51 + _globals['_TRACE']._serialized_end=104 + _globals['_TRACEPACKET']._serialized_start=107 + _globals['_TRACEPACKET']._serialized_end=313 + _globals['_TRACKEVENT']._serialized_start=316 + _globals['_TRACKEVENT']._serialized_end=639 + _globals['_TRACKEVENT_TYPE']._serialized_start=551 + _globals['_TRACKEVENT_TYPE']._serialized_end=639 + _globals['_DEBUGANNOTATION']._serialized_start=641 + _globals['_DEBUGANNOTATION']._serialized_end=694 + _globals['_SOURCELOCATION']._serialized_start=696 + _globals['_SOURCELOCATION']._serialized_end=775 + _globals['_TRACKDESCRIPTOR']._serialized_start=777 + _globals['_TRACKDESCRIPTOR']._serialized_end=873 + _globals['_THREADDESCRIPTOR']._serialized_start=875 + _globals['_THREADDESCRIPTOR']._serialized_end=940 # @@protoc_insertion_point(module_scope) diff --git a/calf/StlLogger.h b/calf/StlLogger.h index 73bcd90..222242e 100644 --- a/calf/StlLogger.h +++ b/calf/StlLogger.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -14,18 +15,61 @@ #include "format/LogFormat.h" #include "utils//ThreadId.h" -struct StlLogger : CalfLogBase { +#ifdef CALF_LOG_FORMAT_PROTOBUF +#define CALF_STL_LOGGER_TYPE PerfettoStlLogger +#else +#define CALF_STL_LOGGER_TYPE JsonStlLogger +#endif + +struct CALF_STL_LOGGER_TYPE : CalfLogBase { - inline static thread_local std::unique_ptr logfile = nullptr; + inline static thread_local std::unique_ptr logfile = nullptr; inline static thread_local std::unique_ptr logFileName = nullptr; +#ifdef CALF_LOG_FORMAT_PROTOBUF + inline static std::unique_ptr perfettoLogfile = nullptr; + inline static std::unique_ptr perfettoLogFileName = nullptr; + inline static std::recursive_mutex perfettoLogfileMutex; + inline static pid_t logfilePid = 0; +#endif + + explicit CALF_STL_LOGGER_TYPE() { ensureFileOpen(); } + + static unsigned long currentTimestamp() { +#ifdef CALF_LOG_FORMAT_PROTOBUF + timespec now{}; + ::clock_gettime(CLOCK_MONOTONIC, &now); + return static_cast(now.tv_sec) * 1000000000UL + + static_cast(now.tv_nsec); +#else + return static_cast(current_time_in_millis()); +#endif + } + +#ifdef CALF_LOG_FORMAT_PROTOBUF + static pid_t processId() { return ::getpid(); } - explicit StlLogger() { ensureFileOpen(); } + static long threadId() { return calf_current_tid(); } +#endif - static std::string getLogFileName() { return logFileName ? *logFileName : std::string{}; } + static std::string getLogFileName() { +#ifdef CALF_LOG_FORMAT_PROTOBUF + const std::lock_guard lock(perfettoLogfileMutex); + return perfettoLogFileName ? *perfettoLogFileName : std::string{}; +#else + return logFileName ? *logFileName : std::string{}; +#endif + } static void rawWriteBytes(const char *buf, const int len) { +#ifdef CALF_LOG_FORMAT_PROTOBUF + const std::lock_guard lock(perfettoLogfileMutex); +#endif ensureFileOpen(); +#ifdef CALF_LOG_FORMAT_PROTOBUF + perfettoLogfile->write(buf, len); +#else logfile->write(buf, len); +#endif if (!CALF_LOG_FILE_BINARY) { logfile->flush(); } @@ -36,9 +80,16 @@ struct StlLogger : CalfLogBase { } static void flush() { +#ifdef CALF_LOG_FORMAT_PROTOBUF + const std::lock_guard lock(perfettoLogfileMutex); + if (perfettoLogfile) { + perfettoLogfile->flush(); + } +#else if (logfile) { logfile->flush(); } +#endif } static void reopenRootArray() { @@ -50,12 +101,28 @@ struct StlLogger : CalfLogBase { private: static void ensureFileOpen() { +#ifdef CALF_LOG_FORMAT_PROTOBUF + const std::lock_guard lock(perfettoLogfileMutex); + const auto currentPid = ::getpid(); + if (perfettoLogfile != nullptr && perfettoLogfile->is_open() && + logfilePid != currentPid) { + perfettoLogfile->close(); + perfettoLogfile.reset(); + perfettoLogFileName.reset(); + } + if (perfettoLogfile != nullptr && perfettoLogfile->is_open()) { + return; + } +#else if (logfile != nullptr && logfile->is_open()) { return; } +#endif std::string logDir; +#ifndef CALF_LOG_FORMAT_PROTOBUF std::string prefix; +#endif if (const char *env = std::getenv("CALF_LOG_DIR"); env != nullptr) { logDir = env; @@ -63,33 +130,58 @@ struct StlLogger : CalfLogBase { logDir = CALF_DEFAULT_LOG_FOLDER; } +#ifndef CALF_LOG_FORMAT_PROTOBUF if (const char *env = std::getenv("CALF_LOG_PREFIX"); env != nullptr) { prefix = env; } else { prefix = CALF_STL_DEFAULT_LOG_FILE_PREFIX; } +#endif char hostname[CALF_HOSTNAME_BUFFER_SIZE]{}; ::gethostname(hostname, sizeof(hostname)); hostname[sizeof(hostname) - 1] = '\0'; +#ifdef CALF_LOG_FORMAT_PROTOBUF + const std::filesystem::path outputFolder{logDir + "/" + hostname}; +#else const std::filesystem::path outputFolder{logDir + "/" + CALF_COMPONENT_NAME + "/" + hostname}; +#endif std::filesystem::create_directories(outputFolder); +#ifdef CALF_LOG_FORMAT_PROTOBUF + const std::filesystem::path path = + outputFolder / (std::string(CALF_COMPONENT_NAME) + "_" + std::to_string(::getpid()) + + CALF_LOG_FILE_EXTENSION); +#else const std::filesystem::path path = outputFolder / (prefix + std::to_string(calf_current_tid()) + CALF_LOG_FILE_EXTENSION); +#endif +#ifdef CALF_LOG_FORMAT_PROTOBUF + std::ios::openmode mode = std::ios::out | std::ios::trunc | std::ios::binary; +#else std::ios::openmode mode = std::ios::in | std::ios::out | std::ios::trunc; if (CALF_LOG_FILE_BINARY) { mode |= std::ios::binary; } +#endif +#ifdef CALF_LOG_FORMAT_PROTOBUF + perfettoLogfile = std::make_unique(path, mode); + perfettoLogFileName = std::make_unique(path.string()); + logfilePid = currentPid; +#else logfile = std::make_unique(path, mode); logFileName = std::make_unique(path.string()); +#endif } }; +using StlLogger = CALF_STL_LOGGER_TYPE; +#undef CALF_STL_LOGGER_TYPE + using Logger = TemplateLogger; #ifdef CALF_LOG diff --git a/calf/SyscallLogger.h b/calf/SyscallLogger.h index 4bc66b7..b2a3bc7 100644 --- a/calf/SyscallLogger.h +++ b/calf/SyscallLogger.h @@ -3,6 +3,7 @@ #if defined(__linux__) +#include #include #include #include @@ -10,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -17,10 +19,20 @@ #include "format/BaseLogger.h" #include "format/LogFormat.h" -struct SyscallLogger : CalfLogBase { +#ifdef CALF_LOG_FORMAT_PROTOBUF +#define CALF_SYSCALL_LOGGER_TYPE PerfettoSyscallLogger +#else +#define CALF_SYSCALL_LOGGER_TYPE JsonSyscallLogger +#endif + +struct CALF_SYSCALL_LOGGER_TYPE : CalfLogBase { static thread_local int fileFD; static thread_local char filePath[PATH_MAX]; +#ifdef CALF_LOG_FORMAT_PROTOBUF + static thread_local pid_t filePid; + inline static std::atomic traceFileState{0}; +#endif // Syscall function pointer — defaults to ::syscall. using SyscallFn = long (*)(long, ...); @@ -28,7 +40,38 @@ struct SyscallLogger : CalfLogBase { static void setSyscallFn(SyscallFn fn) { syscallFn = fn; } - explicit SyscallLogger() { ensureFileOpen(); } + static unsigned long currentTimestamp() { + timespec now{}; +#ifdef CALF_LOG_FORMAT_PROTOBUF + constexpr clockid_t clock = CLOCK_MONOTONIC; +#else + constexpr clockid_t clock = CLOCK_REALTIME; +#endif + if (calf_syscall(SYS_clock_gettime, clock, &now) != 0) { + return 0; + } +#ifdef CALF_LOG_FORMAT_PROTOBUF + return static_cast(now.tv_sec) * 1000000000UL + + static_cast(now.tv_nsec); +#else + static const unsigned long start = static_cast(now.tv_sec) * 1000UL + + static_cast(now.tv_nsec) / 1000000UL; + return static_cast(now.tv_sec) * 1000UL + + static_cast(now.tv_nsec) / 1000000UL - start; +#endif + } + +#ifdef CALF_LOG_FORMAT_PROTOBUF + static pid_t processId() { return static_cast(calf_syscall(SYS_getpid)); } + + static long threadId() { return calf_syscall(SYS_gettid); } +#endif + + explicit CALF_SYSCALL_LOGGER_TYPE() { + if (enable_logger) { + ensureFileOpen(); + } + } static std::string getLogFileName() { return filePath[0] != '\0' ? std::string(filePath) : std::string{}; @@ -36,15 +79,24 @@ struct SyscallLogger : CalfLogBase { static void rawWriteBytes(const char *buf, int len) { ensureFileOpen(); +#ifdef CALF_LOG_FORMAT_PROTOBUF + calf_syscall(SYS_flock, fileFD, LOCK_EX); +#endif int written = 0; while (written < len) { const long result = calf_syscall(SYS_write, fileFD, buf + written, static_cast(len - written)); if (result <= 0) { +#ifdef CALF_LOG_FORMAT_PROTOBUF + calf_syscall(SYS_flock, fileFD, LOCK_UN); +#endif return; } written += static_cast(result); } +#ifdef CALF_LOG_FORMAT_PROTOBUF + calf_syscall(SYS_flock, fileFD, LOCK_UN); +#endif } static void rawWriteStr(const char *buf) { @@ -74,25 +126,59 @@ struct SyscallLogger : CalfLogBase { } static void ensureFileOpen() { +#ifdef CALF_LOG_FORMAT_PROTOBUF + const auto currentPid = processId(); + if (fileFD != -1 && filePid != currentPid) { + calf_syscall(SYS_close, fileFD); + fileFD = -1; + traceFileState.store(0, std::memory_order_release); + } +#endif if (fileFD != -1) { return; } +#ifdef CALF_LOG_FORMAT_PROTOBUF + int expected = 0; + const bool initializesTrace = traceFileState.compare_exchange_strong( + expected, 1, std::memory_order_acq_rel, std::memory_order_acquire); + if (!initializesTrace) { + while (traceFileState.load(std::memory_order_acquire) != 2) { + calf_syscall(SYS_sched_yield); + } + } + ::snprintf(filePath, PATH_MAX, "%s/%s_%ld%s", getHostLogDir(), CALF_COMPONENT_NAME, + static_cast(currentPid), CALF_LOG_FILE_EXTENSION); +#else ::snprintf(filePath, PATH_MAX, "%s/%s%ld%s", getHostLogDir(), getLogPrefix(), calf_syscall(SYS_gettid), CALF_LOG_FILE_EXTENSION); +#endif calf_syscall(SYS_mkdirat, AT_FDCWD, getLogDir(), 0755); +#ifndef CALF_LOG_FORMAT_PROTOBUF calf_syscall(SYS_mkdirat, AT_FDCWD, getSyscallLogDir(), 0755); +#endif calf_syscall(SYS_mkdirat, AT_FDCWD, getHostLogDir(), 0755); +#ifdef CALF_LOG_FORMAT_PROTOBUF + const int openFlags = O_CREAT | O_RDWR | O_APPEND | (initializesTrace ? O_TRUNC : 0); +#else + constexpr int openFlags = O_CREAT | O_RDWR | O_TRUNC; +#endif fileFD = static_cast( - calf_syscall(SYS_openat, AT_FDCWD, filePath, O_CREAT | O_RDWR | O_TRUNC, 0644)); + calf_syscall(SYS_openat, AT_FDCWD, filePath, openFlags, 0644)); if (fileFD == -1) { const char *msg = "CALF: failed to open log file\n"; calf_syscall(SYS_write, STDOUT_FILENO, msg, ::strlen(msg)); ::exit(EXIT_FAILURE); } +#ifdef CALF_LOG_FORMAT_PROTOBUF + if (initializesTrace) { + traceFileState.store(2, std::memory_order_release); + } + filePid = currentPid; +#endif } static const char *getHostname() { @@ -139,7 +225,11 @@ struct SyscallLogger : CalfLogBase { static const char *getHostLogDir() { static char *d = nullptr; if (d == nullptr) { +#ifdef CALF_LOG_FORMAT_PROTOBUF + const char *parent = getLogDir(); +#else const char *parent = getSyscallLogDir(); +#endif d = new char[::strlen(parent) + CALF_HOSTNAME_BUFFER_SIZE]{0}; ::sprintf(d, "%s/%s", parent, getHostname()); } @@ -147,8 +237,14 @@ struct SyscallLogger : CalfLogBase { } }; -inline thread_local int SyscallLogger::fileFD = -1; -inline thread_local char SyscallLogger::filePath[PATH_MAX] = {'\0'}; +inline thread_local int CALF_SYSCALL_LOGGER_TYPE::fileFD = -1; +inline thread_local char CALF_SYSCALL_LOGGER_TYPE::filePath[PATH_MAX] = {'\0'}; +#ifdef CALF_LOG_FORMAT_PROTOBUF +inline thread_local pid_t CALF_SYSCALL_LOGGER_TYPE::filePid = 0; +#endif + +using SyscallLogger = CALF_SYSCALL_LOGGER_TYPE; +#undef CALF_SYSCALL_LOGGER_TYPE using Logger = TemplateLogger; diff --git a/calf/format/BaseLogger.h b/calf/format/BaseLogger.h index 900292d..90420de 100644 --- a/calf/format/BaseLogger.h +++ b/calf/format/BaseLogger.h @@ -44,6 +44,15 @@ inline long long current_time_in_millis() { return static_cast(ts.tv_sec) * 1000 + ts.tv_nsec / 1000000 - start_time; } +template struct AdapterTimestamp { + static unsigned long now() { return static_cast(current_time_in_millis()); } +}; + +template +struct AdapterTimestamp> { + static unsigned long now() { return Adapter::currentTimestamp(); } +}; + #ifdef __CALF_POSIX inline thread_local bool enable_logger = false; #else @@ -86,7 +95,7 @@ template class TemplateLogger { va_list argp; va_start(argp, message); - adapter.writeOpening(current_time_in_millis(), this->invoker, this->file, this->line, + adapter.writeOpening(AdapterTimestamp::now(), this->invoker, this->file, this->line, message, argp); va_end(argp); @@ -100,7 +109,7 @@ template class TemplateLogger { return; } - adapter.writeEpilogue(static_cast(current_time_in_millis())); + adapter.writeEpilogue(AdapterTimestamp::now()); current_log_level--; } @@ -112,7 +121,7 @@ template class TemplateLogger { va_list argp; va_start(argp, message); - adapter.printFormatted(current_time_in_millis(), this->invoker, this->file, this->line, + adapter.printFormatted(AdapterTimestamp::now(), this->invoker, this->file, this->line, CALF_LOG_PRE_MSG, message, argp); va_end(argp); } diff --git a/calf/format/LogFormat.h b/calf/format/LogFormat.h index d5a58b0..90d1ec5 100644 --- a/calf/format/LogFormat.h +++ b/calf/format/LogFormat.h @@ -4,13 +4,13 @@ #if defined(CALF_LOG_FORMAT_PROTOBUF) #include "calf/format/ProtobufBaseLogger.h" template using CalfLogBase = ProtobufLogBase; -inline constexpr char CALF_LOG_FILE_EXTENSION[] = ".pb"; -inline constexpr bool CALF_LOG_FILE_BINARY = true; +static constexpr char CALF_LOG_FILE_EXTENSION[] = ".perfetto-trace"; +static constexpr bool CALF_LOG_FILE_BINARY = true; #else #include "JsonBaseLogger.h" template using CalfLogBase = JsonLogBase; -inline constexpr char CALF_LOG_FILE_EXTENSION[] = ".log"; -inline constexpr bool CALF_LOG_FILE_BINARY = false; +static constexpr char CALF_LOG_FILE_EXTENSION[] = ".log"; +static constexpr bool CALF_LOG_FILE_BINARY = false; #endif #endif // CALF_LOGFORMAT_H diff --git a/calf/format/ProtobufBaseLogger.h b/calf/format/ProtobufBaseLogger.h index 15e236d..9830d24 100644 --- a/calf/format/ProtobufBaseLogger.h +++ b/calf/format/ProtobufBaseLogger.h @@ -6,29 +6,25 @@ #include #include #include +#include #include "calf/utils/constants.h" -#include "calf/protobuf/calf_trace.pb.h" template struct ProtobufLogBase { - using RecordKind = calf::proto::TraceRecord::Kind; + enum class EventType : std::uint64_t { SliceBegin = 1, SliceEnd = 2, Instant = 3 }; - std::uint64_t scopeId{0}; - std::uint64_t parentScopeId{0}; - - inline static thread_local std::uint64_t currentScopeId = 0; - inline static thread_local std::uint64_t nextScopeId = 1; + bool scopeOpen{false}; + inline static thread_local bool descriptorWritten = false; + inline static thread_local pid_t descriptorPid = 0; void writeOpening(unsigned long timestamp, const char *invoker, const char *file, int line, const char *messageFormat, va_list args) { char message[CALF_LOG_MAX_MSG_LEN]{}; expandMessage(messageFormat, args, message, sizeof(message)); - parentScopeId = currentScopeId; - scopeId = nextScopeId++; - currentScopeId = scopeId; - writeRecord(timestamp, scopeId, parentScopeId, calf::proto::TraceRecord::SCOPE_ENTER, - invoker, file, line, message); + ensureTrackDescriptor(); + scopeOpen = true; + writeEvent(timestamp, EventType::SliceBegin, invoker, file, line, message); } static void printFormatted(unsigned long timestamp, const char *invoker, const char *file, @@ -36,25 +32,22 @@ template struct ProtobufLogBase { const char *messageFormat, va_list args) { char message[CALF_LOG_MAX_MSG_LEN]{}; expandMessage(messageFormat, args, message, sizeof(message)); - writeRecord(timestamp, currentScopeId, 0, calf::proto::TraceRecord::EVENT, invoker, file, - line, message); + ensureTrackDescriptor(); + writeEvent(timestamp, EventType::Instant, invoker, file, line, message); } void writeEpilogue(unsigned long timestamp) { - if (scopeId == 0) { + if (!scopeOpen) { return; } - writeRecord(timestamp, scopeId, parentScopeId, calf::proto::TraceRecord::SCOPE_EXIT, - nullptr, nullptr, 0, nullptr); - currentScopeId = parentScopeId; - if (currentScopeId == 0) { - Derived::flush(); - } + writeEvent(timestamp, EventType::SliceEnd, nullptr, nullptr, 0, nullptr); + scopeOpen = false; + Derived::flush(); } static void resetProtobufState() { - currentScopeId = 0; - nextScopeId = 1; + descriptorWritten = false; + descriptorPid = 0; } private: @@ -66,40 +59,90 @@ template struct ProtobufLogBase { va_end(copy); } - static void writeRecord(unsigned long timestamp, std::uint64_t recordScopeId, - std::uint64_t recordParentScopeId, RecordKind kind, - const char *invoker, const char *file, int line, const char *message) { - // Concatenating serialized messages is valid protobuf: repeated records - // from each TraceFile chunk are merged when the complete file is parsed. - char recordBuffer[CALF_LOG_MAX_MSG_LEN + 1024]; - char *record = recordBuffer; - appendUInt64(record, 1, timestamp); - appendUInt64(record, 2, recordScopeId); - if (recordParentScopeId != 0) { - appendUInt64(record, 3, recordParentScopeId); + static std::uint64_t trackUuid() { + return (static_cast(static_cast(Derived::processId())) + << 32U) | + static_cast(Derived::threadId()); + } + + static void ensureTrackDescriptor() { + const auto pid = Derived::processId(); + if (descriptorWritten && descriptorPid == pid) { + return; } - if (kind != calf::proto::TraceRecord::SCOPE_ENTER) { - appendUInt64(record, 4, static_cast(kind)); + + char threadBuffer[128]; + char *thread = threadBuffer; + appendUInt64(thread, 1, static_cast(pid)); + appendUInt64(thread, 2, static_cast(Derived::threadId())); + appendString(thread, 5, "CALF thread", 11); + + char descriptorBuffer[256]; + char *descriptor = descriptorBuffer; + appendUInt64(descriptor, 1, trackUuid()); + appendString(descriptor, 2, "CALF", 4); + appendMessage(descriptor, 4, threadBuffer, thread); + + char packetBuffer[320]; + char *packet = packetBuffer; + appendUInt64(packet, 10, sequenceId()); + appendMessage(packet, 60, descriptorBuffer, descriptor); + writePacket(packetBuffer, packet); + descriptorWritten = true; + descriptorPid = pid; + } + + static void writeEvent(unsigned long timestamp, EventType type, const char *invoker, + const char *file, int line, const char *message) { + char eventBuffer[CALF_LOG_MAX_MSG_LEN + 1024]; + char *event = eventBuffer; + appendUInt64(event, 9, static_cast(type)); + appendUInt64(event, 11, trackUuid()); + if (type != EventType::SliceEnd) { + appendString(event, 22, "calf", 4); } if (invoker != nullptr) { - appendString(record, 5, invoker, ::strnlen(invoker, 255)); - } - if (file != nullptr) { - appendString(record, 6, file, ::strnlen(file, 255)); - } - if (line > 0) { - appendUInt64(record, 7, static_cast(line)); + appendString(event, 23, invoker, ::strnlen(invoker, 255)); } if (message != nullptr) { - appendString(record, 8, message, ::strnlen(message, CALF_LOG_MAX_MSG_LEN - 1)); + char annotationBuffer[CALF_LOG_MAX_MSG_LEN + 32]; + char *annotation = annotationBuffer; + appendString(annotation, 10, "args", 4); + appendString(annotation, 6, message, ::strnlen(message, CALF_LOG_MAX_MSG_LEN - 1)); + appendMessage(event, 4, annotationBuffer, annotation); + } + if (file != nullptr) { + char locationBuffer[768]; + char *location = locationBuffer; + appendString(location, 2, file, ::strnlen(file, 255)); + if (invoker != nullptr) { + appendString(location, 3, invoker, ::strnlen(invoker, 255)); + } + if (line > 0) { + appendUInt64(location, 4, static_cast(line)); + } + appendMessage(event, 33, locationBuffer, location); } - char outputBuffer[sizeof(recordBuffer) + 16]; + char packetBuffer[sizeof(eventBuffer) + 64]; + char *packet = packetBuffer; + appendUInt64(packet, 8, timestamp); + appendUInt64(packet, 10, sequenceId()); + appendMessage(packet, 11, eventBuffer, event); + writePacket(packetBuffer, packet); + } + + static std::uint32_t sequenceId() { + const auto pid = static_cast(Derived::processId()); + const auto tid = static_cast(Derived::threadId()); + const auto id = (pid * 2246822519U) ^ tid; + return id == 0 ? 1 : id; + } + + static void writePacket(const char *begin, const char *end) { + char outputBuffer[CALF_LOG_MAX_MSG_LEN + 1120]; char *output = outputBuffer; - *output++ = static_cast((1U << 3U) | 2U); - appendVarint(output, static_cast(record - recordBuffer)); - ::memcpy(output, recordBuffer, static_cast(record - recordBuffer)); - output += record - recordBuffer; + appendMessage(output, 1, begin, end); Derived::rawWriteBytes(outputBuffer, static_cast(output - outputBuffer)); } @@ -117,12 +160,17 @@ template struct ProtobufLogBase { } static void appendString(char *&output, std::uint32_t field, const char *value, - std::size_t length) { + std::size_t length) { appendVarint(output, static_cast((field << 3U) | 2U)); appendVarint(output, length); ::memcpy(output, value, length); output += length; } + + static void appendMessage(char *&output, std::uint32_t field, const char *begin, + const char *end) { + appendString(output, field, begin, static_cast(end - begin)); + } }; #endif // CALF_PROTOBUFBASELOGGER_H diff --git a/calf/protobuf/calf_trace.pb.cc b/calf/protobuf/calf_trace.pb.cc index eddc2ab..3efeb1c 100644 --- a/calf/protobuf/calf_trace.pb.cc +++ b/calf/protobuf/calf_trace.pb.cc @@ -24,471 +24,2268 @@ PROTOBUF_PRAGMA_INIT_SEG namespace _pb = ::google::protobuf; namespace _pbi = ::google::protobuf::internal; namespace _fl = ::google::protobuf::internal::field_layout; -namespace calf { -namespace proto { +namespace perfetto { +namespace protos { -inline constexpr TraceRecord::Impl_::Impl_( +inline constexpr ThreadDescriptor::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, - invoker_( + thread_name_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), - file_( + tid_{::int64_t{0}}, + pid_{0} {} + +template +PROTOBUF_CONSTEXPR ThreadDescriptor::ThreadDescriptor(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(ThreadDescriptor_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ThreadDescriptorDefaultTypeInternal { + PROTOBUF_CONSTEXPR ThreadDescriptorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ThreadDescriptorDefaultTypeInternal() {} + union { + ThreadDescriptor _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ThreadDescriptorDefaultTypeInternal _ThreadDescriptor_default_instance_; + +inline constexpr SourceLocation::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + file_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + function_name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + line_number_{0u} {} + +template +PROTOBUF_CONSTEXPR SourceLocation::SourceLocation(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(SourceLocation_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct SourceLocationDefaultTypeInternal { + PROTOBUF_CONSTEXPR SourceLocationDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~SourceLocationDefaultTypeInternal() {} + union { + SourceLocation _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceLocationDefaultTypeInternal _SourceLocation_default_instance_; + +inline constexpr DebugAnnotation::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + string_value_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()) {} + +template +PROTOBUF_CONSTEXPR DebugAnnotation::DebugAnnotation(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(DebugAnnotation_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct DebugAnnotationDefaultTypeInternal { + PROTOBUF_CONSTEXPR DebugAnnotationDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~DebugAnnotationDefaultTypeInternal() {} + union { + DebugAnnotation _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DebugAnnotationDefaultTypeInternal _DebugAnnotation_default_instance_; + +inline constexpr TrackEvent::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + debug_annotations_{}, + categories_{}, + name_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), - args_( + source_location_{nullptr}, + track_uuid_{::uint64_t{0u}}, + type_{static_cast< ::perfetto::protos::TrackEvent_Type >(0)} {} + +template +PROTOBUF_CONSTEXPR TrackEvent::TrackEvent(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(TrackEvent_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct TrackEventDefaultTypeInternal { + PROTOBUF_CONSTEXPR TrackEventDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~TrackEventDefaultTypeInternal() {} + union { + TrackEvent _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrackEventDefaultTypeInternal _TrackEvent_default_instance_; + +inline constexpr TrackDescriptor::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + name_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), - timestamp_ms_{::uint64_t{0u}}, - scope_id_{::uint64_t{0u}}, - parent_scope_id_{::uint64_t{0u}}, - kind_{static_cast< ::calf::proto::TraceRecord_Kind >(0)}, - line_{0u} {} + thread_{nullptr}, + uuid_{::uint64_t{0u}} {} + +template +PROTOBUF_CONSTEXPR TrackDescriptor::TrackDescriptor(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(TrackDescriptor_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct TrackDescriptorDefaultTypeInternal { + PROTOBUF_CONSTEXPR TrackDescriptorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~TrackDescriptorDefaultTypeInternal() {} + union { + TrackDescriptor _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrackDescriptorDefaultTypeInternal _TrackDescriptor_default_instance_; + +inline constexpr TracePacket::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + track_event_{nullptr}, + track_descriptor_{nullptr}, + timestamp_{::uint64_t{0u}}, + trusted_packet_sequence_id_{0u}, + timestamp_clock_id_{0u} {} + +template +PROTOBUF_CONSTEXPR TracePacket::TracePacket(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(TracePacket_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct TracePacketDefaultTypeInternal { + PROTOBUF_CONSTEXPR TracePacketDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~TracePacketDefaultTypeInternal() {} + union { + TracePacket _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TracePacketDefaultTypeInternal _TracePacket_default_instance_; + +inline constexpr Trace::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : packet_{}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR Trace::Trace(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Trace_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct TraceDefaultTypeInternal { + PROTOBUF_CONSTEXPR TraceDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~TraceDefaultTypeInternal() {} + union { + Trace _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceDefaultTypeInternal _Trace_default_instance_; +} // namespace protos +} // namespace perfetto +static const ::_pb::EnumDescriptor* PROTOBUF_NONNULL + file_level_enum_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto[1]; +static constexpr const ::_pb::ServiceDescriptor *PROTOBUF_NONNULL *PROTOBUF_NULLABLE + file_level_service_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto = nullptr; +const ::uint32_t + TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + 0x000, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::Trace, _impl_.packet_), + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TracePacket, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TracePacket, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TracePacket, _impl_.trusted_packet_sequence_id_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TracePacket, _impl_.track_event_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TracePacket, _impl_.timestamp_clock_id_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TracePacket, _impl_.track_descriptor_), + 2, + 3, + 0, + 4, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_._has_bits_), + 9, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_.debug_annotations_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_.track_uuid_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_.categories_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackEvent, _impl_.source_location_), + ~0u, + 3, + 2, + ~0u, + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::DebugAnnotation, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::perfetto::protos::DebugAnnotation, _impl_.string_value_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::DebugAnnotation, _impl_.name_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::SourceLocation, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::perfetto::protos::SourceLocation, _impl_.file_name_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::SourceLocation, _impl_.function_name_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::SourceLocation, _impl_.line_number_), + 0, + 1, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackDescriptor, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackDescriptor, _impl_.uuid_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackDescriptor, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::TrackDescriptor, _impl_.thread_), + 2, + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::perfetto::protos::ThreadDescriptor, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::perfetto::protos::ThreadDescriptor, _impl_.pid_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::ThreadDescriptor, _impl_.tid_), + PROTOBUF_FIELD_OFFSET(::perfetto::protos::ThreadDescriptor, _impl_.thread_name_), + 2, + 1, + 0, +}; + +static const ::_pbi::MigrationSchema + schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, sizeof(::perfetto::protos::Trace)}, + {2, sizeof(::perfetto::protos::TracePacket)}, + {15, sizeof(::perfetto::protos::TrackEvent)}, + {30, sizeof(::perfetto::protos::DebugAnnotation)}, + {37, sizeof(::perfetto::protos::SourceLocation)}, + {46, sizeof(::perfetto::protos::TrackDescriptor)}, + {55, sizeof(::perfetto::protos::ThreadDescriptor)}, +}; +static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { + &::perfetto::protos::_Trace_default_instance_._instance, + &::perfetto::protos::_TracePacket_default_instance_._instance, + &::perfetto::protos::_TrackEvent_default_instance_._instance, + &::perfetto::protos::_DebugAnnotation_default_instance_._instance, + &::perfetto::protos::_SourceLocation_default_instance_._instance, + &::perfetto::protos::_TrackDescriptor_default_instance_._instance, + &::perfetto::protos::_ThreadDescriptor_default_instance_._instance, +}; +const char descriptor_table_protodef_calf_2fprotobuf_2fcalf_5ftrace_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + "\n\036calf/protobuf/calf_trace.proto\022\017perfet" + "to.protos\"5\n\005Trace\022,\n\006packet\030\001 \003(\0132\034.per" + "fetto.protos.TracePacket\"\316\001\n\013TracePacket" + "\022\021\n\ttimestamp\030\010 \001(\004\022\"\n\032trusted_packet_se" + "quence_id\030\n \001(\r\0220\n\013track_event\030\013 \001(\0132\033.p" + "erfetto.protos.TrackEvent\022\032\n\022timestamp_c" + "lock_id\030: \001(\r\022:\n\020track_descriptor\030< \001(\0132" + " .perfetto.protos.TrackDescriptor\"\303\002\n\nTr" + "ackEvent\022;\n\021debug_annotations\030\004 \003(\0132 .pe" + "rfetto.protos.DebugAnnotation\022.\n\004type\030\t " + "\001(\0162 .perfetto.protos.TrackEvent.Type\022\022\n" + "\ntrack_uuid\030\013 \001(\004\022\022\n\ncategories\030\026 \003(\t\022\014\n" + "\004name\030\027 \001(\t\0228\n\017source_location\030! \001(\0132\037.p" + "erfetto.protos.SourceLocation\"X\n\004Type\022\024\n" + "\020TYPE_UNSPECIFIED\020\000\022\024\n\020TYPE_SLICE_BEGIN\020" + "\001\022\022\n\016TYPE_SLICE_END\020\002\022\020\n\014TYPE_INSTANT\020\003\"" + "5\n\017DebugAnnotation\022\024\n\014string_value\030\006 \001(\t" + "\022\014\n\004name\030\n \001(\t\"O\n\016SourceLocation\022\021\n\tfile" + "_name\030\002 \001(\t\022\025\n\rfunction_name\030\003 \001(\t\022\023\n\013li" + "ne_number\030\004 \001(\r\"`\n\017TrackDescriptor\022\014\n\004uu" + "id\030\001 \001(\004\022\014\n\004name\030\002 \001(\t\0221\n\006thread\030\004 \001(\0132!" + ".perfetto.protos.ThreadDescriptor\"A\n\020Thr" + "eadDescriptor\022\013\n\003pid\030\001 \001(\005\022\013\n\003tid\030\002 \001(\003\022" + "\023\n\013thread_name\030\005 \001(\t" +}; +static ::absl::once_flag descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto_once; +PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto = { + false, + false, + 940, + descriptor_table_protodef_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + "calf/protobuf/calf_trace.proto", + &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto_once, + nullptr, + 0, + 7, + schemas, + file_default_instances, + TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto::offsets, + file_level_enum_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + file_level_service_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto, +}; +namespace perfetto { +namespace protos { +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL TrackEvent_Type_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto); + return file_level_enum_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto[0]; +} +PROTOBUF_CONSTINIT const uint32_t TrackEvent_Type_internal_data_[] = { + 262144u, 0u, }; +// =================================================================== + +class Trace::_Internal { + public: +}; + +Trace::Trace(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Trace_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:perfetto.protos.Trace) +} +PROTOBUF_NDEBUG_INLINE Trace::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ::perfetto::protos::Trace& from_msg) + : packet_{visibility, arena, from.packet_}, + _cached_size_{0} {} + +Trace::Trace( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Trace& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Trace_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Trace* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:perfetto.protos.Trace) +} +PROTOBUF_NDEBUG_INLINE Trace::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : packet_{visibility, arena}, + _cached_size_{0} {} + +inline void Trace::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Trace::~Trace() { + // @@protoc_insertion_point(destructor:perfetto.protos.Trace) + SharedDtor(*this); +} +inline void Trace::SharedDtor(MessageLite& self) { + Trace& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Trace::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Trace(arena); +} +constexpr auto Trace::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(Trace, _impl_.packet_) + + decltype(Trace::_impl_.packet_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::ZeroInit( + sizeof(Trace), alignof(Trace), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&Trace::PlacementNew_, + sizeof(Trace), + alignof(Trace)); + } +} +constexpr auto Trace::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Trace_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Trace::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Trace::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Trace::ByteSizeLong, + &Trace::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Trace, _impl_._cached_size_), + false, + }, + &Trace::kDescriptorMethods, + &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Trace_class_data_ = + Trace::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Trace::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Trace_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Trace_class_data_.tc_table); + return Trace_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 1, 0, 2> +Trace::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + Trace_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::perfetto::protos::Trace>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated .perfetto.protos.TracePacket packet = 1; + {::_pbi::TcParser::FastMtR1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(Trace, _impl_.packet_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // repeated .perfetto.protos.TracePacket packet = 1; + {PROTOBUF_FIELD_OFFSET(Trace, _impl_.packet_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::perfetto::protos::TracePacket>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void Trace::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.Trace) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.packet_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Trace::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Trace& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Trace::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Trace& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.Trace) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // repeated .perfetto.protos.TracePacket packet = 1; + for (unsigned i = 0, n = static_cast( + this_._internal_packet_size()); + i < n; i++) { + const auto& repfield = this_._internal_packet().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, repfield, repfield.GetCachedSize(), + target, stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.Trace) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Trace::ByteSizeLong(const MessageLite& base) { + const Trace& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Trace::ByteSizeLong() const { + const Trace& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.Trace) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + { + // repeated .perfetto.protos.TracePacket packet = 1; + { + total_size += 1UL * this_._internal_packet_size(); + for (const auto& msg : this_._internal_packet()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Trace::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.Trace) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_packet()->MergeFrom( + from._internal_packet()); + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void Trace::CopyFrom(const Trace& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.Trace) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Trace::InternalSwap(Trace* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.packet_.InternalSwap(&other->_impl_.packet_); +} + +::google::protobuf::Metadata Trace::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class TracePacket::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(TracePacket, _impl_._has_bits_); +}; + +TracePacket::TracePacket(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, TracePacket_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:perfetto.protos.TracePacket) +} +PROTOBUF_NDEBUG_INLINE TracePacket::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ::perfetto::protos::TracePacket& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0} {} + +TracePacket::TracePacket( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const TracePacket& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, TracePacket_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + TracePacket* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.track_event_ = ((cached_has_bits & 0x00000001u) != 0) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.track_event_) + : nullptr; + _impl_.track_descriptor_ = ((cached_has_bits & 0x00000002u) != 0) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.track_descriptor_) + : nullptr; + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, timestamp_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, timestamp_), + offsetof(Impl_, timestamp_clock_id_) - + offsetof(Impl_, timestamp_) + + sizeof(Impl_::timestamp_clock_id_)); + + // @@protoc_insertion_point(copy_constructor:perfetto.protos.TracePacket) +} +PROTOBUF_NDEBUG_INLINE TracePacket::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void TracePacket::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, track_event_), + 0, + offsetof(Impl_, timestamp_clock_id_) - + offsetof(Impl_, track_event_) + + sizeof(Impl_::timestamp_clock_id_)); +} +TracePacket::~TracePacket() { + // @@protoc_insertion_point(destructor:perfetto.protos.TracePacket) + SharedDtor(*this); +} +inline void TracePacket::SharedDtor(MessageLite& self) { + TracePacket& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.track_event_; + delete this_._impl_.track_descriptor_; + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL TracePacket::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) TracePacket(arena); +} +constexpr auto TracePacket::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(TracePacket), + alignof(TracePacket)); +} +constexpr auto TracePacket::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_TracePacket_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &TracePacket::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &TracePacket::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &TracePacket::ByteSizeLong, + &TracePacket::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(TracePacket, _impl_._cached_size_), + false, + }, + &TracePacket::kDescriptorMethods, + &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull TracePacket_class_data_ = + TracePacket::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +TracePacket::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&TracePacket_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(TracePacket_class_data_.tc_table); + return TracePacket_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 5, 2, 0, 7> +TracePacket::_table_ = { + { + PROTOBUF_FIELD_OFFSET(TracePacket, _impl_._has_bits_), + 0, // no _extensions_ + 60, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294965631, // skipmap + offsetof(decltype(_table_), field_entries), + 5, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + TracePacket_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::perfetto::protos::TracePacket>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // optional uint64 timestamp = 8; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(TracePacket, _impl_.timestamp_), 2>(), + {64, 2, 0, PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.timestamp_)}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional uint32 trusted_packet_sequence_id = 10; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(TracePacket, _impl_.trusted_packet_sequence_id_), 3>(), + {80, 3, 0, PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.trusted_packet_sequence_id_)}}, + // optional .perfetto.protos.TrackEvent track_event = 11; + {::_pbi::TcParser::FastMtS1, + {90, 0, 0, PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.track_event_)}}, + // optional .perfetto.protos.TrackDescriptor track_descriptor = 60; + {::_pbi::TcParser::FastMtS2, + {994, 1, 1, PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.track_descriptor_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 58, 0, 1, + 65530, 3, + 65535, 65535 + }}, {{ + // optional uint64 timestamp = 8; + {PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.timestamp_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // optional uint32 trusted_packet_sequence_id = 10; + {PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.trusted_packet_sequence_id_), _Internal::kHasBitsOffset + 3, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + // optional .perfetto.protos.TrackEvent track_event = 11; + {PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.track_event_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // optional uint32 timestamp_clock_id = 58; + {PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.timestamp_clock_id_), _Internal::kHasBitsOffset + 4, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + // optional .perfetto.protos.TrackDescriptor track_descriptor = 60; + {PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.track_descriptor_), _Internal::kHasBitsOffset + 1, 1, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::perfetto::protos::TrackEvent>()}, + {::_pbi::TcParser::GetTable<::perfetto::protos::TrackDescriptor>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void TracePacket::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.TracePacket) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000003u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + ABSL_DCHECK(_impl_.track_event_ != nullptr); + _impl_.track_event_->Clear(); + } + if ((cached_has_bits & 0x00000002u) != 0) { + ABSL_DCHECK(_impl_.track_descriptor_ != nullptr); + _impl_.track_descriptor_->Clear(); + } + } + if ((cached_has_bits & 0x0000001cu) != 0) { + ::memset(&_impl_.timestamp_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.timestamp_clock_id_) - + reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.timestamp_clock_id_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL TracePacket::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const TracePacket& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL TracePacket::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const TracePacket& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TracePacket) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // optional uint64 timestamp = 8; + if ((cached_has_bits & 0x00000004u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 8, this_._internal_timestamp(), target); + } + + // optional uint32 trusted_packet_sequence_id = 10; + if ((cached_has_bits & 0x00000008u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 10, this_._internal_trusted_packet_sequence_id(), target); + } + + // optional .perfetto.protos.TrackEvent track_event = 11; + if ((cached_has_bits & 0x00000001u) != 0) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 11, *this_._impl_.track_event_, this_._impl_.track_event_->GetCachedSize(), target, + stream); + } + + // optional uint32 timestamp_clock_id = 58; + if ((cached_has_bits & 0x00000010u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 58, this_._internal_timestamp_clock_id(), target); + } + + // optional .perfetto.protos.TrackDescriptor track_descriptor = 60; + if ((cached_has_bits & 0x00000002u) != 0) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 60, *this_._impl_.track_descriptor_, this_._impl_.track_descriptor_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TracePacket) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t TracePacket::ByteSizeLong(const MessageLite& base) { + const TracePacket& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t TracePacket::ByteSizeLong() const { + const TracePacket& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TracePacket) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if ((cached_has_bits & 0x0000001fu) != 0) { + // optional .perfetto.protos.TrackEvent track_event = 11; + if ((cached_has_bits & 0x00000001u) != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.track_event_); + } + // optional .perfetto.protos.TrackDescriptor track_descriptor = 60; + if ((cached_has_bits & 0x00000002u) != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.track_descriptor_); + } + // optional uint64 timestamp = 8; + if ((cached_has_bits & 0x00000004u) != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_timestamp()); + } + // optional uint32 trusted_packet_sequence_id = 10; + if ((cached_has_bits & 0x00000008u) != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_trusted_packet_sequence_id()); + } + // optional uint32 timestamp_clock_id = 58; + if ((cached_has_bits & 0x00000010u) != 0) { + total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( + this_._internal_timestamp_clock_id()); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void TracePacket::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TracePacket) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if ((cached_has_bits & 0x0000001fu) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + ABSL_DCHECK(from._impl_.track_event_ != nullptr); + if (_this->_impl_.track_event_ == nullptr) { + _this->_impl_.track_event_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.track_event_); + } else { + _this->_impl_.track_event_->MergeFrom(*from._impl_.track_event_); + } + } + if ((cached_has_bits & 0x00000002u) != 0) { + ABSL_DCHECK(from._impl_.track_descriptor_ != nullptr); + if (_this->_impl_.track_descriptor_ == nullptr) { + _this->_impl_.track_descriptor_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.track_descriptor_); + } else { + _this->_impl_.track_descriptor_->MergeFrom(*from._impl_.track_descriptor_); + } + } + if ((cached_has_bits & 0x00000004u) != 0) { + _this->_impl_.timestamp_ = from._impl_.timestamp_; + } + if ((cached_has_bits & 0x00000008u) != 0) { + _this->_impl_.trusted_packet_sequence_id_ = from._impl_.trusted_packet_sequence_id_; + } + if ((cached_has_bits & 0x00000010u) != 0) { + _this->_impl_.timestamp_clock_id_ = from._impl_.timestamp_clock_id_; + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void TracePacket::CopyFrom(const TracePacket& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TracePacket) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void TracePacket::InternalSwap(TracePacket* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.timestamp_clock_id_) + + sizeof(TracePacket::_impl_.timestamp_clock_id_) + - PROTOBUF_FIELD_OFFSET(TracePacket, _impl_.track_event_)>( + reinterpret_cast(&_impl_.track_event_), + reinterpret_cast(&other->_impl_.track_event_)); +} + +::google::protobuf::Metadata TracePacket::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class TrackEvent::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_._has_bits_); +}; + +TrackEvent::TrackEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, TrackEvent_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:perfetto.protos.TrackEvent) +} +PROTOBUF_NDEBUG_INLINE TrackEvent::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ::perfetto::protos::TrackEvent& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + debug_annotations_{visibility, arena, from.debug_annotations_}, + categories_{visibility, arena, from.categories_}, + name_(arena, from.name_) {} + +TrackEvent::TrackEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const TrackEvent& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, TrackEvent_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + TrackEvent* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.source_location_ = ((cached_has_bits & 0x00000002u) != 0) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.source_location_) + : nullptr; + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, track_uuid_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, track_uuid_), + offsetof(Impl_, type_) - + offsetof(Impl_, track_uuid_) + + sizeof(Impl_::type_)); + + // @@protoc_insertion_point(copy_constructor:perfetto.protos.TrackEvent) +} +PROTOBUF_NDEBUG_INLINE TrackEvent::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + debug_annotations_{visibility, arena}, + categories_{visibility, arena}, + name_(arena) {} + +inline void TrackEvent::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, source_location_), + 0, + offsetof(Impl_, type_) - + offsetof(Impl_, source_location_) + + sizeof(Impl_::type_)); +} +TrackEvent::~TrackEvent() { + // @@protoc_insertion_point(destructor:perfetto.protos.TrackEvent) + SharedDtor(*this); +} +inline void TrackEvent::SharedDtor(MessageLite& self) { + TrackEvent& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.source_location_; + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL TrackEvent::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) TrackEvent(arena); +} +constexpr auto TrackEvent::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.debug_annotations_) + + decltype(TrackEvent::_impl_.debug_annotations_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.categories_) + + decltype(TrackEvent::_impl_.categories_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(TrackEvent), alignof(TrackEvent), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&TrackEvent::PlacementNew_, + sizeof(TrackEvent), + alignof(TrackEvent)); + } +} +constexpr auto TrackEvent::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_TrackEvent_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &TrackEvent::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &TrackEvent::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &TrackEvent::ByteSizeLong, + &TrackEvent::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_._cached_size_), + false, + }, + &TrackEvent::kDescriptorMethods, + &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull TrackEvent_class_data_ = + TrackEvent::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +TrackEvent::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&TrackEvent_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(TrackEvent_class_data_.tc_table); + return TrackEvent_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 6, 3, 49, 7> +TrackEvent::_table_ = { + { + PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_._has_bits_), + 0, // no _extensions_ + 33, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4288674551, // skipmap + offsetof(decltype(_table_), field_entries), + 6, // num_field_entries + 3, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + TrackEvent_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::perfetto::protos::TrackEvent>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // optional .perfetto.protos.TrackEvent.Type type = 9; + {::_pbi::TcParser::FastEr0S1, + {72, 3, 3, PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.type_)}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional uint64 track_uuid = 11; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(TrackEvent, _impl_.track_uuid_), 2>(), + {88, 2, 0, PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.track_uuid_)}}, + // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4; + {::_pbi::TcParser::FastMtR1, + {34, 63, 0, PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.debug_annotations_)}}, + {::_pbi::TcParser::MiniParse, {}}, + // repeated string categories = 22; + {::_pbi::TcParser::FastSR2, + {434, 63, 0, PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.categories_)}}, + // optional string name = 23; + {::_pbi::TcParser::FastSS2, + {442, 0, 0, PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.name_)}}, + }}, {{ + 33, 0, 1, + 65534, 5, + 65535, 65535 + }}, {{ + // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4; + {PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.debug_annotations_), -1, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // optional .perfetto.protos.TrackEvent.Type type = 9; + {PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.type_), _Internal::kHasBitsOffset + 3, 2, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional uint64 track_uuid = 11; + {PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.track_uuid_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // repeated string categories = 22; + {PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.categories_), -1, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kRawString | ::_fl::kRepSString)}, + // optional string name = 23; + {PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.name_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional .perfetto.protos.SourceLocation source_location = 33; + {PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.source_location_), _Internal::kHasBitsOffset + 1, 1, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::perfetto::protos::DebugAnnotation>()}, + {::_pbi::TcParser::GetTable<::perfetto::protos::SourceLocation>()}, + {0, 3}, + }}, + {{ + "\32\0\0\0\12\4\0\0" + "perfetto.protos.TrackEvent" + "categories" + "name" + }}, +}; +PROTOBUF_NOINLINE void TrackEvent::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.TrackEvent) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.debug_annotations_.Clear(); + _impl_.categories_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000003u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + if ((cached_has_bits & 0x00000002u) != 0) { + ABSL_DCHECK(_impl_.source_location_ != nullptr); + _impl_.source_location_->Clear(); + } + } + if ((cached_has_bits & 0x0000000cu) != 0) { + ::memset(&_impl_.track_uuid_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.track_uuid_)) + sizeof(_impl_.type_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL TrackEvent::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const TrackEvent& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL TrackEvent::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const TrackEvent& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TrackEvent) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4; + for (unsigned i = 0, n = static_cast( + this_._internal_debug_annotations_size()); + i < n; i++) { + const auto& repfield = this_._internal_debug_annotations().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 4, repfield, repfield.GetCachedSize(), + target, stream); + } + + cached_has_bits = this_._impl_._has_bits_[0]; + // optional .perfetto.protos.TrackEvent.Type type = 9; + if ((cached_has_bits & 0x00000008u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 9, this_._internal_type(), target); + } + + // optional uint64 track_uuid = 11; + if ((cached_has_bits & 0x00000004u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 11, this_._internal_track_uuid(), target); + } + + // repeated string categories = 22; + for (int i = 0, n = this_._internal_categories_size(); i < n; ++i) { + const auto& s = this_._internal_categories().Get(i); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(s.data(), static_cast(s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.TrackEvent.categories"); + target = stream->WriteString(22, s, target); + } + + // optional string name = 23; + if ((cached_has_bits & 0x00000001u) != 0) { + const ::std::string& _s = this_._internal_name(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.TrackEvent.name"); + target = stream->WriteStringMaybeAliased(23, _s, target); + } + + // optional .perfetto.protos.SourceLocation source_location = 33; + if ((cached_has_bits & 0x00000002u) != 0) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 33, *this_._impl_.source_location_, this_._impl_.source_location_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TrackEvent) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t TrackEvent::ByteSizeLong(const MessageLite& base) { + const TrackEvent& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t TrackEvent::ByteSizeLong() const { + const TrackEvent& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TrackEvent) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + { + // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4; + { + total_size += 1UL * this_._internal_debug_annotations_size(); + for (const auto& msg : this_._internal_debug_annotations()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + // repeated string categories = 22; + { + total_size += + 2 * ::google::protobuf::internal::FromIntSize(this_._internal_categories().size()); + for (int i = 0, n = this_._internal_categories().size(); i < n; ++i) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_categories().Get(i)); + } + } + } + cached_has_bits = this_._impl_._has_bits_[0]; + if ((cached_has_bits & 0x0000000fu) != 0) { + // optional string name = 23; + if ((cached_has_bits & 0x00000001u) != 0) { + total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_name()); + } + // optional .perfetto.protos.SourceLocation source_location = 33; + if ((cached_has_bits & 0x00000002u) != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.source_location_); + } + // optional uint64 track_uuid = 11; + if ((cached_has_bits & 0x00000004u) != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_track_uuid()); + } + // optional .perfetto.protos.TrackEvent.Type type = 9; + if ((cached_has_bits & 0x00000008u) != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_type()); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void TrackEvent::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TrackEvent) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_debug_annotations()->MergeFrom( + from._internal_debug_annotations()); + _this->_internal_mutable_categories()->MergeFrom(from._internal_categories()); + cached_has_bits = from._impl_._has_bits_[0]; + if ((cached_has_bits & 0x0000000fu) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _this->_internal_set_name(from._internal_name()); + } + if ((cached_has_bits & 0x00000002u) != 0) { + ABSL_DCHECK(from._impl_.source_location_ != nullptr); + if (_this->_impl_.source_location_ == nullptr) { + _this->_impl_.source_location_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.source_location_); + } else { + _this->_impl_.source_location_->MergeFrom(*from._impl_.source_location_); + } + } + if ((cached_has_bits & 0x00000004u) != 0) { + _this->_impl_.track_uuid_ = from._impl_.track_uuid_; + } + if ((cached_has_bits & 0x00000008u) != 0) { + _this->_impl_.type_ = from._impl_.type_; + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void TrackEvent::CopyFrom(const TrackEvent& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TrackEvent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void TrackEvent::InternalSwap(TrackEvent* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.debug_annotations_.InternalSwap(&other->_impl_.debug_annotations_); + _impl_.categories_.InternalSwap(&other->_impl_.categories_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.type_) + + sizeof(TrackEvent::_impl_.type_) + - PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.source_location_)>( + reinterpret_cast(&_impl_.source_location_), + reinterpret_cast(&other->_impl_.source_location_)); +} + +::google::protobuf::Metadata TrackEvent::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class DebugAnnotation::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(DebugAnnotation, _impl_._has_bits_); +}; + +DebugAnnotation::DebugAnnotation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, DebugAnnotation_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:perfetto.protos.DebugAnnotation) +} +PROTOBUF_NDEBUG_INLINE DebugAnnotation::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ::perfetto::protos::DebugAnnotation& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + string_value_(arena, from.string_value_), + name_(arena, from.name_) {} + +DebugAnnotation::DebugAnnotation( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const DebugAnnotation& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, DebugAnnotation_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + DebugAnnotation* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:perfetto.protos.DebugAnnotation) +} +PROTOBUF_NDEBUG_INLINE DebugAnnotation::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + string_value_(arena), + name_(arena) {} + +inline void DebugAnnotation::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +DebugAnnotation::~DebugAnnotation() { + // @@protoc_insertion_point(destructor:perfetto.protos.DebugAnnotation) + SharedDtor(*this); +} +inline void DebugAnnotation::SharedDtor(MessageLite& self) { + DebugAnnotation& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.string_value_.Destroy(); + this_._impl_.name_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL DebugAnnotation::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) DebugAnnotation(arena); +} +constexpr auto DebugAnnotation::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(DebugAnnotation), + alignof(DebugAnnotation)); +} +constexpr auto DebugAnnotation::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_DebugAnnotation_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &DebugAnnotation::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &DebugAnnotation::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &DebugAnnotation::ByteSizeLong, + &DebugAnnotation::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(DebugAnnotation, _impl_._cached_size_), + false, + }, + &DebugAnnotation::kDescriptorMethods, + &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull DebugAnnotation_class_data_ = + DebugAnnotation::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +DebugAnnotation::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&DebugAnnotation_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(DebugAnnotation_class_data_.tc_table); + return DebugAnnotation_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 2, 0, 56, 2> +DebugAnnotation::_table_ = { + { + PROTOBUF_FIELD_OFFSET(DebugAnnotation, _impl_._has_bits_), + 0, // no _extensions_ + 10, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294966751, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + DebugAnnotation_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::perfetto::protos::DebugAnnotation>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // optional string string_value = 6; + {::_pbi::TcParser::FastSS1, + {50, 0, 0, PROTOBUF_FIELD_OFFSET(DebugAnnotation, _impl_.string_value_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional string string_value = 6; + {PROTOBUF_FIELD_OFFSET(DebugAnnotation, _impl_.string_value_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional string name = 10; + {PROTOBUF_FIELD_OFFSET(DebugAnnotation, _impl_.name_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\37\14\4\0\0\0\0\0" + "perfetto.protos.DebugAnnotation" + "string_value" + "name" + }}, +}; +PROTOBUF_NOINLINE void DebugAnnotation::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.DebugAnnotation) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000003u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _impl_.string_value_.ClearNonDefaultToEmpty(); + } + if ((cached_has_bits & 0x00000002u) != 0) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL DebugAnnotation::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const DebugAnnotation& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL DebugAnnotation::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const DebugAnnotation& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.DebugAnnotation) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // optional string string_value = 6; + if ((cached_has_bits & 0x00000001u) != 0) { + const ::std::string& _s = this_._internal_string_value(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.DebugAnnotation.string_value"); + target = stream->WriteStringMaybeAliased(6, _s, target); + } + + // optional string name = 10; + if ((cached_has_bits & 0x00000002u) != 0) { + const ::std::string& _s = this_._internal_name(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.DebugAnnotation.name"); + target = stream->WriteStringMaybeAliased(10, _s, target); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.DebugAnnotation) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t DebugAnnotation::ByteSizeLong(const MessageLite& base) { + const DebugAnnotation& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t DebugAnnotation::ByteSizeLong() const { + const DebugAnnotation& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.DebugAnnotation) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000003u) != 0) { + // optional string string_value = 6; + if ((cached_has_bits & 0x00000001u) != 0) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_string_value()); + } + // optional string name = 10; + if ((cached_has_bits & 0x00000002u) != 0) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_name()); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void DebugAnnotation::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.DebugAnnotation) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000003u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _this->_internal_set_string_value(from._internal_string_value()); + } + if ((cached_has_bits & 0x00000002u) != 0) { + _this->_internal_set_name(from._internal_name()); + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void DebugAnnotation::CopyFrom(const DebugAnnotation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.DebugAnnotation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void DebugAnnotation::InternalSwap(DebugAnnotation* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.string_value_, &other->_impl_.string_value_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); +} + +::google::protobuf::Metadata DebugAnnotation::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class SourceLocation::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_._has_bits_); +}; + +SourceLocation::SourceLocation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, SourceLocation_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:perfetto.protos.SourceLocation) +} +PROTOBUF_NDEBUG_INLINE SourceLocation::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ::perfetto::protos::SourceLocation& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + file_name_(arena, from.file_name_), + function_name_(arena, from.function_name_) {} + +SourceLocation::SourceLocation( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const SourceLocation& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, SourceLocation_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SourceLocation* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.line_number_ = from._impl_.line_number_; + + // @@protoc_insertion_point(copy_constructor:perfetto.protos.SourceLocation) +} +PROTOBUF_NDEBUG_INLINE SourceLocation::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + file_name_(arena), + function_name_(arena) {} + +inline void SourceLocation::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.line_number_ = {}; +} +SourceLocation::~SourceLocation() { + // @@protoc_insertion_point(destructor:perfetto.protos.SourceLocation) + SharedDtor(*this); +} +inline void SourceLocation::SharedDtor(MessageLite& self) { + SourceLocation& this_ = static_cast(self); + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.file_name_.Destroy(); + this_._impl_.function_name_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL SourceLocation::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) SourceLocation(arena); +} +constexpr auto SourceLocation::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(SourceLocation), + alignof(SourceLocation)); +} +constexpr auto SourceLocation::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_SourceLocation_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &SourceLocation::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &SourceLocation::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &SourceLocation::ByteSizeLong, + &SourceLocation::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_._cached_size_), + false, + }, + &SourceLocation::kDescriptorMethods, + &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull SourceLocation_class_data_ = + SourceLocation::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +SourceLocation::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&SourceLocation_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(SourceLocation_class_data_.tc_table); + return SourceLocation_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 61, 2> +SourceLocation::_table_ = { + { + PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967281, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + SourceLocation_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::perfetto::protos::SourceLocation>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // optional uint32 line_number = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(SourceLocation, _impl_.line_number_), 2>(), + {32, 2, 0, PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.line_number_)}}, + {::_pbi::TcParser::MiniParse, {}}, + // optional string file_name = 2; + {::_pbi::TcParser::FastSS1, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.file_name_)}}, + // optional string function_name = 3; + {::_pbi::TcParser::FastSS1, + {26, 1, 0, PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.function_name_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional string file_name = 2; + {PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.file_name_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional string function_name = 3; + {PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.function_name_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional uint32 line_number = 4; + {PROTOBUF_FIELD_OFFSET(SourceLocation, _impl_.line_number_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\36\11\15\0\0\0\0\0" + "perfetto.protos.SourceLocation" + "file_name" + "function_name" + }}, +}; +PROTOBUF_NOINLINE void SourceLocation::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.SourceLocation) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000003u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _impl_.file_name_.ClearNonDefaultToEmpty(); + } + if ((cached_has_bits & 0x00000002u) != 0) { + _impl_.function_name_.ClearNonDefaultToEmpty(); + } + } + _impl_.line_number_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL SourceLocation::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const SourceLocation& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL SourceLocation::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const SourceLocation& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SourceLocation) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // optional string file_name = 2; + if ((cached_has_bits & 0x00000001u) != 0) { + const ::std::string& _s = this_._internal_file_name(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.SourceLocation.file_name"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + + // optional string function_name = 3; + if ((cached_has_bits & 0x00000002u) != 0) { + const ::std::string& _s = this_._internal_function_name(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.SourceLocation.function_name"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + + // optional uint32 line_number = 4; + if ((cached_has_bits & 0x00000004u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this_._internal_line_number(), target); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SourceLocation) + return target; +} -template -PROTOBUF_CONSTEXPR TraceRecord::TraceRecord(::_pbi::ConstantInitialized) #if defined(PROTOBUF_CUSTOM_VTABLE) - : ::google::protobuf::Message(TraceRecord_class_data_.base()), +::size_t SourceLocation::ByteSizeLong(const MessageLite& base) { + const SourceLocation& this_ = static_cast(base); #else // PROTOBUF_CUSTOM_VTABLE - : ::google::protobuf::Message(), +::size_t SourceLocation::ByteSizeLong() const { + const SourceLocation& this_ = *this; #endif // PROTOBUF_CUSTOM_VTABLE - _impl_(::_pbi::ConstantInitialized()) { + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SourceLocation) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000007u) != 0) { + // optional string file_name = 2; + if ((cached_has_bits & 0x00000001u) != 0) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_file_name()); + } + // optional string function_name = 3; + if ((cached_has_bits & 0x00000002u) != 0) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_function_name()); + } + // optional uint32 line_number = 4; + if ((cached_has_bits & 0x00000004u) != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_line_number()); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); } -struct TraceRecordDefaultTypeInternal { - PROTOBUF_CONSTEXPR TraceRecordDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~TraceRecordDefaultTypeInternal() {} - union { - TraceRecord _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceRecordDefaultTypeInternal _TraceRecord_default_instance_; +void SourceLocation::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SourceLocation) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; -inline constexpr TraceFile::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : records_{}, - _cached_size_{0} {} + cached_has_bits = from._impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000007u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _this->_internal_set_file_name(from._internal_file_name()); + } + if ((cached_has_bits & 0x00000002u) != 0) { + _this->_internal_set_function_name(from._internal_function_name()); + } + if ((cached_has_bits & 0x00000004u) != 0) { + _this->_impl_.line_number_ = from._impl_.line_number_; + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} -template -PROTOBUF_CONSTEXPR TraceFile::TraceFile(::_pbi::ConstantInitialized) -#if defined(PROTOBUF_CUSTOM_VTABLE) - : ::google::protobuf::Message(TraceFile_class_data_.base()), -#else // PROTOBUF_CUSTOM_VTABLE - : ::google::protobuf::Message(), -#endif // PROTOBUF_CUSTOM_VTABLE - _impl_(::_pbi::ConstantInitialized()) { +void SourceLocation::CopyFrom(const SourceLocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SourceLocation) + if (&from == this) return; + Clear(); + MergeFrom(from); } -struct TraceFileDefaultTypeInternal { - PROTOBUF_CONSTEXPR TraceFileDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~TraceFileDefaultTypeInternal() {} - union { - TraceFile _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceFileDefaultTypeInternal _TraceFile_default_instance_; -} // namespace proto -} // namespace calf -static const ::_pb::EnumDescriptor* PROTOBUF_NONNULL - file_level_enum_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto[1]; -static constexpr const ::_pb::ServiceDescriptor *PROTOBUF_NONNULL *PROTOBUF_NULLABLE - file_level_service_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto = nullptr; -const ::uint32_t - TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE( - protodesc_cold) = { - 0x081, // bitmap - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_._has_bits_), - 11, // hasbit index offset - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.timestamp_ms_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.scope_id_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.parent_scope_id_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.invoker_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.file_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.line_), - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceRecord, _impl_.args_), - 3, - 4, - 5, - 6, - 0, - 1, - 7, - 2, - 0x000, // bitmap - PROTOBUF_FIELD_OFFSET(::calf::proto::TraceFile, _impl_.records_), -}; -static const ::_pbi::MigrationSchema - schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, sizeof(::calf::proto::TraceRecord)}, - {19, sizeof(::calf::proto::TraceFile)}, -}; -static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { - &::calf::proto::_TraceRecord_default_instance_._instance, - &::calf::proto::_TraceFile_default_instance_._instance, -}; -const char descriptor_table_protodef_calf_2fprotobuf_2fcalf_5ftrace_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( - protodesc_cold) = { - "\n\036calf/protobuf/calf_trace.proto\022\ncalf.p" - "roto\"\351\001\n\013TraceRecord\022\024\n\014timestamp_ms\030\001 \001" - "(\004\022\020\n\010scope_id\030\002 \001(\004\022\027\n\017parent_scope_id\030" - "\003 \001(\004\022*\n\004kind\030\004 \001(\0162\034.calf.proto.TraceRe" - "cord.Kind\022\017\n\007invoker\030\005 \001(\t\022\014\n\004file\030\006 \001(\t" - "\022\014\n\004line\030\007 \001(\r\022\014\n\004args\030\010 \001(\t\"2\n\004Kind\022\017\n\013" - "SCOPE_ENTER\020\000\022\t\n\005EVENT\020\001\022\016\n\nSCOPE_EXIT\020\002" - "\"5\n\tTraceFile\022(\n\007records\030\001 \003(\0132\027.calf.pr" - "oto.TraceRecordb\006proto3" -}; -static ::absl::once_flag descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto_once; -PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto = { - false, - false, - 343, - descriptor_table_protodef_calf_2fprotobuf_2fcalf_5ftrace_2eproto, - "calf/protobuf/calf_trace.proto", - &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto_once, - nullptr, - 0, - 2, - schemas, - file_default_instances, - TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto::offsets, - file_level_enum_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto, - file_level_service_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto, -}; -namespace calf { -namespace proto { -const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL TraceRecord_Kind_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto); - return file_level_enum_descriptors_calf_2fprotobuf_2fcalf_5ftrace_2eproto[0]; +void SourceLocation::InternalSwap(SourceLocation* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.file_name_, &other->_impl_.file_name_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.function_name_, &other->_impl_.function_name_, arena); + swap(_impl_.line_number_, other->_impl_.line_number_); +} + +::google::protobuf::Metadata SourceLocation::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } -PROTOBUF_CONSTINIT const uint32_t TraceRecord_Kind_internal_data_[] = { - 196608u, 0u, }; // =================================================================== -class TraceRecord::_Internal { +class TrackDescriptor::_Internal { public: using HasBits = - decltype(::std::declval()._impl_._has_bits_); + decltype(::std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_._has_bits_); + 8 * PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_._has_bits_); }; -TraceRecord::TraceRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +TrackDescriptor::TrackDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) - : ::google::protobuf::Message(arena, TraceRecord_class_data_.base()) { + : ::google::protobuf::Message(arena, TrackDescriptor_class_data_.base()) { #else // PROTOBUF_CUSTOM_VTABLE : ::google::protobuf::Message(arena) { #endif // PROTOBUF_CUSTOM_VTABLE SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:calf.proto.TraceRecord) + // @@protoc_insertion_point(arena_constructor:perfetto.protos.TrackDescriptor) } -PROTOBUF_NDEBUG_INLINE TraceRecord::Impl_::Impl_( +PROTOBUF_NDEBUG_INLINE TrackDescriptor::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ::calf::proto::TraceRecord& from_msg) + const ::perfetto::protos::TrackDescriptor& from_msg) : _has_bits_{from._has_bits_}, _cached_size_{0}, - invoker_(arena, from.invoker_), - file_(arena, from.file_), - args_(arena, from.args_) {} + name_(arena, from.name_) {} -TraceRecord::TraceRecord( +TrackDescriptor::TrackDescriptor( ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, - const TraceRecord& from) + const TrackDescriptor& from) #if defined(PROTOBUF_CUSTOM_VTABLE) - : ::google::protobuf::Message(arena, TraceRecord_class_data_.base()) { + : ::google::protobuf::Message(arena, TrackDescriptor_class_data_.base()) { #else // PROTOBUF_CUSTOM_VTABLE : ::google::protobuf::Message(arena) { #endif // PROTOBUF_CUSTOM_VTABLE - TraceRecord* const _this = this; + TrackDescriptor* const _this = this; (void)_this; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, timestamp_ms_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, timestamp_ms_), - offsetof(Impl_, line_) - - offsetof(Impl_, timestamp_ms_) + - sizeof(Impl_::line_)); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.thread_ = ((cached_has_bits & 0x00000002u) != 0) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.thread_) + : nullptr; + _impl_.uuid_ = from._impl_.uuid_; - // @@protoc_insertion_point(copy_constructor:calf.proto.TraceRecord) + // @@protoc_insertion_point(copy_constructor:perfetto.protos.TrackDescriptor) } -PROTOBUF_NDEBUG_INLINE TraceRecord::Impl_::Impl_( +PROTOBUF_NDEBUG_INLINE TrackDescriptor::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : _cached_size_{0}, - invoker_(arena), - file_(arena), - args_(arena) {} + name_(arena) {} -inline void TraceRecord::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { +inline void TrackDescriptor::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { new (&_impl_) Impl_(internal_visibility(), arena); ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, timestamp_ms_), + offsetof(Impl_, thread_), 0, - offsetof(Impl_, line_) - - offsetof(Impl_, timestamp_ms_) + - sizeof(Impl_::line_)); + offsetof(Impl_, uuid_) - + offsetof(Impl_, thread_) + + sizeof(Impl_::uuid_)); } -TraceRecord::~TraceRecord() { - // @@protoc_insertion_point(destructor:calf.proto.TraceRecord) +TrackDescriptor::~TrackDescriptor() { + // @@protoc_insertion_point(destructor:perfetto.protos.TrackDescriptor) SharedDtor(*this); } -inline void TraceRecord::SharedDtor(MessageLite& self) { - TraceRecord& this_ = static_cast(self); +inline void TrackDescriptor::SharedDtor(MessageLite& self) { + TrackDescriptor& this_ = static_cast(self); this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); ABSL_DCHECK(this_.GetArena() == nullptr); - this_._impl_.invoker_.Destroy(); - this_._impl_.file_.Destroy(); - this_._impl_.args_.Destroy(); + this_._impl_.name_.Destroy(); + delete this_._impl_.thread_; this_._impl_.~Impl_(); } -inline void* PROTOBUF_NONNULL TraceRecord::PlacementNew_( +inline void* PROTOBUF_NONNULL TrackDescriptor::PlacementNew_( const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { - return ::new (mem) TraceRecord(arena); + return ::new (mem) TrackDescriptor(arena); } -constexpr auto TraceRecord::InternalNewImpl_() { - return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(TraceRecord), - alignof(TraceRecord)); +constexpr auto TrackDescriptor::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(TrackDescriptor), + alignof(TrackDescriptor)); } -constexpr auto TraceRecord::InternalGenerateClassData_() { +constexpr auto TrackDescriptor::InternalGenerateClassData_() { return ::google::protobuf::internal::ClassDataFull{ ::google::protobuf::internal::ClassData{ - &_TraceRecord_default_instance_._instance, + &_TrackDescriptor_default_instance_._instance, &_table_.header, nullptr, // OnDemandRegisterArenaDtor nullptr, // IsInitialized - &TraceRecord::MergeImpl, - ::google::protobuf::Message::GetNewImpl(), + &TrackDescriptor::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - &TraceRecord::SharedDtor, - ::google::protobuf::Message::GetClearImpl(), &TraceRecord::ByteSizeLong, - &TraceRecord::_InternalSerialize, + &TrackDescriptor::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &TrackDescriptor::ByteSizeLong, + &TrackDescriptor::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE - PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_._cached_size_), + PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_._cached_size_), false, }, - &TraceRecord::kDescriptorMethods, + &TrackDescriptor::kDescriptorMethods, &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, nullptr, // tracker }; } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const - ::google::protobuf::internal::ClassDataFull TraceRecord_class_data_ = - TraceRecord::InternalGenerateClassData_(); + ::google::protobuf::internal::ClassDataFull TrackDescriptor_class_data_ = + TrackDescriptor::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL -TraceRecord::GetClassData() const { - ::google::protobuf::internal::PrefetchToLocalCache(&TraceRecord_class_data_); - ::google::protobuf::internal::PrefetchToLocalCache(TraceRecord_class_data_.tc_table); - return TraceRecord_class_data_.base(); +TrackDescriptor::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&TrackDescriptor_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(TrackDescriptor_class_data_.tc_table); + return TrackDescriptor_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 0, 54, 2> -TraceRecord::_table_ = { +const ::_pbi::TcParseTable<2, 3, 1, 44, 2> +TrackDescriptor::_table_ = { { - PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_._has_bits_), 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask + 4, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap + 4294967284, // skipmap offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - TraceRecord_class_data_.base(), + 3, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + TrackDescriptor_class_data_.base(), nullptr, // post_loop_handler ::_pbi::TcParser::GenericFallback, // fallback #ifdef PROTOBUF_PREFETCH_PARSE_TABLE - ::_pbi::TcParser::GetTable<::calf::proto::TraceRecord>(), // to_prefetch + ::_pbi::TcParser::GetTable<::perfetto::protos::TrackDescriptor>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - // string args = 8; - {::_pbi::TcParser::FastUS1, - {66, 2, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.args_)}}, - // uint64 timestamp_ms = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(TraceRecord, _impl_.timestamp_ms_), 3>(), - {8, 3, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.timestamp_ms_)}}, - // uint64 scope_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(TraceRecord, _impl_.scope_id_), 4>(), - {16, 4, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.scope_id_)}}, - // uint64 parent_scope_id = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(TraceRecord, _impl_.parent_scope_id_), 5>(), - {24, 5, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.parent_scope_id_)}}, - // .calf.proto.TraceRecord.Kind kind = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(TraceRecord, _impl_.kind_), 6>(), - {32, 6, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.kind_)}}, - // string invoker = 5; - {::_pbi::TcParser::FastUS1, - {42, 0, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.invoker_)}}, - // string file = 6; - {::_pbi::TcParser::FastUS1, - {50, 1, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.file_)}}, - // uint32 line = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(TraceRecord, _impl_.line_), 7>(), - {56, 7, 0, PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.line_)}}, + // optional .perfetto.protos.ThreadDescriptor thread = 4; + {::_pbi::TcParser::FastMtS1, + {34, 1, 0, PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.thread_)}}, + // optional uint64 uuid = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(TrackDescriptor, _impl_.uuid_), 2>(), + {8, 2, 0, PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.uuid_)}}, + // optional string name = 2; + {::_pbi::TcParser::FastSS1, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.name_)}}, + {::_pbi::TcParser::MiniParse, {}}, }}, {{ 65535, 65535 }}, {{ - // uint64 timestamp_ms = 1; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.timestamp_ms_), _Internal::kHasBitsOffset + 3, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // uint64 scope_id = 2; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.scope_id_), _Internal::kHasBitsOffset + 4, 0, + // optional uint64 uuid = 1; + {PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.uuid_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // uint64 parent_scope_id = 3; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.parent_scope_id_), _Internal::kHasBitsOffset + 5, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, - // .calf.proto.TraceRecord.Kind kind = 4; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.kind_), _Internal::kHasBitsOffset + 6, 0, - (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, - // string invoker = 5; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.invoker_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // string file = 6; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.file_), _Internal::kHasBitsOffset + 1, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint32 line = 7; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.line_), _Internal::kHasBitsOffset + 7, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, - // string args = 8; - {PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.args_), _Internal::kHasBitsOffset + 2, 0, - (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // optional string name = 2; + {PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.name_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional .perfetto.protos.ThreadDescriptor thread = 4; + {PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.thread_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::perfetto::protos::ThreadDescriptor>()}, }}, - // no aux_entries {{ - "\26\0\0\0\0\7\4\0\4\0\0\0\0\0\0\0" - "calf.proto.TraceRecord" - "invoker" - "file" - "args" + "\37\0\4\0\0\0\0\0" + "perfetto.protos.TrackDescriptor" + "name" }}, }; -PROTOBUF_NOINLINE void TraceRecord::Clear() { -// @@protoc_insertion_point(message_clear_start:calf.proto.TraceRecord) +PROTOBUF_NOINLINE void TrackDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.TrackDescriptor) ::google::protobuf::internal::TSanWrite(&_impl_); ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if ((cached_has_bits & 0x00000007u) != 0) { + if ((cached_has_bits & 0x00000003u) != 0) { if ((cached_has_bits & 0x00000001u) != 0) { - _impl_.invoker_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); } if ((cached_has_bits & 0x00000002u) != 0) { - _impl_.file_.ClearNonDefaultToEmpty(); - } - if ((cached_has_bits & 0x00000004u) != 0) { - _impl_.args_.ClearNonDefaultToEmpty(); + ABSL_DCHECK(_impl_.thread_ != nullptr); + _impl_.thread_->Clear(); } } - if ((cached_has_bits & 0x000000f8u) != 0) { - ::memset(&_impl_.timestamp_ms_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.line_) - - reinterpret_cast(&_impl_.timestamp_ms_)) + sizeof(_impl_.line_)); - } + _impl_.uuid_ = ::uint64_t{0u}; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } #if defined(PROTOBUF_CUSTOM_VTABLE) -::uint8_t* PROTOBUF_NONNULL TraceRecord::_InternalSerialize( +::uint8_t* PROTOBUF_NONNULL TrackDescriptor::_InternalSerialize( const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { - const TraceRecord& this_ = static_cast(base); + const TrackDescriptor& this_ = static_cast(base); #else // PROTOBUF_CUSTOM_VTABLE -::uint8_t* PROTOBUF_NONNULL TraceRecord::_InternalSerialize( +::uint8_t* PROTOBUF_NONNULL TrackDescriptor::_InternalSerialize( ::uint8_t* PROTOBUF_NONNULL target, ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { - const TraceRecord& this_ = *this; + const TrackDescriptor& this_ = *this; #endif // PROTOBUF_CUSTOM_VTABLE - // @@protoc_insertion_point(serialize_to_array_start:calf.proto.TraceRecord) + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TrackDescriptor) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // uint64 timestamp_ms = 1; - if ((this_._impl_._has_bits_[0] & 0x00000008u) != 0) { - if (this_._internal_timestamp_ms() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this_._internal_timestamp_ms(), target); - } - } - - // uint64 scope_id = 2; - if ((this_._impl_._has_bits_[0] & 0x00000010u) != 0) { - if (this_._internal_scope_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this_._internal_scope_id(), target); - } - } - - // uint64 parent_scope_id = 3; - if ((this_._impl_._has_bits_[0] & 0x00000020u) != 0) { - if (this_._internal_parent_scope_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 3, this_._internal_parent_scope_id(), target); - } - } - - // .calf.proto.TraceRecord.Kind kind = 4; - if ((this_._impl_._has_bits_[0] & 0x00000040u) != 0) { - if (this_._internal_kind() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this_._internal_kind(), target); - } - } - - // string invoker = 5; - if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) { - if (!this_._internal_invoker().empty()) { - const ::std::string& _s = this_._internal_invoker(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "calf.proto.TraceRecord.invoker"); - target = stream->WriteStringMaybeAliased(5, _s, target); - } - } - - // string file = 6; - if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) { - if (!this_._internal_file().empty()) { - const ::std::string& _s = this_._internal_file(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "calf.proto.TraceRecord.file"); - target = stream->WriteStringMaybeAliased(6, _s, target); - } + cached_has_bits = this_._impl_._has_bits_[0]; + // optional uint64 uuid = 1; + if ((cached_has_bits & 0x00000004u) != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this_._internal_uuid(), target); } - // uint32 line = 7; - if ((this_._impl_._has_bits_[0] & 0x00000080u) != 0) { - if (this_._internal_line() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 7, this_._internal_line(), target); - } + // optional string name = 2; + if ((cached_has_bits & 0x00000001u) != 0) { + const ::std::string& _s = this_._internal_name(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.TrackDescriptor.name"); + target = stream->WriteStringMaybeAliased(2, _s, target); } - // string args = 8; - if ((this_._impl_._has_bits_[0] & 0x00000004u) != 0) { - if (!this_._internal_args().empty()) { - const ::std::string& _s = this_._internal_args(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "calf.proto.TraceRecord.args"); - target = stream->WriteStringMaybeAliased(8, _s, target); - } + // optional .perfetto.protos.ThreadDescriptor thread = 4; + if ((cached_has_bits & 0x00000002u) != 0) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 4, *this_._impl_.thread_, this_._impl_.thread_->GetCachedSize(), target, + stream); } if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { @@ -496,18 +2293,18 @@ ::uint8_t* PROTOBUF_NONNULL TraceRecord::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:calf.proto.TraceRecord) + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TrackDescriptor) return target; } #if defined(PROTOBUF_CUSTOM_VTABLE) -::size_t TraceRecord::ByteSizeLong(const MessageLite& base) { - const TraceRecord& this_ = static_cast(base); +::size_t TrackDescriptor::ByteSizeLong(const MessageLite& base) { + const TrackDescriptor& this_ = static_cast(base); #else // PROTOBUF_CUSTOM_VTABLE -::size_t TraceRecord::ByteSizeLong() const { - const TraceRecord& this_ = *this; +::size_t TrackDescriptor::ByteSizeLong() const { + const TrackDescriptor& this_ = *this; #endif // PROTOBUF_CUSTOM_VTABLE - // @@protoc_insertion_point(message_byte_size_start:calf.proto.TraceRecord) + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TrackDescriptor) ::size_t total_size = 0; ::uint32_t cached_has_bits = 0; @@ -516,346 +2313,304 @@ ::size_t TraceRecord::ByteSizeLong() const { ::_pbi::Prefetch5LinesFrom7Lines(&this_); cached_has_bits = this_._impl_._has_bits_[0]; - if ((cached_has_bits & 0x000000ffu) != 0) { - // string invoker = 5; + if ((cached_has_bits & 0x00000007u) != 0) { + // optional string name = 2; if ((cached_has_bits & 0x00000001u) != 0) { - if (!this_._internal_invoker().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this_._internal_invoker()); - } + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_name()); } - // string file = 6; + // optional .perfetto.protos.ThreadDescriptor thread = 4; if ((cached_has_bits & 0x00000002u) != 0) { - if (!this_._internal_file().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this_._internal_file()); - } + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.thread_); } - // string args = 8; + // optional uint64 uuid = 1; if ((cached_has_bits & 0x00000004u) != 0) { - if (!this_._internal_args().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this_._internal_args()); - } - } - // uint64 timestamp_ms = 1; - if ((cached_has_bits & 0x00000008u) != 0) { - if (this_._internal_timestamp_ms() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this_._internal_timestamp_ms()); - } - } - // uint64 scope_id = 2; - if ((cached_has_bits & 0x00000010u) != 0) { - if (this_._internal_scope_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this_._internal_scope_id()); - } - } - // uint64 parent_scope_id = 3; - if ((cached_has_bits & 0x00000020u) != 0) { - if (this_._internal_parent_scope_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this_._internal_parent_scope_id()); - } - } - // .calf.proto.TraceRecord.Kind kind = 4; - if ((cached_has_bits & 0x00000040u) != 0) { - if (this_._internal_kind() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this_._internal_kind()); - } - } - // uint32 line = 7; - if ((cached_has_bits & 0x00000080u) != 0) { - if (this_._internal_line() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this_._internal_line()); - } + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_uuid()); } } return this_.MaybeComputeUnknownFieldsSize(total_size, &this_._impl_._cached_size_); } -void TraceRecord::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:calf.proto.TraceRecord) +void TrackDescriptor::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TrackDescriptor) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if ((cached_has_bits & 0x000000ffu) != 0) { + if ((cached_has_bits & 0x00000007u) != 0) { if ((cached_has_bits & 0x00000001u) != 0) { - if (!from._internal_invoker().empty()) { - _this->_internal_set_invoker(from._internal_invoker()); - } else { - if (_this->_impl_.invoker_.IsDefault()) { - _this->_internal_set_invoker(""); - } - } + _this->_internal_set_name(from._internal_name()); } if ((cached_has_bits & 0x00000002u) != 0) { - if (!from._internal_file().empty()) { - _this->_internal_set_file(from._internal_file()); + ABSL_DCHECK(from._impl_.thread_ != nullptr); + if (_this->_impl_.thread_ == nullptr) { + _this->_impl_.thread_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.thread_); } else { - if (_this->_impl_.file_.IsDefault()) { - _this->_internal_set_file(""); - } + _this->_impl_.thread_->MergeFrom(*from._impl_.thread_); } } if ((cached_has_bits & 0x00000004u) != 0) { - if (!from._internal_args().empty()) { - _this->_internal_set_args(from._internal_args()); - } else { - if (_this->_impl_.args_.IsDefault()) { - _this->_internal_set_args(""); - } - } - } - if ((cached_has_bits & 0x00000008u) != 0) { - if (from._internal_timestamp_ms() != 0) { - _this->_impl_.timestamp_ms_ = from._impl_.timestamp_ms_; - } - } - if ((cached_has_bits & 0x00000010u) != 0) { - if (from._internal_scope_id() != 0) { - _this->_impl_.scope_id_ = from._impl_.scope_id_; - } - } - if ((cached_has_bits & 0x00000020u) != 0) { - if (from._internal_parent_scope_id() != 0) { - _this->_impl_.parent_scope_id_ = from._impl_.parent_scope_id_; - } - } - if ((cached_has_bits & 0x00000040u) != 0) { - if (from._internal_kind() != 0) { - _this->_impl_.kind_ = from._impl_.kind_; - } - } - if ((cached_has_bits & 0x00000080u) != 0) { - if (from._internal_line() != 0) { - _this->_impl_.line_ = from._impl_.line_; - } + _this->_impl_.uuid_ = from._impl_.uuid_; } } _this->_impl_._has_bits_[0] |= cached_has_bits; _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void TraceRecord::CopyFrom(const TraceRecord& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:calf.proto.TraceRecord) +void TrackDescriptor::CopyFrom(const TrackDescriptor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TrackDescriptor) if (&from == this) return; Clear(); MergeFrom(from); } -void TraceRecord::InternalSwap(TraceRecord* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { +void TrackDescriptor::InternalSwap(TrackDescriptor* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { using ::std::swap; auto* arena = GetArena(); ABSL_DCHECK_EQ(arena, other->GetArena()); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.invoker_, &other->_impl_.invoker_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.file_, &other->_impl_.file_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.args_, &other->_impl_.args_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.line_) - + sizeof(TraceRecord::_impl_.line_) - - PROTOBUF_FIELD_OFFSET(TraceRecord, _impl_.timestamp_ms_)>( - reinterpret_cast(&_impl_.timestamp_ms_), - reinterpret_cast(&other->_impl_.timestamp_ms_)); + PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.uuid_) + + sizeof(TrackDescriptor::_impl_.uuid_) + - PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.thread_)>( + reinterpret_cast(&_impl_.thread_), + reinterpret_cast(&other->_impl_.thread_)); } -::google::protobuf::Metadata TraceRecord::GetMetadata() const { +::google::protobuf::Metadata TrackDescriptor::GetMetadata() const { return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } // =================================================================== -class TraceFile::_Internal { +class ThreadDescriptor::_Internal { public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_._has_bits_); }; -TraceFile::TraceFile(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +ThreadDescriptor::ThreadDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) - : ::google::protobuf::Message(arena, TraceFile_class_data_.base()) { + : ::google::protobuf::Message(arena, ThreadDescriptor_class_data_.base()) { #else // PROTOBUF_CUSTOM_VTABLE : ::google::protobuf::Message(arena) { #endif // PROTOBUF_CUSTOM_VTABLE SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:calf.proto.TraceFile) + // @@protoc_insertion_point(arena_constructor:perfetto.protos.ThreadDescriptor) } -PROTOBUF_NDEBUG_INLINE TraceFile::Impl_::Impl_( +PROTOBUF_NDEBUG_INLINE ThreadDescriptor::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ::calf::proto::TraceFile& from_msg) - : records_{visibility, arena, from.records_}, - _cached_size_{0} {} + const ::perfetto::protos::ThreadDescriptor& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + thread_name_(arena, from.thread_name_) {} -TraceFile::TraceFile( +ThreadDescriptor::ThreadDescriptor( ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, - const TraceFile& from) + const ThreadDescriptor& from) #if defined(PROTOBUF_CUSTOM_VTABLE) - : ::google::protobuf::Message(arena, TraceFile_class_data_.base()) { + : ::google::protobuf::Message(arena, ThreadDescriptor_class_data_.base()) { #else // PROTOBUF_CUSTOM_VTABLE : ::google::protobuf::Message(arena) { #endif // PROTOBUF_CUSTOM_VTABLE - TraceFile* const _this = this; + ThreadDescriptor* const _this = this; (void)_this; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, tid_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, tid_), + offsetof(Impl_, pid_) - + offsetof(Impl_, tid_) + + sizeof(Impl_::pid_)); - // @@protoc_insertion_point(copy_constructor:calf.proto.TraceFile) + // @@protoc_insertion_point(copy_constructor:perfetto.protos.ThreadDescriptor) } -PROTOBUF_NDEBUG_INLINE TraceFile::Impl_::Impl_( +PROTOBUF_NDEBUG_INLINE ThreadDescriptor::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) - : records_{visibility, arena}, - _cached_size_{0} {} + : _cached_size_{0}, + thread_name_(arena) {} -inline void TraceFile::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { +inline void ThreadDescriptor::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, tid_), + 0, + offsetof(Impl_, pid_) - + offsetof(Impl_, tid_) + + sizeof(Impl_::pid_)); } -TraceFile::~TraceFile() { - // @@protoc_insertion_point(destructor:calf.proto.TraceFile) +ThreadDescriptor::~ThreadDescriptor() { + // @@protoc_insertion_point(destructor:perfetto.protos.ThreadDescriptor) SharedDtor(*this); } -inline void TraceFile::SharedDtor(MessageLite& self) { - TraceFile& this_ = static_cast(self); +inline void ThreadDescriptor::SharedDtor(MessageLite& self) { + ThreadDescriptor& this_ = static_cast(self); this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.thread_name_.Destroy(); this_._impl_.~Impl_(); } -inline void* PROTOBUF_NONNULL TraceFile::PlacementNew_( +inline void* PROTOBUF_NONNULL ThreadDescriptor::PlacementNew_( const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { - return ::new (mem) TraceFile(arena); + return ::new (mem) ThreadDescriptor(arena); } -constexpr auto TraceFile::InternalNewImpl_() { - constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ - PROTOBUF_FIELD_OFFSET(TraceFile, _impl_.records_) + - decltype(TraceFile::_impl_.records_):: - InternalGetArenaOffset( - ::google::protobuf::Message::internal_visibility()), - }); - if (arena_bits.has_value()) { - return ::google::protobuf::internal::MessageCreator::ZeroInit( - sizeof(TraceFile), alignof(TraceFile), *arena_bits); - } else { - return ::google::protobuf::internal::MessageCreator(&TraceFile::PlacementNew_, - sizeof(TraceFile), - alignof(TraceFile)); - } +constexpr auto ThreadDescriptor::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ThreadDescriptor), + alignof(ThreadDescriptor)); } -constexpr auto TraceFile::InternalGenerateClassData_() { +constexpr auto ThreadDescriptor::InternalGenerateClassData_() { return ::google::protobuf::internal::ClassDataFull{ ::google::protobuf::internal::ClassData{ - &_TraceFile_default_instance_._instance, + &_ThreadDescriptor_default_instance_._instance, &_table_.header, nullptr, // OnDemandRegisterArenaDtor nullptr, // IsInitialized - &TraceFile::MergeImpl, - ::google::protobuf::Message::GetNewImpl(), + &ThreadDescriptor::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), #if defined(PROTOBUF_CUSTOM_VTABLE) - &TraceFile::SharedDtor, - ::google::protobuf::Message::GetClearImpl(), &TraceFile::ByteSizeLong, - &TraceFile::_InternalSerialize, + &ThreadDescriptor::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ThreadDescriptor::ByteSizeLong, + &ThreadDescriptor::_InternalSerialize, #endif // PROTOBUF_CUSTOM_VTABLE - PROTOBUF_FIELD_OFFSET(TraceFile, _impl_._cached_size_), + PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_._cached_size_), false, }, - &TraceFile::kDescriptorMethods, + &ThreadDescriptor::kDescriptorMethods, &descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto, nullptr, // tracker }; } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const - ::google::protobuf::internal::ClassDataFull TraceFile_class_data_ = - TraceFile::InternalGenerateClassData_(); + ::google::protobuf::internal::ClassDataFull ThreadDescriptor_class_data_ = + ThreadDescriptor::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL -TraceFile::GetClassData() const { - ::google::protobuf::internal::PrefetchToLocalCache(&TraceFile_class_data_); - ::google::protobuf::internal::PrefetchToLocalCache(TraceFile_class_data_.tc_table); - return TraceFile_class_data_.base(); +ThreadDescriptor::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ThreadDescriptor_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ThreadDescriptor_class_data_.tc_table); + return ThreadDescriptor_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 1, 1, 0, 2> -TraceFile::_table_ = { +const ::_pbi::TcParseTable<1, 3, 0, 52, 2> +ThreadDescriptor::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_._has_bits_), 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask + 5, 8, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap + 4294967276, // skipmap offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - TraceFile_class_data_.base(), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + ThreadDescriptor_class_data_.base(), nullptr, // post_loop_handler ::_pbi::TcParser::GenericFallback, // fallback #ifdef PROTOBUF_PREFETCH_PARSE_TABLE - ::_pbi::TcParser::GetTable<::calf::proto::TraceFile>(), // to_prefetch + ::_pbi::TcParser::GetTable<::perfetto::protos::ThreadDescriptor>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - // repeated .calf.proto.TraceRecord records = 1; - {::_pbi::TcParser::FastMtR1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(TraceFile, _impl_.records_)}}, + // optional int64 tid = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ThreadDescriptor, _impl_.tid_), 1>(), + {16, 1, 0, PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.tid_)}}, + // optional int32 pid = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ThreadDescriptor, _impl_.pid_), 2>(), + {8, 2, 0, PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.pid_)}}, }}, {{ 65535, 65535 }}, {{ - // repeated .calf.proto.TraceRecord records = 1; - {PROTOBUF_FIELD_OFFSET(TraceFile, _impl_.records_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, - {{ - {::_pbi::TcParser::GetTable<::calf::proto::TraceRecord>()}, + // optional int32 pid = 1; + {PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.pid_), _Internal::kHasBitsOffset + 2, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // optional int64 tid = 2; + {PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.tid_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt64)}, + // optional string thread_name = 5; + {PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.thread_name_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, }}, + // no aux_entries {{ + "\40\0\0\13\0\0\0\0" + "perfetto.protos.ThreadDescriptor" + "thread_name" }}, }; -PROTOBUF_NOINLINE void TraceFile::Clear() { -// @@protoc_insertion_point(message_clear_start:calf.proto.TraceFile) +PROTOBUF_NOINLINE void ThreadDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:perfetto.protos.ThreadDescriptor) ::google::protobuf::internal::TSanWrite(&_impl_); ::uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.records_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000001u) != 0) { + _impl_.thread_name_.ClearNonDefaultToEmpty(); + } + if ((cached_has_bits & 0x00000006u) != 0) { + ::memset(&_impl_.tid_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.pid_) - + reinterpret_cast(&_impl_.tid_)) + sizeof(_impl_.pid_)); + } + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } #if defined(PROTOBUF_CUSTOM_VTABLE) -::uint8_t* PROTOBUF_NONNULL TraceFile::_InternalSerialize( +::uint8_t* PROTOBUF_NONNULL ThreadDescriptor::_InternalSerialize( const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { - const TraceFile& this_ = static_cast(base); + const ThreadDescriptor& this_ = static_cast(base); #else // PROTOBUF_CUSTOM_VTABLE -::uint8_t* PROTOBUF_NONNULL TraceFile::_InternalSerialize( +::uint8_t* PROTOBUF_NONNULL ThreadDescriptor::_InternalSerialize( ::uint8_t* PROTOBUF_NONNULL target, ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { - const TraceFile& this_ = *this; + const ThreadDescriptor& this_ = *this; #endif // PROTOBUF_CUSTOM_VTABLE - // @@protoc_insertion_point(serialize_to_array_start:calf.proto.TraceFile) + // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ThreadDescriptor) ::uint32_t cached_has_bits = 0; (void)cached_has_bits; - // repeated .calf.proto.TraceRecord records = 1; - for (unsigned i = 0, n = static_cast( - this_._internal_records_size()); - i < n; i++) { - const auto& repfield = this_._internal_records().Get(i); + cached_has_bits = this_._impl_._has_bits_[0]; + // optional int32 pid = 1; + if ((cached_has_bits & 0x00000004u) != 0) { target = - ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, repfield, repfield.GetCachedSize(), - target, stream); + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( + stream, this_._internal_pid(), target); + } + + // optional int64 tid = 2; + if ((cached_has_bits & 0x00000002u) != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt64ToArrayWithField<2>( + stream, this_._internal_tid(), target); + } + + // optional string thread_name = 5; + if ((cached_has_bits & 0x00000001u) != 0) { + const ::std::string& _s = this_._internal_thread_name(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "perfetto.protos.ThreadDescriptor.thread_name"); + target = stream->WriteStringMaybeAliased(5, _s, target); } if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { @@ -863,18 +2618,18 @@ ::uint8_t* PROTOBUF_NONNULL TraceFile::_InternalSerialize( ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:calf.proto.TraceFile) + // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ThreadDescriptor) return target; } #if defined(PROTOBUF_CUSTOM_VTABLE) -::size_t TraceFile::ByteSizeLong(const MessageLite& base) { - const TraceFile& this_ = static_cast(base); +::size_t ThreadDescriptor::ByteSizeLong(const MessageLite& base) { + const ThreadDescriptor& this_ = static_cast(base); #else // PROTOBUF_CUSTOM_VTABLE -::size_t TraceFile::ByteSizeLong() const { - const TraceFile& this_ = *this; +::size_t ThreadDescriptor::ByteSizeLong() const { + const ThreadDescriptor& this_ = *this; #endif // PROTOBUF_CUSTOM_VTABLE - // @@protoc_insertion_point(message_byte_size_start:calf.proto.TraceFile) + // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ThreadDescriptor) ::size_t total_size = 0; ::uint32_t cached_has_bits = 0; @@ -882,52 +2637,81 @@ ::size_t TraceFile::ByteSizeLong() const { (void)cached_has_bits; ::_pbi::Prefetch5LinesFrom7Lines(&this_); - { - // repeated .calf.proto.TraceRecord records = 1; - { - total_size += 1UL * this_._internal_records_size(); - for (const auto& msg : this_._internal_records()) { - total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } + cached_has_bits = this_._impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000007u) != 0) { + // optional string thread_name = 5; + if ((cached_has_bits & 0x00000001u) != 0) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_thread_name()); + } + // optional int64 tid = 2; + if ((cached_has_bits & 0x00000002u) != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( + this_._internal_tid()); + } + // optional int32 pid = 1; + if ((cached_has_bits & 0x00000004u) != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_pid()); } } return this_.MaybeComputeUnknownFieldsSize(total_size, &this_._impl_._cached_size_); } -void TraceFile::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:calf.proto.TraceFile) +void ThreadDescriptor::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ThreadDescriptor) ABSL_DCHECK_NE(&from, _this); ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_internal_mutable_records()->MergeFrom( - from._internal_records()); + cached_has_bits = from._impl_._has_bits_[0]; + if ((cached_has_bits & 0x00000007u) != 0) { + if ((cached_has_bits & 0x00000001u) != 0) { + _this->_internal_set_thread_name(from._internal_thread_name()); + } + if ((cached_has_bits & 0x00000002u) != 0) { + _this->_impl_.tid_ = from._impl_.tid_; + } + if ((cached_has_bits & 0x00000004u) != 0) { + _this->_impl_.pid_ = from._impl_.pid_; + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } -void TraceFile::CopyFrom(const TraceFile& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:calf.proto.TraceFile) +void ThreadDescriptor::CopyFrom(const ThreadDescriptor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ThreadDescriptor) if (&from == this) return; Clear(); MergeFrom(from); } -void TraceFile::InternalSwap(TraceFile* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { +void ThreadDescriptor::InternalSwap(ThreadDescriptor* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.records_.InternalSwap(&other->_impl_.records_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.thread_name_, &other->_impl_.thread_name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.pid_) + + sizeof(ThreadDescriptor::_impl_.pid_) + - PROTOBUF_FIELD_OFFSET(ThreadDescriptor, _impl_.tid_)>( + reinterpret_cast(&_impl_.tid_), + reinterpret_cast(&other->_impl_.tid_)); } -::google::protobuf::Metadata TraceFile::GetMetadata() const { +::google::protobuf::Metadata ThreadDescriptor::GetMetadata() const { return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } // @@protoc_insertion_point(namespace_scope) -} // namespace proto -} // namespace calf +} // namespace protos +} // namespace perfetto namespace google { namespace protobuf { } // namespace protobuf diff --git a/calf/protobuf/calf_trace.pb.h b/calf/protobuf/calf_trace.pb.h index 12e07dd..d05f513 100644 --- a/calf/protobuf/calf_trace.pb.h +++ b/calf/protobuf/calf_trace.pb.h @@ -53,65 +53,82 @@ struct TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto { extern "C" { extern const ::google::protobuf::internal::DescriptorTable descriptor_table_calf_2fprotobuf_2fcalf_5ftrace_2eproto; } // extern "C" -namespace calf { -namespace proto { -enum TraceRecord_Kind : int; -extern const uint32_t TraceRecord_Kind_internal_data_[]; -class TraceFile; -struct TraceFileDefaultTypeInternal; -extern TraceFileDefaultTypeInternal _TraceFile_default_instance_; -extern const ::google::protobuf::internal::ClassDataFull TraceFile_class_data_; -class TraceRecord; -struct TraceRecordDefaultTypeInternal; -extern TraceRecordDefaultTypeInternal _TraceRecord_default_instance_; -extern const ::google::protobuf::internal::ClassDataFull TraceRecord_class_data_; -} // namespace proto -} // namespace calf +namespace perfetto { +namespace protos { +enum TrackEvent_Type : int; +extern const uint32_t TrackEvent_Type_internal_data_[]; +class DebugAnnotation; +struct DebugAnnotationDefaultTypeInternal; +extern DebugAnnotationDefaultTypeInternal _DebugAnnotation_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull DebugAnnotation_class_data_; +class SourceLocation; +struct SourceLocationDefaultTypeInternal; +extern SourceLocationDefaultTypeInternal _SourceLocation_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull SourceLocation_class_data_; +class ThreadDescriptor; +struct ThreadDescriptorDefaultTypeInternal; +extern ThreadDescriptorDefaultTypeInternal _ThreadDescriptor_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull ThreadDescriptor_class_data_; +class Trace; +struct TraceDefaultTypeInternal; +extern TraceDefaultTypeInternal _Trace_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull Trace_class_data_; +class TracePacket; +struct TracePacketDefaultTypeInternal; +extern TracePacketDefaultTypeInternal _TracePacket_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull TracePacket_class_data_; +class TrackDescriptor; +struct TrackDescriptorDefaultTypeInternal; +extern TrackDescriptorDefaultTypeInternal _TrackDescriptor_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull TrackDescriptor_class_data_; +class TrackEvent; +struct TrackEventDefaultTypeInternal; +extern TrackEventDefaultTypeInternal _TrackEvent_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull TrackEvent_class_data_; +} // namespace protos +} // namespace perfetto namespace google { namespace protobuf { template <> -internal::EnumTraitsT<::calf::proto::TraceRecord_Kind_internal_data_> - internal::EnumTraitsImpl::value<::calf::proto::TraceRecord_Kind>; +internal::EnumTraitsT<::perfetto::protos::TrackEvent_Type_internal_data_> + internal::EnumTraitsImpl::value<::perfetto::protos::TrackEvent_Type>; } // namespace protobuf } // namespace google -namespace calf { -namespace proto { -enum TraceRecord_Kind : int { - TraceRecord_Kind_SCOPE_ENTER = 0, - TraceRecord_Kind_EVENT = 1, - TraceRecord_Kind_SCOPE_EXIT = 2, - TraceRecord_Kind_TraceRecord_Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = - ::std::numeric_limits<::int32_t>::min(), - TraceRecord_Kind_TraceRecord_Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = - ::std::numeric_limits<::int32_t>::max(), +namespace perfetto { +namespace protos { +enum TrackEvent_Type : int { + TrackEvent_Type_TYPE_UNSPECIFIED = 0, + TrackEvent_Type_TYPE_SLICE_BEGIN = 1, + TrackEvent_Type_TYPE_SLICE_END = 2, + TrackEvent_Type_TYPE_INSTANT = 3, }; -extern const uint32_t TraceRecord_Kind_internal_data_[]; -inline constexpr TraceRecord_Kind TraceRecord_Kind_Kind_MIN = - static_cast(0); -inline constexpr TraceRecord_Kind TraceRecord_Kind_Kind_MAX = - static_cast(2); -inline bool TraceRecord_Kind_IsValid(int value) { - return 0 <= value && value <= 2; +extern const uint32_t TrackEvent_Type_internal_data_[]; +inline constexpr TrackEvent_Type TrackEvent_Type_Type_MIN = + static_cast(0); +inline constexpr TrackEvent_Type TrackEvent_Type_Type_MAX = + static_cast(3); +inline bool TrackEvent_Type_IsValid(int value) { + return 0 <= value && value <= 3; } -inline constexpr int TraceRecord_Kind_Kind_ARRAYSIZE = 2 + 1; -const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL TraceRecord_Kind_descriptor(); +inline constexpr int TrackEvent_Type_Type_ARRAYSIZE = 3 + 1; +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL TrackEvent_Type_descriptor(); template -const ::std::string& TraceRecord_Kind_Name(T value) { - static_assert(::std::is_same::value || +const ::std::string& TrackEvent_Type_Name(T value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to Kind_Name()."); - return TraceRecord_Kind_Name(static_cast(value)); + "Incorrect type passed to Type_Name()."); + return TrackEvent_Type_Name(static_cast(value)); } template <> -inline const ::std::string& TraceRecord_Kind_Name(TraceRecord_Kind value) { - return ::google::protobuf::internal::NameOfDenseEnum( +inline const ::std::string& TrackEvent_Type_Name(TrackEvent_Type value) { + return ::google::protobuf::internal::NameOfDenseEnum( static_cast(value)); } -inline bool TraceRecord_Kind_Parse( - ::absl::string_view name, TraceRecord_Kind* PROTOBUF_NONNULL value) { - return ::google::protobuf::internal::ParseNamedEnum(TraceRecord_Kind_descriptor(), name, +inline bool TrackEvent_Type_Parse( + ::absl::string_view name, TrackEvent_Type* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(TrackEvent_Type_descriptor(), name, value); } @@ -120,30 +137,30 @@ inline bool TraceRecord_Kind_Parse( // ------------------------------------------------------------------- -class TraceRecord final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:calf.proto.TraceRecord) */ { +class ThreadDescriptor final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.ThreadDescriptor) */ { public: - inline TraceRecord() : TraceRecord(nullptr) {} - ~TraceRecord() PROTOBUF_FINAL; + inline ThreadDescriptor() : ThreadDescriptor(nullptr) {} + ~ThreadDescriptor() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(TraceRecord* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + void operator delete(ThreadDescriptor* PROTOBUF_NONNULL msg, std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(TraceRecord)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ThreadDescriptor)); } #endif template - explicit PROTOBUF_CONSTEXPR TraceRecord(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ThreadDescriptor(::google::protobuf::internal::ConstantInitialized); - inline TraceRecord(const TraceRecord& from) : TraceRecord(nullptr, from) {} - inline TraceRecord(TraceRecord&& from) noexcept - : TraceRecord(nullptr, ::std::move(from)) {} - inline TraceRecord& operator=(const TraceRecord& from) { + inline ThreadDescriptor(const ThreadDescriptor& from) : ThreadDescriptor(nullptr, from) {} + inline ThreadDescriptor(ThreadDescriptor&& from) noexcept + : ThreadDescriptor(nullptr, ::std::move(from)) {} + inline ThreadDescriptor& operator=(const ThreadDescriptor& from) { CopyFrom(from); return *this; } - inline TraceRecord& operator=(TraceRecord&& from) noexcept { + inline ThreadDescriptor& operator=(ThreadDescriptor&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -171,13 +188,13 @@ class TraceRecord final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const TraceRecord& default_instance() { - return *reinterpret_cast( - &_TraceRecord_default_instance_); + static const ThreadDescriptor& default_instance() { + return *reinterpret_cast( + &_ThreadDescriptor_default_instance_); } - static constexpr int kIndexInFileMessages = 0; - friend void swap(TraceRecord& a, TraceRecord& b) { a.Swap(&b); } - inline void Swap(TraceRecord* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 6; + friend void swap(ThreadDescriptor& a, ThreadDescriptor& b) { a.Swap(&b); } + inline void Swap(ThreadDescriptor* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -185,7 +202,7 @@ class TraceRecord final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(TraceRecord* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ThreadDescriptor* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -193,13 +210,13 @@ class TraceRecord final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - TraceRecord* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ThreadDescriptor* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const TraceRecord& from); + void CopyFrom(const ThreadDescriptor& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const TraceRecord& from) { TraceRecord::MergeImpl(*this, from); } + void MergeFrom(const ThreadDescriptor& from) { ThreadDescriptor::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -235,18 +252,18 @@ class TraceRecord final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(TraceRecord* PROTOBUF_NONNULL other); + void InternalSwap(ThreadDescriptor* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "calf.proto.TraceRecord"; } + static ::absl::string_view FullMessageName() { return "perfetto.protos.ThreadDescriptor"; } protected: - explicit TraceRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - TraceRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const TraceRecord& from); - TraceRecord( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, TraceRecord&& from) noexcept - : TraceRecord(arena) { + explicit ThreadDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ThreadDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ThreadDescriptor& from); + ThreadDescriptor( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ThreadDescriptor&& from) noexcept + : ThreadDescriptor(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -260,140 +277,285 @@ class TraceRecord final : public ::google::protobuf::Message ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- - using Kind = TraceRecord_Kind; - static constexpr Kind SCOPE_ENTER = TraceRecord_Kind_SCOPE_ENTER; - static constexpr Kind EVENT = TraceRecord_Kind_EVENT; - static constexpr Kind SCOPE_EXIT = TraceRecord_Kind_SCOPE_EXIT; - static inline bool Kind_IsValid(int value) { - return TraceRecord_Kind_IsValid(value); - } - static constexpr Kind Kind_MIN = TraceRecord_Kind_Kind_MIN; - static constexpr Kind Kind_MAX = TraceRecord_Kind_Kind_MAX; - static constexpr int Kind_ARRAYSIZE = TraceRecord_Kind_Kind_ARRAYSIZE; - static inline const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Kind_descriptor() { - return TraceRecord_Kind_descriptor(); - } - template - static inline const ::std::string& Kind_Name(T value) { - return TraceRecord_Kind_Name(value); - } - static inline bool Kind_Parse( - ::absl::string_view name, Kind* PROTOBUF_NONNULL value) { - return TraceRecord_Kind_Parse(name, value); - } // accessors ------------------------------------------------------- enum : int { - kInvokerFieldNumber = 5, - kFileFieldNumber = 6, - kArgsFieldNumber = 8, - kTimestampMsFieldNumber = 1, - kScopeIdFieldNumber = 2, - kParentScopeIdFieldNumber = 3, - kKindFieldNumber = 4, - kLineFieldNumber = 7, + kThreadNameFieldNumber = 5, + kTidFieldNumber = 2, + kPidFieldNumber = 1, }; - // string invoker = 5; - void clear_invoker() ; - const ::std::string& invoker() const; + // optional string thread_name = 5; + bool has_thread_name() const; + void clear_thread_name() ; + const ::std::string& thread_name() const; template - void set_invoker(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_invoker(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_invoker(); - void set_allocated_invoker(::std::string* PROTOBUF_NULLABLE value); + void set_thread_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_thread_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_thread_name(); + void set_allocated_thread_name(::std::string* PROTOBUF_NULLABLE value); private: - const ::std::string& _internal_invoker() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_invoker(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_invoker(); + const ::std::string& _internal_thread_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_thread_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_thread_name(); public: - // string file = 6; - void clear_file() ; - const ::std::string& file() const; - template - void set_file(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_file(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_file(); - void set_allocated_file(::std::string* PROTOBUF_NULLABLE value); + // optional int64 tid = 2; + bool has_tid() const; + void clear_tid() ; + ::int64_t tid() const; + void set_tid(::int64_t value); private: - const ::std::string& _internal_file() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_file(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_file(); + ::int64_t _internal_tid() const; + void _internal_set_tid(::int64_t value); public: - // string args = 8; - void clear_args() ; - const ::std::string& args() const; - template - void set_args(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_args(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_args(); - void set_allocated_args(::std::string* PROTOBUF_NULLABLE value); + // optional int32 pid = 1; + bool has_pid() const; + void clear_pid() ; + ::int32_t pid() const; + void set_pid(::int32_t value); private: - const ::std::string& _internal_args() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_args(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_args(); + ::int32_t _internal_pid() const; + void _internal_set_pid(::int32_t value); public: - // uint64 timestamp_ms = 1; - void clear_timestamp_ms() ; - ::uint64_t timestamp_ms() const; - void set_timestamp_ms(::uint64_t value); + // @@protoc_insertion_point(class_scope:perfetto.protos.ThreadDescriptor) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 3, + 0, 52, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const ThreadDescriptor& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr thread_name_; + ::int64_t tid_; + ::int32_t pid_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull ThreadDescriptor_class_data_; +// ------------------------------------------------------------------- + +class SourceLocation final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.SourceLocation) */ { + public: + inline SourceLocation() : SourceLocation(nullptr) {} + ~SourceLocation() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(SourceLocation* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(SourceLocation)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR SourceLocation(::google::protobuf::internal::ConstantInitialized); + + inline SourceLocation(const SourceLocation& from) : SourceLocation(nullptr, from) {} + inline SourceLocation(SourceLocation&& from) noexcept + : SourceLocation(nullptr, ::std::move(from)) {} + inline SourceLocation& operator=(const SourceLocation& from) { + CopyFrom(from); + return *this; + } + inline SourceLocation& operator=(SourceLocation&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SourceLocation& default_instance() { + return *reinterpret_cast( + &_SourceLocation_default_instance_); + } + static constexpr int kIndexInFileMessages = 4; + friend void swap(SourceLocation& a, SourceLocation& b) { a.Swap(&b); } + inline void Swap(SourceLocation* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SourceLocation* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SourceLocation* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const SourceLocation& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const SourceLocation& from) { SourceLocation::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) private: - ::uint64_t _internal_timestamp_ms() const; - void _internal_set_timestamp_ms(::uint64_t value); + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); public: - // uint64 scope_id = 2; - void clear_scope_id() ; - ::uint64_t scope_id() const; - void set_scope_id(::uint64_t value); + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } private: - ::uint64_t _internal_scope_id() const; - void _internal_set_scope_id(::uint64_t value); + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(SourceLocation* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "perfetto.protos.SourceLocation"; } - public: - // uint64 parent_scope_id = 3; - void clear_parent_scope_id() ; - ::uint64_t parent_scope_id() const; - void set_parent_scope_id(::uint64_t value); + protected: + explicit SourceLocation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + SourceLocation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const SourceLocation& from); + SourceLocation( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, SourceLocation&& from) noexcept + : SourceLocation(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kFileNameFieldNumber = 2, + kFunctionNameFieldNumber = 3, + kLineNumberFieldNumber = 4, + }; + // optional string file_name = 2; + bool has_file_name() const; + void clear_file_name() ; + const ::std::string& file_name() const; + template + void set_file_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_file_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_file_name(); + void set_allocated_file_name(::std::string* PROTOBUF_NULLABLE value); private: - ::uint64_t _internal_parent_scope_id() const; - void _internal_set_parent_scope_id(::uint64_t value); + const ::std::string& _internal_file_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_file_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_file_name(); public: - // .calf.proto.TraceRecord.Kind kind = 4; - void clear_kind() ; - ::calf::proto::TraceRecord_Kind kind() const; - void set_kind(::calf::proto::TraceRecord_Kind value); + // optional string function_name = 3; + bool has_function_name() const; + void clear_function_name() ; + const ::std::string& function_name() const; + template + void set_function_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_function_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_function_name(); + void set_allocated_function_name(::std::string* PROTOBUF_NULLABLE value); private: - ::calf::proto::TraceRecord_Kind _internal_kind() const; - void _internal_set_kind(::calf::proto::TraceRecord_Kind value); + const ::std::string& _internal_function_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_function_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_function_name(); public: - // uint32 line = 7; - void clear_line() ; - ::uint32_t line() const; - void set_line(::uint32_t value); + // optional uint32 line_number = 4; + bool has_line_number() const; + void clear_line_number() ; + ::uint32_t line_number() const; + void set_line_number(::uint32_t value); private: - ::uint32_t _internal_line() const; - void _internal_set_line(::uint32_t value); + ::uint32_t _internal_line_number() const; + void _internal_set_line_number(::uint32_t value); public: - // @@protoc_insertion_point(class_scope:calf.proto.TraceRecord) + // @@protoc_insertion_point(class_scope:perfetto.protos.SourceLocation) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 8, - 0, 54, + static const ::google::protobuf::internal::TcParseTable<2, 3, + 0, 61, 2> _table_; @@ -411,50 +573,45 @@ class TraceRecord final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const TraceRecord& from_msg); + const SourceLocation& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr invoker_; - ::google::protobuf::internal::ArenaStringPtr file_; - ::google::protobuf::internal::ArenaStringPtr args_; - ::uint64_t timestamp_ms_; - ::uint64_t scope_id_; - ::uint64_t parent_scope_id_; - int kind_; - ::uint32_t line_; + ::google::protobuf::internal::ArenaStringPtr file_name_; + ::google::protobuf::internal::ArenaStringPtr function_name_; + ::uint32_t line_number_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull TraceRecord_class_data_; +extern const ::google::protobuf::internal::ClassDataFull SourceLocation_class_data_; // ------------------------------------------------------------------- -class TraceFile final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:calf.proto.TraceFile) */ { +class DebugAnnotation final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.DebugAnnotation) */ { public: - inline TraceFile() : TraceFile(nullptr) {} - ~TraceFile() PROTOBUF_FINAL; + inline DebugAnnotation() : DebugAnnotation(nullptr) {} + ~DebugAnnotation() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(TraceFile* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + void operator delete(DebugAnnotation* PROTOBUF_NONNULL msg, std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(TraceFile)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(DebugAnnotation)); } #endif template - explicit PROTOBUF_CONSTEXPR TraceFile(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DebugAnnotation(::google::protobuf::internal::ConstantInitialized); - inline TraceFile(const TraceFile& from) : TraceFile(nullptr, from) {} - inline TraceFile(TraceFile&& from) noexcept - : TraceFile(nullptr, ::std::move(from)) {} - inline TraceFile& operator=(const TraceFile& from) { + inline DebugAnnotation(const DebugAnnotation& from) : DebugAnnotation(nullptr, from) {} + inline DebugAnnotation(DebugAnnotation&& from) noexcept + : DebugAnnotation(nullptr, ::std::move(from)) {} + inline DebugAnnotation& operator=(const DebugAnnotation& from) { CopyFrom(from); return *this; } - inline TraceFile& operator=(TraceFile&& from) noexcept { + inline DebugAnnotation& operator=(DebugAnnotation&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -482,13 +639,13 @@ class TraceFile final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const TraceFile& default_instance() { - return *reinterpret_cast( - &_TraceFile_default_instance_); + static const DebugAnnotation& default_instance() { + return *reinterpret_cast( + &_DebugAnnotation_default_instance_); } - static constexpr int kIndexInFileMessages = 1; - friend void swap(TraceFile& a, TraceFile& b) { a.Swap(&b); } - inline void Swap(TraceFile* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 3; + friend void swap(DebugAnnotation& a, DebugAnnotation& b) { a.Swap(&b); } + inline void Swap(DebugAnnotation* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -496,7 +653,7 @@ class TraceFile final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(TraceFile* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(DebugAnnotation* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -504,13 +661,13 @@ class TraceFile final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - TraceFile* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + DebugAnnotation* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); } using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const TraceFile& from); + void CopyFrom(const DebugAnnotation& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const TraceFile& from) { TraceFile::MergeImpl(*this, from); } + void MergeFrom(const DebugAnnotation& from) { DebugAnnotation::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -546,18 +703,18 @@ class TraceFile final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(TraceFile* PROTOBUF_NONNULL other); + void InternalSwap(DebugAnnotation* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "calf.proto.TraceFile"; } + static ::absl::string_view FullMessageName() { return "perfetto.protos.DebugAnnotation"; } protected: - explicit TraceFile(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - TraceFile(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const TraceFile& from); - TraceFile( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, TraceFile&& from) noexcept - : TraceFile(arena) { + explicit DebugAnnotation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + DebugAnnotation(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const DebugAnnotation& from); + DebugAnnotation( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, DebugAnnotation&& from) noexcept + : DebugAnnotation(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -574,31 +731,47 @@ class TraceFile final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kRecordsFieldNumber = 1, + kStringValueFieldNumber = 6, + kNameFieldNumber = 10, }; - // repeated .calf.proto.TraceRecord records = 1; - int records_size() const; + // optional string string_value = 6; + bool has_string_value() const; + void clear_string_value() ; + const ::std::string& string_value() const; + template + void set_string_value(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_string_value(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_string_value(); + void set_allocated_string_value(::std::string* PROTOBUF_NULLABLE value); + private: - int _internal_records_size() const; + const ::std::string& _internal_string_value() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_string_value(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_string_value(); public: - void clear_records() ; - ::calf::proto::TraceRecord* PROTOBUF_NONNULL mutable_records(int index); - ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>* PROTOBUF_NONNULL mutable_records(); + // optional string name = 10; + bool has_name() const; + void clear_name() ; + const ::std::string& name() const; + template + void set_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_name(); + void set_allocated_name(::std::string* PROTOBUF_NULLABLE value); private: - const ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>& _internal_records() const; - ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>* PROTOBUF_NONNULL _internal_mutable_records(); + const ::std::string& _internal_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_name(); + public: - const ::calf::proto::TraceRecord& records(int index) const; - ::calf::proto::TraceRecord* PROTOBUF_NONNULL add_records(); - const ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>& records() const; - // @@protoc_insertion_point(class_scope:calf.proto.TraceFile) + // @@protoc_insertion_point(class_scope:perfetto.protos.DebugAnnotation) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, - 1, 0, + static const ::google::protobuf::internal::TcParseTable<0, 2, + 0, 56, 2> _table_; @@ -616,400 +789,2332 @@ class TraceFile final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const TraceFile& from_msg); - ::google::protobuf::RepeatedPtrField< ::calf::proto::TraceRecord > records_; + const DebugAnnotation& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr string_value_; + ::google::protobuf::internal::ArenaStringPtr name_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull TraceFile_class_data_; - -// =================================================================== +extern const ::google::protobuf::internal::ClassDataFull DebugAnnotation_class_data_; +// ------------------------------------------------------------------- +class TrackEvent final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.TrackEvent) */ { + public: + inline TrackEvent() : TrackEvent(nullptr) {} + ~TrackEvent() PROTOBUF_FINAL; +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(TrackEvent* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(TrackEvent)); + } +#endif + template + explicit PROTOBUF_CONSTEXPR TrackEvent(::google::protobuf::internal::ConstantInitialized); -// =================================================================== + inline TrackEvent(const TrackEvent& from) : TrackEvent(nullptr, from) {} + inline TrackEvent(TrackEvent&& from) noexcept + : TrackEvent(nullptr, ::std::move(from)) {} + inline TrackEvent& operator=(const TrackEvent& from) { + CopyFrom(from); + return *this; + } + inline TrackEvent& operator=(TrackEvent&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// ------------------------------------------------------------------- + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TrackEvent& default_instance() { + return *reinterpret_cast( + &_TrackEvent_default_instance_); + } + static constexpr int kIndexInFileMessages = 2; + friend void swap(TrackEvent& a, TrackEvent& b) { a.Swap(&b); } + inline void Swap(TrackEvent* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TrackEvent* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } -// TraceRecord + // implements Message ---------------------------------------------- -// uint64 timestamp_ms = 1; -inline void TraceRecord::clear_timestamp_ms() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.timestamp_ms_ = ::uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline ::uint64_t TraceRecord::timestamp_ms() const { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.timestamp_ms) - return _internal_timestamp_ms(); -} -inline void TraceRecord::set_timestamp_ms(::uint64_t value) { - _internal_set_timestamp_ms(value); - _impl_._has_bits_[0] |= 0x00000008u; - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.timestamp_ms) -} -inline ::uint64_t TraceRecord::_internal_timestamp_ms() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.timestamp_ms_; -} -inline void TraceRecord::_internal_set_timestamp_ms(::uint64_t value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.timestamp_ms_ = value; -} + TrackEvent* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const TrackEvent& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const TrackEvent& from) { TrackEvent::MergeImpl(*this, from); } -// uint64 scope_id = 2; -inline void TraceRecord::clear_scope_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.scope_id_ = ::uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000010u; -} -inline ::uint64_t TraceRecord::scope_id() const { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.scope_id) - return _internal_scope_id(); -} -inline void TraceRecord::set_scope_id(::uint64_t value) { - _internal_set_scope_id(value); - _impl_._has_bits_[0] |= 0x00000010u; - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.scope_id) -} -inline ::uint64_t TraceRecord::_internal_scope_id() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.scope_id_; -} -inline void TraceRecord::_internal_set_scope_id(::uint64_t value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.scope_id_ = value; -} + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); -// uint64 parent_scope_id = 3; -inline void TraceRecord::clear_parent_scope_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.parent_scope_id_ = ::uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000020u; -} -inline ::uint64_t TraceRecord::parent_scope_id() const { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.parent_scope_id) - return _internal_parent_scope_id(); -} -inline void TraceRecord::set_parent_scope_id(::uint64_t value) { - _internal_set_parent_scope_id(value); - _impl_._has_bits_[0] |= 0x00000020u; - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.parent_scope_id) -} -inline ::uint64_t TraceRecord::_internal_parent_scope_id() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.parent_scope_id_; -} -inline void TraceRecord::_internal_set_parent_scope_id(::uint64_t value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.parent_scope_id_ = value; -} + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); -// .calf.proto.TraceRecord.Kind kind = 4; -inline void TraceRecord::clear_kind() { + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(TrackEvent* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "perfetto.protos.TrackEvent"; } + + protected: + explicit TrackEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + TrackEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const TrackEvent& from); + TrackEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, TrackEvent&& from) noexcept + : TrackEvent(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + using Type = TrackEvent_Type; + static constexpr Type TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED; + static constexpr Type TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN; + static constexpr Type TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END; + static constexpr Type TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT; + static inline bool Type_IsValid(int value) { + return TrackEvent_Type_IsValid(value); + } + static constexpr Type Type_MIN = TrackEvent_Type_Type_MIN; + static constexpr Type Type_MAX = TrackEvent_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = TrackEvent_Type_Type_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Type_descriptor() { + return TrackEvent_Type_descriptor(); + } + template + static inline const ::std::string& Type_Name(T value) { + return TrackEvent_Type_Name(value); + } + static inline bool Type_Parse( + ::absl::string_view name, Type* PROTOBUF_NONNULL value) { + return TrackEvent_Type_Parse(name, value); + } + + // accessors ------------------------------------------------------- + enum : int { + kDebugAnnotationsFieldNumber = 4, + kCategoriesFieldNumber = 22, + kNameFieldNumber = 23, + kSourceLocationFieldNumber = 33, + kTrackUuidFieldNumber = 11, + kTypeFieldNumber = 9, + }; + // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4; + int debug_annotations_size() const; + private: + int _internal_debug_annotations_size() const; + + public: + void clear_debug_annotations() ; + ::perfetto::protos::DebugAnnotation* PROTOBUF_NONNULL mutable_debug_annotations(int index); + ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>* PROTOBUF_NONNULL mutable_debug_annotations(); + + private: + const ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>& _internal_debug_annotations() const; + ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>* PROTOBUF_NONNULL _internal_mutable_debug_annotations(); + public: + const ::perfetto::protos::DebugAnnotation& debug_annotations(int index) const; + ::perfetto::protos::DebugAnnotation* PROTOBUF_NONNULL add_debug_annotations(); + const ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>& debug_annotations() const; + // repeated string categories = 22; + int categories_size() const; + private: + int _internal_categories_size() const; + + public: + void clear_categories() ; + const ::std::string& categories(int index) const; + ::std::string* PROTOBUF_NONNULL mutable_categories(int index); + template + void set_categories(int index, Arg_&& value, Args_... args); + ::std::string* PROTOBUF_NONNULL add_categories(); + template + void add_categories(Arg_&& value, Args_... args); + const ::google::protobuf::RepeatedPtrField<::std::string>& categories() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL mutable_categories(); + + private: + const ::google::protobuf::RepeatedPtrField<::std::string>& _internal_categories() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL _internal_mutable_categories(); + + public: + // optional string name = 23; + bool has_name() const; + void clear_name() ; + const ::std::string& name() const; + template + void set_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_name(); + void set_allocated_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_name(); + + public: + // optional .perfetto.protos.SourceLocation source_location = 33; + bool has_source_location() const; + void clear_source_location() ; + const ::perfetto::protos::SourceLocation& source_location() const; + [[nodiscard]] ::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE release_source_location(); + ::perfetto::protos::SourceLocation* PROTOBUF_NONNULL mutable_source_location(); + void set_allocated_source_location(::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_source_location(::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE value); + ::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE unsafe_arena_release_source_location(); + + private: + const ::perfetto::protos::SourceLocation& _internal_source_location() const; + ::perfetto::protos::SourceLocation* PROTOBUF_NONNULL _internal_mutable_source_location(); + + public: + // optional uint64 track_uuid = 11; + bool has_track_uuid() const; + void clear_track_uuid() ; + ::uint64_t track_uuid() const; + void set_track_uuid(::uint64_t value); + + private: + ::uint64_t _internal_track_uuid() const; + void _internal_set_track_uuid(::uint64_t value); + + public: + // optional .perfetto.protos.TrackEvent.Type type = 9; + bool has_type() const; + void clear_type() ; + ::perfetto::protos::TrackEvent_Type type() const; + void set_type(::perfetto::protos::TrackEvent_Type value); + + private: + ::perfetto::protos::TrackEvent_Type _internal_type() const; + void _internal_set_type(::perfetto::protos::TrackEvent_Type value); + + public: + // @@protoc_insertion_point(class_scope:perfetto.protos.TrackEvent) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 6, + 3, 49, + 7> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const TrackEvent& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField< ::perfetto::protos::DebugAnnotation > debug_annotations_; + ::google::protobuf::RepeatedPtrField<::std::string> categories_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE source_location_; + ::uint64_t track_uuid_; + int type_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull TrackEvent_class_data_; +// ------------------------------------------------------------------- + +class TrackDescriptor final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.TrackDescriptor) */ { + public: + inline TrackDescriptor() : TrackDescriptor(nullptr) {} + ~TrackDescriptor() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(TrackDescriptor* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(TrackDescriptor)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR TrackDescriptor(::google::protobuf::internal::ConstantInitialized); + + inline TrackDescriptor(const TrackDescriptor& from) : TrackDescriptor(nullptr, from) {} + inline TrackDescriptor(TrackDescriptor&& from) noexcept + : TrackDescriptor(nullptr, ::std::move(from)) {} + inline TrackDescriptor& operator=(const TrackDescriptor& from) { + CopyFrom(from); + return *this; + } + inline TrackDescriptor& operator=(TrackDescriptor&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TrackDescriptor& default_instance() { + return *reinterpret_cast( + &_TrackDescriptor_default_instance_); + } + static constexpr int kIndexInFileMessages = 5; + friend void swap(TrackDescriptor& a, TrackDescriptor& b) { a.Swap(&b); } + inline void Swap(TrackDescriptor* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TrackDescriptor* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + TrackDescriptor* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const TrackDescriptor& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const TrackDescriptor& from) { TrackDescriptor::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(TrackDescriptor* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "perfetto.protos.TrackDescriptor"; } + + protected: + explicit TrackDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + TrackDescriptor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const TrackDescriptor& from); + TrackDescriptor( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, TrackDescriptor&& from) noexcept + : TrackDescriptor(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kNameFieldNumber = 2, + kThreadFieldNumber = 4, + kUuidFieldNumber = 1, + }; + // optional string name = 2; + bool has_name() const; + void clear_name() ; + const ::std::string& name() const; + template + void set_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_name(); + void set_allocated_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_name(); + + public: + // optional .perfetto.protos.ThreadDescriptor thread = 4; + bool has_thread() const; + void clear_thread() ; + const ::perfetto::protos::ThreadDescriptor& thread() const; + [[nodiscard]] ::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE release_thread(); + ::perfetto::protos::ThreadDescriptor* PROTOBUF_NONNULL mutable_thread(); + void set_allocated_thread(::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_thread(::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE value); + ::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE unsafe_arena_release_thread(); + + private: + const ::perfetto::protos::ThreadDescriptor& _internal_thread() const; + ::perfetto::protos::ThreadDescriptor* PROTOBUF_NONNULL _internal_mutable_thread(); + + public: + // optional uint64 uuid = 1; + bool has_uuid() const; + void clear_uuid() ; + ::uint64_t uuid() const; + void set_uuid(::uint64_t value); + + private: + ::uint64_t _internal_uuid() const; + void _internal_set_uuid(::uint64_t value); + + public: + // @@protoc_insertion_point(class_scope:perfetto.protos.TrackDescriptor) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 3, + 1, 44, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const TrackDescriptor& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE thread_; + ::uint64_t uuid_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull TrackDescriptor_class_data_; +// ------------------------------------------------------------------- + +class TracePacket final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.TracePacket) */ { + public: + inline TracePacket() : TracePacket(nullptr) {} + ~TracePacket() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(TracePacket* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(TracePacket)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR TracePacket(::google::protobuf::internal::ConstantInitialized); + + inline TracePacket(const TracePacket& from) : TracePacket(nullptr, from) {} + inline TracePacket(TracePacket&& from) noexcept + : TracePacket(nullptr, ::std::move(from)) {} + inline TracePacket& operator=(const TracePacket& from) { + CopyFrom(from); + return *this; + } + inline TracePacket& operator=(TracePacket&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TracePacket& default_instance() { + return *reinterpret_cast( + &_TracePacket_default_instance_); + } + static constexpr int kIndexInFileMessages = 1; + friend void swap(TracePacket& a, TracePacket& b) { a.Swap(&b); } + inline void Swap(TracePacket* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TracePacket* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + TracePacket* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const TracePacket& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const TracePacket& from) { TracePacket::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(TracePacket* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "perfetto.protos.TracePacket"; } + + protected: + explicit TracePacket(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + TracePacket(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const TracePacket& from); + TracePacket( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, TracePacket&& from) noexcept + : TracePacket(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kTrackEventFieldNumber = 11, + kTrackDescriptorFieldNumber = 60, + kTimestampFieldNumber = 8, + kTrustedPacketSequenceIdFieldNumber = 10, + kTimestampClockIdFieldNumber = 58, + }; + // optional .perfetto.protos.TrackEvent track_event = 11; + bool has_track_event() const; + void clear_track_event() ; + const ::perfetto::protos::TrackEvent& track_event() const; + [[nodiscard]] ::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE release_track_event(); + ::perfetto::protos::TrackEvent* PROTOBUF_NONNULL mutable_track_event(); + void set_allocated_track_event(::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_track_event(::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE value); + ::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE unsafe_arena_release_track_event(); + + private: + const ::perfetto::protos::TrackEvent& _internal_track_event() const; + ::perfetto::protos::TrackEvent* PROTOBUF_NONNULL _internal_mutable_track_event(); + + public: + // optional .perfetto.protos.TrackDescriptor track_descriptor = 60; + bool has_track_descriptor() const; + void clear_track_descriptor() ; + const ::perfetto::protos::TrackDescriptor& track_descriptor() const; + [[nodiscard]] ::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE release_track_descriptor(); + ::perfetto::protos::TrackDescriptor* PROTOBUF_NONNULL mutable_track_descriptor(); + void set_allocated_track_descriptor(::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_track_descriptor(::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE value); + ::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE unsafe_arena_release_track_descriptor(); + + private: + const ::perfetto::protos::TrackDescriptor& _internal_track_descriptor() const; + ::perfetto::protos::TrackDescriptor* PROTOBUF_NONNULL _internal_mutable_track_descriptor(); + + public: + // optional uint64 timestamp = 8; + bool has_timestamp() const; + void clear_timestamp() ; + ::uint64_t timestamp() const; + void set_timestamp(::uint64_t value); + + private: + ::uint64_t _internal_timestamp() const; + void _internal_set_timestamp(::uint64_t value); + + public: + // optional uint32 trusted_packet_sequence_id = 10; + bool has_trusted_packet_sequence_id() const; + void clear_trusted_packet_sequence_id() ; + ::uint32_t trusted_packet_sequence_id() const; + void set_trusted_packet_sequence_id(::uint32_t value); + + private: + ::uint32_t _internal_trusted_packet_sequence_id() const; + void _internal_set_trusted_packet_sequence_id(::uint32_t value); + + public: + // optional uint32 timestamp_clock_id = 58; + bool has_timestamp_clock_id() const; + void clear_timestamp_clock_id() ; + ::uint32_t timestamp_clock_id() const; + void set_timestamp_clock_id(::uint32_t value); + + private: + ::uint32_t _internal_timestamp_clock_id() const; + void _internal_set_timestamp_clock_id(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:perfetto.protos.TracePacket) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 5, + 2, 0, + 7> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const TracePacket& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE track_event_; + ::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE track_descriptor_; + ::uint64_t timestamp_; + ::uint32_t trusted_packet_sequence_id_; + ::uint32_t timestamp_clock_id_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull TracePacket_class_data_; +// ------------------------------------------------------------------- + +class Trace final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:perfetto.protos.Trace) */ { + public: + inline Trace() : Trace(nullptr) {} + ~Trace() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Trace* PROTOBUF_NONNULL msg, std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Trace)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Trace(::google::protobuf::internal::ConstantInitialized); + + inline Trace(const Trace& from) : Trace(nullptr, from) {} + inline Trace(Trace&& from) noexcept + : Trace(nullptr, ::std::move(from)) {} + inline Trace& operator=(const Trace& from) { + CopyFrom(from); + return *this; + } + inline Trace& operator=(Trace&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Trace& default_instance() { + return *reinterpret_cast( + &_Trace_default_instance_); + } + static constexpr int kIndexInFileMessages = 0; + friend void swap(Trace& a, Trace& b) { a.Swap(&b); } + inline void Swap(Trace* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Trace* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Trace* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Trace& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Trace& from) { Trace::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Trace* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "perfetto.protos.Trace"; } + + protected: + explicit Trace(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Trace(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Trace& from); + Trace( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Trace&& from) noexcept + : Trace(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kPacketFieldNumber = 1, + }; + // repeated .perfetto.protos.TracePacket packet = 1; + int packet_size() const; + private: + int _internal_packet_size() const; + + public: + void clear_packet() ; + ::perfetto::protos::TracePacket* PROTOBUF_NONNULL mutable_packet(int index); + ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>* PROTOBUF_NONNULL mutable_packet(); + + private: + const ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>& _internal_packet() const; + ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>* PROTOBUF_NONNULL _internal_mutable_packet(); + public: + const ::perfetto::protos::TracePacket& packet(int index) const; + ::perfetto::protos::TracePacket* PROTOBUF_NONNULL add_packet(); + const ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>& packet() const; + // @@protoc_insertion_point(class_scope:perfetto.protos.Trace) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, + 1, 0, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Trace& from_msg); + ::google::protobuf::RepeatedPtrField< ::perfetto::protos::TracePacket > packet_; + ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_calf_2fprotobuf_2fcalf_5ftrace_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull Trace_class_data_; + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Trace + +// repeated .perfetto.protos.TracePacket packet = 1; +inline int Trace::_internal_packet_size() const { + return _internal_packet().size(); +} +inline int Trace::packet_size() const { + return _internal_packet_size(); +} +inline void Trace::clear_packet() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.packet_.Clear(); +} +inline ::perfetto::protos::TracePacket* PROTOBUF_NONNULL Trace::mutable_packet(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:perfetto.protos.Trace.packet) + return _internal_mutable_packet()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>* PROTOBUF_NONNULL Trace::mutable_packet() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:perfetto.protos.Trace.packet) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_packet(); +} +inline const ::perfetto::protos::TracePacket& Trace::packet(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.Trace.packet) + return _internal_packet().Get(index); +} +inline ::perfetto::protos::TracePacket* PROTOBUF_NONNULL Trace::add_packet() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::perfetto::protos::TracePacket* _add = _internal_mutable_packet()->Add(); + // @@protoc_insertion_point(field_add:perfetto.protos.Trace.packet) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>& Trace::packet() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:perfetto.protos.Trace.packet) + return _internal_packet(); +} +inline const ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>& +Trace::_internal_packet() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.packet_; +} +inline ::google::protobuf::RepeatedPtrField<::perfetto::protos::TracePacket>* PROTOBUF_NONNULL +Trace::_internal_mutable_packet() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.packet_; +} + +// ------------------------------------------------------------------- + +// TracePacket + +// optional uint64 timestamp = 8; +inline bool TracePacket::has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void TracePacket::clear_timestamp() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.timestamp_ = ::uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::uint64_t TracePacket::timestamp() const { + // @@protoc_insertion_point(field_get:perfetto.protos.TracePacket.timestamp) + return _internal_timestamp(); +} +inline void TracePacket::set_timestamp(::uint64_t value) { + _internal_set_timestamp(value); + _impl_._has_bits_[0] |= 0x00000004u; + // @@protoc_insertion_point(field_set:perfetto.protos.TracePacket.timestamp) +} +inline ::uint64_t TracePacket::_internal_timestamp() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.timestamp_; +} +inline void TracePacket::_internal_set_timestamp(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.timestamp_ = value; +} + +// optional uint32 trusted_packet_sequence_id = 10; +inline bool TracePacket::has_trusted_packet_sequence_id() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline void TracePacket::clear_trusted_packet_sequence_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.trusted_packet_sequence_id_ = 0u; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline ::uint32_t TracePacket::trusted_packet_sequence_id() const { + // @@protoc_insertion_point(field_get:perfetto.protos.TracePacket.trusted_packet_sequence_id) + return _internal_trusted_packet_sequence_id(); +} +inline void TracePacket::set_trusted_packet_sequence_id(::uint32_t value) { + _internal_set_trusted_packet_sequence_id(value); + _impl_._has_bits_[0] |= 0x00000008u; + // @@protoc_insertion_point(field_set:perfetto.protos.TracePacket.trusted_packet_sequence_id) +} +inline ::uint32_t TracePacket::_internal_trusted_packet_sequence_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.trusted_packet_sequence_id_; +} +inline void TracePacket::_internal_set_trusted_packet_sequence_id(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.trusted_packet_sequence_id_ = value; +} + +// optional .perfetto.protos.TrackEvent track_event = 11; +inline bool TracePacket::has_track_event() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.track_event_ != nullptr); + return value; +} +inline void TracePacket::clear_track_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.track_event_ != nullptr) _impl_.track_event_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::perfetto::protos::TrackEvent& TracePacket::_internal_track_event() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::perfetto::protos::TrackEvent* p = _impl_.track_event_; + return p != nullptr ? *p : reinterpret_cast(::perfetto::protos::_TrackEvent_default_instance_); +} +inline const ::perfetto::protos::TrackEvent& TracePacket::track_event() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TracePacket.track_event) + return _internal_track_event(); +} +inline void TracePacket::unsafe_arena_set_allocated_track_event( + ::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.track_event_); + } + _impl_.track_event_ = reinterpret_cast<::perfetto::protos::TrackEvent*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:perfetto.protos.TracePacket.track_event) +} +inline ::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE TracePacket::release_track_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::perfetto::protos::TrackEvent* released = _impl_.track_event_; + _impl_.track_event_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE TracePacket::unsafe_arena_release_track_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.TracePacket.track_event) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::perfetto::protos::TrackEvent* temp = _impl_.track_event_; + _impl_.track_event_ = nullptr; + return temp; +} +inline ::perfetto::protos::TrackEvent* PROTOBUF_NONNULL TracePacket::_internal_mutable_track_event() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.track_event_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::perfetto::protos::TrackEvent>(GetArena()); + _impl_.track_event_ = reinterpret_cast<::perfetto::protos::TrackEvent*>(p); + } + return _impl_.track_event_; +} +inline ::perfetto::protos::TrackEvent* PROTOBUF_NONNULL TracePacket::mutable_track_event() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + _impl_._has_bits_[0] |= 0x00000001u; + ::perfetto::protos::TrackEvent* _msg = _internal_mutable_track_event(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.TracePacket.track_event) + return _msg; +} +inline void TracePacket::set_allocated_track_event(::perfetto::protos::TrackEvent* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.track_event_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.track_event_ = reinterpret_cast<::perfetto::protos::TrackEvent*>(value); + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TracePacket.track_event) +} + +// optional uint32 timestamp_clock_id = 58; +inline bool TracePacket::has_timestamp_clock_id() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline void TracePacket::clear_timestamp_clock_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.timestamp_clock_id_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline ::uint32_t TracePacket::timestamp_clock_id() const { + // @@protoc_insertion_point(field_get:perfetto.protos.TracePacket.timestamp_clock_id) + return _internal_timestamp_clock_id(); +} +inline void TracePacket::set_timestamp_clock_id(::uint32_t value) { + _internal_set_timestamp_clock_id(value); + _impl_._has_bits_[0] |= 0x00000010u; + // @@protoc_insertion_point(field_set:perfetto.protos.TracePacket.timestamp_clock_id) +} +inline ::uint32_t TracePacket::_internal_timestamp_clock_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.timestamp_clock_id_; +} +inline void TracePacket::_internal_set_timestamp_clock_id(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.timestamp_clock_id_ = value; +} + +// optional .perfetto.protos.TrackDescriptor track_descriptor = 60; +inline bool TracePacket::has_track_descriptor() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.track_descriptor_ != nullptr); + return value; +} +inline void TracePacket::clear_track_descriptor() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.track_descriptor_ != nullptr) _impl_.track_descriptor_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const ::perfetto::protos::TrackDescriptor& TracePacket::_internal_track_descriptor() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::perfetto::protos::TrackDescriptor* p = _impl_.track_descriptor_; + return p != nullptr ? *p : reinterpret_cast(::perfetto::protos::_TrackDescriptor_default_instance_); +} +inline const ::perfetto::protos::TrackDescriptor& TracePacket::track_descriptor() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TracePacket.track_descriptor) + return _internal_track_descriptor(); +} +inline void TracePacket::unsafe_arena_set_allocated_track_descriptor( + ::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.track_descriptor_); + } + _impl_.track_descriptor_ = reinterpret_cast<::perfetto::protos::TrackDescriptor*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:perfetto.protos.TracePacket.track_descriptor) +} +inline ::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE TracePacket::release_track_descriptor() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + _impl_._has_bits_[0] &= ~0x00000002u; + ::perfetto::protos::TrackDescriptor* released = _impl_.track_descriptor_; + _impl_.track_descriptor_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE TracePacket::unsafe_arena_release_track_descriptor() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.TracePacket.track_descriptor) + + _impl_._has_bits_[0] &= ~0x00000002u; + ::perfetto::protos::TrackDescriptor* temp = _impl_.track_descriptor_; + _impl_.track_descriptor_ = nullptr; + return temp; +} +inline ::perfetto::protos::TrackDescriptor* PROTOBUF_NONNULL TracePacket::_internal_mutable_track_descriptor() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.track_descriptor_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::perfetto::protos::TrackDescriptor>(GetArena()); + _impl_.track_descriptor_ = reinterpret_cast<::perfetto::protos::TrackDescriptor*>(p); + } + return _impl_.track_descriptor_; +} +inline ::perfetto::protos::TrackDescriptor* PROTOBUF_NONNULL TracePacket::mutable_track_descriptor() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + _impl_._has_bits_[0] |= 0x00000002u; + ::perfetto::protos::TrackDescriptor* _msg = _internal_mutable_track_descriptor(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.TracePacket.track_descriptor) + return _msg; +} +inline void TracePacket::set_allocated_track_descriptor(::perfetto::protos::TrackDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.track_descriptor_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + + _impl_.track_descriptor_ = reinterpret_cast<::perfetto::protos::TrackDescriptor*>(value); + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TracePacket.track_descriptor) +} + +// ------------------------------------------------------------------- + +// TrackEvent + +// repeated .perfetto.protos.DebugAnnotation debug_annotations = 4; +inline int TrackEvent::_internal_debug_annotations_size() const { + return _internal_debug_annotations().size(); +} +inline int TrackEvent::debug_annotations_size() const { + return _internal_debug_annotations_size(); +} +inline void TrackEvent::clear_debug_annotations() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.debug_annotations_.Clear(); +} +inline ::perfetto::protos::DebugAnnotation* PROTOBUF_NONNULL TrackEvent::mutable_debug_annotations(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:perfetto.protos.TrackEvent.debug_annotations) + return _internal_mutable_debug_annotations()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>* PROTOBUF_NONNULL TrackEvent::mutable_debug_annotations() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TrackEvent.debug_annotations) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_debug_annotations(); +} +inline const ::perfetto::protos::DebugAnnotation& TrackEvent::debug_annotations(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackEvent.debug_annotations) + return _internal_debug_annotations().Get(index); +} +inline ::perfetto::protos::DebugAnnotation* PROTOBUF_NONNULL TrackEvent::add_debug_annotations() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::perfetto::protos::DebugAnnotation* _add = _internal_mutable_debug_annotations()->Add(); + // @@protoc_insertion_point(field_add:perfetto.protos.TrackEvent.debug_annotations) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>& TrackEvent::debug_annotations() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:perfetto.protos.TrackEvent.debug_annotations) + return _internal_debug_annotations(); +} +inline const ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>& +TrackEvent::_internal_debug_annotations() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.debug_annotations_; +} +inline ::google::protobuf::RepeatedPtrField<::perfetto::protos::DebugAnnotation>* PROTOBUF_NONNULL +TrackEvent::_internal_mutable_debug_annotations() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.debug_annotations_; +} + +// optional .perfetto.protos.TrackEvent.Type type = 9; +inline bool TrackEvent::has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline void TrackEvent::clear_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_ = 0; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline ::perfetto::protos::TrackEvent_Type TrackEvent::type() const { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackEvent.type) + return _internal_type(); +} +inline void TrackEvent::set_type(::perfetto::protos::TrackEvent_Type value) { + _internal_set_type(value); + _impl_._has_bits_[0] |= 0x00000008u; + // @@protoc_insertion_point(field_set:perfetto.protos.TrackEvent.type) +} +inline ::perfetto::protos::TrackEvent_Type TrackEvent::_internal_type() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::perfetto::protos::TrackEvent_Type>(_impl_.type_); +} +inline void TrackEvent::_internal_set_type(::perfetto::protos::TrackEvent_Type value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + + assert(::google::protobuf::internal::ValidateEnum( + value, ::perfetto::protos::TrackEvent_Type_internal_data_)); + _impl_.type_ = value; +} + +// optional uint64 track_uuid = 11; +inline bool TrackEvent::has_track_uuid() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void TrackEvent::clear_track_uuid() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.track_uuid_ = ::uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::uint64_t TrackEvent::track_uuid() const { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackEvent.track_uuid) + return _internal_track_uuid(); +} +inline void TrackEvent::set_track_uuid(::uint64_t value) { + _internal_set_track_uuid(value); + _impl_._has_bits_[0] |= 0x00000004u; + // @@protoc_insertion_point(field_set:perfetto.protos.TrackEvent.track_uuid) +} +inline ::uint64_t TrackEvent::_internal_track_uuid() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.track_uuid_; +} +inline void TrackEvent::_internal_set_track_uuid(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.track_uuid_ = value; +} + +// repeated string categories = 22; +inline int TrackEvent::_internal_categories_size() const { + return _internal_categories().size(); +} +inline int TrackEvent::categories_size() const { + return _internal_categories_size(); +} +inline void TrackEvent::clear_categories() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.categories_.Clear(); +} +inline ::std::string* PROTOBUF_NONNULL TrackEvent::add_categories() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::std::string* _s = _internal_mutable_categories()->Add(); + // @@protoc_insertion_point(field_add_mutable:perfetto.protos.TrackEvent.categories) + return _s; +} +inline const ::std::string& TrackEvent::categories(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackEvent.categories) + return _internal_categories().Get(index); +} +inline ::std::string* PROTOBUF_NONNULL TrackEvent::mutable_categories(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:perfetto.protos.TrackEvent.categories) + return _internal_mutable_categories()->Mutable(index); +} +template +inline void TrackEvent::set_categories(int index, Arg_&& value, Args_... args) { + ::google::protobuf::internal::AssignToString(*_internal_mutable_categories()->Mutable(index), ::std::forward(value), + args... ); + // @@protoc_insertion_point(field_set:perfetto.protos.TrackEvent.categories) +} +template +inline void TrackEvent::add_categories(Arg_&& value, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::google::protobuf::internal::AddToRepeatedPtrField(*_internal_mutable_categories(), + ::std::forward(value), + args... ); + // @@protoc_insertion_point(field_add:perfetto.protos.TrackEvent.categories) +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& TrackEvent::categories() + const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:perfetto.protos.TrackEvent.categories) + return _internal_categories(); +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +TrackEvent::mutable_categories() ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TrackEvent.categories) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_categories(); +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& +TrackEvent::_internal_categories() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.categories_; +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +TrackEvent::_internal_mutable_categories() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.categories_; +} + +// optional string name = 23; +inline bool TrackEvent::has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void TrackEvent::clear_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::std::string& TrackEvent::name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackEvent.name) + return _internal_name(); +} +template +PROTOBUF_ALWAYS_INLINE void TrackEvent::set_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.TrackEvent.name) +} +inline ::std::string* PROTOBUF_NONNULL TrackEvent::mutable_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.TrackEvent.name) + return _s; +} +inline const ::std::string& TrackEvent::_internal_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.name_.Get(); +} +inline void TrackEvent::_internal_set_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL TrackEvent::_internal_mutable_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE TrackEvent::release_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.TrackEvent.name) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.name_.Set("", GetArena()); + } + return released; +} +inline void TrackEvent::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.kind_ = 0; - _impl_._has_bits_[0] &= ~0x00000040u; + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TrackEvent.name) } -inline ::calf::proto::TraceRecord_Kind TraceRecord::kind() const { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.kind) - return _internal_kind(); + +// optional .perfetto.protos.SourceLocation source_location = 33; +inline bool TrackEvent::has_source_location() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.source_location_ != nullptr); + return value; } -inline void TraceRecord::set_kind(::calf::proto::TraceRecord_Kind value) { - _internal_set_kind(value); - _impl_._has_bits_[0] |= 0x00000040u; - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.kind) +inline void TrackEvent::clear_source_location() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.source_location_ != nullptr) _impl_.source_location_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline ::calf::proto::TraceRecord_Kind TraceRecord::_internal_kind() const { +inline const ::perfetto::protos::SourceLocation& TrackEvent::_internal_source_location() const { ::google::protobuf::internal::TSanRead(&_impl_); - return static_cast<::calf::proto::TraceRecord_Kind>(_impl_.kind_); + const ::perfetto::protos::SourceLocation* p = _impl_.source_location_; + return p != nullptr ? *p : reinterpret_cast(::perfetto::protos::_SourceLocation_default_instance_); +} +inline const ::perfetto::protos::SourceLocation& TrackEvent::source_location() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackEvent.source_location) + return _internal_source_location(); +} +inline void TrackEvent::unsafe_arena_set_allocated_source_location( + ::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.source_location_); + } + _impl_.source_location_ = reinterpret_cast<::perfetto::protos::SourceLocation*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:perfetto.protos.TrackEvent.source_location) +} +inline ::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE TrackEvent::release_source_location() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + _impl_._has_bits_[0] &= ~0x00000002u; + ::perfetto::protos::SourceLocation* released = _impl_.source_location_; + _impl_.source_location_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE TrackEvent::unsafe_arena_release_source_location() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.TrackEvent.source_location) + + _impl_._has_bits_[0] &= ~0x00000002u; + ::perfetto::protos::SourceLocation* temp = _impl_.source_location_; + _impl_.source_location_ = nullptr; + return temp; } -inline void TraceRecord::_internal_set_kind(::calf::proto::TraceRecord_Kind value) { +inline ::perfetto::protos::SourceLocation* PROTOBUF_NONNULL TrackEvent::_internal_mutable_source_location() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.kind_ = value; + if (_impl_.source_location_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::perfetto::protos::SourceLocation>(GetArena()); + _impl_.source_location_ = reinterpret_cast<::perfetto::protos::SourceLocation*>(p); + } + return _impl_.source_location_; +} +inline ::perfetto::protos::SourceLocation* PROTOBUF_NONNULL TrackEvent::mutable_source_location() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + _impl_._has_bits_[0] |= 0x00000002u; + ::perfetto::protos::SourceLocation* _msg = _internal_mutable_source_location(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.TrackEvent.source_location) + return _msg; +} +inline void TrackEvent::set_allocated_source_location(::perfetto::protos::SourceLocation* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.source_location_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + + _impl_.source_location_ = reinterpret_cast<::perfetto::protos::SourceLocation*>(value); + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TrackEvent.source_location) } -// string invoker = 5; -inline void TraceRecord::clear_invoker() { +// ------------------------------------------------------------------- + +// DebugAnnotation + +// optional string string_value = 6; +inline bool DebugAnnotation::has_string_value() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void DebugAnnotation::clear_string_value() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.invoker_.ClearToEmpty(); + _impl_.string_value_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const ::std::string& TraceRecord::invoker() const +inline const ::std::string& DebugAnnotation::string_value() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.invoker) - return _internal_invoker(); + // @@protoc_insertion_point(field_get:perfetto.protos.DebugAnnotation.string_value) + return _internal_string_value(); } template -PROTOBUF_ALWAYS_INLINE void TraceRecord::set_invoker(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void DebugAnnotation::set_string_value(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_._has_bits_[0] |= 0x00000001u; - _impl_.invoker_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.invoker) + _impl_.string_value_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.DebugAnnotation.string_value) } -inline ::std::string* PROTOBUF_NONNULL TraceRecord::mutable_invoker() +inline ::std::string* PROTOBUF_NONNULL DebugAnnotation::mutable_string_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::std::string* _s = _internal_mutable_invoker(); - // @@protoc_insertion_point(field_mutable:calf.proto.TraceRecord.invoker) + ::std::string* _s = _internal_mutable_string_value(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.DebugAnnotation.string_value) return _s; } -inline const ::std::string& TraceRecord::_internal_invoker() const { +inline const ::std::string& DebugAnnotation::_internal_string_value() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.invoker_.Get(); + return _impl_.string_value_.Get(); } -inline void TraceRecord::_internal_set_invoker(const ::std::string& value) { +inline void DebugAnnotation::_internal_set_string_value(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_._has_bits_[0] |= 0x00000001u; - _impl_.invoker_.Set(value, GetArena()); + _impl_.string_value_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL TraceRecord::_internal_mutable_invoker() { +inline ::std::string* PROTOBUF_NONNULL DebugAnnotation::_internal_mutable_string_value() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.invoker_.Mutable( GetArena()); + return _impl_.string_value_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE TraceRecord::release_invoker() { +inline ::std::string* PROTOBUF_NULLABLE DebugAnnotation::release_string_value() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:calf.proto.TraceRecord.invoker) + // @@protoc_insertion_point(field_release:perfetto.protos.DebugAnnotation.string_value) if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* released = _impl_.invoker_.Release(); + auto* released = _impl_.string_value_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.invoker_.Set("", GetArena()); + _impl_.string_value_.Set("", GetArena()); } return released; } -inline void TraceRecord::set_allocated_invoker(::std::string* PROTOBUF_NULLABLE value) { +inline void DebugAnnotation::set_allocated_string_value(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.invoker_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.invoker_.IsDefault()) { - _impl_.invoker_.Set("", GetArena()); + _impl_.string_value_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.string_value_.IsDefault()) { + _impl_.string_value_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:calf.proto.TraceRecord.invoker) + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.DebugAnnotation.string_value) } -// string file = 6; -inline void TraceRecord::clear_file() { +// optional string name = 10; +inline bool DebugAnnotation::has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void DebugAnnotation::clear_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.file_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const ::std::string& TraceRecord::file() const +inline const ::std::string& DebugAnnotation::name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.file) - return _internal_file(); + // @@protoc_insertion_point(field_get:perfetto.protos.DebugAnnotation.name) + return _internal_name(); } template -PROTOBUF_ALWAYS_INLINE void TraceRecord::set_file(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void DebugAnnotation::set_name(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_._has_bits_[0] |= 0x00000002u; - _impl_.file_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.file) + _impl_.name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.DebugAnnotation.name) } -inline ::std::string* PROTOBUF_NONNULL TraceRecord::mutable_file() +inline ::std::string* PROTOBUF_NONNULL DebugAnnotation::mutable_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::std::string* _s = _internal_mutable_file(); - // @@protoc_insertion_point(field_mutable:calf.proto.TraceRecord.file) + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.DebugAnnotation.name) return _s; } -inline const ::std::string& TraceRecord::_internal_file() const { +inline const ::std::string& DebugAnnotation::_internal_name() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.file_.Get(); + return _impl_.name_.Get(); } -inline void TraceRecord::_internal_set_file(const ::std::string& value) { +inline void DebugAnnotation::_internal_set_name(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_._has_bits_[0] |= 0x00000002u; - _impl_.file_.Set(value, GetArena()); + _impl_.name_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL TraceRecord::_internal_mutable_file() { +inline ::std::string* PROTOBUF_NONNULL DebugAnnotation::_internal_mutable_name() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.file_.Mutable( GetArena()); + return _impl_.name_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE TraceRecord::release_file() { +inline ::std::string* PROTOBUF_NULLABLE DebugAnnotation::release_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:calf.proto.TraceRecord.file) + // @@protoc_insertion_point(field_release:perfetto.protos.DebugAnnotation.name) if ((_impl_._has_bits_[0] & 0x00000002u) == 0) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* released = _impl_.file_.Release(); + auto* released = _impl_.name_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.file_.Set("", GetArena()); + _impl_.name_.Set("", GetArena()); } return released; } -inline void TraceRecord::set_allocated_file(::std::string* PROTOBUF_NULLABLE value) { +inline void DebugAnnotation::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.file_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.file_.IsDefault()) { - _impl_.file_.Set("", GetArena()); + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:calf.proto.TraceRecord.file) + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.DebugAnnotation.name) } -// uint32 line = 7; -inline void TraceRecord::clear_line() { +// ------------------------------------------------------------------- + +// SourceLocation + +// optional string file_name = 2; +inline bool SourceLocation::has_file_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void SourceLocation::clear_file_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.line_ = 0u; - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_.file_name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::std::string& SourceLocation::file_name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.SourceLocation.file_name) + return _internal_file_name(); } -inline ::uint32_t TraceRecord::line() const { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.line) - return _internal_line(); +template +PROTOBUF_ALWAYS_INLINE void SourceLocation::set_file_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.file_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.SourceLocation.file_name) } -inline void TraceRecord::set_line(::uint32_t value) { - _internal_set_line(value); - _impl_._has_bits_[0] |= 0x00000080u; - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.line) +inline ::std::string* PROTOBUF_NONNULL SourceLocation::mutable_file_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::std::string* _s = _internal_mutable_file_name(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.SourceLocation.file_name) + return _s; } -inline ::uint32_t TraceRecord::_internal_line() const { +inline const ::std::string& SourceLocation::_internal_file_name() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.line_; + return _impl_.file_name_.Get(); } -inline void TraceRecord::_internal_set_line(::uint32_t value) { +inline void SourceLocation::_internal_set_file_name(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.line_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.file_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL SourceLocation::_internal_mutable_file_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.file_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE SourceLocation::release_file_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.SourceLocation.file_name) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.file_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.file_name_.Set("", GetArena()); + } + return released; +} +inline void SourceLocation::set_allocated_file_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.file_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.file_name_.IsDefault()) { + _impl_.file_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.SourceLocation.file_name) } -// string args = 8; -inline void TraceRecord::clear_args() { +// optional string function_name = 3; +inline bool SourceLocation::has_function_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void SourceLocation::clear_function_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.args_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_.function_name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline const ::std::string& TraceRecord::args() const +inline const ::std::string& SourceLocation::function_name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:calf.proto.TraceRecord.args) - return _internal_args(); + // @@protoc_insertion_point(field_get:perfetto.protos.SourceLocation.function_name) + return _internal_function_name(); } template -PROTOBUF_ALWAYS_INLINE void TraceRecord::set_args(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void SourceLocation::set_function_name(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.args_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:calf.proto.TraceRecord.args) + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.function_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.SourceLocation.function_name) } -inline ::std::string* PROTOBUF_NONNULL TraceRecord::mutable_args() +inline ::std::string* PROTOBUF_NONNULL SourceLocation::mutable_function_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::std::string* _s = _internal_mutable_args(); - // @@protoc_insertion_point(field_mutable:calf.proto.TraceRecord.args) + ::std::string* _s = _internal_mutable_function_name(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.SourceLocation.function_name) return _s; } -inline const ::std::string& TraceRecord::_internal_args() const { +inline const ::std::string& SourceLocation::_internal_function_name() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.args_.Get(); + return _impl_.function_name_.Get(); } -inline void TraceRecord::_internal_set_args(const ::std::string& value) { +inline void SourceLocation::_internal_set_function_name(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.args_.Set(value, GetArena()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.function_name_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL TraceRecord::_internal_mutable_args() { +inline ::std::string* PROTOBUF_NONNULL SourceLocation::_internal_mutable_function_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.args_.Mutable( GetArena()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.function_name_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE TraceRecord::release_args() { +inline ::std::string* PROTOBUF_NULLABLE SourceLocation::release_function_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:calf.proto.TraceRecord.args) - if ((_impl_._has_bits_[0] & 0x00000004u) == 0) { + // @@protoc_insertion_point(field_release:perfetto.protos.SourceLocation.function_name) + if ((_impl_._has_bits_[0] & 0x00000002u) == 0) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* released = _impl_.args_.Release(); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* released = _impl_.function_name_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.args_.Set("", GetArena()); + _impl_.function_name_.Set("", GetArena()); } return released; } -inline void TraceRecord::set_allocated_args(::std::string* PROTOBUF_NULLABLE value) { +inline void SourceLocation::set_allocated_function_name(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.args_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.args_.IsDefault()) { - _impl_.args_.Set("", GetArena()); + _impl_.function_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.function_name_.IsDefault()) { + _impl_.function_name_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:calf.proto.TraceRecord.args) + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.SourceLocation.function_name) +} + +// optional uint32 line_number = 4; +inline bool SourceLocation::has_line_number() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void SourceLocation::clear_line_number() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.line_number_ = 0u; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::uint32_t SourceLocation::line_number() const { + // @@protoc_insertion_point(field_get:perfetto.protos.SourceLocation.line_number) + return _internal_line_number(); +} +inline void SourceLocation::set_line_number(::uint32_t value) { + _internal_set_line_number(value); + _impl_._has_bits_[0] |= 0x00000004u; + // @@protoc_insertion_point(field_set:perfetto.protos.SourceLocation.line_number) +} +inline ::uint32_t SourceLocation::_internal_line_number() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.line_number_; +} +inline void SourceLocation::_internal_set_line_number(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.line_number_ = value; } // ------------------------------------------------------------------- -// TraceFile +// TrackDescriptor -// repeated .calf.proto.TraceRecord records = 1; -inline int TraceFile::_internal_records_size() const { - return _internal_records().size(); +// optional uint64 uuid = 1; +inline bool TrackDescriptor::has_uuid() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void TrackDescriptor::clear_uuid() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.uuid_ = ::uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::uint64_t TrackDescriptor::uuid() const { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackDescriptor.uuid) + return _internal_uuid(); +} +inline void TrackDescriptor::set_uuid(::uint64_t value) { + _internal_set_uuid(value); + _impl_._has_bits_[0] |= 0x00000004u; + // @@protoc_insertion_point(field_set:perfetto.protos.TrackDescriptor.uuid) +} +inline ::uint64_t TrackDescriptor::_internal_uuid() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.uuid_; +} +inline void TrackDescriptor::_internal_set_uuid(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.uuid_ = value; } -inline int TraceFile::records_size() const { - return _internal_records_size(); + +// optional string name = 2; +inline bool TrackDescriptor::has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline void TraceFile::clear_records() { +inline void TrackDescriptor::clear_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.records_.Clear(); + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline ::calf::proto::TraceRecord* PROTOBUF_NONNULL TraceFile::mutable_records(int index) +inline const ::std::string& TrackDescriptor::name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:calf.proto.TraceFile.records) - return _internal_mutable_records()->Mutable(index); + // @@protoc_insertion_point(field_get:perfetto.protos.TrackDescriptor.name) + return _internal_name(); +} +template +PROTOBUF_ALWAYS_INLINE void TrackDescriptor::set_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.TrackDescriptor.name) } -inline ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>* PROTOBUF_NONNULL TraceFile::mutable_records() +inline ::std::string* PROTOBUF_NONNULL TrackDescriptor::mutable_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:calf.proto.TraceFile.records) + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.TrackDescriptor.name) + return _s; +} +inline const ::std::string& TrackDescriptor::_internal_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.name_.Get(); +} +inline void TrackDescriptor::_internal_set_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL TrackDescriptor::_internal_mutable_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE TrackDescriptor::release_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.TrackDescriptor.name) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.name_.Set("", GetArena()); + } + return released; +} +inline void TrackDescriptor::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TrackDescriptor.name) +} + +// optional .perfetto.protos.ThreadDescriptor thread = 4; +inline bool TrackDescriptor::has_thread() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.thread_ != nullptr); + return value; +} +inline void TrackDescriptor::clear_thread() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.thread_ != nullptr) _impl_.thread_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const ::perfetto::protos::ThreadDescriptor& TrackDescriptor::_internal_thread() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::perfetto::protos::ThreadDescriptor* p = _impl_.thread_; + return p != nullptr ? *p : reinterpret_cast(::perfetto::protos::_ThreadDescriptor_default_instance_); +} +inline const ::perfetto::protos::ThreadDescriptor& TrackDescriptor::thread() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.TrackDescriptor.thread) + return _internal_thread(); +} +inline void TrackDescriptor::unsafe_arena_set_allocated_thread( + ::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.thread_); + } + _impl_.thread_ = reinterpret_cast<::perfetto::protos::ThreadDescriptor*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:perfetto.protos.TrackDescriptor.thread) +} +inline ::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE TrackDescriptor::release_thread() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + _impl_._has_bits_[0] &= ~0x00000002u; + ::perfetto::protos::ThreadDescriptor* released = _impl_.thread_; + _impl_.thread_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE TrackDescriptor::unsafe_arena_release_thread() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.TrackDescriptor.thread) + + _impl_._has_bits_[0] &= ~0x00000002u; + ::perfetto::protos::ThreadDescriptor* temp = _impl_.thread_; + _impl_.thread_ = nullptr; + return temp; +} +inline ::perfetto::protos::ThreadDescriptor* PROTOBUF_NONNULL TrackDescriptor::_internal_mutable_thread() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _internal_mutable_records(); + if (_impl_.thread_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::perfetto::protos::ThreadDescriptor>(GetArena()); + _impl_.thread_ = reinterpret_cast<::perfetto::protos::ThreadDescriptor*>(p); + } + return _impl_.thread_; } -inline const ::calf::proto::TraceRecord& TraceFile::records(int index) const +inline ::perfetto::protos::ThreadDescriptor* PROTOBUF_NONNULL TrackDescriptor::mutable_thread() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:calf.proto.TraceFile.records) - return _internal_records().Get(index); + _impl_._has_bits_[0] |= 0x00000002u; + ::perfetto::protos::ThreadDescriptor* _msg = _internal_mutable_thread(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.TrackDescriptor.thread) + return _msg; +} +inline void TrackDescriptor::set_allocated_thread(::perfetto::protos::ThreadDescriptor* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.thread_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + + _impl_.thread_ = reinterpret_cast<::perfetto::protos::ThreadDescriptor*>(value); + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TrackDescriptor.thread) +} + +// ------------------------------------------------------------------- + +// ThreadDescriptor + +// optional int32 pid = 1; +inline bool ThreadDescriptor::has_pid() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void ThreadDescriptor::clear_pid() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.pid_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::int32_t ThreadDescriptor::pid() const { + // @@protoc_insertion_point(field_get:perfetto.protos.ThreadDescriptor.pid) + return _internal_pid(); +} +inline void ThreadDescriptor::set_pid(::int32_t value) { + _internal_set_pid(value); + _impl_._has_bits_[0] |= 0x00000004u; + // @@protoc_insertion_point(field_set:perfetto.protos.ThreadDescriptor.pid) +} +inline ::int32_t ThreadDescriptor::_internal_pid() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.pid_; +} +inline void ThreadDescriptor::_internal_set_pid(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.pid_ = value; +} + +// optional int64 tid = 2; +inline bool ThreadDescriptor::has_tid() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void ThreadDescriptor::clear_tid() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.tid_ = ::int64_t{0}; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline ::int64_t ThreadDescriptor::tid() const { + // @@protoc_insertion_point(field_get:perfetto.protos.ThreadDescriptor.tid) + return _internal_tid(); +} +inline void ThreadDescriptor::set_tid(::int64_t value) { + _internal_set_tid(value); + _impl_._has_bits_[0] |= 0x00000002u; + // @@protoc_insertion_point(field_set:perfetto.protos.ThreadDescriptor.tid) +} +inline ::int64_t ThreadDescriptor::_internal_tid() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.tid_; +} +inline void ThreadDescriptor::_internal_set_tid(::int64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.tid_ = value; +} + +// optional string thread_name = 5; +inline bool ThreadDescriptor::has_thread_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void ThreadDescriptor::clear_thread_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.thread_name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline ::calf::proto::TraceRecord* PROTOBUF_NONNULL TraceFile::add_records() +inline const ::std::string& ThreadDescriptor::thread_name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:perfetto.protos.ThreadDescriptor.thread_name) + return _internal_thread_name(); +} +template +PROTOBUF_ALWAYS_INLINE void ThreadDescriptor::set_thread_name(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - ::calf::proto::TraceRecord* _add = _internal_mutable_records()->Add(); - // @@protoc_insertion_point(field_add:calf.proto.TraceFile.records) - return _add; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.thread_name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:perfetto.protos.ThreadDescriptor.thread_name) } -inline const ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>& TraceFile::records() const +inline ::std::string* PROTOBUF_NONNULL ThreadDescriptor::mutable_thread_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:calf.proto.TraceFile.records) - return _internal_records(); + ::std::string* _s = _internal_mutable_thread_name(); + // @@protoc_insertion_point(field_mutable:perfetto.protos.ThreadDescriptor.thread_name) + return _s; } -inline const ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>& -TraceFile::_internal_records() const { +inline const ::std::string& ThreadDescriptor::_internal_thread_name() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.records_; + return _impl_.thread_name_.Get(); } -inline ::google::protobuf::RepeatedPtrField<::calf::proto::TraceRecord>* PROTOBUF_NONNULL -TraceFile::_internal_mutable_records() { - ::google::protobuf::internal::TSanRead(&_impl_); - return &_impl_.records_; +inline void ThreadDescriptor::_internal_set_thread_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.thread_name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ThreadDescriptor::_internal_mutable_thread_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.thread_name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ThreadDescriptor::release_thread_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:perfetto.protos.ThreadDescriptor.thread_name) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.thread_name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.thread_name_.Set("", GetArena()); + } + return released; +} +inline void ThreadDescriptor::set_allocated_thread_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.thread_name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.thread_name_.IsDefault()) { + _impl_.thread_name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:perfetto.protos.ThreadDescriptor.thread_name) } #ifdef __GNUC__ @@ -1017,18 +3122,18 @@ TraceFile::_internal_mutable_records() { #endif // __GNUC__ // @@protoc_insertion_point(namespace_scope) -} // namespace proto -} // namespace calf +} // namespace protos +} // namespace perfetto namespace google { namespace protobuf { template <> -struct is_proto_enum<::calf::proto::TraceRecord_Kind> : std::true_type {}; +struct is_proto_enum<::perfetto::protos::TrackEvent_Type> : std::true_type {}; template <> -inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::calf::proto::TraceRecord_Kind>() { - return ::calf::proto::TraceRecord_Kind_descriptor(); +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::perfetto::protos::TrackEvent_Type>() { + return ::perfetto::protos::TrackEvent_Type_descriptor(); } } // namespace protobuf diff --git a/calf/protobuf/calf_trace.proto b/calf/protobuf/calf_trace.proto index d3ab157..79123d2 100644 --- a/calf/protobuf/calf_trace.proto +++ b/calf/protobuf/calf_trace.proto @@ -1,26 +1,57 @@ -syntax = "proto3"; +syntax = "proto2"; -package calf.proto; +package perfetto.protos; -// Records are flat so a logger can append them without retaining a complete -// trace in memory. scope_id and parent_scope_id reconstruct the call tree. -message TraceRecord { - enum Kind { - SCOPE_ENTER = 0; - EVENT = 1; - SCOPE_EXIT = 2; +// Minimal declarations of Perfetto's stable TrackEvent wire format. Field +// numbers match the upstream Perfetto protos, so these files open directly in +// the Perfetto UI and trace processor. +message Trace { + repeated TracePacket packet = 1; +} + +message TracePacket { + optional uint64 timestamp = 8; + optional uint32 trusted_packet_sequence_id = 10; + optional TrackEvent track_event = 11; + optional uint32 timestamp_clock_id = 58; + optional TrackDescriptor track_descriptor = 60; +} + +message TrackEvent { + enum Type { + TYPE_UNSPECIFIED = 0; + TYPE_SLICE_BEGIN = 1; + TYPE_SLICE_END = 2; + TYPE_INSTANT = 3; } - uint64 timestamp_ms = 1; - uint64 scope_id = 2; - uint64 parent_scope_id = 3; - Kind kind = 4; - string invoker = 5; - string file = 6; - uint32 line = 7; - string args = 8; + repeated DebugAnnotation debug_annotations = 4; + optional Type type = 9; + optional uint64 track_uuid = 11; + repeated string categories = 22; + optional string name = 23; + optional SourceLocation source_location = 33; +} + +message DebugAnnotation { + optional string string_value = 6; + optional string name = 10; +} + +message SourceLocation { + optional string file_name = 2; + optional string function_name = 3; + optional uint32 line_number = 4; +} + +message TrackDescriptor { + optional uint64 uuid = 1; + optional string name = 2; + optional ThreadDescriptor thread = 4; } -message TraceFile { - repeated TraceRecord records = 1; +message ThreadDescriptor { + optional int32 pid = 1; + optional int64 tid = 2; + optional string thread_name = 5; } diff --git a/profiler/README.md b/profiler/README.md index bbf46c0..1557050 100644 --- a/profiler/README.md +++ b/profiler/README.md @@ -10,7 +10,7 @@ backed by the CALF trace loader and statistics engine. ## Features -- Navigate logs by host, backend, and thread. +- Navigate logs by host, component, and thread. - Explore nested scopes and events as a call tree. - Inspect source locations, arguments, timestamps, and durations. - Search invokers, arguments, and source paths. @@ -58,6 +58,8 @@ Inspector expects the directory structure generated by CALF: ```text calf_logs/ +|-- / +| `-- _.perfetto-trace |-- syscall/ | `-- / | `-- .log @@ -66,8 +68,9 @@ calf_logs/ `-- .log ``` -Each log file is presented independently. Files outside this three-level layout -are still loaded and grouped under an `unknown` backend when possible. +Each Perfetto file contains all component threads for one process. JSON thread +files are presented independently. Other files are grouped under an `unknown` +backend when possible. ## Web interface diff --git a/profiler/__init__.py b/profiler/__init__.py index 8ebe38c..1286bd9 100644 --- a/profiler/__init__.py +++ b/profiler/__init__.py @@ -1,3 +1,3 @@ -"""Interactive viewer and analyzer for CALF JSON and protobuf traces.""" +"""Interactive viewer and analyzer for CALF JSON and Perfetto traces.""" from .. import __version__ diff --git a/profiler/__main__.py b/profiler/__main__.py index d553345..1eb7a50 100644 --- a/profiler/__main__.py +++ b/profiler/__main__.py @@ -10,11 +10,11 @@ def main() -> None: parser = argparse.ArgumentParser( prog="calf", description=( - "Web inspector and profiler for CALF JSON and protobuf traces.\n\n" + "Web inspector and profiler for CALF JSON and Perfetto traces.\n\n" "Traces are read from a log directory laid out as:\n" " /syscall//.log\n" " /stl//.log\n" - " /syscall//.pb\n\n" + " //_.perfetto-trace\n\n" "Each trace file becomes a tab in the web inspector." ), formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/profiler/loader.py b/profiler/loader.py index cc86f36..d60cd84 100644 --- a/profiler/loader.py +++ b/profiler/loader.py @@ -74,15 +74,15 @@ def repair_and_load(path: str) -> list: def load_protobuf(path: str) -> list: - """Load a CALF protobuf stream, ignoring an incomplete final record.""" - return _protobuf_records_to_entries(_iter_protobuf_records(path)) + """Load a Perfetto trace stream, ignoring an incomplete final packet.""" + return _perfetto_packets_to_entries(_iter_perfetto_packets(path)) -def _iter_protobuf_records(path: str) -> Iterator[calf_trace_pb2.TraceRecord]: +def _iter_perfetto_packets(path: str) -> Iterator[calf_trace_pb2.TracePacket]: with open(path, "rb", buffering=1024 * 1024) as trace_file: offset = 0 while field := trace_file.read(1): - if field != b"\x0a": # TraceFile.records, length-delimited + if field != b"\x0a": # perfetto.protos.Trace.packet raise RuntimeError( f"Cannot parse {path}: invalid protobuf field at byte {offset}" ) @@ -94,9 +94,9 @@ def _iter_protobuf_records(path: str) -> Iterator[calf_trace_pb2.TraceRecord]: if len(payload) < length: break offset += length - record = calf_trace_pb2.TraceRecord() - record.ParseFromString(payload) - yield record + packet = calf_trace_pb2.TracePacket() + packet.ParseFromString(payload) + yield packet def _read_varint( @@ -118,44 +118,57 @@ def _read_varint( raise RuntimeError(f"Cannot parse {path}: invalid protobuf varint at byte {start}") -def _protobuf_records_to_entries(records: Iterable[calf_trace_pb2.TraceRecord]) -> list: +def _perfetto_packets_to_entries( + packets: Iterable[calf_trace_pb2.TracePacket], +) -> list: roots = [] - scopes = {} + stacks: dict[int, list[dict]] = {} - for record in records: - if record.kind == calf_trace_pb2.TraceRecord.SCOPE_ENTER: + for packet in packets: + if not packet.HasField("track_event"): + continue + event = packet.track_event + stack = stacks.setdefault(event.track_uuid, []) + timestamp_ms = packet.timestamp // 1_000_000 + source = event.source_location + args = next( + ( + annotation.string_value + for annotation in event.debug_annotations + if annotation.name == "args" + ), + "", + ) + + if event.type == calf_trace_pb2.TrackEvent.TYPE_SLICE_BEGIN: entry = { - "invoker": record.invoker or "?", - "args": record.args, - "file": record.file, - "line": record.line, - "ts_enter": record.timestamp_ms, + "invoker": event.name or source.function_name or "?", + "args": args, + "file": source.file_name, + "line": source.line_number, + "ts_enter": timestamp_ms, "ts_exit": None, "events": [], } - scopes[record.scope_id] = entry - parent = scopes.get(record.parent_scope_id) - (parent["events"] if parent is not None else roots).append(entry) - elif record.kind == calf_trace_pb2.TraceRecord.EVENT: + (stack[-1]["events"] if stack else roots).append(entry) + stack.append(entry) + elif event.type == calf_trace_pb2.TrackEvent.TYPE_INSTANT: entry = { - "invoker": record.invoker or "?", - "args": record.args, - "file": record.file, - "line": record.line, - "ts": record.timestamp_ms, + "invoker": event.name or source.function_name or "?", + "args": args, + "file": source.file_name, + "line": source.line_number, + "ts": timestamp_ms, } - parent = scopes.get(record.scope_id) - (parent["events"] if parent is not None else roots).append(entry) - elif record.kind == calf_trace_pb2.TraceRecord.SCOPE_EXIT: - scope = scopes.get(record.scope_id) - if scope is not None: - scope["ts_exit"] = record.timestamp_ms + (stack[-1]["events"] if stack else roots).append(entry) + elif event.type == calf_trace_pb2.TrackEvent.TYPE_SLICE_END and stack: + stack.pop()["ts_exit"] = timestamp_ms return roots def load_trace(path: str) -> list: - if path.lower().endswith(".pb"): + if path.lower().endswith(".perfetto-trace"): return load_protobuf(path) return repair_and_load(path) @@ -269,18 +282,22 @@ class TraceTab: """ One tab = one log file. - Tabs are labeled " / / " so each thread's trace - is presented independently. + JSON tabs represent one thread. Perfetto tabs contain every thread for a + component on a host. """ hostname: str kind: str # "syscall", "stl", or ... - path: str # path to the single .log or .pb file this tab represents + path: str # path to the single .log or Perfetto file this tab represents _roots: Optional[list[TraceNode]] = field(default=None, repr=False) _load_lock: threading.Lock = field(default_factory=threading.Lock, repr=False) @property def tid(self) -> str: """Thread-id portion of the filename, e.g. '44623' from 'stl_44623.log'.""" + if self.path.lower().endswith(".perfetto-trace"): + stem = os.path.basename(self.path)[: -len(".perfetto-trace")] + _, separator, pid = stem.rpartition("_") + return f"process {pid} (all threads)" if separator and pid.isdigit() else "all threads" stem = os.path.splitext(os.path.basename(self.path))[0] # Strip the kind prefix if present (stl_44623 -> 44623) if "_" in stem: @@ -310,11 +327,12 @@ def total_nodes(self) -> int: def discover_tabs(log_dir: str) -> list[TraceTab]: """ - Walk log_dir and create one TraceTab per .log or .pb file. + Walk log_dir and create one TraceTab per .log or .perfetto-trace file. Expected CALF layout: /syscall//.log /stl//.log + //_.perfetto-trace """ if not os.path.isdir(log_dir): raise FileNotFoundError(f"Log directory not found: {log_dir!r}") @@ -324,13 +342,18 @@ def discover_tabs(log_dir: str) -> list[TraceTab]: for root, dirs, files in os.walk(log_dir): dirs.sort() for fname in sorted(files): - if not fname.lower().endswith((".log", ".pb")): + if not fname.lower().endswith((".log", ".perfetto-trace")): continue full = os.path.join(root, fname) rel = os.path.relpath(full, log_dir).replace("\\", "/") parts = rel.split("/") - if len(parts) == 3: + if fname.lower().endswith(".perfetto-trace"): + hostname = os.path.basename(root) or "unknown" + stem = fname[: -len(".perfetto-trace")] + component, separator, pid = stem.rpartition("_") + kind = component if separator and pid.isdigit() else stem or "unknown" + elif len(parts) == 3: kind, hostname = parts[0], parts[1] else: hostname = os.path.basename(root) or "unknown" @@ -339,7 +362,7 @@ def discover_tabs(log_dir: str) -> list[TraceTab]: tabs.append(TraceTab(hostname=hostname, kind=kind, path=full)) if not tabs: - raise RuntimeError(f"No .log or .pb files found under {log_dir!r}") + raise RuntimeError(f"No .log or .perfetto-trace files found under {log_dir!r}") order = {"syscall": 0, "stl": 1, "unknown": 2} tabs.sort(key=lambda t: (order.get(t.kind, 9), t.hostname, t.tid)) diff --git a/tests/profiler_loader_tests.py b/tests/profiler_loader_tests.py index 282235f..c57eeb8 100644 --- a/tests/profiler_loader_tests.py +++ b/tests/profiler_loader_tests.py @@ -5,26 +5,27 @@ from calf.protobuf import calf_trace_pb2 -def _record(trace, kind, scope_id, timestamp, parent_scope_id=0, **fields): - record = trace.records.add( - kind=kind, - scope_id=scope_id, - parent_scope_id=parent_scope_id, - timestamp_ms=timestamp, - ) - for name, value in fields.items(): - setattr(record, name, value) - - -def test_loads_protobuf_trace_tree_and_truncated_tail(tmp_path): - trace = calf_trace_pb2.TraceFile() - _record(trace, calf_trace_pb2.TraceRecord.SCOPE_ENTER, 1, 10, invoker="outer") - _record(trace, calf_trace_pb2.TraceRecord.SCOPE_ENTER, 2, 11, 1, invoker="inner") - _record(trace, calf_trace_pb2.TraceRecord.EVENT, 2, 12, args="event") - _record(trace, calf_trace_pb2.TraceRecord.SCOPE_EXIT, 2, 13, 1) - _record(trace, calf_trace_pb2.TraceRecord.SCOPE_EXIT, 1, 14) - - path = tmp_path / "syscall_42.pb" +def _event(trace, kind, timestamp, name="", args="", track_uuid=1): + packet = trace.packet.add(timestamp=timestamp * 1_000_000) + event = packet.track_event + event.type = kind + event.track_uuid = track_uuid + event.name = name + event.source_location.function_name = name + if args: + annotation = event.debug_annotations.add(name="args") + annotation.string_value = args + + +def test_loads_perfetto_trace_tree_and_truncated_tail(tmp_path): + trace = calf_trace_pb2.Trace() + _event(trace, calf_trace_pb2.TrackEvent.TYPE_SLICE_BEGIN, 10, "outer") + _event(trace, calf_trace_pb2.TrackEvent.TYPE_SLICE_BEGIN, 11, "inner") + _event(trace, calf_trace_pb2.TrackEvent.TYPE_INSTANT, 12, "inner", "event") + _event(trace, calf_trace_pb2.TrackEvent.TYPE_SLICE_END, 13) + _event(trace, calf_trace_pb2.TrackEvent.TYPE_SLICE_END, 14) + + path = tmp_path / "syscall_42.perfetto-trace" encoded = trace.SerializeToString() path.write_bytes(encoded[:-1]) @@ -36,20 +37,27 @@ def test_loads_protobuf_trace_tree_and_truncated_tail(tmp_path): assert roots[0]["ts_exit"] is None -def test_discovers_json_and_protobuf_traces(tmp_path): +def test_discovers_json_and_perfetto_traces(tmp_path): trace_dir = tmp_path / "syscall" / "host" trace_dir.mkdir(parents=True) (trace_dir / "syscall_1.log").write_text(json.dumps({"invoker": "json", "ts": 1})) - (trace_dir / "syscall_2.pb").write_bytes(calf_trace_pb2.TraceFile().SerializeToString()) + perfetto_dir = tmp_path / "host" + perfetto_dir.mkdir() + (perfetto_dir / "calf_42.perfetto-trace").write_bytes( + calf_trace_pb2.Trace().SerializeToString() + ) tabs = discover_tabs(str(tmp_path)) - assert [tab.tid for tab in tabs] == ["1", "2"] + assert [(tab.kind, tab.tid) for tab in tabs] == [ + ("syscall", "1"), + ("calf", "process 42 (all threads)"), + ] -def test_protobuf_loader_uses_bounded_reads(tmp_path, monkeypatch): - trace = calf_trace_pb2.TraceFile() - _record(trace, calf_trace_pb2.TraceRecord.EVENT, 1, 10, invoker="event") - path = tmp_path / "trace.pb" +def test_perfetto_loader_uses_bounded_reads(tmp_path, monkeypatch): + trace = calf_trace_pb2.Trace() + _event(trace, calf_trace_pb2.TrackEvent.TYPE_INSTANT, 10, "event") + path = tmp_path / "trace.perfetto-trace" path.write_bytes(trace.SerializeToString()) real_open = open @@ -78,8 +86,8 @@ def bounded_open(*args, **kwargs): def test_web_server_creation_does_not_load_tabs(tmp_path): from calf.profiler.web import create_web_server - path = tmp_path / "trace.pb" - path.write_bytes(calf_trace_pb2.TraceFile().SerializeToString()) + path = tmp_path / "trace.perfetto-trace" + path.write_bytes(calf_trace_pb2.Trace().SerializeToString()) tab = TraceTab(hostname="host", kind="syscall", path=str(path)) server = create_web_server([tab], port=0) @@ -92,10 +100,10 @@ def test_web_server_creation_does_not_load_tabs(tmp_path): def test_cli_does_not_load_tabs(tmp_path, monkeypatch): from calf.profiler import __main__ as profiler_main - trace_dir = tmp_path / "syscall" / "host" + trace_dir = tmp_path / "host" trace_dir.mkdir(parents=True) - (trace_dir / "trace.pb").write_bytes( - calf_trace_pb2.TraceFile().SerializeToString() + (trace_dir / "calf_42.perfetto-trace").write_bytes( + calf_trace_pb2.Trace().SerializeToString() ) captured_tabs = [] diff --git a/tests/protobuf_tests.cpp b/tests/protobuf_tests.cpp index 9267b1b..186f493 100644 --- a/tests/protobuf_tests.cpp +++ b/tests/protobuf_tests.cpp @@ -4,10 +4,12 @@ #include #include +#include #include #include #include #include +#include #include TEST(ProtobufLoggerTest, WritesStreamableNestedTrace) { @@ -30,32 +32,56 @@ TEST(ProtobufLoggerTest, WritesStreamableNestedTrace) { } } + std::array threadPaths; + std::array threads; + for (std::size_t index = 0; index < threads.size(); ++index) { + threads[index] = std::thread([index, &threadPaths]() { + Logger logger("worker", "trace.cpp", 20, calf_current_tid(), "worker=%zu", index); + threadPaths[index] = logger.getLogFileName(); + }); + } + for (auto &thread : threads) { + thread.join(); + } + EXPECT_EQ(threadPaths[0], path); + EXPECT_EQ(threadPaths[1], path); + std::ifstream input(path, std::ios::binary); const std::string data((std::istreambuf_iterator(input)), std::istreambuf_iterator()); - calf::proto::TraceFile trace; + perfetto::protos::Trace trace; ASSERT_TRUE(trace.ParseFromString(data)); - ASSERT_EQ(trace.records_size(), 6); - EXPECT_EQ(trace.records(0).kind(), calf::proto::TraceRecord::SCOPE_ENTER); - EXPECT_EQ(trace.records(0).scope_id(), 1u); - EXPECT_EQ(trace.records(0).parent_scope_id(), 0u); - EXPECT_EQ(trace.records(0).invoker(), "outer"); - EXPECT_EQ(trace.records(0).file(), "trace.cpp"); - EXPECT_EQ(trace.records(0).line(), 10u); - EXPECT_EQ(trace.records(0).args(), "request=7"); - EXPECT_EQ(trace.records(1).kind(), calf::proto::TraceRecord::EVENT); - EXPECT_EQ(trace.records(1).scope_id(), 1u); - EXPECT_EQ(trace.records(1).args(), "started"); - EXPECT_EQ(trace.records(2).scope_id(), 2u); - EXPECT_EQ(trace.records(2).parent_scope_id(), 1u); - EXPECT_EQ(trace.records(3).args(), "value=ok"); - EXPECT_EQ(trace.records(4).kind(), calf::proto::TraceRecord::SCOPE_EXIT); - EXPECT_EQ(trace.records(4).scope_id(), 2u); - EXPECT_EQ(trace.records(5).kind(), calf::proto::TraceRecord::SCOPE_EXIT); - EXPECT_EQ(trace.records(5).scope_id(), 1u); + ASSERT_EQ(trace.packet_size(), 13); + ASSERT_TRUE(trace.packet(0).has_track_descriptor()); + EXPECT_EQ(trace.packet(0).track_descriptor().thread().pid(), ::getpid()); + + const auto &outerBegin = trace.packet(1).track_event(); + EXPECT_FALSE(trace.packet(1).has_timestamp_clock_id()); + EXPECT_EQ(outerBegin.type(), perfetto::protos::TrackEvent::TYPE_SLICE_BEGIN); + EXPECT_EQ(outerBegin.name(), "outer"); + EXPECT_EQ(outerBegin.source_location().file_name(), "trace.cpp"); + EXPECT_EQ(outerBegin.source_location().line_number(), 10u); + ASSERT_EQ(outerBegin.debug_annotations_size(), 1); + EXPECT_EQ(outerBegin.debug_annotations(0).name(), "args"); + EXPECT_EQ(outerBegin.debug_annotations(0).string_value(), "request=7"); + + EXPECT_EQ(trace.packet(2).track_event().type(), + perfetto::protos::TrackEvent::TYPE_INSTANT); + EXPECT_EQ(trace.packet(2).track_event().debug_annotations(0).string_value(), "started"); + EXPECT_EQ(trace.packet(3).track_event().type(), + perfetto::protos::TrackEvent::TYPE_SLICE_BEGIN); + EXPECT_EQ(trace.packet(4).track_event().debug_annotations(0).string_value(), "value=ok"); + EXPECT_EQ(trace.packet(5).track_event().type(), + perfetto::protos::TrackEvent::TYPE_SLICE_END); + EXPECT_EQ(trace.packet(6).track_event().type(), + perfetto::protos::TrackEvent::TYPE_SLICE_END); + EXPECT_EQ(outerBegin.track_uuid(), trace.packet(0).track_descriptor().uuid()); EXPECT_FALSE(data.empty()); - EXPECT_EQ(std::filesystem::path(path).extension(), ".pb"); + EXPECT_EQ(std::filesystem::path(path).extension(), ".perfetto-trace"); + EXPECT_EQ(std::filesystem::path(path).filename(), + "calf_" + std::to_string(::getpid()) + ".perfetto-trace"); + EXPECT_EQ(std::filesystem::path(path).parent_path().parent_path(), root); std::filesystem::remove_all(root); } diff --git a/tests/syscall_protobuf_tests.cpp b/tests/syscall_protobuf_tests.cpp index 3b46518..2dbc92e 100644 --- a/tests/syscall_protobuf_tests.cpp +++ b/tests/syscall_protobuf_tests.cpp @@ -4,13 +4,86 @@ #include #include +#include +#include +#include #include #include #include #include +#include #include #include +namespace { +std::atomic handledGetpid{0}; +std::atomic handledGettid{0}; +std::atomic handledClockGettime{0}; + +long recordingSyscall(long number, ...) { + va_list args; + va_start(args, number); + long result = -1; + switch (number) { + case SYS_getpid: + ++handledGetpid; + result = ::syscall(number); + break; + case SYS_gettid: + ++handledGettid; + result = ::syscall(number); + break; + case SYS_clock_gettime: { + ++handledClockGettime; + const auto clock = va_arg(args, long); + auto *time = reinterpret_cast(va_arg(args, long)); + result = ::syscall(number, clock, time); + break; + } + case SYS_mkdirat: { + const auto dirfd = va_arg(args, long); + const auto *path = reinterpret_cast(va_arg(args, long)); + const auto mode = va_arg(args, long); + result = ::syscall(number, dirfd, path, mode); + break; + } + case SYS_openat: { + const auto dirfd = va_arg(args, long); + const auto *path = reinterpret_cast(va_arg(args, long)); + const auto flags = va_arg(args, long); + const auto mode = va_arg(args, long); + result = ::syscall(number, dirfd, path, flags, mode); + break; + } + case SYS_write: { + const auto fd = va_arg(args, long); + const auto *buffer = reinterpret_cast(va_arg(args, long)); + const auto size = va_arg(args, long); + result = ::syscall(number, fd, buffer, size); + break; + } + case SYS_flock: { + const auto fd = va_arg(args, long); + const auto operation = va_arg(args, long); + result = ::syscall(number, fd, operation); + break; + } + case SYS_close: { + const auto fd = va_arg(args, long); + result = ::syscall(number, fd); + break; + } + case SYS_sched_yield: + result = ::syscall(number); + break; + default: + break; + } + va_end(args); + return result; +} +} // namespace + TEST(SyscallProtobufLoggerTest, PreservesInterfaceAndWritesProtobuf) { const std::filesystem::path root = std::filesystem::temp_directory_path() / ("calf-syscall-protobuf-tests-" + @@ -29,18 +102,67 @@ TEST(SyscallProtobufLoggerTest, PreservesInterfaceAndWritesProtobuf) { LOG("event=%s", "written"); } + std::array threadPaths; + std::array threads; + for (std::size_t index = 0; index < threads.size(); ++index) { + threads[index] = std::thread([index, &threadPaths]() { + ENABLE_LOGGER(); + Logger logger("worker", "trace.cpp", 20, ::syscall(SYS_gettid), "worker=%zu", index); + threadPaths[index] = logger.getLogFileName(); + }); + } + for (auto &thread : threads) { + thread.join(); + } + EXPECT_EQ(threadPaths[0], path); + EXPECT_EQ(threadPaths[1], path); + std::ifstream input(path, std::ios::binary); const std::string data((std::istreambuf_iterator(input)), std::istreambuf_iterator()); - calf::proto::TraceFile trace; + perfetto::protos::Trace trace; ASSERT_TRUE(trace.ParseFromString(data)); - ASSERT_EQ(trace.records_size(), 3); - EXPECT_EQ(trace.records(0).kind(), calf::proto::TraceRecord::SCOPE_ENTER); - EXPECT_EQ(trace.records(0).args(), "scope=2"); - EXPECT_EQ(trace.records(1).kind(), calf::proto::TraceRecord::EVENT); - EXPECT_EQ(trace.records(1).args(), "event=written"); - EXPECT_EQ(trace.records(2).kind(), calf::proto::TraceRecord::SCOPE_EXIT); - EXPECT_EQ(std::filesystem::path(path).extension(), ".pb"); + ASSERT_EQ(trace.packet_size(), 10); + EXPECT_TRUE(trace.packet(0).has_track_descriptor()); + EXPECT_EQ(trace.packet(1).track_event().type(), + perfetto::protos::TrackEvent::TYPE_SLICE_BEGIN); + EXPECT_EQ(trace.packet(1).track_event().debug_annotations(0).string_value(), "scope=2"); + EXPECT_EQ(trace.packet(2).track_event().type(), + perfetto::protos::TrackEvent::TYPE_INSTANT); + EXPECT_EQ(trace.packet(2).track_event().debug_annotations(0).string_value(), "event=written"); + EXPECT_EQ(trace.packet(3).track_event().type(), + perfetto::protos::TrackEvent::TYPE_SLICE_END); + EXPECT_EQ(std::filesystem::path(path).extension(), ".perfetto-trace"); + EXPECT_EQ(std::filesystem::path(path).filename(), + "calf_" + std::to_string(::getpid()) + ".perfetto-trace"); + EXPECT_EQ(std::filesystem::path(path).parent_path().parent_path(), root); std::filesystem::remove_all(root); } + +TEST(SyscallProtobufLoggerTest, RoutesPerfettoSystemCallsThroughConfiguredHandler) { + handledGetpid = 0; + handledGettid = 0; + handledClockGettime = 0; + SET_CALF_SYSCALL_HANDLER(recordingSyscall); + ENABLE_LOGGER(); + SyscallLogger::resetProtobufState(); + + { + SyscallLoggingSuspender suspended; + Logger logger("disabled", "trace.cpp", 79, ::syscall(SYS_gettid), "ignored"); + } + EXPECT_EQ(handledGetpid.load(), 0); + EXPECT_EQ(handledGettid.load(), 0); + EXPECT_EQ(handledClockGettime.load(), 0); + + { + Logger logger("hook", "trace.cpp", 80, ::syscall(SYS_gettid), "scope"); + logger.log("event"); + } + + EXPECT_GT(handledGetpid.load(), 0); + EXPECT_GT(handledGettid.load(), 0); + EXPECT_EQ(handledClockGettime.load(), 3); + SET_CALF_SYSCALL_HANDLER(::syscall); +}