ets:i / 1 tty的第二个选项含义

时间:2012-03-06 23:26:42

标签: erlang

我现在正在尝试研究gproc项目的内部结构。当使用" ets:i / 1"命令,tty给了我3个选项。 (p)数字的含义是什么?

(emacs@yus-iMac.local)35> ets:i(gproc).
<1   > {{<0.77.0>,l}}
<2   > {{<0.77.0>,{c,l,c1}},[{initial,3}]}
<3   > {{<0.77.0>,{n,l,{dummy,1}}},[]}
<4   > {{<0.77.0>,{p,l,prop}},[]}
<5   > {{{c,l,c1},<0.77.0>},<0.77.0>,3}
<6   > {{{n,l,{dummy,1}},n},<0.77.0>,undefined}
<7   > {{{p,l,prop},<0.77.0>},<0.77.0>,undefined}
EOT  (q)uit (p)Digits (k)ill /Regexp -->p
Bad digits
EOT  (q)uit (p)Digits (k)ill /Regexp -->1
EOT  (q)uit (p)Digits (k)ill /Regexp --><1>
EOT  (q)uit (p)Digits (k)ill /Regexp -->k
ok
(emacs@yus-iMac.local)36> ets:i(gproc).

=ERROR REPORT==== 7-Mar-2012::07:20:00 ===
** Generic server gproc terminating 
** Last message in was {'DOWN',#Ref<0.0.0.178>,process,<0.77.0>,normal}
** When Server state == {state}
** Reason for termination == 
** {badarg,[{ets,member,[gproc,{<0.77.0>,l}],[]},
            {gproc,process_is_down,1,[{file,"src/gproc.erl"},{line,1777}]},
            {gproc,handle_info,2,[{file,"src/gproc.erl"},{line,1689}]},
            {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,597}]},
            {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
** exception error: bad argument
     in function  ets:first/1
        called as ets:first(gproc)
     in call from ets:i/3 (ets.erl, line 1203)
(emacs@yus-iMac.local)37> 

1 个答案:

答案 0 :(得分:2)

pNNN将打印记录号NNN。

例如:

(emacs@yus-iMac.local)35> ets:i(gproc).
<1   > {{<0.77.0>,l}}
<2   > {{<0.77.0>,{c,l,c1}},[{initial,3}]}
<3   > {{<0.77.0>,{n,l,{dummy,1}}},[]}
<4   > {{<0.77.0>,{p,l,prop}},[]}
<5   > {{{c,l,c1},<0.77.0>},<0.77.0>,3}
<6   > {{{n,l,{dummy,1}},n},<0.77.0>,undefined}
<7   > {{{p,l,prop},<0.77.0>},<0.77.0>,undefined}
EOT  (q)uit (p)Digits (k)ill /Regexp -->p3
{{<0.77.0>,{n,l,{dummy,1}}},[]}