| /xnu-10063.141.1/doc/observability/ |
| H A D | recount.md | 9 ARM64 devices with a fast timebase read and Intel devices can track time spent in the kernel (syste… 63 Coalition pointers can be found with the `showtaskcoalitions` macro, and should be _resource_ coali… 75 …tities like threads and tasks starts with a `recount_plan_t`, declared using `RECOUNT_PLAN_DECLARE… 80 - `ru_energy_nj`: the energy consumed by a CPU, in nano-Joules with `CONFIG_PERVASIVE_ENERGY` 82 The metrics are stored in a `recount_metrics` structure with the following fields: 85 - `ru_cycles`: the cycles run by a CPU with `CONFIG_PERVASIVE_CPI` 86 - `ru_instructions`: the instructions retired by a CPU with `CONFIG_PERVASIVE_CPI` 88 At context switch, `recount_switch_thread` captures the hardware counters with `recount_snapshot` i… 90 The per-CPU variable is then updated with the current snapshot for the next switch. 91 …_user` or `recount_enter_user`, which performs the same operation, except with `recount_snapshot_s… [all …]
|
| /xnu-10063.141.1/doc/debugging/ |
| H A D | debugging.md | 3 Debugging xnu through kernel core files or with a live device. 7 xnu’s debugging macros are compatible with both Python 3.9+. Please be careful about pulling 18 * Name collisions at the top level may override methods with unexpected results. 29 ### Dealing with binary data 46 with open(filepath, 'wb') as f: 57 with open(filepath, 'wb') as f: 82 provides you with buffering (aka caching) in case your random small chunk accesses are repeated: 112 with strange characters in it. The lossless option is meant to be used when a string is only a tran… 126 ### Dealing with signed numbers 157 Ensure the macro matches what LLDB returns from the REPL. For example, compare `showproc(xxx)` with… [all …]
|
| H A D | task_ref.md | 9 Tasks in XNU are reference counted. When a task is created it starts with two 25 One of the big problems seen with task references is that difficult to debug 37 hierarchical. To help with debugging the following task reference group 131 -------- OP 1 Stack Index 0 with active refs 1 of 165 --------
|
| /xnu-10063.141.1/iokit/DriverKit/ |
| H A D | OSAction.iig | 9 * compliance with the License. The rights granted to you under the License 47 * State associated with the callback may be allocated and stored for the creator of the object. 48 * Methods to allocate an OSAction instance are generated for each method defined in a class with 49 …* a TYPE attribute. The generated methods are named CreateAction{name of method with type attribut… 55 …* with GetReference. If successful, the generated method returns kIOReturnSuccess and a created OS… 56 …* through the 'action' parameter with a +1 retain count to be released by the caller. See IOReturn… 67 …ion Methods to allocate an OSAction instance are generated for each method defined in a class with 75 * with GetReference. 76 * @param action Created OSAction with +1 retain count to be released by the caller. 102 …* @discussion Reference data is allocated with zero initialized content. It may be set and retrie… [all …]
|
| H A D | IOEventLink.iig | 9 * compliance with the License. The rights granted to you under the License 64 * with os_eventlink_create() (see <os/eventlink_private.h>). The application then has to extract 65 …* the remote eventlink port with os_eventlink_extract_remote_port(). To send the remote eventlink … 76 …* Once the remote eventlink port has been sent to the driver, the driver should be notified with a… 77 …g signaling mechanism. The driver should handle this by activating the IOEventLink with Activate(). 91 …* @param name User-specified name. If an IOEventLink with the same name already exists… 95 … * @param eventLink Created IOEventLink with +1 retain count to be released by the caller. 140 …* @brief Signal the eventlink and wait with a timeout. If a thread is waiting on the eventli… 151 …* @brief Wait with a timeout. If a thread is waiting on the eventlink, this will wake up tha… 178 * @brief Associate a thread with the eventlink. [all …]
|
| H A D | IOWorkGroup.iig | 9 * compliance with the License. The rights granted to you under the License 50 * workgroup port with os_workgroup_copy_port(). To send the workgroup port to the driver, use: 60 …* Once the workgroup port has been sent to the driver, the driver should be notified with a user-d… 78 … * @param workgroup Created IOWorkGroup with +1 retain count to be released by the caller. 108 * a workgroup with Leave(), use the same token that was passed to Join(). 117 …* @discussion The workgroup must have been joined with Join(). Use the same token in Join() for t… 127 …. This method should be called after the client has configured the eventlink with the IOConnectTrap
|
| H A D | IOBufferMemoryDescriptor.iig | 9 * compliance with the License. The rights granted to you under the License 61 * and zero length until set with SetLength(). 62 * @param memory Created descriptor with +1 retain count to be released by the caller. 82 …* @param range An IOAddressSegment structure filled out with the address and length of the m… 91 * with this method.
|
| H A D | IODispatchQueue.iig | 9 * compliance with the License. The rights granted to you under the License 80 kIODispatchQueueReentrant Creates a queue that allows release with the Sleep 108 * @brief Return the name the queue was created with. 144 … * concurrently with other blocks executed with DispatchConcurrent. The queue will be 145 * retained until the block completes. May only be used with a queue created with 173 …* @brief Log the current execution context with respect to any queues the current thread hol… 219 * @discussion Signals a thread that gave up the queue with Sleep() to continue running. 229 * @discussion Signals a thread that gave up the queue with Sleep() to continue running.
|
| H A D | IODataQueueDispatchSource.iig | 9 * compliance with the License. The rights granted to you under the License 48 * @param source Created source with +1 retain count to be released by the caller. 125 … * @param callback to invoked if the queue is non-empty with the next entry to be dequeued. 135 * @param callback invoked if the queue was non-empty with the entry that was dequeued. 158 * and if true after those calls, the notification sent with SendDataServiced(). 159 * @param callback invoked if the queue was non-empty with the entry that was dequeued. 172 * and if true after those calls, the notification sent with SendDataAvailable(). 182 …a producer, check if the queue has sufficient free space for a queue entry with the specified size. 192 …a producer, check if the queue has sufficient free space for queue entries with the specified size.
|
| H A D | IODMACommand.iig | 9 * compliance with the License. The rights granted to you under the License 84 * IODMACommand does not perform bounce buffering but allows access to the mapping with 108 * @param command Returned IODMACommand object with +1 retain count. 172 the memory specified with the data param 174 the memory specified with the data param 178 * @param dataffset Offset into the memory specified with the data param
|
| /xnu-10063.141.1/tools/lldbmacros/ |
| H A D | README.md | 26 lldb can be used for kernel debugging the same way as gdb. The simplest way is to start lldb with k… 37 …* start lldb with the right symbols file. If you do not know the version apriori, then enable dsym… 46 #for gdb (eg with astris) 51 …* Once connected you can debug with basic lldb commands like print, bt, expr etc. The xnu debug ma… 52 …In case if you are working with older kernel files you can load kernel specific commands by doing - 76 …aries in lldb. Following is the stack of platforms and how commands and summaries interact with it. 80 | | |--lldb core--| | | <-- interacts with remote kernel or corefile. 93 …will show task summary output with lines matching string 'kernel_task' into a file /tmp/kernel_tas… 96 It will automatically register given types with the functions within the kernel category. 107 |-xnu.py # xnu debug framework along with kgmhelp, xnudebug commands. [all …]
|
| /xnu-10063.141.1/doc/primitives/ |
| H A D | atomics.md | 15 as this document builds on it, and explains the liberties XNU takes with said 42 By default, C11 comes with two variants of each atomic "operation": 45 - a regular variant which is equivalent to the former with the *seq_cst* 53 and hardware reorderings and optimizations, which is great, but comes with 57 It seems very tempting to use `atomic_*_explicit()` functions with explicit 59 optimizations with relaxed atomics, that most developers will not expect. 61 does with other plain memory accesess such as coalescing, reordering, hoisting 107 3. `os_atomic_*` only comes with the explicit variants: 132 Qualifying atomic variables with `_Atomic` or even 151 with an optional barrier ordering. It is implemented with C11's [all …]
|
| H A D | string-handling.md | 9 intersection with the -fbounds-safety C extension. 20 # The problems with string functions 48 terminated string. Because of coexistence with `strn` functions that make no 64 # Changes with -fbounds-safety 68 prevents confusing the two in the way that is problematic with `strlcpy`, for 78 -fbounds-safety and XNU enshrine this practice with the following additions: 126 `tsnprintf` or `strbufcpy` once. As a quick reference, with -fbounds-safety 131 build a string with successive calls to `scnprintf`, you would use
|
| /xnu-10063.141.1/bsd/crypto/doc/ |
| H A D | KernelCrypto.txt | 9 * The implementation was written so as to conform with Netscapes SSL. 15 * included with this distribution is covered by the same copyright terms 23 * in documentation (online or textual) provided with the package. 25 * Redistribution and use in source and binary forms, with or without 32 * documentation and/or other materials provided with the distribution. 70 form is allowed (with or without changes) provided that: 88 This software is provided 'as is' with no explicit or implied warranties 100 form is allowed (with or without changes) provided that: 118 This software is provided 'as is' with no explicit or implied warranties 131 The free distribution and use of this software is allowed (with or without [all …]
|
| /xnu-10063.141.1/libkdd/kdd.xcodeproj/ |
| H A D | project.pbxproj | 25 …7C00B4808B /* stackshot-with-waitinfo in Resources */ = {isa = PBXBuildFile; fileRef = 04C64AC91D2… 26 …4808B /* stackshot-with-waitinfo.plist.gz in Resources */ = {isa = PBXBuildFile; fileRef = 04C64AC… 84 … /* stackshot-with-shared-cache-layout.plist.gz in Resources */ = {isa = PBXBuildFile; fileRef = 1… 85 …D9B9 /* stackshot-with-shared-cache-layout in Resources */ = {isa = PBXBuildFile; fileRef = 13739E… 86 …C5D600FFC181 /* stackshot-with-kcid in Resources */ = {isa = PBXBuildFile; fileRef = 13A79CA81CF8C… 87 …0FFC181 /* stackshot-with-kcid.plist.gz in Resources */ = {isa = PBXBuildFile; fileRef = 13A79CA91… 121 …AF15F /* stackshot-with-asyncinfo.plist.gz in Resources */ = {isa = PBXBuildFile; fileRef = D66E8C… 123 …D009AF15F /* stackshot-with-asyncinfo in Resources */ = {isa = PBXBuildFile; fileRef = D66E8CF7268… 181 …stackshot-with-waitinfo */ = {isa = PBXFileReference; lastKnownFileType = file; name = "stackshot-… 182 …with-waitinfo.plist.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; name = "sta… [all …]
|
| /xnu-10063.141.1/doc/vm/ |
| H A D | memorystatus_kills.md | 41 …0% and all others when available\_pages < 5%. One exception is on devices with >= 4GB of memory. F… 47 …empt to fix this by hopefully killing whatever higher band process is talking with the idle daemon. 55 …with `POSIX_SPAWN_JETSAM_RELAUNCH_BEHAVIOR_HIGH`, if the majority of durations are in bucket 2 the… 57 …on gets in the aging band. This is currently band 10 for daemons. Daemons with high relaunch likel… 63 In this case the `memorystatus_thread` kills the process with the lowest jetsam priority and resets… 73 This only happens on platforms with `CONFIG_FREEZE`. Currently this is just iOS. When the system is… 74 Since frozen processes can be in any band <= foreground, we scan the bands for procs with the `P_ME… 84 …us_thread` to pick and kill a process. Memorystatus will kill the process with the lowest jetsam p… 88 …sions in the last 10 m.s. The `memorystatus_thread` will kill the process with the lowest jetsam p… 90 NB: These thresholds are very old and have probably not scaled well with current hardware. Accordin…
|
| /xnu-10063.141.1/doc/allocators/ |
| H A D | api-basics.md | 9 - the VM subsystem that provides allocations at the granularity of pages (with 65 made with `Z_WAITOK` from regular (non exhaustible) zones, or from `kalloc*` 66 interfaces with a size smaller than `KALLOC_SAFE_ALLOC_SIZE`, 83 from other types (typically `zone_require` will be used with this zone), 99 one of its variants (like IOKit's `IOMallocData`). However, this comes with 117 types or structure members can be decorated with `__kernel_ptr_semantics` 139 These come in two variants: arrays, and arrays prefixed with a header. 145 The following rules are expected when dealing with variable sized allocations: 151 If those rules can't be followed, then the allocation must be split with 157 When allocating untyped memory with the data APIs ensure that it doesn't [all …]
|
| /xnu-10063.141.1/tests/iokit/ |
| H A D | io_catalog_send_data.m | 102 "build an IORegistry entry with mismatching IOService and " 117 "return success with development kernel"); 120 T_EXPECT_EQ(kret, kIOReturnNotPrivileged, "build an entry with" 126 "IOCatalogueSendData should return success with kernelmanagerd");
|
| /xnu-10063.141.1/libkdd/ |
| H A D | README.md | 43 …s reserved for special types like ints, longs etc. A cool new functionality made possible with this 47 Feature description: Generic data with description 49 Further more generic data with description is very much possible now. For example 54 … look at the description and print the data even if they are not compiled with knowledge of the fi… 75 For example, the stackshot code gathers information and describes the state of a given task with re…
|
| /xnu-10063.141.1/tools/tests/MPMMTest/ |
| H A D | README | 3 These tests measure the speed of IPC with mach messaging and kqueues. To build, 14 variables with command line options--run './MPMMtest -h' for details.
|
| /xnu-10063.141.1/ |
| H A D | APPLE_LICENSE | 24 Modifications, taken alone or in combination with Original Code. 38 with a client other than You. 41 thereof with code not governed by the terms of this License. 69 common control with, You, where "control" means (a) the power, direct 92 (b) You must include a copy of this License with every copy of Source 104 (a) You must satisfy all the conditions of Section 2.1 with respect to 129 terms of this License with information on how and where to obtain such 158 Code with other code not governed by the terms of this License and 171 rights consistent with the scope of the license granted herein 240 with Apple's third party trademark usage guidelines which are posted [all …]
|
| /xnu-10063.141.1/osfmk/mach/ |
| H A D | mach_port.defs | 9 * compliance with the License. The rights granted to you under the License 83 * to which the target task has access, along with 116 * Allocates the specified kind of object, with the given name. 139 * It can use any name not associated with a right. 148 * Destroys all rights associated with the name and makes it 150 * port (possibly with multiple user refs), a port set, or 151 * a dead name (again, with multiple user refs). 213 * right and return info about the message with the 221 * or'ed with one of these element types: 294 * (with MACH_SEND_NOTIFY option to mach_msg call). Can [all …]
|
| /xnu-10063.141.1/tools/tests/perf_index/ |
| H A D | README | 7 these arguments. For example if run with the following arguments: 10 iperf will run the cpu workload on two threads with a total work load size of 17 quite drastically between test type, so you may need to play around with the 25 script with the following arguments: 48 file_create - creates n files (in the same directory) with the open(2) system
|
| /xnu-10063.141.1/libkern/libkern/c++/ |
| H A D | OSPtr.h | 58 code may fail to compile with future versions of IOKit \ 60 pointers). If you are OK with that, please define the \
|
| /xnu-10063.141.1/iokit/IOKit/ |
| H A D | IOKernelReporters.h | 842 static OSPtr<IOSimpleReporter> with(IOService *reportingService, 960 static OSPtr<IOStateReporter> with(IOService *reportingService, 1563 static OSPtr<IOHistogramReporter> with(IOService *reportingService, 1742 static OSPtr<IOReportLegend> with(OSArray *legend);
|