History log of /fuchsia/zircon/kernel/lib/ktrace/ktrace.cpp
Revision Date Author Comments
# 9dd5b5f5 24-May-2018 Adam Barth <abarth@chromium.org>

[syscalls] Update parameter types and names

This CL updates the parameter types and names for a number of syscalls
to match the Zircon System API rubric. There's more work to do to make
all the syscalls conform to the rubric, but this change is a start.

Change-Id: I218ac5e7e0cbd80a8c69fef7891ad40b78b6b407


# 87b543ef 18-Mar-2018 Abdulla Kamar <abdulla@google.com>

[hypervisor][ktrace] Add VCPU blocking events

Add ktrace events for when the VCPU is blocked while either waiting for
an interrupt or waiting for a port packet to become available.

This also restructures the way we record metadata for VCPU ktraces in
order to be more efficient.

PD-100 #comment

Change-Id: I43551a0068bb3d6393a9a58c21b3ea813edfb726


# e2800c96 05-Dec-2017 George Kulakowski <kulakowski@google.com>

[ktrace] Use RAII mutex in ktrace

Change-Id: I18a962d2cd5489cc760710be535627d865435201


# 47884aba 17-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][ktrace][arm] use the raw tick counter for ktrace on arm

-Add current_ticks() call which uses the appropriate architectural
counter.
-Switch ktrace to using that.

ZX-1387 #comment

Change-Id: I10f1f50c7b464abb241bf719026fbdca046b1226


# e09e4008 13-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel][ktrace] Revamp static registration, add "ktrace_ready" probe

Change the static registration scheme so that the "orphan" section
created is read-only. Writable "orphan" sections do not come out
right with LLD and we must avoid them.

Report an event for "tracing is all set up now". This also serves
to ensure that there will be at least one static probe entry so that
registration is actually tested. Since __{start,stop}_ktrace_probe
symbols will always be defined by the linker, we don't need to use
weak symbols, which force the compiler to use a GOT slot under PIC.

Along the way this makes the ktrace_probeN macros C++-compatible
and ;-eating.

Change-Id: I30c5aac0af1c5822e4aff3fedaac5dd961b97dfd


# 07e82268 05-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel] Remove kernel/app module

This is no longer used at all.
The kernel/app/tests code doesn't use the "app" infrastructure.
So move it to kernel/tests.

Change-Id: I6cd8ec1bf569fd95940e5ebf4dc5f640b265eb69


# 3508e365 26-Sep-2017 Erik Gilling <konkers@google.com>

[ktrace] Use ZX_MAX_NAME_LEN in ktrace_name_etc().

Use (ZX_MAX_NAME_LEN - 1) instead of hard coded 31.

Change-Id: I844c4da84a18d1112eb4bd674b72810d12ac4ac7


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# e1490736 01-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move kernel/kernel/vm to just kernel/vm

Change-Id: I8f724a9f8a61415712661d1fdd3dc4e1c70cf620


# 388a7f68 31-Aug-2017 Dave Bort <dbort@google.com>

[lib/magenta] Rename kernel/lib/magenta to kernel/object

TODO: Rename magenta.{cpp,h} and other instances of "magenta" in this
module.

For MG-1091 "Rename kernel/lib/magenta"

Change-Id: I2abc316f543798e00d3a4d1c2c83195da26e6836


# 22256063 21-Aug-2017 George Kulakowski <kulakowski@google.com>

[kernel][status] Convert the rest of kernel/lib to mx_status_t

Change-Id: Iba1bb7024bcefa7c5e3ee58b02d0be758c6545ae


# 32181c1a 24-Jul-2017 George Kulakowski <kulakowski@google.com>

[magenta][userthread] Collapse user_thread.h and thread_dispatcher.h

Change-Id: I76cab0bdffbc4d1411f9aea71a68217f85dccc98


# 1da9ff74 21-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][ktrace] push all of the process names into the ktrace buffer when restarting

Change-Id: Ib310618aa964e1a9bbc0e719b029455b4dd6562e


