From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5844 invoked by alias); 10 Apr 2010 14:27:24 -0000 Received: (qmail 5834 invoked by uid 22791); 10 Apr 2010 14:27:22 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 10 Apr 2010 14:27:08 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3AER6Tb012808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 10 Apr 2010 10:27:06 -0400 Received: from ana.ghostprotocols.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3AER2OK007868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 10 Apr 2010 10:27:05 -0400 Received: by ana.ghostprotocols.net (Postfix, from userid 500) id B441060F6; Sat, 10 Apr 2010 11:27:00 -0300 (BRT) Date: Sat, 10 Apr 2010 14:27:00 -0000 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu Cc: Ingo Molnar , lkml , systemtap , DLE , Paul Mackerras , Peter Zijlstra , Mike Galbraith , Frederic Weisbecker Subject: Re: [PATCH -tip v2 7/8] perf probe: Remove die() from probe-finder code Message-ID: <20100410142700.GN3908@ghostprotocols.net> References: <20100406220542.13329.45837.stgit@localhost6.localdomain6> <20100406220629.13329.71869.stgit@localhost6.localdomain6> <4BBFB5CE.7070104@redhat.com> <20100410012815.GC16721@ghostprotocols.net> <4BBFFC86.4020201@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BBFFC86.4020201@redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-08-17) Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00085.txt.bz2 Em Sat, Apr 10, 2010 at 12:20:22AM -0400, Masami Hiramatsu escreveu: > Arnaldo Carvalho de Melo wrote: > > Em Fri, Apr 09, 2010 at 07:18:38PM -0400, Masami Hiramatsu escreveu: > >> Hi Arnaldo, > >> > >> Has this code done what you suggested? :) > >> I'd like to have your comment. > > > > It improves the current situation, yes, but there are still cases there > > where die() is called, I assume that is left for later, right? > > With the next (8/8) patch, all die()s are removed at least from > probe-{event,finder}.c, except for all x*() wrappers. Ok > > > > Like here, the TUI/GUI can try to add a probe but if it fails it can > > still continue providing things like a "perf top" window, analysing > > perf.data files, doing 'perf diffs', etc. > > Sure, this die() is removed by next (8/8) patch. Sorry, I've split it because > of easy to review... Ok > >>> tvar->value = xstrdup(regs); > >>> if (ref) { > >>> tvar->ref = xzalloc(sizeof(struct kprobe_trace_arg_ref)); > > > > We have to kill those xzcalloc, etc, too they are die() in disguise :-) > > Hmm, I think that will cost high, because only failing to allocate memory, > which theoretically means we can't continue to operate it. In that case, > we'd better just use backtrace() and die(). Consider a situation where we are trying to allocate lots of objects allocated for some big operation (adding probes for all functions in all threads, whatever), we can just say to the user "hey, you don't have memory to do this" but other operations are possible, so calling panic(), oops, die() is not the right thing to do. - Arnaldo