Skip to content

@on_load and @on_definition callbacks do not emit trace events #14427

Closed
@lukaszsamson

Description

@lukaszsamson

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Elixir 1.18.3 (compiled with Erlang/OTP 27)

Operating system

any

Current behavior

With an example tracer

defmodule MyTracer do
  def trace(event, env) do
    dbg({env.file, env.line})
    dbg(event)
    :ok
  end
end
Code.put_compiler_option(:tracers, [MyTracer])

compile example code from https://hexdocs.pm/elixir/1.18.3/Module.html#module-on_definition and https://hexdocs.pm/elixir/1.18.3/Module.html#module-on_load

No traces for the functions given in @on_load and @on_definition attributes are emitted.

Expected behavior

I would expect @on_load to emit :local_function (or :remote_function) and @on_definition to emit :remote_function events. @before_compile, @after_compile and @after_verify correctly emit :remote_(function|macro)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions