@@ -56,6 +56,7 @@ defmodule Mix.Tasks.Profile.Tprof do
5656 * `--no-deps-check` - does not check dependencies
5757 * `--no-archives-check` - does not check archives
5858 * `--no-halt` - does not halt the system after running the command
59+ * `--no-set-on-spawn` - does not profile spawned processes
5960 * `--no-start` - does not start applications after compilation
6061 * `--no-elixir-version-check` - does not check the Elixir version from mix.exs
6162
@@ -159,7 +160,8 @@ defmodule Mix.Tasks.Profile.Tprof do
159160 archives_check: :boolean ,
160161 warmup: :boolean ,
161162 elixir_version_check: :boolean ,
162- parallel_require: :keep
163+ parallel_require: :keep ,
164+ set_on_spawn: :boolean
163165 ]
164166
165167 @ aliases [
@@ -171,7 +173,7 @@ defmodule Mix.Tasks.Profile.Tprof do
171173
172174 @ impl true
173175 def run ( args ) do
174- { opts , head } = OptionParser . parse_head !( args , aliases: @ aliases , strict: @ switches )
176+ { opts , head } = parse !( args )
175177 Mix.Task . reenable ( "profile.tprof" )
176178
177179 Mix.Tasks.Run . run (
@@ -183,9 +185,13 @@ defmodule Mix.Tasks.Profile.Tprof do
183185 )
184186 end
185187
186- defp profile_code ( code_string , opts ) do
187- opts = Enum . map ( opts , & parse_opt / 1 )
188+ @ doc false
189+ def parse! ( args ) do
190+ { opts , args } = OptionParser . parse! ( args , aliases: @ aliases , strict: @ switches )
191+ { Enum . map ( opts , & parse_opt / 1 ) , args }
192+ end
188193
194+ defp profile_code ( code_string , opts ) do
189195 content =
190196 quote do
191197 unquote ( __MODULE__ ) . profile (
0 commit comments