@@ -45,7 +45,7 @@ defmodule Mix.Tasks.Profile.Tprof do
4545 * `--calls` - filters out any results with a call count lower than this
4646 * `--time` - filters out any results that took lower than specified (in µs), the `type` needs to be `time`
4747 * `--memory` - filters out any results that used less memory than specified (in words), the `type` needs to be `memory`
48- * `--sort` - sorts the results by `calls` or by the value of `type` (default: the value of `type`)
48+ * `--sort` - sorts the results by `calls`, `per_call` or by the value of `type` (default: the value of `type`)
4949 * `--eval`, `-e` - evaluates the given code
5050 * `--require`, `-r` - requires pattern before running the command
5151 * `--parallel`, `-p` - makes all requires parallel
@@ -214,6 +214,7 @@ defmodule Mix.Tasks.Profile.Tprof do
214214 defp parse_opt ( { :sort , "time" } ) , do: { :sort , :time }
215215 defp parse_opt ( { :sort , "calls" } ) , do: { :sort , :calls }
216216 defp parse_opt ( { :sort , "memory" } ) , do: { :sort , :memory }
217+ defp parse_opt ( { :sort , "per_call" } ) , do: { :sort , :per_call }
217218 defp parse_opt ( { :sort , other } ) , do: Mix . raise ( "Invalid sort option: #{ other } " )
218219 defp parse_opt ( other ) , do: other
219220
@@ -235,7 +236,7 @@ defmodule Mix.Tasks.Profile.Tprof do
235236 `type` needs to be `:time`
236237 * `:memory` - filters out any results that used less memory than specified (in words),
237238 `type` needs to be `:memory`
238- * `:sort` - sort the results by `:calls` or by the value of `type`
239+ * `:sort` - sort the results by `:calls`, `:per_call` or by the value of `type`
239240 (default: the value of `type`)
240241 * `:warmup` - if the code should be warmed up before profiling (default: `true`)
241242 * `:set_on_spawn` - if newly spawned processes should be measured (default: `true`)
@@ -267,6 +268,9 @@ defmodule Mix.Tasks.Profile.Tprof do
267268 :calls ->
268269 :calls
269270
271+ :per_call ->
272+ :measurement_per_call
273+
270274 ^ type ->
271275 :measurement
272276
0 commit comments