2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

98_fhemdebug.pm: display function-reference-names (Forum #110125)

git-svn-id: https://svn.fhem.de/fhem/trunk@21673 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-04-14 13:19:24 +00:00
parent 90d2fe29d8
commit a7d6426f44

View File

@ -4,6 +4,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
use B qw(svref_2object);
my $fhemdebug_enabled; my $fhemdebug_enabled;
my $main_callfn; my $main_callfn;
@ -113,8 +114,13 @@ fhemdebug_timerList($)
for my $h (@intAtA) { for my $h (@intAtA) {
my $tt = $h->{TRIGGERTIME}; my $tt = $h->{TRIGGERTIME};
my $fnName = $h->{FN};
if(ref($fnName) ne "") {
my $cv = svref_2object($fnName);
$fnName = $cv->GV->NAME if($cv); # get function name
}
push(@res, sprintf("%s.%05d %s%s", push(@res, sprintf("%s.%05d %s%s",
FmtDateTime($tt), int(($tt-int($tt))*100000), $h->{FN}, FmtDateTime($tt), int(($tt-int($tt))*100000), $fnName,
$h->{STACKTRACE} ? $h->{STACKTRACE} : "")); $h->{STACKTRACE} ? $h->{STACKTRACE} : ""));
} }
return join("\n", @res); return join("\n", @res);