Skip to content

Commit

Permalink
Add message_queue tracing events to android_track_event
Browse files Browse the repository at this point in the history
As part of running tools/gen_c_protos, it generated c
headers for other protos.

Test: Manual
Change-Id: Ic761d2c6d1f119e0d48a32f148f1f2ef7965120e
  • Loading branch information
zezeozue committed Feb 12, 2025
1 parent 8158b5e commit 687fade
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 7 deletions.
1 change: 1 addition & 0 deletions include/perfetto/public/protos/common/builtin_clock.pzc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ PERFETTO_PB_ENUM(perfetto_protos_BuiltinClock){
PERFETTO_PB_ENUM_ENTRY(perfetto_protos_BUILTIN_CLOCK_MONOTONIC_RAW) = 5,
PERFETTO_PB_ENUM_ENTRY(perfetto_protos_BUILTIN_CLOCK_BOOTTIME) = 6,
PERFETTO_PB_ENUM_ENTRY(perfetto_protos_BUILTIN_CLOCK_TSC) = 9,
PERFETTO_PB_ENUM_ENTRY(perfetto_protos_BUILTIN_CLOCK_PERF) = 10,
PERFETTO_PB_ENUM_ENTRY(perfetto_protos_BUILTIN_CLOCK_MAX_ID) = 63,
};

Expand Down
30 changes: 30 additions & 0 deletions include/perfetto/public/protos/config/data_source_config.pzc.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ PERFETTO_PB_MSG_DECL(perfetto_protos_AndroidPowerConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_AndroidSdkSyspropGuardConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_AndroidSystemPropertyConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromeConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromiumHistogramSamplesConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromiumSystemMetricsConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_EtwConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_FtraceConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_GpuCounterConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_GpuRenderStagesConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_HeapprofdConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_InodeFileConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_InterceptorConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_JavaHprofConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_KernelWakelocksConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_NetworkPacketTraceConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_PackagesListConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_PerfEventConfig);
Expand All @@ -55,6 +59,7 @@ PERFETTO_PB_MSG_DECL(perfetto_protos_TestConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_TrackEventConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_V8Config);
PERFETTO_PB_MSG_DECL(perfetto_protos_VulkanMemoryConfig);
PERFETTO_PB_MSG_DECL(perfetto_protos_WindowManagerConfig);

PERFETTO_PB_ENUM_IN_MSG(perfetto_protos_DataSourceConfig, SessionInitiator){
PERFETTO_PB_ENUM_IN_MSG_ENTRY(perfetto_protos_DataSourceConfig,
Expand Down Expand Up @@ -249,6 +254,31 @@ PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
perfetto_protos_PixelModemConfig,
pixel_modem_config,
129);
PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
MSG,
perfetto_protos_WindowManagerConfig,
windowmanager_config,
130);
PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
MSG,
perfetto_protos_ChromiumSystemMetricsConfig,
chromium_system_metrics,
131);
PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
MSG,
perfetto_protos_KernelWakelocksConfig,
kernel_wakelocks_config,
132);
PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
MSG,
perfetto_protos_GpuRenderStagesConfig,
gpu_renderstages_config,
133);
PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
MSG,
perfetto_protos_ChromiumHistogramSamplesConfig,
chromium_histogram_samples,
134);
PERFETTO_PB_FIELD(perfetto_protos_DataSourceConfig,
STRING,
const char*,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@
#include "perfetto/public/pb_macros.h"
#include "perfetto/public/protos/trace/track_event/track_event.pzc.h"

PERFETTO_PB_MSG(perfetto_protos_AndroidMessageQueue);
PERFETTO_PB_FIELD(perfetto_protos_AndroidMessageQueue,
STRING,
const char*,
sending_thread_name,
1);
PERFETTO_PB_FIELD(perfetto_protos_AndroidMessageQueue,
STRING,
const char*,
receiving_thread_name,
2);
PERFETTO_PB_FIELD(perfetto_protos_AndroidMessageQueue,
VARINT,
int32_t,
message_code,
3);
PERFETTO_PB_FIELD(perfetto_protos_AndroidMessageQueue,
VARINT,
uint64_t,
message_delay_ms,
4);

PERFETTO_PB_EXTENSION_FIELD(perfetto_protos_AndroidTrackEvent,
perfetto_protos_TrackEvent,
STRING,
Expand All @@ -44,4 +66,10 @@ PERFETTO_PB_EXTENSION_FIELD(perfetto_protos_AndroidTrackEvent,
const char*,
apex_name,
2003);
PERFETTO_PB_EXTENSION_FIELD(perfetto_protos_AndroidTrackEvent,
perfetto_protos_TrackEvent,
MSG,
perfetto_protos_AndroidMessageQueue,
message_queue,
2004);
#endif // INCLUDE_PERFETTO_PUBLIC_PROTOS_TRACE_ANDROID_ANDROID_TRACK_EVENT_PZC_H_
17 changes: 17 additions & 0 deletions include/perfetto/public/protos/trace/trace_packet.pzc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PERFETTO_PB_MSG_DECL(perfetto_protos_AndroidGameInterventionList);
PERFETTO_PB_MSG_DECL(perfetto_protos_AndroidLogPacket);
PERFETTO_PB_MSG_DECL(perfetto_protos_AndroidSystemProperty);
PERFETTO_PB_MSG_DECL(perfetto_protos_BatteryCounters);
PERFETTO_PB_MSG_DECL(perfetto_protos_BluetoothTraceEvent);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromeBenchmarkMetadata);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromeEventBundle);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromeMetadataPacket);
Expand All @@ -54,6 +55,7 @@ PERFETTO_PB_MSG_DECL(perfetto_protos_HeapGraph);
PERFETTO_PB_MSG_DECL(perfetto_protos_InitialDisplayState);
PERFETTO_PB_MSG_DECL(perfetto_protos_InodeFileMap);
PERFETTO_PB_MSG_DECL(perfetto_protos_InternedData);
PERFETTO_PB_MSG_DECL(perfetto_protos_KernelWakelockData);
PERFETTO_PB_MSG_DECL(perfetto_protos_LayersSnapshotProto);
PERFETTO_PB_MSG_DECL(perfetto_protos_MemoryTrackerSnapshot);
PERFETTO_PB_MSG_DECL(perfetto_protos_ModuleSymbols);
Expand Down Expand Up @@ -511,6 +513,21 @@ PERFETTO_PB_FIELD(perfetto_protos_TracePacket,
perfetto_protos_PixelModemTokenDatabase,
pixel_modem_token_database,
111);
PERFETTO_PB_FIELD(perfetto_protos_TracePacket,
MSG,
perfetto_protos_Trigger,
clone_snapshot_trigger,
113);
PERFETTO_PB_FIELD(perfetto_protos_TracePacket,
MSG,
perfetto_protos_BluetoothTraceEvent,
bluetooth_trace_event,
114);
PERFETTO_PB_FIELD(perfetto_protos_TracePacket,
MSG,
perfetto_protos_KernelWakelockData,
kernel_wakelock_data,
115);
PERFETTO_PB_FIELD(perfetto_protos_TracePacket,
MSG,
perfetto_protos_TestEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ PERFETTO_PB_MSG_DECL(perfetto_protos_CounterDescriptor);
PERFETTO_PB_MSG_DECL(perfetto_protos_ProcessDescriptor);
PERFETTO_PB_MSG_DECL(perfetto_protos_ThreadDescriptor);

PERFETTO_PB_ENUM_IN_MSG(perfetto_protos_TrackDescriptor, ChildTracksOrdering){
PERFETTO_PB_ENUM_IN_MSG_ENTRY(perfetto_protos_TrackDescriptor, UNKNOWN) = 0,
PERFETTO_PB_ENUM_IN_MSG_ENTRY(perfetto_protos_TrackDescriptor,
LEXICOGRAPHIC) = 1,
PERFETTO_PB_ENUM_IN_MSG_ENTRY(perfetto_protos_TrackDescriptor,
CHRONOLOGICAL) = 2,
PERFETTO_PB_ENUM_IN_MSG_ENTRY(perfetto_protos_TrackDescriptor,
EXPLICIT) = 3,
};

PERFETTO_PB_MSG(perfetto_protos_TrackDescriptor);
PERFETTO_PB_FIELD(perfetto_protos_TrackDescriptor, VARINT, uint64_t, uuid, 1);
PERFETTO_PB_FIELD(perfetto_protos_TrackDescriptor,
Expand Down Expand Up @@ -83,5 +93,15 @@ PERFETTO_PB_FIELD(perfetto_protos_TrackDescriptor,
bool,
disallow_merging_with_system_tracks,
9);
PERFETTO_PB_FIELD(perfetto_protos_TrackDescriptor,
VARINT,
enum perfetto_protos_TrackDescriptor_ChildTracksOrdering,
child_ordering,
11);
PERFETTO_PB_FIELD(perfetto_protos_TrackDescriptor,
VARINT,
int32_t,
sibling_order_rank,
12);

#endif // INCLUDE_PERFETTO_PUBLIC_PROTOS_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PZC_H_
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ PERFETTO_PB_MSG_DECL(perfetto_protos_ChromeUserEvent);
PERFETTO_PB_MSG_DECL(perfetto_protos_ChromeWindowHandleEventInfo);
PERFETTO_PB_MSG_DECL(perfetto_protos_DebugAnnotation);
PERFETTO_PB_MSG_DECL(perfetto_protos_LogMessage);
PERFETTO_PB_MSG_DECL(perfetto_protos_PixelModemEventInsight);
PERFETTO_PB_MSG_DECL(perfetto_protos_Screenshot);
PERFETTO_PB_MSG_DECL(perfetto_protos_SourceLocation);
PERFETTO_PB_MSG_DECL(perfetto_protos_TaskExecution);
Expand Down Expand Up @@ -251,11 +250,6 @@ PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
perfetto_protos_Screenshot,
screenshot,
50);
PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
MSG,
perfetto_protos_PixelModemEventInsight,
pixel_modem_event_insight,
51);
PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
MSG,
perfetto_protos_SourceLocation,
Expand Down
18 changes: 17 additions & 1 deletion protos/perfetto/trace/android/android_track_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,31 @@ import public "protos/perfetto/trace/track_event/track_event.proto";

