Commit Graph

62 Commits

Author SHA1 Message Date
Ingo Weinhold 189010cbc2 Added support for I/O scheduling events to the system profiler interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-19 14:33:29 +00:00
Ingo Weinhold d8d4b902cb * The system profiler scheduling event structures sport nanotime_ts now.
* Adjusted the DebugAnalyzer to handle nanosecond times.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 22:56:29 +00:00
Ingo Weinhold 1f3f5ca265 Fixed header guard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-27 21:10:08 +00:00
Ingo Weinhold a492466dad Created new private system header computed_asm_macros.h defining the macro we
use for the asm_offsets.cpp file, so it can be reused elsewhere.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-27 14:07:05 +00:00
Axel Dörfler 3f67d04bc4 * This fixes the "'noreturn' function returns" warning in exit().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:59:46 +00:00
Axel Dörfler 486fffdaaf * Forgot to add linkat(), this really closes #4928 now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:30:16 +00:00
Axel Dörfler fb2500da15 * Added missing AT_EACCESS.
* Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat().
* Added stub for mknodat().
* The kernel backend for faccessat() does not yet differentiate between
  effective and real user/group IDs, though.
* Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything
  (more or less). This also closes ticket #4928.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:17:17 +00:00
Axel Dörfler ecf6b86c92 * The pthread_thread structure is now allocated for all threads.
* Therefore, all pthread functions should now work fine on all threads.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-09 21:33:35 +00:00
Axel Dörfler 6242fd5977 * Added the possibility to debug latency issues with spinlocks.
* When DEBUG_SPINLOCK_LATENCIES is 1, the system will panic if any spinlock is
  held longer than DEBUG_LATENCY micro seconds (currently 200). If your system
  doesn't boot anymore, a new safemode setting can disable the panic.
