| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Message-Id: <20221025105502.222708-2-damien@zamaudio.com>
|
|
|
|
|
|
|
|
| |
with an output similar to the userland vmstat command
* vm/vm_page.c (db_show_vmstat): New function.
* vm/vm_page.h (db_show_vmstat): New prototype.
* ddb/db_command.c (db_show_cmds): Add vmstat command.
|
| |
|
|
|
|
|
| |
* ddb/db_examine.c(db_examine): Add q modifier to examine 64bit values.
* doc/mach.texi (examine): Document q modifier.
|
|
|
|
| |
* ddb/db_command.c: Include <ipc/mach_port.h>.
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/db_interface.h (db_read_bytes): Return boolean_t instead of
void.
* i386/i386/db_interface.c (db_user_to_kernel_address): Return -1
instead of calling db_error() if address is bogus.
(db_read_bytes): Return FALSE instead of calling db_error() if address
is bogus.
* ddb/db_access.c (db_get_task_value): Return 0 if db_read_bytes failed.
* ddb/db_examine.c (db_xcdump): Only print * if db_read_bytes failed.
|
|
|
|
|
|
|
|
|
|
| |
Maps '$mapXX' to a VM map structure address. @var{xx} is a task
identification number printed by a @code{show all tasks} command.
* ddb/db_task_thread.c (db_get_map): New function.
* ddb/db_task_thread.h (db_get_map): New declaration.
* ddb/db_variables.c (db_vars): Add new variable.
* doc/mach.texi: Document this.
|
|
|
|
|
|
|
|
|
|
|
| |
* ddb/db_command.c (db_debug_all_traps_cmd): New declaration and
function.
(db_debug_port_references_cmd): Likewise.
* doc/mach.texi: Describe new commands.
* i386/i386/db_interface.h (db_debug_all_traps): New declaration.
* i386/i386/trap.c (db_debug_all_traps): New function.
* ipc/mach_port.c (db_debug_port_references): New function.
* ipc/mach_port.h (db_debug_port_references): New declaration.
|
|
|
|
|
|
|
|
|
|
| |
* ddb/db_print.c (OPTION_SCHED): New macro.
(db_print_thread): Display scheduling information if the flag is
given.
(db_print_task): Adapt.
(db_show_all_threads): Parse new modifier.
(db_show_one_thread): Likewise.
* doc/mach.texi: Document the new flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, user wiring is removed, simply because it has never been used.
Second, make the VM system track wiring requests to better handle
protection. This change makes it possible to wire entries with
VM_PROT_NONE protection without actually reserving any page for
them until protection changes, and even make those pages pageable
if protection is downgraded to VM_PROT_NONE.
* ddb/db_ext_symtab.c: Update call to vm_map_pageable.
* i386/i386/user_ldt.c: Likewise.
* ipc/mach_port.c: Likewise.
* vm/vm_debug.c (mach_vm_region_info): Update values returned
as appropriate.
* vm/vm_map.c (vm_map_entry_copy): Update operation as appropriate.
(vm_map_setup): Update member names as appropriate.
(vm_map_find_entry): Update to account for map member variable changes.
(vm_map_enter): Likewise.
(vm_map_entry_inc_wired): New function.
(vm_map_entry_reset_wired): Likewise.
(vm_map_pageable_scan): Likewise.
(vm_map_protect): Update wired access, call vm_map_pageable_scan.
(vm_map_pageable_common): Rename to ...
(vm_map_pageable): ... and rewrite to use vm_map_pageable_scan.
(vm_map_entry_delete): Fix unwiring.
(vm_map_copy_overwrite): Replace inline code with a call to
vm_map_entry_reset_wired.
(vm_map_copyin_page_list): Likewise.
(vm_map_print): Likewise. Also print map size and wired size.
(vm_map_copyout_page_list): Update to account for map member variable
changes.
* vm/vm_map.h (struct vm_map_entry): Remove `user_wired_count' member,
add `wired_access' member.
(struct vm_map): Rename `user_wired' member to `size_wired'.
(vm_map_pageable_common): Remove function.
(vm_map_pageable_user): Remove macro.
(vm_map_pageable): Replace macro with function declaration.
* vm/vm_user.c (vm_wire): Update call to vm_map_pageable.
|
|
|
|
|
| |
ddb/db_elf.c (elf_db_search_symbol): Use ELF32_ST_BIND and ELF32_ST_TYPE to
access symbol bind and type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ddb/db_elf.c (elf_db_sym_init): Turn `i' into unsigned.
* device/ds_routines.c (ds_device_open, device_writev_trap): Likewise.
* i386/i386/user_ldt.c (i386_set_ldt): Likewise for `i', `min_selector', and
`first_desc'.
(i386_get_ldt): Likewise for `ldt_count'.
(user_ldt_free): Likewise for `i'.
* i386/i386/xen.h (hyp_set_ldt): Turn `count' into unsigned long.
* i386/intel/pmap.c (pmap_bootstrap): Turn `i', `j' and 'n' into unsigned.
(pmap_clear_bootstrap_pagetable): Likewise for `i' and `j'.
* ipc/ipc_kmsg.c (ipc_msg_print): Turn `i' and `numwords' into unsigned.
* kern/boot_script.c (boot_script_parse_line): Likewise for `i'.
* kern/bootstrap.c (bootstrap_create): Likewise for `n' and `i'.
* kern/host.c (host_processors): Likewise for `i'.
* kern/ipc_tt.c (mach_ports_register): Likewise.
* kern/mach_clock.c (tickadj, bigadj): turn into unsigned.
* kern/processor.c (processor_set_things): Turn `i' into unsigned.
* kern/task.c (task_threads): Likewise.
* kern/thread.c (consider_thread_collect, stack_init): Likewise.
* kern/strings.c (memset): Turn `i' into size_t.
* vm/memory_object.c (memory_object_lock_request): Turn `i' into unsigned.
* xen/block.c (hyp_block_init): Use %u format for evt.
(device_open): Drop unused err variable.
(device_write): Turn `copy_npages', `i', `nbpages', and `j' into unsigned.
* xen/console.c (hypcnread, hypcnwrite, hypcnclose): Turn dev to dev_t.
(hypcnclose): Return void.
* xen/console.h (hypcnread, hypcnwrite, hypcnclose): Fix prototypes
accordingly.
* xen/evt.c (form_int_mask): Turn `i' into int.
* xen/net.c (hyp_net_init): Use %u format for evt.
(device_open): Remove unused `err' variable.
|
|
|
|
|
|
| |
This reverts commit a8a52cafb5621b475737ffdc81f63703d5b37904.
It seems to be breaking backtracing in ddb...
|
|
|
|
|
| |
ddb/db_output.c (db_printf): Return 0.
ddb/db_printf.h (db_printf): Change declaration to return an int.
|
|
|
|
|
| |
ddb/db_elf.c (elf_db_search_symbol): Use ELF32_ST_BIND and ELF32_ST_TYPE to
access symbol bind and type.
|
|
|
|
|
| |
* ddb/db_output.c (db_putchar): Fix off-by-one, allowing one more
character to be printed before the newline is inserted.
|
|
|
|
|
|
|
|
|
| |
* ddb/db_command.c (db_show_cmds): Add `slabinfo'.
* kern/slab.c (slab_info): Generalize so that it can be used with
different printf-like functions, and turn it into a static function.
(slab_info): New wrapper retaining the old behaviour.
(db_show_slab_info): New wrapper that uses `db_printf' instead.
* kern/slab.h (db_show_slab_info): New declaration.
|
|
|
|
|
|
|
|
| |
* kern/lock.c (do_check_simple_locks): New variable.
(check_simple_locks): Make check conditional.
(check_simple_locks_{en,dis}able): New functions.
* kern/lock.h (check_simple_locks_{en,dis}able): New declarations.
* ddb/db_trap.c (db_task_trap): Disable simple lock checks.
|
|
|
|
|
| |
* ddb/db_trap.c (db_task_trap): Automatically display stack traces if
an unexpected trap occurs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the port names are mapped to an IPC object (e.g. a port)
using a table. This, however, requires large chunks of continuous
memory, and leads to scalability problems as virtual kernel memory is
a scarce resource. To avoid excessive overhead, non-contiguous port
names are spilled into a splay tree.
Replace the IPC table with a radix tree. As the radix tree is able to
store non-contiguous names with reasonable overhead, we can drop the
splay tree as well.
* ipc/ipc_entry.c (ipc_entry_tree_collision): Remove function.
(ipc_entry_cache): New variable.
(ipc_entry_lookup): Replace with a radix tree lookup.
(ipc_entry_get): The free list handling is changed a little. Adopt
accordingly.
(ipc_entry_free_name): New function.
(ipc_entry_alloc): Adopt accordingly.
(ipc_entry_alloc_name): Likewise.
(ipc_entry_dealloc): Likewise.
(ipc_entry_grow_table): Remove function.
* ipc/ipc_entry.h (struct ipc_entry): Update comment, add field for
name and free list, remove unused fields.
(ipc_entry_cache, ie_alloc, ie_free): New declarations.
(struct ipc_tree_entry): Remove. Also remove any related declarations.
(ipc_entry_grow_table): Remove declaration.
* ipc/ipc_init.c (ipc_bootstrap): Adopt initialization.
* ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): Use `ipc_entry_alloc'
instead of re-coding it. Adopt free list handling.
(ipc_kmsg_copyout_object): Adopt free list handling, store the name.
* ipc/ipc_object.c (ipc_object_copyout): Likewise.
(ipc_object_copyout_multiname): Likewise.
* ipc/ipc_space.c (ipc_space_create): Initialize radix tree and free list.
Drop table and splay tree initialization.
(ipc_space_destroy): Free ipc entries and radix tree, remove table and
splay tree cleanup.
* ipc/ipc_space.h (struct ipc_space): Add radix tree, free list, and size.
Remove all fields related to the table and splay tree.
* ddb/db_print.c (db_port_iterate): Adopt iteration.
(db_lookup_port): Adopt lookup.
* include/mach_debug/ipc_info.h: Remove unused parts of the debug interface.
* include/mach_debug/mach_debug.defs: Likewise.
* include/mach_debug/mach_debug_types.defs: Likewise.
* ipc/mach_debug.c: Likewise.
* ipc/ipc_right.c (ipc_right_reverse): Adopt lookup, store name.
(ipc_right_check): Adopt removal.
(ipc_right_destroy): Likewise.
(ipc_right_dealloc): Likewise.
(ipc_right_delta): Likewise.
(ipc_right_copyin): Adopt insertion, adopt removal.
(ipc_right_copyin_two): Adopt removal.
(ipc_right_copyout): Adopt insertion, adopt removal.
(ipc_right_rename): Likewise, also update comment.
* ipc/mach_port.c (mach_port_names): Adopt iteration.
(mach_port_get_set_status): Likewise.
* ipc/port.h: Update comment.
* ipc/ipc_hash.c: Delete file.
* ipc/ipc_hash.h: Likewise.
* ipc/ipc_splay.c: Likewise.
* ipc/ipc_splay.h: Likewise.
* Makefrag.am (libkernel_a_SOURCES): Remove these files.
|
|
|
|
| |
Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ddb/db_elf.c: New file.
* ddb/db_elf.h: Likewise.
* Makefrag.am (libkernel_a_SOURCES): Add db_elf.{c,h}.
* ddb/db_sym.c (dummy_db_sym_init): New stub db_sym_init function.
(db_sym_switch): Add ELF functions.
* ddb/db_sym.h (SYMTAB_ELF): New macro.
(elf_db_sym_init): New declaration.
* i386/i386at/model_dep.c (c_boot_entry): Get ELF section header
information from the multiboot structure, and call elf_db_sym_init.
|
|
|
|
|
|
| |
* ddb/db_command.c (db_show_all_cmds): Add `tasks'.
* ddb/db_print.c (db_show_all_tasks): New function.
* ddb/db_print.h (db_show_all_tasks): New prototype.
|
|
|
|
|
| |
* ddb/db_print.c (db_print_thread): Use db_thread_stat to format the
flags.
|
|
|
|
|
|
| |
* ddb/db_print.c (db_print_task): Print task name if available.
* i386/i386/db_interface.c (db_task_name): Likewise.
* i386/i386/db_machdep.h (DB_GNUMACH_TASK_NAME): Remove unused definition.
|
|
|
|
|
|
| |
* ddb/db_command.c (db_command_table): Add "halt" command.
* i386/i386/db_interface.h (db_halt_cpu): New declaration.
* i386/i386at/model_dep.c (db_halt_cpu): New function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert from K&R style function definitions to ANSI style
function definitions.
* ddb/db_access.c: Convert function prototypes from K&R to ANSI.
* ddb/db_aout.c: Likewise.
* ddb/db_break.c: Likewise.
* ddb/db_command.c: Likewise.
* ddb/db_cond.c: Likewise.
* ddb/db_examine.c: Likewise.
* ddb/db_expr.c: Likewise.
* ddb/db_ext_symtab.c: Likewise.
* ddb/db_input.c: Likewise.
* ddb/db_lex.c: Likewise.
* ddb/db_macro.c: Likewise.
* ddb/db_mp.c: Likewise.
* ddb/db_output.c: Likewise.
* ddb/db_print.c: Likewise.
* ddb/db_run.c: Likewise.
* ddb/db_sym.c: Likewise.
* ddb/db_task_thread.c: Likewise.
* ddb/db_trap.c: Likewise.
* ddb/db_variables.c: Likewise.
* ddb/db_watch.c: Likewise.
* device/blkio.c: Likewise.
* device/chario.c: Likewise.
* device/dev_lookup.c: Likewise.
* device/dev_name.c: Likewise.
* device/dev_pager.c: Likewise.
* device/ds_routines.c: Likewise.
* device/net_io.c: Likewise.
* device/subrs.c: Likewise.
* i386/i386/db_interface.c: Likewise.
* i386/i386/fpu.c: Likewise.
* i386/i386/io_map.c: Likewise.
* i386/i386/loose_ends.c: Likewise.
* i386/i386/mp_desc.c: Likewise.
* i386/i386/pcb.c: Likewise.
* i386/i386/phys.c: Likewise.
* i386/i386/trap.c: Likewise.
* i386/i386/user_ldt.c: Likewise.
* i386/i386at/com.c: Likewise.
* i386/i386at/kd.c: Likewise.
* i386/i386at/kd_event.c: Likewise.
* i386/i386at/kd_mouse.c: Likewise.
* i386/i386at/kd_queue.c: Likewise.
* i386/i386at/lpr.c: Likewise.
* i386/i386at/model_dep.c: Likewise.
* i386/i386at/rtc.c: Likewise.
* i386/intel/pmap.c: Likewise.
* i386/intel/read_fault.c: Likewise.
* ipc/ipc_entry.c: Likewise.
* ipc/ipc_hash.c: Likewise.
* ipc/ipc_kmsg.c: Likewise.
* ipc/ipc_marequest.c: Likewise.
* ipc/ipc_mqueue.c: Likewise.
* ipc/ipc_notify.c: Likewise.
* ipc/ipc_port.c: Likewise.
* ipc/ipc_right.c: Likewise.
* ipc/mach_debug.c: Likewise.
* ipc/mach_msg.c: Likewise.
* ipc/mach_port.c: Likewise.
* ipc/mach_rpc.c: Likewise.
* kern/act.c: Likewise.
* kern/exception.c: Likewise.
* kern/ipc_mig.c: Likewise.
* kern/ipc_tt.c: Likewise.
* kern/lock_mon.c: Likewise.
* kern/mach_clock.c: Likewise.
* kern/machine.c: Likewise.
* kern/printf.c: Likewise.
* kern/priority.c: Likewise.
* kern/startup.c: Likewise.
* kern/syscall_emulation.c: Likewise.
* kern/syscall_subr.c: Likewise.
* kern/thread_swap.c: Likewise.
* kern/time_stamp.c: Likewise.
* kern/timer.c: Likewise.
* kern/xpr.c: Likewise.
* vm/memory_object.c: Likewise.
* vm/vm_debug.c: Likewise.
* vm/vm_external.c: Likewise.
* vm/vm_fault.c: Likewise.
* vm/vm_kern.c: Likewise.
* vm/vm_map.c: Likewise.
* vm/vm_pageout.c: Likewise.
* vm/vm_user.c: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
Use strncpy instead of strcpy to copy the name of a symbol into the
symtab structure. Make sure that the string is properly terminated.
Found using Coverity.
* ddb/db_sym.c (db_add_symbol_table): Use strncpy instead of strcpy,
ensure string termination.
|
| |
|
|
|
|
| |
* ddb/db_watch.c (db_watchpoint_cmd) (db_option): Remove forward declaration.
|
|
|
|
|
|
|
|
| |
Declare void argument lists that were not declared in the first
part of this patch and
* kern/sched_prim.h (recompute_priorities): Fix prototype.
* kern/startup.c (setup_main) (recompute_priorities): Fix call.
|
|
|
|
|
| |
* ddb/db_command.h (db_error): Mark with attribute noreturn.
* i386/i386/setjmp.h (_longjmp): Likewise.
|
| |
|
|
|
|
|
|
| |
Initialize lhs to zero to avoid uninitialized usage in db_unary().
* ddb/db_expr.c (db_mult_expr) (lhs): Initialize to zero.
|
|
|
|
|
|
|
|
| |
Now that we have returns there are no more warnings from GCC about
uninitialized variable. Remove unnecessary initialization of variable
bkpt.
* ddb/db_break.c (db_delete_cmd) (bkpt): Remove unnecessary initialization.
|
|
|
|
|
|
|
| |
Variable addr and member address are already of db_addr_t type which
is type defined as vm_offset_t.
* ddb/db_break.c (db_find_breakpoint_here) (DB_PHYS_EQ) (addr, address): Remove unecessary casts.
|
| |
|
|
|
|
|
| |
* ddb/db_break.h (db_check_breakpoint_valid): Add prototype.
* ddb/db_trap.c (db_init_default_thread, db_check_breakpoint_valid): Remove forward declarations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this way everything falls into place and there is one cast less.
Function db_task_printsym() is already always called with the cast to
db_addr_t in the first argument.
* ddb/db_aout.c (aout_db_line_at_pc): Use db_addr_t instead of db_expr_t.
(aout_db_search_by_addr): Don't cast to vm_offset_t. Argument is already
db_addr_t.
* ddb/db_aout.h (aout_db_line_at_pc): Use db_addr_t instead of db_expr_t.
* ddb/db_sym.c (db_task_printsym): Likewise.
(db_line_at_pc): Likewise.
* ddb/db_sym.h (db_task_printsym): Likewise.
(db_line_at_pc): Likewise.
* i386/i386/db_trace.c (db_task_printsym): Cast to db_addr_t instead of db_expr_t.
Member swap_func is a pointer to void.
|
|
|
|
|
|
| |
Variable db_maxoff is in other files declared as unsigned long.
* ddb/db_print.c (db_maxoff): Use unsigned long instead of an unsigned int.
|
|
|
|
|
|
|
|
|
|
| |
Function db_console() is called only if CONSOLE_ON_MASTER.
If it stays this way, db_console() will not compile. I don't know
if it should be removed. Maybe someone will rewrite it.
* ddb/db_mp.c (db_console): Definition only if CONSOLE_ON_MASTER.
* ddb/db_mp.h [CONSOLE_ON_MASTER] (db_console): Add prototype.
|
|
|
|
| |
* ddb/db_mp.c (db_enter_debug): Use boolean instead of an int.
|
|
|
|
| |
* ddb/db_examine.c: Trivial stylistic fix for consistency.
|
|
|
|
| |
* ddb/db_examine.c (db_option): Remove forward declaration.
|
|
|
|
| |
* ddb/db_command.c (db_fncall): Remove forward declaration.
|
|
|
|
| |
* ddb/db_command.c (db_cmd_loop_done): Use boolean values.
|
|
|
|
|
|
| |
Variable addr is already of type db_addr_t.
* ddb/db_break.c (db_find_thread_breakpoint_here) (addr): Don't cast to db_addr_t.
|
|
|
|
| |
* ddb/db_break.c (db_add_thread_breakpoint): Fix argument list.
|
|
|
|
|
| |
* ddb/db_aout.c (db_sym_parse_and_lookup): Remove forward declaration.
* ddb/db_sym.h (db_sym_parse_and_lookup): Add prototype.
|
|
|
|
|
|
|
| |
Function aout_db_qualified_search() returns db_sym_t. Use DB_SYM_NULL as
return value instead of zero.
* ddb/db_aout.c (aout_db_qualified_search): Use DB_SYM_NULL as return value.
|