From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11504 invoked by alias); 15 Mar 2006 09:52:46 -0000 Received: (qmail 11497 invoked by uid 22791); 15 Mar 2006 09:52:45 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 15 Mar 2006 09:52:44 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k2F9qgWS014282 for ; Wed, 15 Mar 2006 04:52:42 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k2F9qg100848 for ; Wed, 15 Mar 2006 04:52:42 -0500 Received: from vpn83-131.boston.redhat.com (vpn83-131.boston.redhat.com [172.16.83.131]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k2F9qf6a028356 for ; Wed, 15 Mar 2006 04:52:42 -0500 Subject: new benchmark framework From: Martin Hunt To: SystemTAP Content-Type: text/plain Organization: Red Hat Inc. Date: Wed, 15 Mar 2006 09:52:00 -0000 Message-Id: <1142416360.27792.8.camel@dragon> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-3.fc4) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00790.txt.bz2 I've checked in a new benchmark framework that makes it easy to see how fast a code fragment is running. I've also got some simple tests included. Code is in src/runtime/bench2. It is self-contained and can be moved anywhere. It uses the installed systemtap. To write a test, simply create a file and put the following two lines at the top: --- #!/usr/bin/env ruby load './bench.rb' #Then create a test like this: # script test to print 5 integers test4 = Stapbench.new("printf 5 integers") test4.code = "printf(\"%d, %d, %d, %d, %d\\n\", 1, 0xffff, 0x8000ffff, 0xffff000011112222, 0x7000000000000000)" test4.run test4.print --- Then run the above file. That's it. It can test C code as well as Systemtap script. See the examples. Sample output from "run_bench": SystemTap BENCH2 Wed Mar 15 01:00:52 PST 2006 kernel: 2.6.9-34.ELsmp x86_64 Red Hat Enterprise Linux WS release 4 (Nahant Update 3) tiger: 01:00:52 up 51 min, 1 user, load average: 1.46, 1.29, 0.87 processors: 4 (2 physical) Intel(R) Xeon(TM) CPU 2.80GHz MemTotal: 1025428 kB MemFree: 750220 kB ---------------------------------------------------------------- For comparison, function call overhead is 721 nsecs. Times below are nanoseconds per probe and include kprobe overhead. ---------------------------------------------------------------- +--- S = Script, R = Runtime |+-- * = Relayfs Threads || NAME 1 2 4 R : empty probe 1471 737 559 S : empty probe 1556 784 594 S : printf 100 chars 2178 1445 1148 S*: printf 100 chars 2184 1290 1108 R : printf 100 chars 2064 1333 1039 R : printf 5 integers 3793 2006 1589 S : printf 5 integers 3930 2136 1644 You can see the overhead for printing integers is high. We should be able to improve on all the printf numbers soon. Martin