@@ -45,7 +45,7 @@ defmodule Mix.Tasks.Profile.Tprof do
45
45
* `--calls` - filters out any results with a call count lower than this
46
46
* `--time` - filters out any results that took lower than specified (in µs), the `type` needs to be `time`
47
47
* `--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`)
49
49
* `--eval`, `-e` - evaluates the given code
50
50
* `--require`, `-r` - requires pattern before running the command
51
51
* `--parallel`, `-p` - makes all requires parallel
@@ -214,6 +214,7 @@ defmodule Mix.Tasks.Profile.Tprof do
214
214
defp parse_opt ( { :sort , "time" } ) , do: { :sort , :time }
215
215
defp parse_opt ( { :sort , "calls" } ) , do: { :sort , :calls }
216
216
defp parse_opt ( { :sort , "memory" } ) , do: { :sort , :memory }
217
+ defp parse_opt ( { :sort , "per_call" } ) , do: { :sort , :per_call }
217
218
defp parse_opt ( { :sort , other } ) , do: Mix . raise ( "Invalid sort option: #{ other } " )
218
219
defp parse_opt ( other ) , do: other
219
220
@@ -235,7 +236,7 @@ defmodule Mix.Tasks.Profile.Tprof do
235
236
`type` needs to be `:time`
236
237
* `:memory` - filters out any results that used less memory than specified (in words),
237
238
`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`
239
240
(default: the value of `type`)
240
241
* `:warmup` - if the code should be warmed up before profiling (default: `true`)
241
242
* `:set_on_spawn` - if newly spawned processes should be measured (default: `true`)
@@ -267,6 +268,9 @@ defmodule Mix.Tasks.Profile.Tprof do
267
268
:calls ->
268
269
:calls
269
270
271
+ :per_call ->
272
+ :measurement_per_call
273
+
270
274
^ type ->
271
275
:measurement
272
276
0 commit comments