Add --disable-fork-teardown to script.

Bug: 153893612
Change-Id: I2cfd5f8eac2b364434639233d55731cc0dbd98e0
diff --git a/tools/heap_profile b/tools/heap_profile
index f16251d..eaac620 100755
--- a/tools/heap_profile
+++ b/tools/heap_profile
@@ -223,6 +223,11 @@
       "rather than at the time of the dump.",
       action="store_true")
   parser.add_argument(
+      "--disable-fork-teardown",
+      help="Do not tear down client in forks. This can be useful for programs "
+      "that use vfork. Android 11+ only.",
+      action="store_true")
+  parser.add_argument(
       "--simpleperf",
       action="store_true",
       help="Get simpleperf profile of heapprofd. This is "
@@ -280,6 +285,8 @@
     target_cfg += "no_running: true\n"
   if args.dump_at_max:
     target_cfg += "dump_at_max: true\n"
+  if args.disable_fork_teardown:
+    target_cfg += "disable_fork_teardown: true\n"
   if args.pid:
     for pid in args.pid.split(','):
       try: