Merge "Fix incorrect GCA RSS memory calculation" into main
diff --git a/src/trace_processor/metrics/sql/android/android_camera.sql b/src/trace_processor/metrics/sql/android/android_camera.sql
index 1d54753..c5f2c24 100644
--- a/src/trace_processor/metrics/sql/android/android_camera.sql
+++ b/src/trace_processor/metrics/sql/android/android_camera.sql
@@ -28,8 +28,11 @@
 SELECT ts, dur, rss_val AS gca_rss_val
 FROM rss_and_swap_span
 JOIN (
-  SELECT max(start_ts), upid
+  SELECT max(rss), upid
   FROM process
+  JOIN (
+    SELECT max(rss_val) as rss, upid FROM rss_and_swap_span GROUP BY upid
+  ) USING (upid)
   WHERE name GLOB '*GoogleCamera'
     OR name GLOB '*googlecamera.fishfood'
     OR name GLOB '*GoogleCameraEng'