# afa9d2b6 15-Jun-2017 George Kulakowski <kulakowski@google.com>

[kernel][lib] Use the new MX_OK and MX_ERR_* names

Change-Id: I436bb0728838729bef6e20a6db0e8ce6a96b5534


# d77d89b6 06-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] restructure kernel vm headers and remove more legacy routines

Mostly unpack vm.h into a few separate headers.

No functional change

Change-Id: Ifd85506f49596d82a3a0e970fc911a34f3064d70


# 063b76c3 25-May-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][ktrace] move the timestamp getting to the point where its stored

shouldn't affect timestamping much and speeds up cases where it's masked
out.

Change-Id: I81845f1207825800e143b037868674d4dde0539f


# 487eabf3 02-May-2017 Abdulla Kamar <abdulla@google.com>

[kernel][timer] Remove get_tsc_ticks_per_ms.

We already have ticks_per_second, which is used everywhere else.

Change-Id: I88c3ed210b80597db755f68257700c1bbaaf7d74


# 633e58eb 26-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][vm] Remove defunct min_alloc_gap arguments

Change-Id: I931dd3a70fff34ca2acd157f8fcedd71ba9e44a3


# 5d9c4f03 25-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][pc] Finish C++ conversion

Change-Id: Iea6ff5e497597c1b0cd3a914e1a3cdd5b641cf58


# ab10aa63 25-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][time] Rename lk_bigtime_t and current_time_hires()

Now that millisecond time is gone from the kernel, reclaim the names
used for it.

lk_bigtime_t -> lk_time_t
current_time_hires() -> current_time()

Change-Id: I7db5de01171096c04a2b12d293e047e6a08a0aef


# 32aa0515 15-Mar-2017 Andy Mutton <andymutton@google.com>

[sysgen][kernel] Make sysgen totes a build time thing.

This patch does the following things:
- removes all commited sysgen generated code.
- generates all sysgen code into gen/include
other directory opinions welcome.
- changes sysgen to generate a single file of a single type
(it was easier to work with this way - I may delete the other version).
- changes various makefiles and sources to work with new include paths.
- changes all the filenames to things that are slightly better than gen-*
other filename opinions welcome.

Please commence filename, output-path and make-fu bike-shedding... now!

Change-Id: I822bb685820a05a1467b12097175c92881c4bd4a


# e65268a4 14-Mar-2017 George Kulakowski <kulakowski@google.com>

[magenta][locks] Annotate some mutexes

Change-Id: I8ff6ad8d3e6dbe424e8e7cfdb06943b5838ae8b4


# 27eb826d 27-Feb-2017 George Kulakowski <kulakowski@google.com>

[kernel][style] Use nullptr rather than NULL in kernel C++ code

Change-Id: I7feea6a42c00531be28a98c820b2c234484bfe3b


# aaca9508 12-Dec-2016 Carlos Pizano <cpu@google.com>

[syscalls] switch to generated code

...from the macro and syscall.inc universe

Most of the turbulence is changing the badgercast back
to T* and the adding user_ptr<T> in each spot which
looks less pretty but it is correct by construction
and a temporary state anyhow.

In the final state the syscalls would look and speak
pretty again, but that needs more codegen.

Along with this we also change pointer/buffers from
user mode to have underscore prefix, so we are consistent
there.

Change-Id: I8342210f667f5056ac56a5bab168cb8776ab35ce


# 3a057a23 09-Nov-2016 Roland McGrath <mcgrathr@google.com>

[kernel][vdso] Implement mx_num_cpus in vDSO without a syscall

Remove the mx_num_cpus syscall and replace it with a pure
user-space implementation in the vDSO. The kernel writes
the value into the vDSO's rodata in the VMO, so the vDSO
code can simply read it.

Change-Id: I1a86d877bbb49f2d8e68a16455f31a10d04c86d0


# 9b2038fb 17-Oct-2016 Jeff Brown <jeffbrown@google.com>

[ktrace] fix memory corruption due to long probe names

Change-Id: Ia2b22c7b35402ef1049dde9e17b4191605146552


# d835bf19 10-Oct-2016 Brian Swetland <swetland@google.com>

[ktrace] add userspace trace probe support

- /dev/class/misc/ktrace gains two ioctls:
- IOCTL_KTRACE_GET_HANDLE
- IOCTL_KTRACE_ADD_PROBE
- mx_ktrace_write() syscall allows injecting probes from userspace
- ktrace supports runtime probe registration

Change-Id: I6cf34da5cb044c1432f926466e29d5a2005c4851


# f59d9ef8 02-Sep-2016 Todd Eisenberger <teisenbe@google.com>

[vmm] Add support for requesting gaps between allocations

The gaps are guaranteed at the time of invocation, though may
be filled by subsequent allocations that have smaller gap requirements.
A future revision could make the gaps hard requirements.

Change-Id: I3be705d8e07c1c2b4bdd9f70bce57f9640c73ff2


# f5d5842b 04-Oct-2016 Travis Geiselbrecht <travisg@google.com>

[kernel] add -Wmissing-prototypes, fix all the warnings that show up

Mostly just a bunch of functions that needed to be made static, though
fix a few places where a prototype needs to be moved into a header
to be shared across a few files.

Change-Id: Ic7510490257c5c9ef1c702317db4121c45daae35


# a9bebf05 03-Oct-2016 Travis Geiselbrecht <travisg@google.com>

[kernel][time] move current_time_hires() to nanoseconds

Find all the cases where it's used (mostly for benchmarking) and
make sure it's in nanoseconds.

Switch the PC time calculations to use the fixed point multiplication
routines.

Change-Id: I06ef9d705dbef3f23e20bf25b7a8c7c8f37a72b4


# df410dab 20-Sep-2016 Brian Swetland <swetland@google.com>

[ktrace] ktrace_probe0(name), ktrace_probe2(name,a,b) for quick probing

These macros allow 0 or 2 argument named tracepoints to be created.
They are assigned an event number in the 0x800..0xFFF range and a
mapping from event number to name is added to the trace metadata.

Change-Id: I0385f1b06a1cc45114d3b2cf3915a23e0cb640ee


# e3f7c52f 18-Sep-2016 Brian Swetland <swetland@google.com>

[ktrace] trace syscall enter/exit, irq enter, some cleanup

Change-Id: Iad65dcba3fb6c9cea6a35ad05536c51bca15d230


# c88c2c44 17-Sep-2016 Brian Swetland <swetland@google.com>

[ktrace][ktracedump] report existing threads when trace starts

Change-Id: Ia6c05389a51675d5aabaaaa46dc8421125398e70


# cf3d281d 17-Sep-2016 Brian Swetland <swetland@google.com>

[ktrace][ktracedump] move to variable sized ktrace records

The low 4 bits of the record now indicate the size of the entire
record, in units of sizeof(uint64_t)

ktrace_open(tag) now provides a common path to acquire a record
to write a payload into, with the timestamp, thread id, and tag
pre-loaded. It returns NULL if tracing is disabled, the event
group is masked, or the trace buffer is full.

re-implemented ktrace_name() against ktrace_open() and ktrace()
as an inline function against ktrace_open()

Update ktracedump to handle the changes to the wire format.

Change-Id: Ifc1d58beb7ca8fc017b9a6b4d0edb97cdb908cf6


# 794863d3 04-Sep-2016 Brian Swetland <swetland@google.com>

[ktrace] core kernel event tracing facility

This adds the ktrace() tracepoint system, which compiles
out to nothing when WITH_LIB_KTRACE is not included.

Trace packets are accumulated in a buffer and an API is
provided to drain the buffer, start/stop tracing, adjust
trace event group masks to determine which events to
capture, etc.

The default buffer size is 32MB. It is adjustable with
the commandline option ktrace.bufsize (value in MB).

The default group mask for tracing from boot is all groups.
It is adjustable with ktrace.grpmask.

Change-Id: I491e4303f858021f9bf9600ba22ecb2c763d0e22