Skip to content

Commit

Permalink
Merge "Add AndroidProcessMetadata to gc metric." into main
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-uhler authored and Gerrit Code Review committed Dec 9, 2024
2 parents 1a0d053 + 3afd5fd commit b4c1dfa
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ syntax = "proto2";

package perfetto.protos;

import "protos/perfetto/metrics/android/process_metadata.proto";

message AndroidGarbageCollectionUnaggMetric {
message GarbageCollectionEvent {
// Name of thread running garbage collection.
Expand Down Expand Up @@ -58,6 +60,8 @@ message AndroidGarbageCollectionUnaggMetric {
optional int64 tid = 18;
// monotonic duration of event.
optional int64 gc_monotonic_dur = 19;
// Details about the process (uid, version, etc)
optional AndroidProcessMetadata process = 20;
}
repeated GarbageCollectionEvent gc_events = 1;
}
}
3 changes: 3 additions & 0 deletions protos/perfetto/metrics/perfetto_merged_metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,12 @@ message AndroidGarbageCollectionUnaggMetric {
optional int64 tid = 18;
// monotonic duration of event.
optional int64 gc_monotonic_dur = 19;
// Details about the process (uid, version, etc)
optional AndroidProcessMetadata process = 20;
}
repeated GarbageCollectionEvent gc_events = 1;
}

// End of protos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto

// Begin of protos/perfetto/metrics/android/app_process_starts_metric.proto
Expand Down
35 changes: 18 additions & 17 deletions python/perfetto/trace_processor/metrics.descriptor
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,23 @@ bindAppDur

intent_dur (R intentDur
total_dur (RtotalDur
�
Mprotos/perfetto/metrics/android/android_garbage_collection_unagg_metric.protoperfetto.protos"�
�
6protos/perfetto/metrics/android/process_metadata.protoperfetto.protos"�
AndroidProcessMetadata
name ( Rname
uid (RuidI
package ( 2/.perfetto.protos.AndroidProcessMetadata.PackageRpackage
pid (Rpidv
Package!
package_name ( R packageName(
apk_version_code (RapkVersionCode

debuggable (R
debuggableJJJJJ
�
Mprotos/perfetto/metrics/android/android_garbage_collection_unagg_metric.protoperfetto.protos6protos/perfetto/metrics/android/process_metadata.proto"�
#AndroidGarbageCollectionUnaggMetrich
gc_events ( 2K.perfetto.protos.AndroidGarbageCollectionUnaggMetric.GarbageCollectionEventRgcEvents�
gc_events ( 2K.perfetto.protos.AndroidGarbageCollectionUnaggMetric.GarbageCollectionEventRgcEvents�
GarbageCollectionEvent
thread_name ( R
threadName!
Expand All @@ -138,7 +151,8 @@ gc_int_dur (RgcIntDur
gc_ts (RgcTs
pid (Rpid
tid (Rtid(
gc_monotonic_dur (RgcMonotonicDur
gc_monotonic_dur (RgcMonotonicDurA
process ( 2'.perfetto.protos.AndroidProcessMetadataRprocess
�
8protos/perfetto/metrics/android/android_boot_unagg.protoperfetto.protos?protos/perfetto/metrics/android/app_process_starts_metric.protoMprotos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto"�
AndroidBootUnaggv
Expand Down Expand Up @@ -194,19 +208,6 @@ Rprotos/perfetto/metrics/android/sysui_update_notif_on_ui_mode_changed_metric.pr
name ( Rname
dur_ms (RdurMs
dur_ns (RdurNs
�
6protos/perfetto/metrics/android/process_metadata.protoperfetto.protos"�
AndroidProcessMetadata
name ( Rname
uid (RuidI
package ( 2/.perfetto.protos.AndroidProcessMetadata.PackageRpackage
pid (Rpidv
Package!
package_name ( R packageName(
apk_version_code (RapkVersionCode

debuggable (R
debuggableJJJJJ
Cprotos/perfetto/metrics/android/android_frame_timeline_metric.protoperfetto.protos6protos/perfetto/metrics/android/process_metadata.proto"�
AndroidFrameTimelineMetric!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
-- limitations under the License.
--

SELECT RUN_METRIC('android/process_metadata.sql');

INCLUDE PERFETTO MODULE android.garbage_collection;
INCLUDE PERFETTO MODULE android.suspend;

Expand Down Expand Up @@ -41,7 +43,10 @@ SELECT AndroidGarbageCollectionUnaggMetric(
'gc_ts', gc_ts,
'tid', tid,
'pid', pid,
'gc_monotonic_dur', _extract_duration_without_suspend(gc_ts, gc_dur)
)) FROM android_garbage_collection_events
'gc_monotonic_dur', _extract_duration_without_suspend(gc_ts, gc_dur),
'process', metadata
))
FROM android_garbage_collection_events
LEFT JOIN process_metadata using (upid)
)
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ android_garbage_collection_unagg {
tid: 3185
pid: 3162
gc_monotonic_dur: 666169475
process {
name: "com.google.android.deskclock"
uid: 10182
pid: 3162
}
}
gc_events {
thread_name: "HeapTaskDaemon"
Expand All @@ -40,6 +45,11 @@ android_garbage_collection_unagg {
tid: 2534
pid: 2523
gc_monotonic_dur: 58870646
process {
name: "com.google.android.apps.nexuslauncher"
uid: 10248
pid: 2523
}
}
gc_events {
thread_name: "HeapTaskDaemon"
Expand All @@ -56,6 +66,11 @@ android_garbage_collection_unagg {
tid: 2917
pid: 2909
gc_monotonic_dur: 168393585
process {
name: "com.google.android.apps.wellbeing"
uid: 10173
pid: 2909
}
}
gc_events {
thread_name: "HeapTaskDaemon"
Expand All @@ -72,5 +87,10 @@ android_garbage_collection_unagg {
tid: 2865
pid: 2855
gc_monotonic_dur: 148630605
process {
name: "com.google.android.euicc"
uid: 10141
pid: 2855
}
}
}
}

0 comments on commit b4c1dfa

Please sign in to comment.