Stratus3D/eflambe

Eflambé stuck on a simple example

Zabrane opened this issue · 2 comments

Hi @Stratus3D

I'm trying this very simple example using eflambé from master:

> application:ensure_all_started(eflambe).
{ok,[eflambe]}
> eflambe:capture({lists, seq, [1, 10]}, 1, [{open, speedscope}]).

Nothing happens after that. The call is stuck forever. This happens on both Linux and macOS.

My config:

%% Mac
$ erl
Erlang/OTP 24 [erts-12.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

$ sw_vers 
ProductName:    macOS
ProductVersion: 11.6
BuildVersion:   20G165

%% Linux
$ erl %% Linux
Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

Help appreciated.

@Zabrane currently eflambe:capture/3 is block call that waits for something else running on your Erlang node to invoke the lists:seq/2 function. The third element in the tuple for the first argument needs to be the arity, not the arguments themselves. The correct arguments to this function would be:

> eflambe:capture({lists, seq, 2}, 1, [{open, speedscope}]).

However, if you just want to profile lists:seq/2 directly, you can use the eflambe:apply/2 function, and pass in the arguments:

> eflambe:apply({lists, seq, [1, 10]}, [{open, speedscope}]).
Successful finished trace
Output filename: ./1642802698322929-eflambe-output.bggg
[1,2,3,4,5,6,7,8,9,10]

I am going to commit a fix so the third element in the module function arity tuple is validated to be an integer to catch invalid calls.

Hope this helps! Let me know if you have any other issues or suggestions.

@Stratus3D amazing, thanks for the clarifications.