* Besides some problems during boot when the MTRRs are set up, 200 usecs work
  fine here if all debug output is turned off (the output stuff is definitely
  problematic, though I don't have a good idea on how to improve upon it a lot).
* Renamed the formerly BeOS compatible safemode settings to look better; there
  is no need to be compatible there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-08 20:26:48 +00:00
Ingo Weinhold d6778355ee * <DiskDeviceTypes.h>: Removed kPartitionTypeIntel{Primary,Logical} constants.
* Added new header headers/private/system/disk_device_types.h, which defines
  the <DiskDeviceTypes.h> constants as macros and which can be used where the
  constants cannot be used. The constants are defined using the macros, so now
  there's only one place where the string literals should be specified.
* Use the macros in the partitioning systems. I was too lazy to also adjust the
  file systems -- most of them seem to hard-code the string literal yet.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:07:42 +00:00
Stefano Ceccherini f0bf38026a Add safemode option to disable the use of APIC timers
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33132 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-14 09:02:15 +00:00
Jonas Sundström 893988af82 Added and modified kernel stubs and headers for arch mipsel. Correctness not included.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-23 02:52:09 +00:00
François Revol bad4d0ccdc [ARM]
Add an __ARM_ARCH__ macro defined to the arch version to simplify checks for >= some version.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-11 03:02:44 +00:00
Ingo Weinhold 213d2d8f9d Added syscall _kern_kernel_debugger() to enter the kernel debugger.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 12:35:42 +00:00
Axel Dörfler 8ae594ffd4 * Introduced dedicated syscalls for the deprecated BeOS fs_attr API. Before,
each attribute access needed 3 syscalls, now only one as it should.
* Renamed the new Haiku call fs_open_attr() to fs_fopen_attr(), and added a new
  function fs_open_attr() that takes a path (same semantics as the
  fs_[f]open_attr_dir() functions already present in BeOS).
* Merged former _kern_open_attr(), and _kern_create_attr() into one syscall.
* Cleaned up vfs.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 00:34:44 +00:00
François Revol bb1325a30e [GSoC] [ARM] Patch by Johannes Wischert.
Placeholder private headers for the kernel and libroot.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-27 16:23:08 +00:00
Axel Dörfler f75b8de3fc * Discarded the "parametersSize" parameter from various disk device manager
functions.
* Since we now use UserStringParameter, this fixes the missing null termination
  of the parameter string, and thus bug #4045.
* Removed UserMemoryParameter, as it's no longer in use.
* Adjusted syscalls accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-26 17:27:27 +00:00
Axel Dörfler 6ef35ef770 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-26 17:23:59 +00:00
Ingo Weinhold 0b11ecb18c * Always include the public arch_debugger.h headers. The structures defined
there are prefixed with the respective architecture name. Useful for remote
  debugging a different architecture.
* <x86/arch_debugger.h>: Introduced a structure for the FPU state, so that it
  isn't left to the debugger.
* Removed the _kern_get_thread_cpu_state() syscall. Was originally intended for
  bdb compatiblity, but isn't really needed.
* Kernel x86 arch_get_debug_cpu_state(): The use of fnsave was broken, since
  it reinits the FPU after saving the state. This resulted in weird results
  when debugging functions using the FPU. We now use fxsave, if available.
  Otherwise fnsave + frstor should be used -- not fully implemented yet.
  Same for arch_set_debug_cpu_state().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-21 22:18:39 +00:00
Axel Dörfler 5fbad060b3 * Work-in-progress on a kernel profile service that can be evaluated from
userland afterwards.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-17 16:21:06 +00:00
Clemens Zeidler ceaa15b6a7 Forgot this, thanks to Andrea Bernardi!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31488 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-09 18:24:27 +00:00
Axel Dörfler 3609af391d * Renamed _kern_reserve_heap_address_range() to _kern_reserve_address_range(),
and added a _kern_unreserve_address_range() as well.
* The runtime loader now reserves the space needed for all its areas first
  to make sure there is enough space left for all areas of a single image.
* This also fixes the final part of bug #4008.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-19 11:09:21 +00:00
Axel Dörfler 82db8a9e15 * Added an "unmapAddressRange" argument to the file mapping syscall. This is
the first part of making the runtime loader behave itself; it should already
  make Clockwerk run okay with any number of translators (even if not all of
  them will work yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-19 08:23:11 +00:00
Ingo Weinhold 568ade58d0 User debugger support:
* Generalized address checks. The debugger can now also read the commpage.
* Added new syscall _kern_get_thread_cpu_state() to get the CPU state of a
  not running thread. Introduced arch_get_thread_debug_cpu_state() for that
  purpose, which is only implemented for x86 ATM (uses the new
  i386_get_thread_user_iframe()).
* Don't allow a debugger to change a thread's "esp" anymore. That's the esp
  register in the kernel. "user_esp" can still be changed.
* Generally set RF (resume flag) in eflags in interrupt handlers, not only
  after a instruction breakpoint debug exception. This should prevent
  breakpoints from being triggered more than once (e.g. when the breakpoint is
  on an instruction that can cause a page fault). I still saw those with bdb
  in VMware, but that might be a VMware bug.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-14 12:14:06 +00:00
Ingo Weinhold 897514785a Introduced macro B_DEFINE_SYMBOL_VERSION() in <BeBuild.h> to help with
versioning symbols, and private macro DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION()
for symbols compiled into both libroot and kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30828 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-22 14:57:40 +00:00
Ingo Weinhold 003ebb0e83 * Also define the build system variables TARGET_STATIC_{LIBSTDC++,LIBSUPC++}.
* runtime loader:
  - Fixed gcc 4 warnings.
  - Enabled -Werror.
  - Renamed all remaining *.c source files to *.cpp.
  - Implemented GNU style ELF symbol versioning support.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-20 02:22:36 +00:00
Ingo Weinhold 51c706f70c Added variables to the glue code that identify the Haiku version and ABI.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-12 21:01:26 +00:00
Ingo Weinhold 22a332f0b0 Added a base struct for the scheduling event structures. To keep the interface
C friendly it's not an actual base class, but casting to it is fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-30 12:23:02 +00:00
Ingo Weinhold 227fe7d34a * Scheduler/wait object listener:
- Moved scheduler listening interface to <listeners.h> and added more
    convenient to use templatized notification functions.
  - Added a listener mechanism for the wait objects (semaphores, condition
    variables, mutex, rw_lock).
* system profiler:
  - Hopefully fixed locking issues related to notifying the profiler thread
    for good. We still had an inconsistent locking order, since the scheduler
    notification callbacks are invoked with the thread lock held and have to
    acquire the object lock then, while the other callbacks acquired the object
    lock first and as a side effect of ConditionVariable::NotifyOne() acquired
    the thread lock. Now we make sure the object lock is the innermost lock.
  - Track the number of dropped events due to a full buffer.
    _user_system_profiler_next_buffer() returns this count now.
  - When scheduling profiling events are requested also listen to wait objects
    and generate the respective profiling events. We send those events lazily
    and cache the infos to avoid resending an event for the same wait object.
  - When starting profiling we do now generate "thread scheduled" events for
    the already running threads.
  - _user_system_profiler_start(): Check whether the parameters pointer is a
    userland address at all.
  - The system_profiler_team_added event does now also contain the team's name.
* Added a sem_get_name_unsafe() returning a semaphore's name. It is "unsafe",
  since the caller has to ensure that the semaphore exists and continues to
  exist as long as the returned name is used.
* Adjusted the "profile" and "scheduling_recorder" according to the system
  profiling changes. The latter prints the number of dropped events, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30345 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-23 13:47:52 +00:00
Ingo Weinhold 5b2f0f33f9 * Changed the interface of _kern_system_profiler_start(). The parameters are
passed in a structure now, so it is easier to extend it and ignore unused
  parameters.
* One can now select which system profiling events one is interested in.
* Added scheduling events to the system profiling interface. Those are pretty
  much the ones recorded when scheduler tracing is enabled. Still missing are
  the "wait object" events that allow to interpret what a thread is waiting
  for.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-18 17:35:28 +00:00
Ingo Weinhold 1b9d2885d3 * Also pass the team arguments and thread names with the respective system
profiling events.
* profile: Avoid using get_{team,thread}_info() in common code paths. The
  system profiling mode is asynchronous, so the team or thread in question
  could already be gone.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-16 10:02:33 +00:00
Ingo Weinhold e2ae69da52 The kernel side of a new system-wide sampling-based profiling mechanism.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-11 22:20:51 +00:00
David McPaul 8507d18bcb define Stack Program Header type
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-10 03:27:27 +00:00
Axel Dörfler 3f78b216ad * Implemented a basic notification mechanism. Right now, only media changes and
device additions/removals can be monitored.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-18 08:55:49 +00:00
Ingo Weinhold 19d40f9eb7 Moved the rld_export structure from <user_runtime.h> to
<runtime_loader.h>, since it isn't a kernel <-> userland interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-02 03:43:01 +00:00
Ingo Weinhold 47c40a10a1 * Prefixed memset_physical() and memcpy_to_physical() with "vm_",
added vm_memcpy_from_physical() and vm_memcpy_physical_page(), and
  added respective functions to the vm_translation_map operations. The
  architecture specific implementation can now decide how to implement
  them most efficiently. Added generic implementations that can be used,
  though.
* Changed vm_{get,put}_physical_page(). The former no longer accepts
  flags (the only flag PHYSICAL_PAGE_DONT_WAIT wasn't needed anymore).
  Instead it returns an implementation-specific handle that has to be
  passed to the latter. Added vm_{get,put}_physical_page_current_cpu()
  and *_debug() variants, that work only for the current CPU,
  respectively when in the kernel debugger. Also adjusted the
  vm_translation_map operations accordingly.
* Made consequent use of the physical memory operations in the source
  tree.
* Also adjusted the m68k and ppc implementations with respect to the
  vm_translation_map operation changes, but they are probably broken,
  nevertheless.
* For x86 the generic physical page mapper isn't used anymore. It is
  suboptimal in any case. For systems with small memory it is too much
  overhead, since one can just map the complete physical memory (that's
  not done yet, though). For systems with large memory it counteracts
  the VM strategy to reuse the least recently used pages. Since those
  pages will most likely not be mapped by the page mapper anymore, it
  will keep remapping chunks. This was also the reason why building
  Haiku in Haiku was significantly faster with only 256 MB RAM (since
  that much could be kept mapped all the time).
  Now we're using a different strategy: We have small pools of virtual
  page slots per CPU that are used for the physical page operations
  (memset_physical(), memcpy_*_physical()) with CPU-pinned thread.
  Furthermore we have four slots per translation map, which are used to
  map page tables.

These changes speed up the Haiku image build in Haiku significantly. On
my Core2 Duo 2.2 GHz 2 GB machine about 40% to 20 min 40 s (KDEBUG
disabled, block cache debug disabled). Still more than factor 3 slower
than FreeBSD and Linux, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-20 00:06:09 +00:00
Axel Dörfler 38bbc95758 * Made the use of file devices more convenient and complete by adding
the methods IsFile() and GetFilePath() to BDiskDevice, and
  BDiskDeviceRoster::GetFileDeviceForPath().
* Added new syscalls to implement this functionality.
* Added new flag B_DISK_DEVICE_IS_FILE.
* Fixed wrong operator precedence assumption in the BDiskDevice class at
  several places.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 21:51:43 +00:00
François Revol 5222f12a32 - Add m68k pendant of: r27529 & r27778 - handle skipIframes parameter
r27530 - allow faults with ints disabled if there is a handler
r27648 - call the end-of-interrupt thread callback
r27718 - add <asm_defs.h>, not used yet
r27722 - register the commpage as image and symbols (but we don't use it yet)
- remove dupped call to thread_get_current_thread()
- use 16MB iospace for now, 4MB seems too small.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 18:13:11 +00:00
Ingo Weinhold c73aeac11e We need to let the runtime loader call shared object termination hooks
from exit().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 12:26:27 +00:00
Ingo Weinhold 1b6eff280f * Replaced the vm_get_physical_page() "flags"
PHYSICAL_PAGE_{NO,CAN}_WAIT into an actual flag
  PHYSICAL_PAGE_DONT_WAIT.
* Pass the flags through to the chunk mapper callback.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27979 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 20:55:32 +00:00
Ingo Weinhold cfe2aa898c Should have been part of the previous commit. x86 commpage definition
for memset().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 18:44:44 +00:00
François Revol 68083f29a3 The last 16MB (physical) on Atari is used for IO, and we currently map it through transparent translation register. Move commpage out of the way.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 09:48:08 +00:00
Ingo Weinhold 4069a00744 Header containing macro definitions used in various assembly sources.
I'm not happy with the location, but I didn't see any better one in the
header tree.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 22:46:07 +00:00
Ingo Weinhold 8839d592bc Added syscall _kern_read_kernel_image_symbols() for reading a kernel
image's symbol and string tables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 11:13:38 +00:00
Axel Dörfler ca7cb625b9 * Implemented a (private for now) get_system_info_etc() call, that can retrieve
various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
  accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-17 16:27:17 +00:00
Salvatore Benedetto 40dae3708f * Adding msg{rcv,snd,get,ctl} syscalls to the system
* Add message queue init function call to main.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 15:03:01 +00:00
Ingo Weinhold e032a7f50e Scheduling analysis: Also record the number of times a thread waits on a
locking primitive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 00:07:11 +00:00
Ingo Weinhold 020ac56840 * Fixed bug in the "scheduler" command: The check when a thread was
unscheduled was incorrect.
* Introduced _kern_analyze_scheduling() syscall. It requires scheduler
  kernel tracing to be enabled. It uses the tracing entries for a given
  period of time to do a similar analysis the "scheduler" debugger
  command does (i.e. number of runs, run time, latencies, preemption
  times) for each thread. Additionally the analysis includes for each
  thread how long the thread waited on each locking primitive in total.
* Added kernel tracing for the creation of semaphores and initialization
  of condition variables, mutexes, and rw locks. The enabling macro is
  SCHEDULING_ANALYSIS_TRACING. The only purpose is to provide
  _kern_analyze_scheduling() with more info on the locking primitives
  (the name in particular).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 15:10:44 +00:00
Ingo Weinhold 232fd3bae3 Moved the wait type definitions to <thread_defs.h>. We're going to use
them in userland, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27301 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:48:47 +00:00
François Revol e097cf0ba2 warning about to be fixed address collision
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 13:50:31 +00:00