• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# Copyright (C) 2025 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# ahat-test-dump-gen.sh.in is an input template for a script to re-generate
18# the test dump hprof files. The files should be regenerated whenever there
19# are changes to src/test-dump/*.
20#
21# To regenerate the test dump files:
22# $ m ahat-test-dump-gen
23# $ croot
24# $ bash out/soong/.intermediates/art/tools/ahat/ahat-test-dump-gen/android_common/gen/ahat-test-dump-gen.sh
25#
26# The outputs are placed in the etc/ directory where they can be checked in to
27# be used by the ahat tests. Note: You'll see a lot of error messages from
28# running the script that should be safe to ignore, as long as you see
29# etc/test-dump.hprof and etc/test-dump-base.hprof being generated.
30
31AHAT_ETC_DIR=${ANDROID_BUILD_TOP}/art/tools/ahat/etc
32AHAT_TEST_DUMP_JAR=@AHAT_TEST_DUMP_JAR@
33AHAT_TEST_DUMP_MAP=$(dirname ${AHAT_TEST_DUMP_JAR})/../proguard_dictionary
34
35# Build required dependencies.
36m build-art-host libahat-test-jni
37
38
39# test-dump.hprof
40art --no-compile -cp ${AHAT_TEST_DUMP_JAR} Main ${AHAT_ETC_DIR}/test-dump.hprof
41
42# test-dump-base.hprof
43art --no-compile -cp ${AHAT_TEST_DUMP_JAR} Main ${AHAT_ETC_DIR}/test-dump-base.hprof --base
44
45# test-dump.map
46cp ${AHAT_TEST_DUMP_MAP} ${AHAT_ETC_DIR}/test-dump.map
47