Commit Graph

66203 Commits

Author SHA1 Message Date
PulkoMandy
2d24dd2184 Synchronize PowerPC HaikuPortsCross repo definition with actual repository state 2024-07-20 23:30:04 +02:00
PulkoMandy
9d09763865 Create source packages during bootstrap
This used to be the default in haikuporter, but it isn't anymore. This
resulted in source packages (which are needed for bootstrap) not being
generated.
2024-07-20 23:27:50 +02:00
Adrien Destugues
87d1e18fc0 libroot_stubs: missing stubs for getentropy() 2024-07-19 17:33:36 +02:00
Andrew Lindesay
3dbcc10023 HaikuDepot: Unified Rating Star Drawing
The drawing code in the package list view is now
unified with other places where the rating stars are
being displayed.

Change-Id: I6a8fef51a6ddc57d10cd62a98a26a65de9cd91c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7879
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-07-19 12:35:21 +00:00
Augustin Cavalier
d72befae1e kernel/fd: Create the SyscallRestartWrapper before calling common_vector_io.
Otherwise, it seems compiler will optimize the assign operation into
a call of the first constructor, meaning the thread's syscall flag
won't be set properly.

Fixes #18951.
2024-07-18 21:50:19 -04:00
Augustin Cavalier
bc19d91fb6 kernel/user_debugger: Clean up scheduling of flushes a bit.
Instead of doing the checks in profiling_do_sample, we now do them
in profiling_event. This allows some comments to be consolidated
and make the logic clearer (but it should be functionally the same.)

Also add a check that profiling is still happening at the end
of profiling_flush.
2024-07-18 21:25:00 -04:00
Augustin Cavalier
c5a499a74b kernel/timer: Only reset the hardware timer if we canceled the first one.
Otherwise we don't need to reset it.
2024-07-18 21:21:54 -04:00
Augustin Cavalier
6baf6183d0 kernel/user_debugger: Rework profiler flush mechanism.
Instead of taking the sample inside the timer callback
or the flush callback depending, always take it in the timer
callback, for consistency's sake. This should always work
because we try to flush the buffer when it's only 70% full;
in testing I can't recall seeing any dropped ticks.

Also add a flush call in the post_syscall hook, in case
we hit the flush threshhold while profiling in the kernel
and couldn't trigger the flush then.

Seems to significantly reduce "missed" ticks overall,
but there are still wildly inconsistent results and
lots of missing time.

Change-Id: I43a5e9c050a50309329da39f8a2386c3e2b3c0dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7851
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-18 16:40:20 +00:00
Andrew Lindesay
05bd1a31dc HaikuDepot: Resize Shutdown Window
The shutting down window should scale with the
layout manager.

Closes #17916

Change-Id: I3ec86af91d13de9fb7feae338dfcb35c2ae119ca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7880
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-07-18 15:00:12 +00:00
Andrew Lindesay
2060f156e8 HaikuDepot: UI ScrollView Scaling
Fixes #7844

Change-Id: I70d1e4980bbcc10f68e264d35c5dc77bff981200
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7876
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-07-18 09:24:49 +00:00
Oscar Lesta
3761b2f420 etc/profile: locale settings might have changed since SetupEnvironment.
Before this, changing the locale settings via Locale preflet required
a reboot in order for the changes to get picked up by programs running
on Terminal.

Fixes: #18734

Change-Id: I149931c511020f9eb881e71f79d1fd6c647477e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7792
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-07-18 09:23:27 +00:00
Andrew Lindesay
c3cad23617 HaikuDepot: UI Scaling
Fix aspects of HaikuDepot's UI that do not scale when
the font size changes to accommodate a high resolution
monitor.

Change-Id: I105ebfe5a8f501cd7ffc22822438147ba07382a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7844
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-07-17 22:32:57 +00:00
Jérôme Duval
987a1436b3 udis86: remove
switch credits in AboutSystem from udis86 to zydis

Change-Id: I03a7965a272c50714df9726e53c7d4067d8f1925
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7850
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-17 19:11:50 +00:00
Jérôme Duval
34b59fca80 Debugger: switch to zydis for x86 and x86_64
Change-Id: Iec6d21bc989c3d532c175fd78a2339fede3df1dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7849
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-17 19:11:50 +00:00
Jérôme Duval
06b1eff6ec zydis: build static lib
* for GCC2 build with a modern GCC as suggested by waddlesplash
* make the headers compatible with GCC2

