X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fperl%2Flib%2FCollectd.pm;h=ca3b5d2349805a505ae22df4faad8c7b9feda529;hb=b4c8f3f762d666742c774ab3b45815e5a416e5da;hp=557950cb3e5747d24832eb41b01cf9f16b5a9553;hpb=e5c6a442843929db1880035866fd6b21026dda56;p=collectd.git diff --git a/bindings/perl/lib/Collectd.pm b/bindings/perl/lib/Collectd.pm index 557950cb..ca3b5d23 100644 --- a/bindings/perl/lib/Collectd.pm +++ b/bindings/perl/lib/Collectd.pm @@ -116,6 +116,7 @@ my @fc_plugins : shared = (); my %cf_callbacks : shared = (); my %types = ( + TYPE_CONFIG, "config", TYPE_INIT, "init", TYPE_READ, "read", TYPE_WRITE, "write", @@ -135,6 +136,12 @@ my %fc_exec_names = ( FC_TARGET, "invoke" ); +my %fc_cb_types = ( + FC_CB_EXEC, "exec", + FC_CB_CREATE, "create", + FC_CB_DESTROY, "destroy" +); + foreach my $type (keys %types) { $plugins[$type] = &share ({}); } @@ -172,7 +179,9 @@ sub plugin_call_all { } if (TYPE_LOG != $type) { - DEBUG ("Collectd::plugin_call: type = \"$type\", args=\"@_\""); + DEBUG ("Collectd::plugin_call: type = \"$type\" (" + . $types{$type} . "), args=\"" + . join(', ', map { defined($_) ? $_ : '' } @_) . "\""); } if (! defined $plugins[$type]) { @@ -267,7 +276,8 @@ sub plugin_register { my $data = shift; DEBUG ("Collectd::plugin_register: " - . "type = \"$type\", name = \"$name\", data = \"$data\""); + . "type = \"$type\" (" . $types{$type} + . "), name = \"$name\", data = \"$data\""); if (! ((defined $type) && (defined $name) && (defined $data))) { ERROR ("Usage: Collectd::plugin_register (type, name, data)"); @@ -322,7 +332,8 @@ sub plugin_unregister { my $type = shift; my $name = shift; - DEBUG ("Collectd::plugin_unregister: type = \"$type\", name = \"$name\""); + DEBUG ("Collectd::plugin_unregister: type = \"$type\" (" + . $types{$type} . "), name = \"$name\""); if (! ((defined $type) && (defined $name))) { ERROR ("Usage: Collectd::plugin_unregister (type, name)"); @@ -454,35 +465,6 @@ sub plugin_flush { } } -sub plugin_flush_one { - my $timeout = shift; - my $name = shift; - - WARNING ("Collectd::plugin_flush_one is deprecated - " - . "use Collectd::plugin_flush instead."); - - if (! (defined ($timeout) && defined ($name))) { - ERROR ("Usage: Collectd::plugin_flush_one(timeout, name)"); - return; - } - - plugin_flush (plugins => $name, timeout => $timeout); -} - -sub plugin_flush_all { - my $timeout = shift; - - WARNING ("Collectd::plugin_flush_all is deprecated - " - . "use Collectd::plugin_flush instead."); - - if (! defined ($timeout)) { - ERROR ("Usage: Collectd::plugin_flush_all(timeout)"); - return; - } - - plugin_flush (timeout => $timeout); -} - sub fc_call { my $type = shift; my $name = shift; @@ -511,7 +493,9 @@ sub fc_call { } DEBUG ("Collectd::fc_call: " - . "type = \"$type\", name = \"$name\", cb_type = \"$cb_type\""); + . "type = \"$type\" (" . $fc_types{$type} + . "), name = \"$name\", cb_type = \"$cb_type\" (" + . $fc_cb_types{$cb_type} . ")"); { lock %{$fc_plugins[$type]}; @@ -564,7 +548,8 @@ sub fc_register { my %fc : shared; DEBUG ("Collectd::fc_register: " - . "type = \"$type\", name = \"$name\", proc = \"$proc\""); + . "type = \"$type\" (" . $fc_types{$type} + . "), name = \"$name\", proc = \"$proc\""); if (! ((defined $type) && (defined $name) && (defined $proc))) { ERROR ("Usage: Collectd::fc_register(type, name, proc)");