From owner-svn-src-head@FreeBSD.ORG Sat Nov 14 09:33:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6E2D106568D; Sat, 14 Nov 2009 09:33:51 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5F128FC14; Sat, 14 Nov 2009 09:33:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAE9XpVH093097; Sat, 14 Nov 2009 09:33:51 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAE9XpvC093095; Sat, 14 Nov 2009 09:33:51 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200911140933.nAE9XpvC093095@svn.freebsd.org> From: Colin Percival Date: Sat, 14 Nov 2009 09:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199265 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2009 09:33:52 -0000 Author: cperciva Date: Sat Nov 14 09:33:51 2009 New Revision: 199265 URL: http://svn.freebsd.org/changeset/base/199265 Log: Update malloc utrace structure parsing to reflect the change (r199265) in how malloc_init is logged from (0, 0, 0) to (-1, 0, 0). While we're here, simplify the logic. Reviewed by: jhb (earlier version) Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Nov 14 09:31:47 2009 (r199264) +++ head/usr.bin/kdump/kdump.c Sat Nov 14 09:33:51 2009 (r199265) @@ -1121,17 +1121,14 @@ ktruser_malloc(int len, unsigned char *p { struct utrace_malloc *ut = (struct utrace_malloc *)p; - if (ut->p == NULL) { - if (ut->s == 0 && ut->r == NULL) - printf("malloc_init()\n"); - else - printf("%p = malloc(%zu)\n", ut->r, ut->s); - } else { - if (ut->s == 0) - printf("free(%p)\n", ut->p); - else - printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s); - } + if (ut->p == (void *)(intptr_t)(-1)) + printf("malloc_init()\n"); + else if (ut->s == 0) + printf("free(%p)\n", ut->p); + else if (ut->p == NULL) + printf("%p = malloc(%zu)\n", ut->r, ut->s); + else + printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s); } void