From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30458 invoked by alias); 19 Dec 2005 19:30:01 -0000 Received: (qmail 30451 invoked by uid 22791); 19 Dec 2005 19:30:00 -0000 X-Spam-Status: No, hits=-2.6 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; Mon, 19 Dec 2005 19:29:58 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id jBJJTulC032527 for ; Mon, 19 Dec 2005 14:29:56 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id jBJJTu104415; Mon, 19 Dec 2005 14:29:56 -0500 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id jBJJTuV1011239; Mon, 19 Dec 2005 14:29:56 -0500 Received: from tooth.toronto.redhat.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 255AF80032B; Mon, 19 Dec 2005 14:29:56 -0500 (EST) Received: from tooth.toronto.redhat.com (IDENT:017HqIBtxUFvd45UMPjxGGrJnzTwnjiK@localhost [127.0.0.1]) by tooth.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id jBJJTtuI009724; Mon, 19 Dec 2005 14:29:55 -0500 Received: (from fche@localhost) by tooth.toronto.redhat.com (8.12.8/8.12.8/Submit) id jBJJTtEA009720; Mon, 19 Dec 2005 14:29:55 -0500 X-Authentication-Warning: tooth.toronto.redhat.com: fche set sender to fche@redhat.com using -f To: Martin Hunt Cc: systemtap@sources.redhat.com Subject: Re: analysis of polling in systemtap References: <1134762840.3952.49.camel@monkey2> From: fche@redhat.com (Frank Ch. Eigler) Date: Mon, 19 Dec 2005 19:53:00 -0000 In-Reply-To: <1134762840.3952.49.camel@monkey2> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2005-q4/txt/msg00489.txt.bz2 hunt wrote: > [...] Unfortunately if an error is hit, the error message is > sometimes cleared before the script exits. [...] Error and warning > messages are sent over a separate channel and are displayed > immediately. [...] The error/warning messages already go to stderr, if I read the code correctly. A script that generates lots of stdout + stderr traffic may need to be diagnosed the same way as for unix tools generally: separate stderr redirection. > [...] > sortn(called, 10, SORT_VALUE) > printa(called, 10, "%1d called %2s\t%d times") > delete called > [...] One obvious problem with this is the race and possible mismatches between the "sortn" and "printa" calls. Compared to this, the proposed sorted-limited-foreach is indeed somewhat slower, but likewise requires the same number of script lines: foreach (x in called- limit 10) printf("%d called %s" ... ) # there is also a race here. delete called - FChE