It seems impossible to get the filename in the self-defined hook function (lua-5.3.5).
Although there is a "source" field of the structure named lua_D
lua_D