Commit Graph

86 Commits

Author SHA1 Message Date
Thomas Wagenveld
df6db8b8cc Userland: Make representation of 'null' IPv4-address friendlier
Show an empty column rather than 'null' in SystemMonitor and show
'no IP' in the network applet if the adapter has no IPv4-address
configured.
2021-08-03 10:20:51 +02:00
Thomas Wagenveld
3a40287776 Userland: Add network adapter link status to SystemMonitor and applet
Add a column named 'Link status' to the Network tab in SystemMonitor
showing the speed and duplex if the link is up.
Add the link speed behind the existing text in the applet or show
'down' if the link is down.
2021-08-03 10:20:51 +02:00
sin-ack
eb6cf00c0e SystemMonitor: Register ProcessStateModel with ProcessModel on construct
Since this was missing, ProcessStateModel never received
model_did_update, and it was possible for the ProcessModel index to go
stale and show another process.

Fixes #9129.
2021-08-01 19:26:07 +04:30
Brian Gianforcaro
a51e6547aa Applications: Remove unused header includes 2021-08-01 08:10:16 +02:00
Marcus Nilsson
ebb96b7fea SystemMonitor: Only update kill actions when pid changes
Return early from on_selection_change if the pid hasn't changed or we
get an invalid result from selected_id().
2021-07-29 11:44:26 +02:00
Marcus Nilsson
5fbb476856 SystemMonitor: Use kill(pid,0) when checking for kill permission
We can use kill(pid,0) to check for kill permissions instead of relying
on file path access. Using 0 as signal does error checking but does not
send a signal.
2021-07-29 11:44:26 +02:00
Maciej Zygmanowski
13773d3ced SystemMonitor: Display connection status icons in Network tab 2021-07-27 00:28:12 +02:00
brapru
c4eaba6c88 SystemManager: Separate sockets GroupBox into TCP/UDP 2021-07-25 00:33:00 +02:00
Andreas Kling
687a12d7fb Userland: Add GUI::Window::add_menu() and use it everywhere
Applications previously had to create a GUI::Menubar object, add menus
to it, and then call GUI::Window::set_menubar().

This patch introduces GUI::Window::add_menu() which creates the menubar
automatically and adds items to it. Application code becomes slightly
simpler as a result. :^)
2021-07-21 21:24:26 +02:00
Andreas Kling
c7d891765c LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
2021-07-21 18:02:15 +02:00
Tom
a635ff4e60 Everywhere: Make tracking cpu usage independent from system ticks
This switches tracking CPU usage to more accurately measure time in
user and kernel land using either the TSC or another time source.
This will also come in handy when implementing a tickless kernel mode.
2021-07-18 22:08:26 +02:00
Tom
7e77a2ec40 Everywhere: Improve CPU usage calculation
As threads come and go, we can't simply account for how many time
slices the threads at any given point may have been using. We need to
also account for threads that have since disappeared. This means we
also need to track how many time slices we have expired globally.

However, because this doesn't account for context switches outside of
the system timer tick values may still be under-reported. To solve this
we will need to track more accurate time information on each context
switch.

This also fixes top's cpu usage calculation which was still based on
the number of context switches.

Fixes #6473
2021-07-18 22:08:26 +02:00
Gunnar Beutner
ed25a6ad0d SystemMonitor: Add support for 64-bit addresses 2021-07-18 17:31:13 +02:00
Tom
ad5d9d648b Kernel: Use PAE to allow accessing all physical memory beyond 4GB
We already use PAE for the NX bit, but this changes the PhysicalAddress
structure to be able to hold 64 bit physical addresses. This allows us
to use all the available physical memory.
2021-07-08 11:43:34 +02:00
Daniel Bertalan
ca06fd658d Everywhere: Remove unused local variables and lambda captures 2021-07-08 10:11:00 +02:00
Spencer Dixon
00f93b2545 LibThreading: Add ability to cancel ongoing BackgroundActions
Handlers of the BackgroundAction are responsible for checking if the
action has been cancelled and returning early.
2021-07-02 16:47:14 +02:00
Andreas Kling
ee3a73ddbb AK: Rename downcast<T> => verify_cast<T>
This makes it much clearer what this cast actually does: it will
VERIFY that the thing we're casting is a T (using is<T>()).
2021-06-24 19:57:01 +02:00
Gunnar Beutner
631d36fd98 Everywhere: Add component declarations
This adds component declarations so that users can select to not build
certain parts of the OS.
2021-06-17 11:03:51 +02:00
Ali Mohammad Pur
7ac196974d Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&> 2021-06-08 19:14:24 +02:00
Marcus Nilsson
b06d01f040 SystemMonitor: Disable menu items for inaccessible process
Disable the context menu items if user cannot access the process.

Fixes #7486
2021-05-28 18:45:57 +01:00
Jesse Buhagiar
2753505962 SystemMonitor: Use u64 for disk sizes
This fixes #7288, which was being caused by unsigned 32-bit integer
overflow
2021-05-28 16:37:25 +01:00
Andreas Kling
a1e133cc6b LibCore: Make ProcessStatisticsReader return results in a Vector
The HashMap API was overkill and made using this less ergonomic than
it should be.
2021-05-23 11:10:15 +02:00
Andreas Kling
786f6841b3 SystemMonitor: Remove "Inspect Process" action from context menu
Since everyone opts out of being inspectable by default now, let's not
offer inspection from the menu since it will fail in a default setup.
2021-05-22 23:30:40 +02:00
Andreas Kling
9676548800 SystemMonitor: Symbolicate process stacks in a background thread
Use a Threading::BackgroundAction to symbolicate stacks. This avoids
blocking the main thread and keeps the GUI running (mostly.)
2021-05-22 19:57:19 +02:00
Andreas Kling
5729b4e9a5 SystemMonitor: Don't unveil /tmp/portal/symbol
This portal doesn't exist after SymbolServer has been removed.
2021-05-22 18:54:22 +02:00
Andreas Kling
5d6252b29e LibSymbolication: Rename Client.{cpp,h} => Symbolication.{cpp,h} 2021-05-22 18:54:22 +02:00
Andreas Kling
252cb54310 LibSymbolication+SystemMonitor+bt: Move symbolication back in-process
Process-separated symbolication was cute, but ultimately the threat
model is kinda silly. We're already *running* the binary, but we're
afraid to parse its symbol table? :^)

This commit makes SystemMonitor and bt do symbolication in-process.
SymbolServer and the symbol user will be removed separately.
2021-05-22 18:54:22 +02:00
Andreas Kling
d783076a30 Userland: Rename LibSymbolClient => LibSymbolication 2021-05-22 18:54:22 +02:00
Max Wipfli
229414b002 Applications: Use titlecase and distinct underlined characters in menus
This changes (context) menus across the system to conform to titlecase
capitalization and to not underline the same character twice (for
accessing actions with Alt).
2021-05-21 18:41:28 +01:00
Andreas Kling
6a012ad79f LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
2021-05-20 20:55:29 +02:00
Marcus Nilsson
63897c469b
SystemMonitor: Don't try and show process window with nothing selected (#7221)
When right-clicking with no selected row in the process list,
SystemMonitor would still show a context menu. This disables
the context menu if index is invalid and also disables Alt+Enter
so that build_process_window() is never called with a PID of -1.

Fixes #7167.
2021-05-18 08:10:27 +02:00
brapru
c2ae6c189e SystemMonitor: Show UDP sockets
Creates a new TableView in the socket list for UDP information.

Resolves #6980.
2021-05-18 08:03:40 +02:00
Linus Groh
067b880459 SystemMonitor: Make ProcessModel icon column non-sortable
Sorting by icon is neither intuitive nor useful, so let's disable it
(like in GUI::FileSystemModel).
2021-05-15 00:15:09 +01:00
Andreas Kling
ef09f9c825 SystemMonitor: Make sure we set a model before changing column sizes
Changing a view's column metadata requires that a model is set.
2021-05-15 00:50:51 +02:00
Andreas Kling
31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00
Andreas Kling
3c3b384c80 SystemMonitor: Boost main thread priority to maximum on startup
It's frustrating when the system is under heavy load and you want to
investigate using SystemMonitor, but SystemMonitor chokes on the lag.

Let's at give it a fighting chance by maxing out the main thread prio.
2021-05-13 23:28:40 +02:00
Linus Groh
c8738bbd7e SystemMonitor: Spell process window title as "System Monitor"
This is what we use for the main window and elsewhere.
2021-05-12 17:52:56 +01:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Andreas Kling
4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Andreas Kling
3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling
935be7f297 SystemMonitor: Show action status tips in the statusbar :^) 2021-04-23 17:25:33 +02:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Andreas Kling
0eedf3bfea SystemMonitor: Only show two decimal digits for the CPU usage 2021-04-22 18:24:12 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
2a6a54dea5 Userland: Use Core::DirIterator::next_full_path()
Simplify some code by using this instead of concatenating the full path
ourselves at the call site.
2021-04-21 23:49:01 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Andreas Kling
e43fba0c58 SystemMonitor: Add tab with detailed state to process properties window
This is done using a wrapper model that transforms all the information
about a single process in the ProcessModel and turns it into a 2-column
table model with only that process in it.
2021-04-11 13:24:59 +02:00
Andreas Kling
a78ea2c0b2 SystemMonitor: Add a little header to the process properties window
Show a larger (32x32) version of the executable icon and the process
name + PID above the various property tabs.
2021-04-11 12:52:42 +02:00
Andreas Kling
1c52dc86ee SystemMonitor: Simplify executable icon lookup in ProcessModel 2021-04-11 12:52:42 +02:00
Andreas Kling
2c94c9fa7f SystemMonitor: Add Alt shorcuts to menu actions 2021-04-09 17:10:30 +02:00