Project

General

Profile

Bug #10595

::kmalog doesn't work for early entries

Added by John Levon 11 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Start date:
2019-03-26
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

As seen in #10594, I have a zero-sized allocation, but ::kmalog zerosized is silent.
In fact, the log entry is there:

> ::kmalog zerosized
> 
> *kmem_zerosized_log::print kmem_log_header_t lh_hits lh_nchunks lh_chunksize lh_base
lh_hits = 0x1
lh_nchunks = 0x10
lh_chunksize = 0x1000
lh_base = 0xfffffe0385c8a000 "" 

> *kmem_zerosized_log::print kmem_log_header_t lh_base | >base
> <base+0x4000::bufctl -v
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
fffffe0385c8e000                0                0 fffffffffbc550a0
                                0                0                0
                 kmem_log_event+0x8f
                 kmem_alloc+0x15c
                 kmem_zalloc+0xed
                 used_res_io_mem+0x48
                 acpi_isa_device_enum+0xd9
                 isa_enumerate+0xde
                 impl_bus_initialprobe+0x65
                 impl_setup_ddi+0xdc
                 create_devinfo_tree+0xcc
                 setup_ddi+0x13
                 startup_modules+0xf6
                 startup+0x55
                 main+0x9b
                 _locore_start+0x90

> <base+0x4000::print kmem_bufctl_audit_t
{
    bc_next = 0
    bc_addr = 0
    bc_slab = 0
    bc_cache = 0
    bc_timestamp = 0
    bc_thread = t0
    bc_lastlog = 0
    bc_contents = 0
    bc_depth = 0xe
    bc_stack = [ 0xfffffffffbdc679f, 0xfffffffffbdc95ac, 0xfffffffffbdc943d, 0xfffffffff7843e98, 0xfffffffff7844019, 0xfffffffffbbd4fee, 0xfffffffffb8263a5, 0xfffffffffb82618c, 0xfffffffffbd1149c, 0xfffffffffbd10d43, 0xfffffffffb86b036, 0xfffffffffb869465, 0xfffffffffbde468b, 0xfffffffffb8000a0, 0 ]
}

The problem is that bc_timestamp is 0 (we were before gethrtime() was operation in KMEM_AUDIT()),
and that's what showbc() in ::kmalog's walker uses to decide the walk is done.

It could probably use another field instead.

Also available in: Atom PDF