View Source edbg_sup_trees (edbg v0.9.1)

Explore all supervision trees

Display all supervisors we have found in our system.

Each line has a number that can be referenced, where the S mean that the process is a supervisor.

     (abc@ozzy)1> edbg:suptrees().
     1:S kernel_safe_sup <0.74.0> []
     2:S kernel_sup <0.49.0> [erl_distribution]
    23:S logger_sup <0.75.0> []
    27:S net_sup <0.57.0> []
  
    (h)elp e(x)pand [<N>] (s)hrink [<N>]
    (p)rocess info [<N> [<M>]] (b)acktrace [<N> [<M>]]
    (r)efresh (q)uit

Note the short help text; we will now go through what those commands does.

First let us expand supervisor 23 to see its children. Note the indentation and the G which mean that the process is a gen_server process, where W mean some other worker process.

   suptrees> x 23
   1:S kernel_safe_sup <0.74.0> []
   2:S kernel_sup <0.49.0> [erl_distribution]
   23:S logger_sup <0.75.0> []
   24:G   default <0.79.0> [logger_h_common]
   25:G   logger_proxy <0.77.0> [logger_proxy]
   26:G   logger_handler_watcher <0.76.0> [logger_handler_watcher]
   27:S net_sup <0.57.0> []

Print the process-info of worker 24 Note the list of linked processes.

     suptrees> p 24
  
     === Process Info: <0.79.0>
     [{registered_name,logger_std_h_default},
     {current_function,{gen_server,loop,7}},
     {initial_call,{proc_lib,init_p,5}},
     {status,waiting},
     {message_queue_len,0},
     {links,[<0.75.0>,<0.80.0>]},
     {dictionary,
          [{'$ancest...snip...

We can also print the process info of any linked processes. Let us print the process-info of the second process in the links list.

     suptrees> p 24 2
  
     === Process Info: <0.80.0>
     [{current_function,{logger_std_h,file_ctrl_loop,1}},
     {initial_call,{erlang,apply,2}},
     {status,waiting},
     {message_queue_len,0},
     {links,[<0.79.0>]},
     {diction.....snip...

We can continue like this...

     suptrees> p 24 2 1
  
     === Process Info: <0.79.0>
     [{registered_name,logger_std_h_default},
     {current_function,{gen_server,loop,7}},
     {initial_call,{proc_lib,init_p,5}},
     {status,waiting},
     {message_queue_len,0},
     {links,[<0.75.0>,<0.80.0>]},
     {dictionary,....snip...

We can also print the process backtrace in the same way:

     suptrees> b 24 2
      ...snip...

We can also setup a monitor for a process:

     suptrees> m 161 2
  
     Monitoring: <0.343.0>
  
     ...do stuff, crunch...
  
     Monitor got DOWN from: <0.343.0> , Reason: shutdown

We can print the state of a gen_server. Let say we have the following:

     1:S kernel_safe_sup <0.74.0> []
     2:S kernel_sup <0.49.0> [erl_distribution]
     3:S   logger_sup <0.75.0> []
     4:G     default <0.79.0> [logger_h_common]
      ...snip...

Now print the state of the <0.79.0> gen_server process.

     suptrees> g 4
  
     Process State: <0.79.0>
     #{burst_limit_enable => true,burst_limit_max_count => 500,
     burst_limit_window_time => 1000,burst_msg_count => 0,
      ...snip..

You can start tracing on a process like this:

     suptrees> ts 4

You stop the tracing like this:

     suptrees> te

You show the trace output (like with edbg:file/0 ) like this:

   suptrees> tf

Link to this section Summary

Functions

Enter the Supervisor Tree Browser.

Link to this section Functions

Enter the Supervisor Tree Browser.