package perfetto.protos;

// Information about sending and receiving messages on threads with
// Looper and MessageQueue.
message AndroidMessageQueue {
// Thread name sending a message on the MessageQueue.
optional string sending_thread_name = 1;
// Thread name receiving a message on the MessageQueue.
optional string receiving_thread_name = 2;
// User-defined message code for messages in the MessageQueue.
optional int32 message_code = 3;
// Intended delay in millis before a message on the MessageQueue is executed.
optional uint64 message_delay_ms = 4;
}

message AndroidTrackEvent {
// Usable range: [2001, 2999]
// Next id: 2004
// Next id: 2005
extend TrackEvent {
// The name of a binder service.
optional string binder_service_name = 2001;
// The name of a binder interface.
optional string binder_interface_name = 2002;
// The name of an apex.
optional string apex_name = 2003;

// MessageQueue messages.
optional AndroidMessageQueue message_queue = 2004;
}
}
10 changes: 10 additions & 0 deletions src/shared_lib/test/protos/test_messages.pzc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ PERFETTO_PB_ENUM(protozero_test_protos_BigEnum){
PERFETTO_PB_ENUM_ENTRY(protozero_test_protos_END) = 100500,
};

PERFETTO_PB_ENUM(protozero_test_protos_VeryNegativeEnum){
PERFETTO_PB_ENUM_ENTRY(protozero_test_protos_DEF) = 0,
PERFETTO_PB_ENUM_ENTRY(protozero_test_protos_VAL) = -2147483647 - 1,
};

PERFETTO_PB_ENUM_IN_MSG(protozero_test_protos_TestVersioning_V2, Enumz_V2){
PERFETTO_PB_ENUM_IN_MSG_ENTRY(protozero_test_protos_TestVersioning_V2,
ONE) = 1,
Expand Down Expand Up @@ -477,6 +482,11 @@ PERFETTO_PB_FIELD(protozero_test_protos_EveryField,
enum protozero_test_protos_BigEnum,
big_enum,
53);
PERFETTO_PB_FIELD(protozero_test_protos_EveryField,
VARINT,
enum protozero_test_protos_VeryNegativeEnum,
very_negative_enum,
54);
PERFETTO_PB_FIELD(protozero_test_protos_EveryField,
STRING,
const char*,
Expand Down

0 comments on commit 687fade

Please sign in to comment.