From owner-svn-src-head@freebsd.org Tue Jun 7 01:42:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32FF7B6D75F; Tue, 7 Jun 2016 01:42:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFA961C65; Tue, 7 Jun 2016 01:42:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id z187so18247073pfz.3; Mon, 06 Jun 2016 18:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/lov09hw3B1OKjyNBKRtld6GouwYOBzc1ZBHmTf06yA=; b=Uh8sz4lHp0LKZWhrRKuCYxuKwXNZYXWwN4jM4bZ13mjSXO96AarSV9Rt174b7SSMaC ffhsgdwnCMoAP0jQHqbfBs7yoWHg3q2tqNoRhE1Sb/iItIoeC33QeNesKcAY3AswDDFj Pj2YVMpu3QQpL631kOM6QkW7yZhtLzRewPujkS3gUtEg/oANjKvmscDzeKOulsqUjJPe sPkMNNsZeK6Ww0uAcbzV+kY4EnGU1qvXIyv0tZQB5urMIui/LXKrPhuFRsirEqEn/KIG wHCxVa/0qg00ZRxHeuvao29p+w3RB7gJcu+AnhvwlLSae/gfvSvHX8bfwpfsAumP3NDE wB1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/lov09hw3B1OKjyNBKRtld6GouwYOBzc1ZBHmTf06yA=; b=AUAntGzhPutZr1ZB+2aj51c76fKcMt5FFWVTuJH91WdxAfssV75i5yMWWIim2gYvWx OX+0Vt7UzeiTGKl8FTPPrfLwiiAm3Lz6t1x1eHURzdUHz59BoDFaXTztQVkrsDx6UPke xFPr6C0b4/4jooFm8DeSaJi3PfwpqRywiqMNISZDPyjEtYppCLqy+9CCaeBwqYiw+eRp QGBNOya0jHD02ckVw04x0LHsY25/nbxw+WTMVWYgdOVl3Kx5KsWAl8//azZnpO2P7nhT FvvaMlvvTKdn+ppIp+DaIQD3UECZgi1NfJrTJn25Zs6zg14pf9avShCJOCivFfi2hHQc fcSQ== X-Gm-Message-State: ALyK8tLDv3llhRsXyxFb91ySiEH7Gn8U6v3lwNVgulXMYyouTmYG0m3zYtka7KPaJUnO2w== X-Received: by 10.98.54.194 with SMTP id d185mr28793173pfa.34.1465263747192; Mon, 06 Jun 2016 18:42:27 -0700 (PDT) Received: from [192.168.20.14] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id ty10sm22407869pab.27.2016.06.06.18.42.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 18:42:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r301522 - in head: share/man/man4 sys/kern From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: <201606062057.u56KvOMU015125@repo.freebsd.org> Date: Mon, 6 Jun 2016 18:42:22 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <379A4F79-F631-4696-8C09-0822610C04D4@gmail.com> References: <201606062057.u56KvOMU015125@repo.freebsd.org> To: "Bjoern A. Zeeb" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 07 Jun 2016 01:42:28 -0000 > On Jun 6, 2016, at 13:57, Bjoern A. Zeeb wrote: >=20 > Author: bz > Date: Mon Jun 6 20:57:24 2016 > New Revision: 301522 > URL: https://svnweb.freebsd.org/changeset/base/301522 Awesome -- thanks bz!!! > Log: > Implement a `show panic` command to DDB which will helpfully print the > panic string again if set, in case it scrolled out of the active > window. This avoids having to remember the symbol name. >=20 > Also add a show callout command to DDB in order to inspect > some struct callout fields in case of panics in the callout code. > This may help to see if there was memory corruption or to further > ease debugging problems. >=20 > Obtained from: projects/vnet > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Reviewed by: jhb (comment only on the show panic initally) > Differential Revision: https://reviews.freebsd.org/D4527 >=20 > Modified: > head/share/man/man4/ddb.4 > head/sys/kern/kern_shutdown.c > head/sys/kern/kern_timeout.c >=20 > Modified: head/share/man/man4/ddb.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/share/man/man4/ddb.4 Mon Jun 6 20:42:54 2016 (r301521) > +++ head/share/man/man4/ddb.4 Mon Jun 6 20:57:24 2016 (r301522) > @@ -60,7 +60,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 18, 2016 > +.Dd June 6, 2016 > .Dt DDB 4 > .Os > .Sh NAME > @@ -599,6 +599,13 @@ See the > header file for more details on the exact meaning of the structure fields.= > .\" > .Pp > +.It Ic show Cm callout Ar addr > +Show information about the callout structure > +.Vt struct callout > +present at > +.Ar addr . > +.\" > +.Pp > .It Ic show Cm cbstat > Show brief information about the TTY subsystem. > .\" > @@ -834,6 +841,10 @@ option is specified the > complete object is printed. > .\" > .Pp > +.It Ic show Cm panic > +Print the panic message if set. > +.\" > +.Pp > .It Ic show Cm page > Show statistics on VM pages. > .\" >=20 > Modified: head/sys/kern/kern_shutdown.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/kern/kern_shutdown.c Mon Jun 6 20:42:54 2016 (r301521)= > +++ head/sys/kern/kern_shutdown.c Mon Jun 6 20:57:24 2016 (r301522)= > @@ -929,3 +929,14 @@ mkdumpheader(struct kerneldumpheader *kd > strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); > kdh->parity =3D kerneldump_parity(kdh); > } > + > +#ifdef DDB > +DB_SHOW_COMMAND(panic, db_show_panic) > +{ > + > + if (panicstr =3D=3D NULL) > + db_printf("panicstr not set\n"); > + else > + db_printf("panic: %s\n", panicstr); > +} > +#endif >=20 > Modified: head/sys/kern/kern_timeout.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/kern/kern_timeout.c Mon Jun 6 20:42:54 2016 (r301521) > +++ head/sys/kern/kern_timeout.c Mon Jun 6 20:57:24 2016 (r301522) > @@ -38,6 +38,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include "opt_callout_profiling.h" > +#include "opt_ddb.h" > #if defined(__arm__) > #include "opt_timer.h" > #endif > @@ -60,6 +61,11 @@ __FBSDID("$FreeBSD$"); > #include > #include >=20 > +#ifdef DDB > +#include > +#include > +#endif > + > #ifdef SMP > #include > #endif > @@ -1615,3 +1621,34 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta > CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > 0, 0, sysctl_kern_callout_stat, "I", > "Dump immediate statistic snapshot of the scheduled callouts"); > + > +#ifdef DDB > +static void > +_show_callout(struct callout *c) > +{ > + > + db_printf("callout %p\n", c); > +#define C_DB_PRINTF(f, e) db_printf(" %s =3D " f "\n", #e, c->e);= > + db_printf(" &c_links =3D %p\n", &(c->c_links)); > + C_DB_PRINTF("%" PRId64, c_time); > + C_DB_PRINTF("%" PRId64, c_precision); > + C_DB_PRINTF("%p", c_arg); > + C_DB_PRINTF("%p", c_func); > + C_DB_PRINTF("%p", c_lock); > + C_DB_PRINTF("%#x", c_flags); > + C_DB_PRINTF("%#x", c_iflags); > + C_DB_PRINTF("%d", c_cpu); > +#undef C_DB_PRINTF > +} > + > +DB_SHOW_COMMAND(callout, db_show_callout) > +{ > + > + if (!have_addr) { > + db_printf("usage: show callout \n"); > + return; > + } > + > + _show_callout((struct callout *)addr); > +} > +#endif /* DDB */ >=20