Revision: 1288
Author: [email protected]
Date: Tue Jun 8 03:10:39 2010
Log: Added --minimal option to nytprofhtml to disable generation of
graphviz .dot files and block/sub-level statement report files.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1288
Modified:
/trunk/Changes
/trunk/NYTProf.xs
/trunk/bin/nytprofhtml
=======================================
--- /trunk/Changes Mon Jun 7 15:14:07 2010
+++ /trunk/Changes Tue Jun 8 03:10:39 2010
@@ -45,6 +45,8 @@
invocations of a particular string eval.
Multiple BEGINs (e.g., use) on the same line get distinct names.
+ Added --minimal option to nytprofhtml to disable generation of
+ graphviz .dot files and block/sub-level statement report files.
Added automatic detection of calls to POSIX::_exit() by the sub profiler
so finish_profile() gets called and a usable profile is produced.
Added posix_exit=1 option to do the same thing (in a different way)
=======================================
--- /trunk/NYTProf.xs Mon Jun 7 09:41:57 2010
+++ /trunk/NYTProf.xs Tue Jun 8 03:10:39 2010
@@ -4424,7 +4424,8 @@
if (c == NYTP_TAG_TIME_BLOCK) {
block_line_num = read_int(in);
sub_line_num = read_int(in);
- tag = nytp_time_block;
+ if (profile_blocks)
+ tag = nytp_time_block;
}
/* Because it happens that the two "optional" arguments are
=======================================
--- /trunk/bin/nytprofhtml Mon Jun 7 16:27:22 2010
+++ /trunk/bin/nytprofhtml Tue Jun 8 03:10:39 2010
@@ -56,6 +56,7 @@
'delete|d!' => \my $opt_delete,
'open!' => \my $opt_open,
'help|h' => sub { exit usage() },
+ 'minimal|m!'=> \my $opt_minimal,
'profself!' => sub {
# profile nytprofhtml itself
our $profself = "nytprof-nytprofhtml.out";
@@ -66,6 +67,8 @@
) or do { exit usage(); };
+DB::set_option('blocks', 0) if $opt_minimal;
+
sub usage {
print <<END;
usage: [perl] nytprofhtml [opts]
@@ -73,6 +76,7 @@
--out <dir>, -o <dir> Write report files to this directory [default:
nytprof]
--delete, -d Delete any old report files in <dir> first
--lib <lib>, -l <lib> Add <lib> to the beginning of \...@inc
+ --minimal, -m Don't generate graphviz .dot files or
block/sub-level reports
--help, -h Print this message
This script of part of the Devel::NYTProf distribution.
@@ -345,7 +349,7 @@
my $sub_table = subroutine_table($profile, $fi, undef, undef);
- if ($sub_table) {
+ if ($sub_table and not $opt_minimal) {
my $dot_file = html_safe_filename($filestr) . ".dot";
$sub_table .= qq{
@@ -732,7 +736,7 @@
print $fh q{<br/>(Can't create visual treemap of subroutine
exclusive times without the <a
href="http://search.cpan.org/dist/JSON-Any/">JSON::Any</a> module.)<br/>};
}
- if (1) {
+ if (not $opt_minimal) {
output_subs_callgraph_dot_file($reporter, "packages-callgraph.dot", undef,
1);
print $fh q{NYTProf also generates call-graph files in }
.q{<a
href="http://en.wikipedia.org/wiki/Graphviz">Graphviz</a> format: }
@@ -1300,7 +1304,7 @@
my $rep_links = join ' • ', map {
sprintf(qq{<a %s>%s</a>}, $reporter->href_for_file($fi, undef,
$_), $_)
- } qw(line block sub);
+ } values %{$profile->get_profile_levels};
print $fh "<td>$rep_links</td>";
print $fh sprintf q{<td><a name="f%s" title="%s">%s</a> %s</td>},
--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]