Change-Id: Ice74eeddbe10bc8f9cf9ae90baa833a46bb3c676
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7848
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-17 19:11:50 +00:00
Jérôme Duval
cb130a72e8 disasm: switch to zydis on x86/x86_64
Change-Id: I72a006cb217e14228fce0f5e0b8aa8470c1bfba9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7839
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-17 19:11:50 +00:00
Jérôme Duval
1003e004e6 Import Zydis 4.1.0
* udis86 isn't updated since 2014. New SIMD opcodes are missing.
Thus replaces udis86 with Zydis, which is actively developed and used in
Webkit, SpiderMonkey. It is under MIT license.
* encoder code is removed

Change-Id: Ieae7e829e186ce7d4a6df640c62561ad220858fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7847
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-17 19:11:50 +00:00
Augustin Cavalier
911f99e2d6 kernel/timer: Rename "last" to "previous".
It points to the previous list item, not the last (final) one.
No functional change intended, but improves code readability.
2024-07-17 13:41:04 -04:00
Augustin Cavalier
2b916f6121 kernel/image: Report image removals on team destruction or exec.
We can't call user_debug_image_deleted with the lock held, so clear
the list and remove all images before unlocking and looping again.
This also means we free() without the lock held, which should
reduce contention.
2024-07-17 13:40:16 -04:00
Augustin Cavalier
10a7c77a3a kernel/team: Notify the debugger when we create the commpage image.
It isn't relocated, so otherwise we wouldn't ever notify.
2024-07-17 13:39:06 -04:00
Augustin Cavalier
58d9ba9035 profile: Emit paths only in the callgrind output.
The callgrind information should contain a path to an ELF file,
not an identifier. We thus only add the identifer when we don't
have something that looks like a path (or is the commpage.)

This allows applications that analyze callgrind output to merge
images with the same ELF file.
2024-07-17 13:31:54 -04:00
Augustin Cavalier
ed79e85ae0 profile: Don't try to be clever in SharedImage::ContainsAddress().
The data section could theoretically be before the text section,
but it also may not exist and have a size of 0. The commpage
image is one such image with those qualities, and so we
would thus always find it as having a hit when encountering it
in the list.

And since data_size might be 0, just do < instead of <= and -1.

This massively fixes the profiler's output.
2024-07-17 12:47:07 -04:00
Augustin Cavalier
43f2492813 profile: Drop some unused code.
Commented out and not needed.
2024-07-17 12:44:57 -04:00
Augustin Cavalier
1b6cac3521 profile: Use BStackOrHeapArray to store the result arrays.
Otherwise with very large profile results we can overflow the stack.
2024-07-17 12:43:24 -04:00
Augustin Cavalier
421a5795ae profile: Stop new threads and resume them with the debugger API.
If we don't stop new threads, then they can run before we
have a chance to start profiling them.
2024-07-17 11:10:13 -04:00
Augustin Cavalier
189a9bbf63 strace: Resume target threads with the debugger API not resume_thread().
This way, the thread will be resumed only after the kernel
has finished processing our debugger change requests written
to the same port.
2024-07-17 11:07:32 -04:00
Augustin Cavalier
d75f6109c2 kernel/arch: Prioritize post_interrupt_callback over invoke_scheduler.
The profiler depends on this, and it's likely to invoke the scheduler
of its own accord anyway.

This logic could possibly be abstracted into a generic function, seeing
as it's the same across all architectures...
2024-07-17 00:30:24 -04:00
Augustin Cavalier
8a30142841 profile: Unset image in ExclusiveProfileResult if we didn't find a symbol.
Fixes unknown hit counters.
2024-07-17 00:25:06 -04:00
Augustin Cavalier
acd752e158 kernel/m68k: Apply same fix to arch_debug_get_stack_trace as in x86.
All the other arches don't even have an implementation of this function.
2024-07-16 21:44:46 -04:00
Augustin Cavalier
7eb6aafc30 profiler: Actually support profiling user stack frames only.
The "-k" argument (which never did anything before) is now inverted
compared to what it used to be, i.e. now specifying it will profile
kernel frames, too, whereas by default only user frames will be
sampled.
2024-07-16 20:37:40 -04:00
Augustin Cavalier
6d5c99effe kernel/x86: Make arch_debug_get_stack_trace handle user-only stack traces.
Begin by getting the user iframe, and remove the logic that was
preventing any return addresses from being reported if STACK_TRACE_KERNEL
was unset.
2024-07-16 20:22:09 -04:00
Augustin Cavalier
e763eb55ee kernel/events: Check sync->set for B_EVENT_INVALID.
The infos[i] will only have B_EVENT_INVALID in the case where
select() returned an error and we set it ourselves; or for
wait_for_objects, it will now always be set as one of the select
flags, so we can't rely on it there.

Failing to deselect objects (or, in the case where we did receive
B_EVENT_INVALID, deselecting them again incorrectly) can cause
memory corruptions and use-after-frees.

Fixes at least one KDL inadvertently introduced after the previous
refactorings, but the double-deselect problems predate that commit.
2024-07-16 19:20:34 -04:00
Augustin Cavalier
e21aac37e7 strace: wait_for_thread status argument is an Out parameter. 2024-07-16 19:06:13 -04:00
Augustin Cavalier
9e7e161599 strace: Add tracing for wait_for_objects and event_queue syscalls. 2024-07-16 19:03:02 -04:00
Augustin Cavalier
96fb940571 strace: Move poll/select syscall handling to an "event" file.
Also bring along the type handlers, and use FlagsTypeHandler.
2024-07-16 18:43:50 -04:00
Augustin Cavalier
ef62eb6117 strace: Only print the first 8 iovecs.
Same limit as other array printers in this file.
2024-07-16 18:43:50 -04:00
Augustin Cavalier
0fbd5c96af strace: vsnprintf returns total possible characters, not number written.
Thus we have to clamp it. Fixes crashes with very long syscall arguments.
2024-07-16 18:43:50 -04:00
Augustin Cavalier
6c4e414fe6 strace: Move TypeHandler for iovec back to NetworkTypes.
Takes advantage of some of its macros.
2024-07-16 18:43:50 -04:00
Augustin Cavalier
72b440df7d kernel/events: Fix wait_for_objects.
In the preceding commit, I missed that "events" was cleared
inside the select loop, making a use later on useless.

Now we don't clear it in the loop, but wait till the end
to do so. (Considering we return without clearing it in
case of out-of-memory or other problems, this may not
even be necessary, but it at least preserves existing
behavior.)
2024-07-16 17:59:03 -04:00
Augustin Cavalier
9a4c543934 pthread: Implement pthread_timedjoin_np.
This also corrects an oversight in pthread_join() that not all
potential error codes of wait_for_thread were accounted for
(in particular EDEADLK wasn't.)

This is a non-standard extension, but is present on both Linux
and FreeBSD, at least.

Change-Id: Ie96e7a261e863ab491bee30349360df7ff3d0e80
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5099
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-16 19:59:39 +00:00
Augustin Cavalier
69b420563b kernel/thread: Remove duplicate declaration of _user_rename_thread.
No functional change.
2024-07-16 15:33:19 -04:00
Augustin Cavalier
7f86e9ee17 kernel: Properly report that no events were selected in select_fd.
Adjust wait_for_objects/select/poll implementations to handle this
properly (use the original array's selected-events values, not
the select info's values, and ignore errors if events were reported.)

event_queue is not adjusted and will behave differently after this
change (specifically it will not allow such FDs to be added,
which matches behavior of epoll/kqueue elsewhere.)

Change-Id: Icea26efce894f00697afd29f3bf51b7e60e522ab
2024-07-16 15:32:59 -04:00
Augustin Cavalier
9aaf80afaa FAT: Use user_strlcpy in dosfs_read_attr.
Fixes a SMAP violation.
2024-07-16 14:39:59 -04:00
Augustin Cavalier
85fb1089de libroot: Use getentropy to initialize the stack protector.
Now that it's in libroot, we don't need to invoke the syscall directly.
2024-07-16 14:16:09 -04:00
Jérôme Duval
4169a972ee POSIX: move getentropy(2) from libbsd
Specified in POSIX.1-2024
https://www.austingroupbugs.net/view.php?id=1134
Change-Id: Ie715a102aa6f7764bc639e0a1874a6c7f7d81019
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7846
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-16 16:09:00 +00:00
Augustin Cavalier
bc28372cec pthread: Apply extern "C" to getname/setname.
Necessary because we don't include gnu/pthread.h here.
2024-07-16 00:19:56 -04:00
Augustin Cavalier
fc1a0ea5ab SetupEnvironment: Remove first set of LC_CTYPE.
It's set again about 30 lines later, this time with the real value,
so there's no need to set it here.
2024-07-15 22:57:57 -04:00
Augustin Cavalier
a6fd327884 pthread: Account for more errors than B_BAD_THREAD_ID in pthread_getname_np. 2024-07-15 21:31:22 -04:00
Augustin Cavalier
10563a5fb2 pthread: Reorder the extension functions and make them non-weak.
Put the extensions above the "Haiku thread API bridge",
fix their indentation, and make them standard instead of weak symbols.
(musl does not declare these functions as weak symbols, at least.)
2024-07-15 21:31:04 -04:00
Augustin Cavalier
ba0223da5d Haiku Book: Fix typo in launch_daemon documentation. 2024-07-15 21:17:04 -04:00