2012-03-06 9 views
0

gprocプロジェクトの内部構造を勉強しようとしています。 "ets:i/1"コマンドを使うとき、ttyは私に3つのオプションを与えます。 (p)数字の意味は?ets:i/1 ttyの2番目のオプションの意味

([email protected])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 
([email protected])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) 
([email protected])37> 

答えて

2

pNNNはレコード番号NNNを印刷します。例えば

([email protected])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}}},[]} 
関連する問題