From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.213.28.69 with SMTP id l5cs3463ebc; Sat, 23 Jan 2010 19:17:23 -0800 (PST) Received: by 10.224.81.138 with SMTP id x10mr3152397qak.299.1264303042742; Sat, 23 Jan 2010 19:17:22 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 8si12784125qwj.33.2010.01.23.19.17.22; Sat, 23 Jan 2010 19:17:22 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id DAC7C1D788BB; Sat, 23 Jan 2010 22:17:21 -0500 (EST) Received: from magnesium.club.cc.cmu.edu (MAGNESIUM.CLUB.CC.cmu.edu [128.237.157.15]) by rubyforge.org (Postfix) with ESMTP id 2ED8B18582C9 for ; Sat, 23 Jan 2010 22:17:17 -0500 (EST) Received: (qmail 22262 invoked from network); 24 Jan 2010 03:17:16 -0000 Received: from pion.club.cc.cmu.edu (HELO localhost.localdomain) (128.237.157.88) by magnesium.club.cc.cmu.edu with SMTP; 24 Jan 2010 03:17:16 -0000 From: Rich Lane To: sup-devel@rubyforge.org Date: Sat, 23 Jan 2010 19:16:00 -0800 Message-Id: <1264302960-17337-1-git-send-email-rlane@club.cc.cmu.edu> X-Mailer: git-send-email 1.6.3.3 Subject: [sup-devel] [PATCH] enable ruby-prof with SUP_PROFILE environment variable X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org If SUP_PROFILE is set, it's used as the filename to dump profiling output which you can use kcachegrind to inspect. --- bin/sup | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/bin/sup b/bin/sup index 7824aca..f7c4af7 100755 --- a/bin/sup +++ b/bin/sup @@ -14,6 +14,11 @@ require 'fileutils' require 'trollop' require "sup"; Redwood::check_library_version_against "git" +if ENV['SUP_PROFILE'] + require 'ruby-prof' + RubyProf.start +end + if no_ncursesw debug "No 'ncursesw' gem detected. Install it for wide character support." end @@ -379,6 +384,11 @@ ensure end Index.unlock + + if (fn = ENV['SUP_PROFILE']) + result = RubyProf.stop + File.open(fn, 'w') { |io| RubyProf::CallTreePrinter.new(result).print(io) } + end end unless Redwood::exceptions.empty? -- 1.6.3.3 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel