Commit Graph

17563 Commits

Author SHA1 Message Date
Andreas Kling
0fc3983c8d Profiler: Cache and reuse mapped ELF objects
In multi-process profiles, the same ELF objects tend to occur many
times (everyone has libc.so for example) so we will quickly run out
of VM if we map each object once per process that uses it.

Fix this by adding a "mapped object cache" that maps the path of
an ELF object to a cached memory mapping and wrapping ELF::Image.
2021-03-03 22:57:45 +01:00
Bui Quang Minh
faed0e63dc HackStudio: Allow multi-selection in project view tree 2021-03-03 21:59:22 +01:00
Zac
6d68ae45b4 FileManager: Add launch handler actions to desktop context menu
Extracted a method from the code in the File Manager application which
added actions for activating launch handlers found for the selected
file from the context menu. Applied this method to desktop files
and shortcuts.

Note: made some launch handler related methods in the DirectoryView
static or const which allows passing const DirectoryView& to certain
methods.
2021-03-03 21:53:01 +01:00
davidot
9fd9ce1f9e LibWeb: Stop scrolling above content in BlockBox 2021-03-03 21:48:51 +01:00
Andreas Kling
157af93d69 Base: Set a nice PROMPT in /etc/shellrc :^) 2021-03-03 20:37:23 +01:00
Andreas Kling
bcca3d4cdd Terminal: Stop pushing a PROMPT into the shell's environment
This isn't the terminal's responsibility.
2021-03-03 20:37:23 +01:00
Andreas Kling
d96a44a738 Kernel: Avoid transient kmalloc heap allocations in sys$select()
Dynamic Vector allocations in sys$select() were showing up in the
full-system profile and since there will never be more than FD_SETSIZE
file descriptors to worry about, we can confidently add enough inline
capacity to this Vector that it never has to kmalloc.

To compensate for the increased stack usage, reduce the size of the
FDInfo struct while we're here. :^)
2021-03-03 20:37:23 +01:00
Ben Wiederhake
cf32f29af6 AK+LibM: Rename EXPECT_CLOSE to EXPECT_APPROXIMATE 2021-03-03 20:19:24 +01:00
Ben Wiederhake
5df014b8ff AK+LibM: Make EXPECT_CLOSE more useful during debugging 2021-03-03 20:19:24 +01:00
Marco
9b27b0cd1a Kernel: init: Make comment clearer 2021-03-03 14:18:43 +01:00
ihsinme
69f82ede7a AK: Fix OOO mistake in StackInfo.cpp
"!=" has higher priority than "=".
2021-03-03 11:09:44 +01:00
Brian Gianforcaro
afe099388e Kernel: Add 'boot_prof' option to enable full system profiling on boot
The full system profiling functionality is useful for profiling the
boot performance of the system. Add a new kernel boot option to start
the system with profiling enabled. This lets you disable and view a
profile once the system is booted.

You can use it by running:
```
$ run.sh qcmd boot_prof
```
2021-03-03 11:05:16 +01:00
Brian Gianforcaro
0f424afd5a Kernel: Mark more of the kernel initialization as UNMAP_AFTER_INIT 2021-03-03 11:05:16 +01:00
Brian Gianforcaro
84a399de5d Kernel: Move Kernel CommandLine parsing to strongly typed API.
Previously all of the CommandLine parsing was spread out around the
Kernel. Instead move it all into the Kernel CommandLine class, and
expose a strongly typed API for querying the state of options.
2021-03-03 11:05:16 +01:00
Nick Johnson
74881ac649
Kernel: Make InstructionFetch PageFault flags match up (#5608)
Previously, the instruction fetch flag of the page fault handler
did not have the currect binary representation, and would always
return false. This aligns these flags.
2021-03-03 11:04:51 +01:00
Linus Groh
585123127e LibJS: Support @@toPrimitive in ToPrimitive abstract operation
Fixes #3961.
2021-03-03 11:04:06 +01:00
one-some
f99644e75b Cube: Add an argument for the "frameless cube" option 2021-03-03 11:03:34 +01:00
Ben Wiederhake
add94aebfa Kernel: Don't trust user-supplied bool in sys$stat
Found by fuzz-syscalls. Can be reproduced by running this in the Shell:
    $ syscall stat [ Desktop 7 buf 2 ]

Fixes #5316.
2021-03-03 11:03:03 +01:00
Tom
c73dfe5bf6 WindowServer: Mark screen dirty when changing highlighted window
Because the z-order changes we not only need to recompute occlusions
but we also need to mark the screen area of the previous and new
highlighted window as dirty.

Fixes #5599
2021-03-03 08:20:11 +01:00
Tom
87c1b1a25d WindowServer: Use active shadow for highlighted window
If we're switching through windows we should also use the active
shadow for the highlighted window.
2021-03-03 08:20:11 +01:00
Tom
c57d719d62 WindowServer: Prepare dirty rects if only the frame was invalidated 2021-03-03 08:20:11 +01:00
Andreas Kling
5e7abea31e Kernel+Profiler: Capture metadata about all profiled processes
The perfcore file format was previously limited to a single process
since the pid/executable/regions data was top-level in the JSON.

This patch moves the process-specific data into a top-level array
named "processes" and we now add entries for each process that has
been sampled during the profile run.

This makes it possible to see samples from multiple threads when
viewing a perfcore file with Profiler. This is extremely cool! :^)
2021-03-02 22:38:06 +01:00
Andreas Kling
ea500dd3e3 Kernel: Start work on full system profiling :^)
The superuser can now call sys$profiling_enable() with PID -1 to enable
profiling of all running threads in the system. The perf events are
collected in a global PerformanceEventBuffer (currently 32 MiB in size.)

The events can be accessed via /proc/profile
2021-03-02 22:38:06 +01:00
Andreas Kling
b425c2602c Kernel: Better handling of allocation failure in profiling
If we can't allocate a PerformanceEventBuffer to store the profiling
events, we now fail sys$profiling_enable() and sys$perf_event()
with ENOMEM instead of carrying on with a broken buffer.
2021-03-02 22:38:06 +01:00
Linus Groh
e7ef729db3 LibJS: Use Value::get_method() a bunch 2021-03-02 19:20:29 +01:00
Linus Groh
1b43a6ef2d LibJS: Implement the GetMethod abstract operation
https://tc39.es/ecma262/#sec-getmethod

We have bunch of duplicated on-demand versions of this, let's do it
properly.
2021-03-02 19:20:29 +01:00
Ashleigh Newman-Jones
f0912027ff Kernel: Enable AVX flags if supported by cpu
This enables AVX and its dependency CR4.OSXSAVE when both are available on the cpu.
2021-03-02 16:35:06 +01:00
Mart G
de9f458ff5 SpaceAnalyzer: Reduce thickness of black borders between cells.
-Adds take_from_{left,right,top,bottom} to Rect.
2021-03-02 14:46:06 +01:00
Bui Quang Minh
ee7c8fbd7b HackStudio: Implement removing file from disk 2021-03-02 14:45:18 +01:00
William McPherson
c7777ff289 Piano: Reset position in piano roll when exporting
When you reset() a Track, you need to set the piano roll iterators back
to the first notes.

Fixes #2578. The bug was due to pressing export between 2 notes - the
tracks were never told to go back to the first note.
2021-03-02 14:44:42 +01:00
Andreas Kling
dce030eefc Kernel: Use RDTSC instead of get_fast_random() for syscall stack noise
This was the original approach before we switched to get_fast_random()
which wasn't fast enough, so we added a buffer.

Unfortunately that buffer is racy and we can actually skid past the end
of it and continue fetching "random" offsets from the adjacent memory
for a while, until we run out of kernel data segment and trip a fault.

Instead of making this even more convoluted, let's just go back to the
pleasantly simple (RDTSC & 0xff) approach. :^)

