Skip to content

Instantly share code, notes, and snippets.

@sgonyea
Created November 4, 2010 17:19
Show Gist options
  • Save sgonyea/662803 to your computer and use it in GitHub Desktop.
Save sgonyea/662803 to your computer and use it in GitHub Desktop.
Here are the trace commands
If you enter this on the erlang console
dbg:tracer().
dbg:p(all,[c,sos,sol]).
dbg:tpl(riak_kv_pb_socket, init, [{'_',[],[{message,{return_trace}}]}]).
dbg:tpl(riak_kv_pb_socket, process_message, [{'_',[],[{message,{return_trace}}]}]).
dbg:tpl(riak_kv_pb_socket, send_msg, [{'_',[],[{message,{return_trace}}]}]).
You'll see some activity as messages are processed - the first argument to process_message is the incoming request from the client as an erlang record, the first argument to send_msg is the response.
So if a client issues a get request for a notfound key, you see this:
(riak@127.0.0.1)6> (<0.739.0>) call riak_kv_pb_socket:process_message({rpbgetreq,<<"b">>,<<"k">>,undefined},{state,#Port<0.3373>,
{riak_client,'riak@127.0.0.1',<<2,210,167,162>>},
undefined,undefined})
(<0.739.0>) call riak_kv_pb_socket:send_msg({rpbgetresp,undefined,undefined},{state,#Port<0.3373>,
{riak_client,'riak@127.0.0.1',<<2,210,167,162>>},
undefined,undefined})
(<0.739.0>) returned from riak_kv_pb_socket:send_msg/2 -> {state,
#Port<0.3373>,
{riak_client,
'riak@127.0.0.1',
<<2,210,167,162>>},
undefined,
undefined}
(<0.739.0>) returned from riak_kv_pb_socket:process_message/2 -> {state,
#Port<0.3373>,
{riak_client,
'riak@127.0.0.1',
<<2,210,
167,162>>},
undefined,
undefined}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment