Home | History | Annotate | Download | only in ddb
History log of /src/sys/ddb/db_variables.c
RevisionDateAuthorComments
 1.47  10-Mar-2020  christos Make the db_kernelonly() macro visible to all files and re-use it.
Register access is kernel only.
 1.46  17-Feb-2018  sevan branches: 1.46.4;
Opt to print a backtrace on panic by default with the intention of improving bug reports.
Instead of relying on ddb.onpanic=2, introduce a new sysctl called dumpstack to handle this.
via <jmcneill> channeled through <mrg> on tech-kern[1]

[1] https://mail-index.netbsd.org/tech-kern/2018/02/15/msg023103.html
 1.45  28-Dec-2017  christos - add ddb.panicstackframes to avoid scrolling the interesting parts of panic
stacktraces off.
- change valuep to void * to avoid casts
- sort and use c99 initializers in variables array
 1.44  25-Feb-2014  pooka Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.43  02-Jun-2012  dsl branches: 1.43.2; 1.43.4;
Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
the item itself.
In the places where the caller specifies a function and a structure
address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
 1.42  11-Mar-2009  martin branches: 1.42.12;
Switch the default value (if no options DDB_ONPANIC is defined) for
ddb.onpanic to 1, change it back to 0 in sysctl.conf and make sure
postinstall installs this setting.
This avoids us trying to dump while booting from install CD, but keeps
the default the same once we are far enough through /etc/rc.d. Failing
earlier is unlikely to be recovered by an automatic reboot.
OK: core.
 1.41  07-Mar-2009  ad Make ddb compile and work in userspace. Mostly this is comprised of three
types of changes:

- Add a few new methods to replace stuff like p_find(), CPU_INFO_FOREACH.

- Use db_read_bytes() instead of accessing kernel structures directly,
and similar changes.

- Add ifdef _KERNEL where the above hasn't been done, and an XXX comment.
 1.40  30-Jan-2009  ad branches: 1.40.2;
Default DDB_ONPANIC to zero. The end product is ultimately for the
consumption of users external to the project, users who are unlikely to
be kernel hackers with the motivation to debug crashes. In this situation
rebooting and creating a crash dump is more appropriate than interrupting
normal service for an unbounded amount of time, while also leaving the
machine at cryptic db> prompt.
 1.39  22-Feb-2007  matt branches: 1.39.42; 1.39.52; 1.39.54;
Fix lossage from boolean_t -> bool and updated x86 bus_dma.
 1.38  16-Nov-2006  christos branches: 1.38.4;
__unused removal on arguments; approved by core.
 1.37  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.36  30-Aug-2006  christos branches: 1.36.2; 1.36.4;
fix incomplete initializer.
 1.35  14-May-2006  christos XXX: GCC uninitialized.
 1.34  27-Nov-2005  yamt branches: 1.34.4; 1.34.6; 1.34.8; 1.34.12;
make DDB_COMMANDONENTER sysctl. (ddb.commandonenter)
suggested by Christos Zoulas.
 1.33  01-Jun-2005  drochner branches: 1.33.2; 1.33.8;
more constification fallout
 1.32  29-Sep-2004  reinoud Implement ddb setting that allows all ddb output to be teed into the
kernel message buffer/log. Its off by default and can be switched on in the
kernel configuration on build time, be set as a variable in ddb and be set
using sysctl.

This adds the sysctl value
ddb.tee_msgbuf = 0
by default.

The functionality is especially added and aimed for developers who are not
blessed with a serial console and wish to keep all their ddb output in the
log. Specifying /l as a modifier to some selected commands will also put
the output in the log but not all commands provide one nor has the same
meaning for all commands.

This feature could in the future also be implemented as an ddb command but
that could lead to more bloat allthough maybe easier for non developpers to
use when mailing their backtraces from kernel crashes.
 1.31  25-May-2004  atatat Sysctl descriptions under ddb subtree
 1.30  24-Mar-2004  atatat branches: 1.30.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.29  04-Dec-2003  atatat Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
 1.28  29-Jun-2003  fvdl branches: 1.28.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.27  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.26  10-Nov-2002  thorpej Avoid a GCC 3.3 strict alias warning.
 1.25  04-Nov-2002  itohy Dump DDB_* and SYMTAB_SPACE options to opt_ddbparam.h rather than opt_ddb.h.
These options are used in limited files but #include "opt_ddb.h" are
everywhere, and changing them caused almost full recompilation.
 1.24  15-Feb-2002  simonb ANSIfy, KNF.
Make some variables and functions static when not used outside of a module.
Make variables in headers extern.
Delete the unused db_find_watchpoint() function.
 1.23  20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.22  12-Nov-2001  lukem add RCSIDs
 1.21  11-Apr-2001  msaitoh branches: 1.21.2;
fix invalid reference to $fromconsole via DDB
 1.20  17-Jan-2001  jdolecek branches: 1.20.2;
constify a little
 1.19  05-Jul-2000  jhawk "set" now displays the name of the variable, old value, and new value,
just as "write" does.
 1.18  27-Jun-2000  mrg remove include of <vm/vm.h>
 1.17  28-Oct-1999  lukem branches: 1.17.6;
- change db_cmd_list() to list commands vertically rather than horizontally
- sort entries in the various command tables, so that the `help' lists
are easier to use. this included hacking db_machine_commands_install()
to search for the "machine" entry to change the `more cmds' pointer,
rather than assuming it was the first entry
- add a `sync' command, which is effectively `reboot 0x100'.
- remove db_help_cmd(); it was unused (and was almost a duplicate of
db_cmd_list()).
- move some extern decls to db_output.h, since they're used in more than one
place now
- rename NEXT_TAB to DB_NEXT_TAB and move to db_output.h
 1.16  12-Apr-1999  pk branches: 1.16.2; 1.16.4; 1.16.6;
Quote "AS IS" as in the majority of Carnegy Mellon notices.
 1.15  06-Apr-1999  pk Fix a pasto in copyright text which has been procreating like rabbits..
 1.14  29-Oct-1998  jonathan branches: 1.14.6;
Add options DDB_FROMCONSOLE and sysctl ddb.fromconsole, analagous to
DDB_ONPANIC. Lets user ignore breaks but enter DDB on panic. Intended
for machines where debug on panic is useful, but DDB entry is not,
(public-access console, or terminal-servers which send spurious breaks)

Add new ddb hook, console_debugger(), which decides whether or not to
ignore console ddb requests. Console drivers should be updated to call
console_debugger(), not Debugger(), in response to serial-console
break or ddb keyboard sequence.
 1.13  04-Jul-1998  jonathan defopt DDB.
 1.12  31-Jan-1998  ross Print more info on ps/w, note the current proc, and properly declare db_maxoff.
 1.11  04-Feb-1997  cgd make variable pointers (in variable declaration structs) be 'long *', so
that the common case can be handled with no hassles on all machines.
fix up the various internal variables which are also exported via sysctl
(and which therefore must be 'int's) to do the right thing via a special
read/write function.
 1.10  03-Feb-1997  cgd fix various 64-bitness bugs.
 1.9  09-Jan-1997  thorpej Define db_onpanic variable; if non-zero, the DDB will be entered when
the kernel panics. It may be initialized to 0 with the kernel option
"DDB_ONPANIC=0", and is patchable. It may be changed at run-time
from within the DDB (as a DDB variable) or via the ddb.onpanic sysctl
node.

Export all DDB built-in variables via sysctl.
 1.8  05-Feb-1996  christos DDB prototype changes.
 1.7  09-Oct-1994  mycroft db_error() does not return.
 1.6  29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.5  18-Dec-1993  mycroft Canonicalize all #includes.
 1.4  02-Aug-1993  mycroft branches: 1.4.2;
Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
 1.3  15-Jul-1993  brezak Add 'ps' command. Add -more- pager to output from Mach ddb.
 1.2  20-May-1993  cgd add explicit rcs id
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.2.1  14-Nov-1993  mycroft Canonicalize all #includes.
 1.14.6.2  12-Apr-1999  pk branches: 1.14.6.2.2;
Pullup copyright text corrections.
 1.14.6.1  07-Apr-1999  pk Pull up from trunk: copyright text warts.
 1.14.6.2.2.1  21-Jun-1999  thorpej Sync w/ -current.
 1.16.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.16.4.1  15-Nov-1999  fvdl Sync with -current
 1.16.2.3  21-Apr-2001  bouyer Sync with HEAD
 1.16.2.2  11-Feb-2001  bouyer Sync with HEAD.
 1.16.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.6.1  30-Sep-2001  he Pull up revision 1.21 (requested by msaitoh):
Fix which variable is tweaked for ``fromconsole''.
 1.20.2.5  11-Nov-2002  nathanw Catch up to -current
 1.20.2.4  28-Feb-2002  nathanw Catch up to -current.
 1.20.2.3  08-Jan-2002  nathanw Catch up to -current.
 1.20.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.20.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.21.2.2  16-Mar-2002  jdolecek Catch up with -current.
 1.21.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.2.7  11-Dec-2005  christos Sync with head.
 1.28.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.2.5  19-Oct-2004  skrll Sync with HEAD
 1.28.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.28.2.2  03-Aug-2004  skrll Sync with HEAD
 1.28.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.30.2.1  28-May-2004  tron Pull up revision 1.31 (requested by atatat in ticket #390):
Sysctl descriptions under ddb subtree
 1.33.8.1  29-Nov-2005  yamt sync with head.
 1.33.2.3  26-Feb-2007  yamt sync with head.
 1.33.2.2  30-Dec-2006  yamt sync with head.
 1.33.2.1  21-Jun-2006  yamt sync with head.
 1.34.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.34.8.2  03-Sep-2006  yamt sync with head.
 1.34.8.1  24-May-2006  yamt sync with head.
 1.34.6.1  01-Jun-2006  kardel Sync with head.
 1.34.4.1  09-Sep-2006  rpaulo sync with head
 1.36.4.2  10-Dec-2006  yamt sync with head.
 1.36.4.1  22-Oct-2006  yamt sync with head
 1.36.2.1  18-Nov-2006  ad Sync with head.
 1.38.4.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.39.54.2  12-Mar-2009  snj Pull up following revision(s) (requested by martin in ticket #564):
etc/sysctl.conf: revision 1.6
sys/ddb/db_variables.c: revision 1.42
usr.sbin/postinstall/postinstall: revision 1.91
Switch the default value (if no options DDB_ONPANIC is defined) for
ddb.onpanic to 1, change it back to 0 in sysctl.conf and make sure
postinstall installs this setting.
This avoids us trying to dump while booting from install CD, but keeps
the default the same once we are far enough through /etc/rc.d. Failing
earlier is unlikely to be recovered by an automatic reboot.
OK: core.
 1.39.54.1  24-Feb-2009  snj Pull up following revision(s) (requested by ad in ticket #487):
sys/ddb/db_variables.c: revision 1.40
Default DDB_ONPANIC to zero. The end product is ultimately for the
consumption of users external to the project, users who are unlikely to
be kernel hackers with the motivation to debug crashes. In this situation
rebooting and creating a crash dump is more appropriate than interrupting
normal service for an unbounded amount of time, while also leaving the
machine at cryptic db> prompt.
 1.39.52.2  28-Apr-2009  skrll Sync with HEAD.
 1.39.52.1  03-Mar-2009  skrll Sync with HEAD.
 1.39.42.1  04-May-2009  yamt sync with head.
 1.40.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.42.12.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.42.12.1  30-Oct-2012  yamt sync with head
 1.43.4.1  18-May-2014  rmind sync with head
 1.43.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.46.4.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed