[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.11.0
Modestas Vainius
modax at alioth.debian.org
Fri Mar 11 01:30:59 UTC 2011
The following commit has been merged in the master branch:
commit 1a57bc0a714501a8ebe2b7daec960531916f7452
Author: Modestas Vainius <modestas at vainius.eu>
Date: Fri Mar 11 03:15:40 2011 +0200
Add perl profiler (NYPTprof) helper for debugging purposes.
Depends on the libdevel-nytprof-perl package.
---
debian/copyright | 27 +++++++++++++++++++++++++--
perl-profiler.pl | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/debian/copyright b/debian/copyright
index 0832adf..31b248b 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -73,8 +73,31 @@ The follwing license applies to:
| You should have received a copy of the GNU General Public License
| along with this program. If not, see <http://www.gnu.org/licenses/>.
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL-2'.
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
+ - perl-profiler.pl
+
+ Copyright: 2008-2010, Tim Bunce <timb at cpan.org>
+ Copyright: 2008, Adam J. Kaplan <akaplan at cpan.org>
+ Copyright: 2008, The New York Times Company
+ Copyright: 2011, Modestas Vainius <modax at debian.org>
+
+ Licensed under Artistic or GPL-1+
+
+ | This program is free software; you can redistribute it and/or modify
+ | it under the terms of the Artistic License, which comes with Perl.
+
+ On Debian systems, the complete text of the Artistic License
+ can be found in `/usr/share/common-licenses/Artistic'
+
+ | This program is free software; you can redistribute it and/or modify
+ | it under the terms of the GNU General Public License as published by
+ | the Free Software Foundation; either version 1, or (at your option)
+ | any later version.
+
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'
The Debian packaging is:
diff --git a/perl-profiler.pl b/perl-profiler.pl
new file mode 100755
index 0000000..4fcc169
--- /dev/null
+++ b/perl-profiler.pl
@@ -0,0 +1,54 @@
+#!/usr/bin/perl -w
+
+# Based on /usr/share/doc/libdevel-nytprof-perl/examples/demo/demo-run.pl
+# from the libdevel-nytprof-perl package.
+# License: Artistic or GPL-1+
+
+use strict;
+use IO::Handle;
+
+my $NYTPROF = ($ENV{NYTPROF}) ? "$ENV{NYTPROF}:" : "";
+
+my %runs = (
+ start_begin => {
+ skip => 0,
+ NYTPROF => 'start=begin:optimize=0',
+ },
+ start_check => {
+ skip => 1,
+ NYTPROF => 'start=init:optimize=0',
+ },
+ start_end => {
+ skip => 1,
+ NYTPROF => 'start=end:optimize=0',
+ },
+);
+
+my $bin = shift @ARGV;
+my $name = $bin;
+$name =~ s,^.*/,,;
+
+for my $run (keys %runs) {
+
+ next if $runs{$run}{skip};
+ $ENV{NYTPROF} = $NYTPROF . $runs{$run}{NYTPROF} || '';
+ $ENV{NYTPROF_HTML} = $runs{$run}{NYTPROF_HTML} || '';
+
+ my $cmd = "perl -d:NYTProf $bin @ARGV";
+ open my $fh, "| $cmd"
+ or die "Error starting $cmd\n";
+ $fh->autoflush;
+ close $fh
+ or die "Error closing pipe to $cmd: $!\n";
+
+ my $outdir = "${name}-profiler/$run";
+ system("rm -rf $outdir") == 0 or exit 0;
+ system("mkdir -p $outdir") == 0 or exit 0;
+ system("nytprofhtml --open --out=$outdir") == 0
+ or exit 0;
+
+ #system "ls -lrt $outdir/.";
+
+ sleep 1;
+}
+
--
Debian Qt/KDE packaging tools
More information about the pkg-kde-commits
mailing list