Skip to content

Commit

Permalink
fixes for 5.6: Stats.xs DEBUG_v and c_minus Dump $t workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Jun 9, 2014
1 parent 9cb54cb commit ed914fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -1,5 +1,9 @@
-*- change-log -*-

0.09 2014-06-09 rurban
* fix Stats.xs for 5.6. no -Dv on 5.6, combine with -Dt instead
* fix c_minus for 5.6. Needed to seperate $t Dump.

0.08 2014-06-06 rurban
* fix overhead subtraction, and count OPCLASS at the end
just -E0 is still wrong, i.e. still gives the -E overhead
Expand Down
21 changes: 12 additions & 9 deletions Stats.xs
Expand Up @@ -15,6 +15,9 @@
(defined(__CYGWIN__) && (__GNUC__ > 3)) || defined(AIX))
# define DISABLE_PERL_CORE_EXPORTED
#endif
#if PERL_VERSION < 7
# define DEBUG_v(x) DEBUG_t(x)
#endif

STATIC U32 opcount[MAXO];

Expand Down Expand Up @@ -75,18 +78,18 @@ my_runops(pTHX)
# endif
#endif
}
if (!ignore) {
opcount[PL_op->op_type]++;
#ifdef DEBUGGING
if (DEBUG_v_TEST_) {
if (!ignore) {
opcount[PL_op->op_type]++;
#if defined(DEBUGGING) && PERL_VERSION > 7
if (DEBUG_v_TEST_) {
# ifndef DISABLE_PERL_CORE_EXPORTED
debop(PL_op);
debop(PL_op);
# endif
PerlIO_printf(Perl_debug_log, "Counted %d for %s\n",
opcount[PL_op->op_type]+1, PL_op_name[PL_op->op_type]);
}
PerlIO_printf(Perl_debug_log, "Counted %d for %s\n",
opcount[PL_op->op_type]+1, PL_op_name[PL_op->op_type]);
}
#endif
}
}
} while ((PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX)));
DEBUG_v(Perl_deb(aTHX_ "leaving RUNOPS level (B::Stats)\n"));

Expand Down
10 changes: 7 additions & 3 deletions c_minus
Expand Up @@ -90,11 +90,15 @@ print P "package B::Stats::Minus;
# UPPERCASE for -E (features overhead)
";
$Data::Dumper::Sortkeys = 1;
print P Data::Dumper->Dump([\%c, $t, $tE], [qw(overhead test test_E)]);
print P "# \$test for -e1
";
my $dd = Data::Dumper->new([\%c, $tE], [qw(overhead test_E)]);
print P $dd->Dump();
print P "# \$test_E for -E1
";
# 5.6 misses $t
$dd = Data::Dumper->new([$t], [qw(test)]);
print P $dd->Dump();
print P "# \$test for -e1
";
print P "1;
";
close P;

0 comments on commit ed914fe

Please sign in to comment.