:eprof not found in phoenix app

I want to use :eprof in my phoenix app, but it says (module :eprof is not available)

I tried to add :observer to extra_applications in my mix.exs but it doesn’t change anything. I already have :runtime_tools app.

I start my app with iex -S mix phx.server.

If I start just iex I can call :eprof.

Version:

Erlang/OTP 27 [erts-15.1.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.18.2) 

The :eprof module is part of the :tools application (see eprof — tools v4.1.1). So :tools is the application you want to add to extra_applications if your application generally needs access to eprof. If you just need it on occasion you can also use Mix.ensure_application!/1.

3 Likes

Thanks, I didn’t realize that :tools was the name of the app.

Afaik some of these modules had been shuffled around a bit in recent OTP version – not sure when exactly. E.g. :observer used to be in :runtime_tools instead of its own application.

1 Like