summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author MarkDacek <dacek@google.com> 2023-02-17 23:24:13 +0000
committer Mark Dacek <dacek@google.com> 2023-03-07 21:57:17 +0000
commit4fbd01953c11b754e3ed71412d248e294fea79a6 (patch)
treecaff6ea62f3d6e67ef8d8239c9b69ef07f06f266
parent88e949945d99a3740286cf8085164ebfd896d8a2 (diff)
Make TRACE_BEGIN_SOONG great again.
Bug: 262724077 Test: m nothing Test: Verify with echo/printf that the values are the same Change-Id: Ie18f726c59ae269bd4f935842c90b3285bd8a156
-rwxr-xr-xbuild_test.bash12
-rwxr-xr-xsoong_ui.bash12
2 files changed, 18 insertions, 6 deletions
diff --git a/build_test.bash b/build_test.bash
index eda4bebe1..defdd82a8 100755
--- a/build_test.bash
+++ b/build_test.bash
@@ -34,9 +34,15 @@ SKIPPED_PRODUCTS=(
aosp_riscv64
)
-# To track how long we took to startup. %N isn't supported on Darwin, but
-# that's detected in the Go code, which skips calculating the startup time.
-export TRACE_BEGIN_SOONG=$(date +%s%N)
+# To track how long we took to startup.
+case $(uname -s) in
+ Darwin)
+ export TRACE_BEGIN_SOONG=`$T/prebuilts/build-tools/path/darwin-x86/date +%s%3N`
+ ;;
+ *)
+ export TRACE_BEGIN_SOONG=$(date +%s%N)
+ ;;
+esac
# Remove BUILD_NUMBER so that incremental builds on build servers don't
# re-read makefiles every time.
diff --git a/soong_ui.bash b/soong_ui.bash
index 7bddb586b..1d027c4c7 100755
--- a/soong_ui.bash
+++ b/soong_ui.bash
@@ -14,9 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# To track how long we took to startup. %N isn't supported on Darwin, but
-# that's detected in the Go code, which skips calculating the startup time.
-export TRACE_BEGIN_SOONG=$(date +%s%N)
+# To track how long we took to startup.
+case $(uname -s) in
+ Darwin)
+ export TRACE_BEGIN_SOONG=`$T/prebuilts/build-tools/path/darwin-x86/date +%s%3N`
+ ;;
+ *)
+ export TRACE_BEGIN_SOONG=$(date +%s%N)
+ ;;
+esac
source $(cd $(dirname $BASH_SOURCE) &> /dev/null && pwd)/../make/shell_utils.sh
require_top