From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:12:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9691A106567D; Thu, 24 Nov 2011 07:12:44 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BCD0B8FC19; Thu, 24 Nov 2011 07:12:43 +0000 (UTC) Received: by faap15 with SMTP id p15so3657729faa.13 for ; Wed, 23 Nov 2011 23:12:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=oZBSD4muZo0SB1+lFk7NP8WW46Loja9c6yQ8laXNfN8=; b=Vu18LJvxiHCDexqP+Os9MagWO1JgbPCNZyq5tM/ljhgXldQWqBuyDH6uJSsZiZ2Zen KeA3jvcCWLd6IRYDQ14DYm2c58quHQ7RDrRvwchvqhV8TTaxp+oKdm0tdXGywY3VSZs2 VhLpwMFmLGskNn0IHPhL18oasXmGwI7X2s9Yo= Received: by 10.204.148.67 with SMTP id o3mr28313295bkv.130.1322118762299; Wed, 23 Nov 2011 23:12:42 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id x27sm24559721fag.14.2011.11.23.23.12.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Nov 2011 23:12:38 -0800 (PST) From: Mikolaj Golub To: mdf@FreeBSD.org Organization: TOA Ukraine References: <201111230734.pAN7YA78032998@svn.freebsd.org> Sender: Mikolaj Golub Date: Thu, 24 Nov 2011 09:12:35 +0200 In-Reply-To: (mdf@freebsd.org's message of "Wed, 23 Nov 2011 11:10:47 -0800") Message-ID: <86ipmaq9i4.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 07:12:44 -0000 On Wed, 23 Nov 2011 11:10:47 -0800 mdf@FreeBSD.org wrote: >> š š š š š š š š š š š šprintf(" AT_IGNORE=0x%lu", >> - š š š š š š š š š š š š š (unsigned long)aux->a_un.a_val); >> + š š š š š š š š š š š š š (unsigned long)auxv[i].a_un.a_val); m> I didn't see this before, but this gives very misleading output. The m> 0x prefix implies the output will be hex, but it's printed as decimal, m> here and below. Oh. Thanks! Will fix. m> I don't know if there's a style preference for 0x%lx versus %#lx, m> though, or a preference for a different type for the print (uintmax_t, m> for example). There is probably a preference for using u_long rather m> than unsigned long, since it's shorter. It looks like both 0x%lx and %#lx are widely spread in our source, I like %#lx a little more. It looks for me that (u_long) will be ok for now, so the chage for the printf above would be: printf(" AT_IGNORE=%#lx", (u_long)auxv[i].a_un.a_val); Anyway, printing all values in the same format was considered by me as a temporary solution. I am going to have format depending on a_type, so e.g. AT_PAGESZ will be 4096, not 0x1000. Also, now they are printed as one string for a process: PID COMM AUXV 2520 firefox-bin AT_PHDR=0x400040 AT_PHENT=0x38 AT_PHNUM=0x7 AT_PAGESZ=0x1000 ... I am considering changing this too, to something like below: PID COMM AUXV VALUE 2520 firefox-bin AT_PHDR 0x400040 2520 firefox-bin AT_PHENT 56 2520 firefox-bin AT_PHNUM 7 ... -- Mikolaj Golub