From 8efba1db81fc1294114cea70de0df53f4d4ab9a4 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Mon, 23 Sep 2024 10:23:37 -0400
Subject: Use Lua command-line args to make frame_profile_quit.lua generic.

Now the location to which to teleport and the camera focus point can both be
specified by the caller, in this case the frame_profile bash script.
---
 scripts/perf/frame_profile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'scripts/perf')

diff --git a/scripts/perf/frame_profile b/scripts/perf/frame_profile
index 0a4e0a74ff..dcbb954536 100755
--- a/scripts/perf/frame_profile
+++ b/scripts/perf/frame_profile
@@ -6,5 +6,5 @@ then
     exe="$(ls "$exe/Contents/MacOS/Second Life "*)"
 fi
 
-"$exe" --autologin --luafile frame_profile_quit.lua \
+"$exe" --autologin --luafile 'frame_profile_quit.lua 228 232 26' \
      http://maps.secondlife.com/secondlife/Bug%20Island/220/224/27
-- 
cgit v1.2.3


From dc5c10f6b74793cab5c188e6bec24ab28b336693 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Mon, 23 Sep 2024 10:46:54 -0400
Subject: Make frame_profile bash script find its workarea's viewer build.

---
 scripts/perf/frame_profile | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

(limited to 'scripts/perf')

diff --git a/scripts/perf/frame_profile b/scripts/perf/frame_profile
index dcbb954536..84eb1166d5 100755
--- a/scripts/perf/frame_profile
+++ b/scripts/perf/frame_profile
@@ -1,6 +1,39 @@
 #!/usr/bin/env bash
 
 exe="$1"
+
+if [[ -z "$exe" ]]
+then
+    # this script lives in scripts/perf
+    base="$(dirname "$0")/../.."
+    case $OSTYPE in
+        darwin*)
+            # Don't assume a build type (e.g. RelWithDebInfo). Collect all of
+            # both, and pick the most recent build.
+            exe="$(ls -t "$base"/build-darwin-x86_64/newview/*/"Second Life"*.app/Contents/MacOS/"Second Life"* | head -1)"
+            ;;
+
+        cygwin)
+            exe="$(ls -t "$base"/build-*/newview/*/secondlife-bin.exe | head -1)"
+            ;;
+
+        linux-gnu)
+            exe="$(ls -t "$base"/build-linux-*/newview/packaged/secondlife | head -1)"
+            ;;
+
+        *)
+            stderr "Unknown platform $OSTYPE"
+            exit 1
+            ;;
+    esac
+fi
+
+if [ -z "$exe" ]
+then stderr "No viewer package build found"
+     exit 1
+fi
+
+# If a Mac user specified the .app bundle itself, dig in for the executable.
 if [[ "$OSTYPE" == darwin* && -d "$exe" && "$exe" == *.app ]]
 then
     exe="$(ls "$exe/Contents/MacOS/Second Life "*)"
-- 
cgit v1.2.3