Fixes #4912.
2021-03-02 14:25:38 +01:00
Itamar
05c48cc8d8 LanguageServers/Cpp: Fix nullptr dereference in ~LanguageClient
The WeakPtr to the ServerConnection is nullified if the server crashes.

Closes #5570.
2021-03-02 13:37:26 +01:00
Angus Gibson
0e881bc5d7 LibWeb: Handle scrolling an OutOfProcessWebView
When a mousewheel scroll event isn't handled by the web content
itself (e.g. an overflowed box or similar), the event needs to get
passed back up to the OutOfProcessWebView.
2021-03-02 13:20:03 +01:00
Angus Gibson
e9c1d9c89a LibWeb: Return whether handle_mousewheel was handled
We try scrolling a Node with the handle_mousewheel event, but if it
isn't scrollable, the event should be passed back up to the page
host. This is the first step in that process.
2021-03-02 13:20:03 +01:00
Itamar
17e6287333 LanguageServers/Cpp: Fix typo 2021-03-02 12:50:37 +01:00
Itamar
1d3b5dabc3 LibCpp: Parse ellipsis
We can now parse the printf function declaration :^)
2021-03-02 12:50:37 +01:00
Itamar
5c79297b2c LibCpp: Consume attribute specification when parsing
Consume __atribute__(...), without actually parsing its content.
2021-03-02 12:50:37 +01:00
Itamar
5a7abb8363 LibCpp: Parse type qualifiers 2021-03-02 12:50:37 +01:00
thankyouverycool
71a123148a Serendipity: A new welcome app
Provides the basic Help+ReadMe care package to new users and some
interesting tips to get started. Feel free to add more!
2021-03-02 11:57:27 +01:00
thankyouverycool
0443cd4eed LibGUI: Add word wrapping to Labels
Adds basic word wrap support to Label widgets. Doesn't yet
negotiate autosize or Center/Bottom TextAlignments perfectly.
2021-03-02 11:57:27 +01:00
Andrew Kaster
1aa605bc03 Meta: Run test-js and test-compress as CTest executables
Reduces the number of steps in the Actions workflow this way :^)
2021-03-02 09:00:21 +01:00
Andrew Kaster
8453bb3461 Userland: Gate OSC 9 usage in test-js behind an argument
Instead of assuming that we should use the OSC 9 progress messages
whenever we run on serenity, add a show-progress=[true|false] option.

This lets us avoid seeing esc sequence spam in GitHub Actions logs.
2021-03-02 09:00:21 +01:00
Linus Groh
d8415520de LibJS: Put console dbgln() logging behind #ifdef __serenity__
No need to have duplicate output in the Lagom-built js REPL. :^)
2021-03-02 08:36:34 +01:00
Ben Wiederhake
25301e450a Kernel: Fix sign error in TCP resend logic 2021-03-02 08:36:08 +01:00
Ben Wiederhake
5c15ca7b84 Kernel: Make sockets use AK::Time 2021-03-02 08:36:08 +01:00
Ben Wiederhake
719cb93a1a Kernel: Make clang(?) happy about templates(?)
This caused some issues with QtCreator, and since it's not wrong and improves
readability very slightly, I adopt it.
2021-03-02 08:36:08 +01:00
Ben Wiederhake
336303bda4 Kernel: Make kgettimeofday use AK::Time 2021-03-02 08:36:08 +01:00
Ben Wiederhake
05d5e3fad9 Kernel: Remove duplicative kgettimeofday(timeval&) function 2021-03-02 08:36:08 +01:00
Ben Wiederhake
c040e64b7d Kernel: Make TimeManagement use AK::Time internally
I don't dare touch the multi-threading logic and locking mechanism, so it stays
timespec for now. However, this could and should be changed to AK::Time, and I
bet it will simplify the "increment_time_since_boot()" code.
2021-03-02 08:36:08 +01:00
Ben Wiederhake
91c72faa3c Kernel: Make TimerQueue use AK::Time in interface 2021-03-02 08:36:08 +01:00