ladybird/Kernel
Andreas Kling b32e961a84 Kernel: Implement a simple process time profiler
The kernel now supports basic profiling of all the threads in a process
by calling profiling_enable(pid_t). You finish the profiling by calling
profiling_disable(pid_t).

This all works by recording thread stacks when the timer interrupt
fires and the current thread is in a process being profiled.
Note that symbolication is deferred until profiling_disable() to avoid
adding more noise than necessary to the profile.

A simple "/bin/profile" command is included here that can be used to
start/stop profiling like so:

    $ profile 10 on
    ... wait ...
    $ profile 10 off

After a profile has been recorded, it can be fetched in /proc/profile

There are various limits (or "bugs") on this mechanism at the moment:

- Only one process can be profiled at a time.
- We allocate 8MB for the samples, if you use more space, things will
  not work, and probably break a bit.
- Things will probably fall apart if the profiled process dies during
  profiling, or while extracing /proc/profile
2019-12-11 20:36:56 +01:00
..
Arch/i386 Kernel: Break out of the idle loop on WaitQueue wake instead of on IRQ 2019-12-08 00:33:35 +01:00
Devices Kernel: Give PTY's *actually* unique major ID's 2019-12-09 21:03:39 +01:00
FileSystem Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
Heap Kernel: Demangle userspace ELF symbols in backtraces 2019-11-27 14:06:24 +01:00
Net AK: SinglyLinkedList::size_slow() should return size_t 2019-12-09 17:51:21 +01:00
TTY Kernel: Give PTY's *actually* unique major ID's 2019-12-09 21:03:39 +01:00
VM Kernel: Move VMObject::for_each_region() to MemoryManager.h 2019-12-09 20:06:03 +01:00
.bochsrc Meta: Make Serenity run on Bochs once again 2019-08-06 21:09:24 +02:00
.gitignore Meta: Removed all gitignore in the source tree only keeping the root one 2019-06-30 10:41:26 +02:00
Assertions.h Kernel: Move i386.{cpp,h} => Arch/i386/CPU.{cpp,h} 2019-06-07 20:02:01 +02:00
build-gpt-image-grub.sh Build: Fix more bugs in the POSIX sh-ification of scripts 2019-11-03 13:11:43 +01:00
build-image-grub.sh Build: Bump the default disk image size from 500MB to 600MB 2019-11-26 12:54:33 +01:00
build-image-qemu.sh Build: Bump the default disk image size from 500MB to 600MB 2019-11-26 12:54:33 +01:00
build-root-filesystem.sh MenuApplets: Add CPUGraph, our first menu applet :^) 2019-12-05 19:38:08 +01:00
CMOS.cpp AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
CMOS.h AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
Console.cpp Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
Console.h Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
DoubleBuffer.cpp Revert "Kernel: Make DoubleBuffer use a KBuffer instead of kmalloc()ing" 2019-10-18 15:58:06 +02:00
DoubleBuffer.h Revert "Kernel: Make DoubleBuffer use a KBuffer instead of kmalloc()ing" 2019-10-18 15:58:06 +02:00
FB.h Kernel: Add framebuffer ioctls; wrap raw ioctls with a C API 2019-08-18 07:40:02 +02:00
grub_gpt.cfg PartitionTable: Initial GPT Support, Adding Block Limit 2019-10-07 10:11:39 +02:00
grub.cfg Kernel: Add serial_debug cmdline parameter 2019-08-11 08:22:42 +02:00
init.cpp Kernel: Use a WaitQueue to implement finalizer wakeup 2019-12-01 19:17:17 +01:00
install.sh POSIX compliance: (most) shell scripts converted to generic shell 2019-11-03 09:26:22 +01:00
IO.h Kernel: First cut of a sb16 driver 2019-07-13 08:00:24 +02:00
IRQHandler.cpp Kernel: Move PIC.cpp into Arch/i386/ 2019-07-09 15:04:43 +02:00
IRQHandler.h AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
KBuffer.h Kernel: Make Region single-owner instead of ref-counted 2019-09-27 14:25:42 +02:00
KBufferBuilder.cpp Kernel: Add KBufferBuilder, similar to StringBuilder but for KBuffer 2019-08-06 20:04:12 +02:00
KBufferBuilder.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
KeyCode.h AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
KParams.cpp AK: Make HashMap::get(Key) return an Optional<Value>. 2019-07-24 10:25:43 +02:00
KParams.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
kprintf.cpp Kernel: Demangle userspace ELF symbols in backtraces 2019-11-27 14:06:24 +01:00
KResult.h Kernel: Align the KResult value storage appropriately. 2019-08-02 19:22:48 +02:00
kstdio.h Kernel: Demangle userspace ELF symbols in backtraces 2019-11-27 14:06:24 +01:00
KSyms.cpp Kernel: Demangle kernel C++ symbols correctly again 2019-11-29 14:59:15 +01:00
KSyms.h Kernel: Allow modules to link against anything in kernel.map :^) 2019-11-28 21:30:20 +01:00
linker.ld Revert "Kernel: Move Kernel mapping to 0xc0000000" 2019-11-23 17:27:09 +01:00
Lock.cpp Kernel: Use a dedicated thread state for wait-queued threads 2019-12-01 16:02:58 +01:00
Lock.h Kernel: Add a WaitQueue for Thread queueing/waking and use it for Lock 2019-12-01 12:07:43 +01:00
makeall.sh MenuApplets: Add CPUGraph, our first menu applet :^) 2019-12-05 19:38:08 +01:00
Makefile Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
mkmap.sh Kernel: Allow modules to link against anything in kernel.map :^) 2019-11-28 21:30:20 +01:00
Module.h Kernel: Implement basic module unloading :^) 2019-11-28 21:07:22 +01:00
MousePacket.h AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
Multiboot.h AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
PCI.cpp Kernel: Hide PCI logs behind a debug flag like other logs 2019-08-14 06:28:53 +02:00
PCI.h Kernel: Add more PCI configuration reading functions 2019-08-14 06:28:53 +02:00
Process.cpp Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
Process.h Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
ProcessTracer.cpp AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
ProcessTracer.h Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
Profiling.cpp Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
Profiling.h Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
RTC.cpp Kernel: Fix BIOS date/time on hardware 2019-09-28 13:59:49 +02:00
RTC.h Add clang-format file 2019-05-28 17:31:20 +02:00
run run: Unbreak this script when running with a regular Bourne /bin/sh 2019-11-13 21:57:51 +01:00
Scheduler.cpp Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
Scheduler.h Kernel: Use a WaitQueue to implement finalizer wakeup 2019-12-01 19:17:17 +01:00
SharedBuffer.cpp Kernel: Teach Region how to remap itself 2019-11-03 21:11:08 +01:00
SharedBuffer.h Kernel+LibC: Make all SharedBuffers purgeable (default: non-volatile) 2019-12-09 20:06:47 +01:00
StdLib.cpp Kernel: Demangle userspace ELF symbols in backtraces 2019-11-27 14:06:24 +01:00
StdLib.h Kernel: Add strncmp() 2019-08-11 16:30:43 +02:00
sync.sh Build: Make sure PATH is passed properly (#765) 2019-11-12 10:26:50 +01:00
Syscall.cpp Kernel: Disallow syscalls from writeable memory 2019-11-29 16:30:05 +01:00
Syscall.h Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
TestModule.cpp Kernel: Have modules export their name in a "module_name" string 2019-11-29 21:31:17 +01:00
Thread.cpp Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
Thread.h Kernel: Implement a simple process time profiler 2019-12-11 20:36:56 +01:00
UnixTypes.h Kernel: Start implementing purgeable memory support 2019-12-09 19:12:38 +01:00
WaitQueue.cpp Kernel: Break out of the idle loop on WaitQueue wake instead of on IRQ 2019-12-08 00:33:35 +01:00
WaitQueue.h Kernel: Add a WaitQueue for Thread queueing/waking and use it for Lock 2019-12-01 12:07:43 +01:00