From owner-freebsd-current@FreeBSD.ORG Thu Nov 19 15:07:41 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E791D106566B; Thu, 19 Nov 2009 15:07:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 293BF8FC15; Thu, 19 Nov 2009 15:07:39 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so971255fga.13 for ; Thu, 19 Nov 2009 07:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=Ld7HO7o63PvcOCMMw0unLLAZCopEIOMq1V3pVQK/LFI=; b=IDYhul34LLOzKRvgmnyhWTS67incXxdQR9U8ANkMZUJwC/Rbh+0wPJOeEDKio9UneX sb0tHzSc3wjoIPd2CnUXUxYIuJFMRPf43hRyYuA+QM+x7zJTQRnHOboUPy8KfzDFIyoN 5EvnHXqbrD0bWsZ/4Cdp35Q5HZDOuPzcbx7sI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=vAaO8er/0KDPlfqUVCHVUooV44IIkfF4mhX+8+8Y7L+K0KZNw53ZSQ5u18kRa+XIoQ FJ6FhRKG6e8a+RP8o3f1ge2LsFitEwbWq9fSaxCc4kYJGZEgnDPfAVPMG6EqjHPBEzte HoNIhdix2W9KqnDupYhEwtOYhXxG+SaAAmeD8= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.161.205 with SMTP id s13mr16589fax.27.1258643258907; Thu, 19 Nov 2009 07:07:38 -0800 (PST) In-Reply-To: <645CAAD7-A3BE-44B3-97D5-F4E4786943A4@freebsd.org> References: <3bbf2fe10911160718j7784b311g2980aa02c79bc9ec@mail.gmail.com> <20091117141713.GA51251@sandvine.com> <9C740225-CB30-4D26-8E4B-F9D5DC51B899@FreeBSD.org> <3bbf2fe10911181733j598083feiddf3d4b34d0007d6@mail.gmail.com> <3bbf2fe10911190545l264c0e2s615034999f46bc0a@mail.gmail.com> <645CAAD7-A3BE-44B3-97D5-F4E4786943A4@freebsd.org> Date: Thu, 19 Nov 2009 16:07:38 +0100 X-Google-Sender-Auth: d40fecae5ace554d Message-ID: <3bbf2fe10911190707w63d1ab66pa2014c526342f68e@mail.gmail.com> From: Attilio Rao To: "Robert N. M. Watson" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Ed Maste Subject: Re: [PATCH] Let gcore use ptrace interface rather than the procfs X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2009 15:07:41 -0000 2009/11/19 Robert N. M. Watson : > > On 19 Nov 2009, at 13:45, Attilio Rao wrote: > >>> If you add the missing include of sys/wait.h, elfcore.c generates an er= ror >>> instead of a warning on this non-traditional use of wait(2): >>> >>> + wait(); >>> >>> Something like this may be preferred: >>> >>> if (waitpid(pid, NULL, 0) < 0) >>> err(1, "waitpid"); >> >> I didn't get a warning neither an error but yes, the waitpid() is >> preferred and should be used. > > This warning was on i386 9.x, FYI, and was a property of failing to call = wait(2) with an argument. > >>> I think that kills the last of the procfs dependencies, in which case >>> perhaps we can remove the procfs.h include from elfcore.c, which requir= es >>> defining a local version of a summary data structure borrowed from proc= fs. >>> It's worth trying with procfs unmounted, however, to make sure they're >>> really all gone (which is how I ran into the above problem). >> >> I don't like the idea to replicate the structures because of code >> maintence. IMHO is ok to have procfs header. > > > I'm not sure I agree; looking at the elfcore code, it looks like it goes = to some amount of inconvenience to stuff things into the structure in the f= irst place, primarily because that was how procfs exported it. With your ex= cellent change, there's no need for gcore(1) to depend on procfs-specific d= ata structures that may change, or more ideally, be removed in the future. Yeah, I had the same feeling as the interfaces should be more lifted in order to less fit procfs (example: probabilly readmap could export directly the list of objects from libutil rather then transforming it) but let's get there in a second round of changes probabilly. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein