2 * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 #include <mach/mach_types.h>
29 #include <mach/machine/vm_param.h>
30 #include <mach/task.h>
32 #include <kern/kern_types.h>
33 #include <kern/ledger.h>
34 #include <kern/processor.h>
35 #include <kern/thread.h>
36 #include <kern/task.h>
39 #include <ipc/ipc_port.h>
40 #include <ipc/ipc_object.h>
41 #include <vm/vm_map.h>
42 #include <vm/vm_kern.h>
44 #include <vm/vm_protos.h> /* last */
45 #include <sys/resource.h>
46 #include <sys/signal.h>
48 #undef thread_should_halt
50 /* BSD KERN COMPONENT INTERFACE */
52 extern unsigned int not_in_kdp
; /* Skip acquiring locks if we're in kdp */
54 thread_t
get_firstthread(task_t
);
55 int get_task_userstop(task_t
);
56 int get_thread_userstop(thread_t
);
57 boolean_t
current_thread_aborted(void);
58 void task_act_iterate_wth_args(task_t
, void(*)(thread_t
, void *), void *);
59 kern_return_t
get_signalact(task_t
, thread_t
*, int);
60 int fill_task_rusage(task_t task
, rusage_info_current
*ri
);
61 int fill_task_io_rusage(task_t task
, rusage_info_current
*ri
);
62 int fill_task_qos_rusage(task_t task
, rusage_info_current
*ri
);
63 void fill_task_billed_usage(task_t task
, rusage_info_current
*ri
);
64 void task_bsdtask_kill(task_t
);
66 extern uint64_t get_dispatchqueue_serialno_offset_from_proc(void *p
);
67 extern uint64_t proc_uniqueid(void *p
);
70 extern void psignal(void *, int);
76 void *get_bsdtask_info(task_t t
)
81 void task_bsdtask_kill(task_t t
)
83 void * bsd_info
= get_bsdtask_info(t
);
84 if (bsd_info
!= NULL
) {
85 psignal(bsd_info
, SIGKILL
);
91 void *get_bsdthreadtask_info(thread_t th
)
93 return(th
->task
!= TASK_NULL
? th
->task
->bsd_info
: NULL
);
99 void set_bsdtask_info(task_t t
,void * v
)
107 void *get_bsdthread_info(thread_t th
)
115 int get_thread_lock_count(thread_t th
); /* forced forward */
116 int get_thread_lock_count(thread_t th
)
118 return(th
->mutex_count
);
122 * XXX: wait for BSD to fix signal code
123 * Until then, we cannot block here. We know the task
124 * can't go away, so we make sure it is still active after
125 * retrieving the first thread for extra safety.
127 thread_t
get_firstthread(task_t task
)
129 thread_t thread
= (thread_t
)(void *)queue_first(&task
->threads
);
131 if (queue_end(&task
->threads
, (queue_entry_t
)thread
))
132 thread
= THREAD_NULL
;
135 return (THREAD_NULL
);
143 thread_t
*result_out
,
146 kern_return_t result
= KERN_SUCCESS
;
147 thread_t inc
, thread
= THREAD_NULL
;
154 return (KERN_FAILURE
);
157 for (inc
= (thread_t
)(void *)queue_first(&task
->threads
);
158 !queue_end(&task
->threads
, (queue_entry_t
)inc
); ) {
159 thread_mtx_lock(inc
);
161 (inc
->sched_flags
& TH_SFLAG_ABORTED_MASK
) != TH_SFLAG_ABORT
) {
165 thread_mtx_unlock(inc
);
167 inc
= (thread_t
)(void *)queue_next(&inc
->task_threads
);
171 *result_out
= thread
;
175 act_set_astbsd(thread
);
177 thread_mtx_unlock(thread
);
180 result
= KERN_FAILURE
;
194 kern_return_t result
= KERN_FAILURE
;
202 return (KERN_FAILURE
);
205 for (inc
= (thread_t
)(void *)queue_first(&task
->threads
);
206 !queue_end(&task
->threads
, (queue_entry_t
)inc
); ) {
208 thread_mtx_lock(inc
);
211 (inc
->sched_flags
& TH_SFLAG_ABORTED_MASK
) != TH_SFLAG_ABORT
) {
212 result
= KERN_SUCCESS
;
216 thread_mtx_unlock(inc
);
220 inc
= (thread_t
)(void *)queue_next(&inc
->task_threads
);
223 if (result
== KERN_SUCCESS
) {
225 act_set_astbsd(thread
);
227 thread_mtx_unlock(thread
);
235 ledger_t
get_task_ledger(task_t t
)
241 * This is only safe to call from a thread executing in
242 * in the task's context or if the task is locked. Otherwise,
243 * the map could be switched for the task (and freed) before
244 * we go to return it here.
246 vm_map_t
get_task_map(task_t t
)
251 vm_map_t
get_task_map_reference(task_t t
)
264 vm_map_reference_swap(m
);
272 ipc_space_t
get_task_ipcspace(task_t t
)
274 return(t
->itk_space
);
277 int get_task_numactivethreads(task_t task
)
280 int num_active_thr
=0;
283 for (inc
= (thread_t
)(void *)queue_first(&task
->threads
);
284 !queue_end(&task
->threads
, (queue_entry_t
)inc
); inc
= (thread_t
)(void *)queue_next(&inc
->task_threads
))
290 return num_active_thr
;
293 int get_task_numacts(task_t t
)
295 return(t
->thread_count
);
298 /* does this machine need 64bit register set for signal handler */
299 int is_64signalregset(void)
301 if (task_has_64BitData(current_task())) {
309 * Swap in a new map for the task/thread pair; the old map reference is
310 * returned. Also does a pmap switch if thread provided is current thread.
313 swap_task_map(task_t task
, thread_t thread
, vm_map_t map
)
316 boolean_t doswitch
= (thread
== current_thread()) ? TRUE
: FALSE
;
318 if (task
!= thread
->task
)
319 panic("swap_task_map");
322 mp_disable_preemption();
325 thread
->map
= task
->map
= map
;
326 vm_commit_pagezero_status(map
);
329 pmap_switch(map
->pmap
);
331 mp_enable_preemption();
334 #if (defined(__i386__) || defined(__x86_64__)) && NCOPY_WINDOWS > 0
335 inval_copy_windows(thread
);
343 * This is only safe to call from a thread executing in
344 * in the task's context or if the task is locked. Otherwise,
345 * the map could be switched for the task (and freed) before
346 * we go to return it here.
348 pmap_t
get_task_pmap(task_t t
)
350 return(t
->map
->pmap
);
356 uint64_t get_task_resident_size(task_t task
)
360 map
= (task
== kernel_task
) ? kernel_map
: task
->map
;
361 return((uint64_t)pmap_resident_count(map
->pmap
) * PAGE_SIZE_64
);
364 uint64_t get_task_compressed(task_t task
)
368 map
= (task
== kernel_task
) ? kernel_map
: task
->map
;
369 return((uint64_t)pmap_compressed(map
->pmap
) * PAGE_SIZE_64
);
372 uint64_t get_task_resident_max(task_t task
)
376 map
= (task
== kernel_task
) ? kernel_map
: task
->map
;
377 return((uint64_t)pmap_resident_max(map
->pmap
) * PAGE_SIZE_64
);
380 uint64_t get_task_purgeable_size(task_t task
)
383 ledger_amount_t credit
, debit
;
384 uint64_t volatile_size
= 0;
386 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.purgeable_volatile
, &credit
, &debit
);
387 if (ret
!= KERN_SUCCESS
) {
391 volatile_size
+= (credit
- debit
);
393 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.purgeable_volatile_compressed
, &credit
, &debit
);
394 if (ret
!= KERN_SUCCESS
) {
398 volatile_size
+= (credit
- debit
);
400 return volatile_size
;
406 uint64_t get_task_phys_footprint(task_t task
)
409 ledger_amount_t credit
, debit
;
411 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.phys_footprint
, &credit
, &debit
);
412 if (KERN_SUCCESS
== ret
) {
413 return (credit
- debit
);
422 uint64_t get_task_phys_footprint_max(task_t task
)
427 ret
= ledger_get_maximum(task
->ledger
, task_ledgers
.phys_footprint
, &max
);
428 if (KERN_SUCCESS
== ret
) {
438 uint64_t get_task_phys_footprint_limit(task_t task
)
443 ret
= ledger_get_limit(task
->ledger
, task_ledgers
.phys_footprint
, &max
);
444 if (KERN_SUCCESS
== ret
) {
451 uint64_t get_task_internal(task_t task
)
454 ledger_amount_t credit
, debit
;
456 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.internal
, &credit
, &debit
);
457 if (KERN_SUCCESS
== ret
) {
458 return (credit
- debit
);
464 uint64_t get_task_internal_compressed(task_t task
)
467 ledger_amount_t credit
, debit
;
469 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.internal_compressed
, &credit
, &debit
);
470 if (KERN_SUCCESS
== ret
) {
471 return (credit
- debit
);
477 uint64_t get_task_purgeable_nonvolatile(task_t task
)
480 ledger_amount_t credit
, debit
;
482 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.purgeable_nonvolatile
, &credit
, &debit
);
483 if (KERN_SUCCESS
== ret
) {
484 return (credit
- debit
);
490 uint64_t get_task_purgeable_nonvolatile_compressed(task_t task
)
493 ledger_amount_t credit
, debit
;
495 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.purgeable_nonvolatile_compressed
, &credit
, &debit
);
496 if (KERN_SUCCESS
== ret
) {
497 return (credit
- debit
);
503 uint64_t get_task_alternate_accounting(task_t task
)
506 ledger_amount_t credit
, debit
;
508 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.alternate_accounting
, &credit
, &debit
);
509 if (KERN_SUCCESS
== ret
) {
510 return (credit
- debit
);
516 uint64_t get_task_alternate_accounting_compressed(task_t task
)
519 ledger_amount_t credit
, debit
;
521 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.alternate_accounting_compressed
, &credit
, &debit
);
522 if (KERN_SUCCESS
== ret
) {
523 return (credit
- debit
);
529 uint64_t get_task_page_table(task_t task
)
532 ledger_amount_t credit
, debit
;
534 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.page_table
, &credit
, &debit
);
535 if (KERN_SUCCESS
== ret
) {
536 return (credit
- debit
);
542 uint64_t get_task_iokit_mapped(task_t task
)
545 ledger_amount_t credit
, debit
;
547 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.iokit_mapped
, &credit
, &debit
);
548 if (KERN_SUCCESS
== ret
) {
549 return (credit
- debit
);
555 uint64_t get_task_cpu_time(task_t task
)
558 ledger_amount_t credit
, debit
;
560 ret
= ledger_get_entries(task
->ledger
, task_ledgers
.cpu_time
, &credit
, &debit
);
561 if (KERN_SUCCESS
== ret
) {
562 return (credit
- debit
);
571 task_t
get_threadtask(thread_t th
)
583 return(vm_map_min(map
));
593 return(vm_map_max(map
));
605 get_vmsubmap_entries(
607 vm_object_offset_t start
,
608 vm_object_offset_t end
)
610 int total_entries
= 0;
611 vm_map_entry_t entry
;
615 entry
= vm_map_first_entry(map
);
616 while((entry
!= vm_map_to_entry(map
)) && (entry
->vme_start
< start
)) {
617 entry
= entry
->vme_next
;
620 while((entry
!= vm_map_to_entry(map
)) && (entry
->vme_start
< end
)) {
621 if(entry
->is_sub_map
) {
623 get_vmsubmap_entries(VME_SUBMAP(entry
),
631 entry
= entry
->vme_next
;
635 return(total_entries
);
642 int total_entries
= 0;
643 vm_map_entry_t entry
;
647 entry
= vm_map_first_entry(map
);
649 while(entry
!= vm_map_to_entry(map
)) {
650 if(entry
->is_sub_map
) {
652 get_vmsubmap_entries(VME_SUBMAP(entry
),
660 entry
= entry
->vme_next
;
664 return(total_entries
);
666 #endif /* CONFIG_COREDUMP */
678 return(task
->user_stop_count
);
688 return(th
->user_stop_count
);
695 get_task_pidsuspended(
698 return (task
->pidsuspended
);
708 return (task
->frozen
);
718 return ((th
->sched_flags
& TH_SFLAG_ABORTED_MASK
) == TH_SFLAG_ABORT
);
722 * This routine is like thread_should_abort() above. It checks to
723 * see if the current thread is aborted. But unlike above, it also
724 * checks to see if thread is safely aborted. If so, it returns
725 * that fact, and clears the condition (safe aborts only should
726 * have a single effect, and a poll of the abort status
730 current_thread_aborted (
733 thread_t th
= current_thread();
736 if ((th
->sched_flags
& TH_SFLAG_ABORTED_MASK
) == TH_SFLAG_ABORT
&&
737 (th
->options
& TH_OPT_INTMASK
) != THREAD_UNINT
)
739 if (th
->sched_flags
& TH_SFLAG_ABORTSAFELY
) {
742 if (th
->sched_flags
& TH_SFLAG_ABORTSAFELY
)
743 th
->sched_flags
&= ~TH_SFLAG_ABORTED_MASK
;
754 task_act_iterate_wth_args(
756 void (*func_callback
)(thread_t
, void *),
763 for (inc
= (thread_t
)(void *)queue_first(&task
->threads
);
764 !queue_end(&task
->threads
, (queue_entry_t
)inc
); ) {
765 (void) (*func_callback
)(inc
, func_arg
);
766 inc
= (thread_t
)(void *)queue_next(&inc
->task_threads
);
773 #include <sys/bsdtask_info.h>
776 fill_taskprocinfo(task_t task
, struct proc_taskinfo_internal
* ptinfo
)
779 task_absolutetime_info_data_t tinfo
;
781 uint32_t cswitch
= 0, numrunning
= 0;
782 uint32_t syscalls_unix
= 0;
783 uint32_t syscalls_mach
= 0;
787 map
= (task
== kernel_task
)? kernel_map
: task
->map
;
789 ptinfo
->pti_virtual_size
= map
->size
;
790 ptinfo
->pti_resident_size
=
791 (mach_vm_size_t
)(pmap_resident_count(map
->pmap
))
794 ptinfo
->pti_policy
= ((task
!= kernel_task
)?
795 POLICY_TIMESHARE
: POLICY_RR
);
797 tinfo
.threads_user
= tinfo
.threads_system
= 0;
798 tinfo
.total_user
= task
->total_user_time
;
799 tinfo
.total_system
= task
->total_system_time
;
801 queue_iterate(&task
->threads
, thread
, thread_t
, task_threads
) {
805 if (thread
->options
& TH_OPT_IDLE_THREAD
)
811 if ((thread
->state
& TH_RUN
) == TH_RUN
)
813 cswitch
+= thread
->c_switch
;
814 tval
= timer_grab(&thread
->user_timer
);
815 tinfo
.threads_user
+= tval
;
816 tinfo
.total_user
+= tval
;
818 tval
= timer_grab(&thread
->system_timer
);
820 if (thread
->precise_user_kernel_time
) {
821 tinfo
.threads_system
+= tval
;
822 tinfo
.total_system
+= tval
;
824 /* system_timer may represent either sys or user */
825 tinfo
.threads_user
+= tval
;
826 tinfo
.total_user
+= tval
;
829 syscalls_unix
+= thread
->syscalls_unix
;
830 syscalls_mach
+= thread
->syscalls_mach
;
832 thread_unlock(thread
);
836 ptinfo
->pti_total_system
= tinfo
.total_system
;
837 ptinfo
->pti_total_user
= tinfo
.total_user
;
838 ptinfo
->pti_threads_system
= tinfo
.threads_system
;
839 ptinfo
->pti_threads_user
= tinfo
.threads_user
;
841 ptinfo
->pti_faults
= task
->faults
;
842 ptinfo
->pti_pageins
= task
->pageins
;
843 ptinfo
->pti_cow_faults
= task
->cow_faults
;
844 ptinfo
->pti_messages_sent
= task
->messages_sent
;
845 ptinfo
->pti_messages_received
= task
->messages_received
;
846 ptinfo
->pti_syscalls_mach
= task
->syscalls_mach
+ syscalls_mach
;
847 ptinfo
->pti_syscalls_unix
= task
->syscalls_unix
+ syscalls_unix
;
848 ptinfo
->pti_csw
= task
->c_switch
+ cswitch
;
849 ptinfo
->pti_threadnum
= task
->thread_count
;
850 ptinfo
->pti_numrunning
= numrunning
;
851 ptinfo
->pti_priority
= task
->priority
;
857 fill_taskthreadinfo(task_t task
, uint64_t thaddr
, int thuniqueid
, struct proc_threadinfo_internal
* ptinfo
, void * vpp
, int *vidp
)
861 mach_msg_type_number_t count
;
862 thread_basic_info_data_t basic_info
;
868 for (thact
= (thread_t
)(void *)queue_first(&task
->threads
);
869 !queue_end(&task
->threads
, (queue_entry_t
)thact
); ) {
870 addr
= (thuniqueid
==0)?thact
->machine
.cthread_self
: thact
->thread_id
;
874 count
= THREAD_BASIC_INFO_COUNT
;
875 if ((kret
= thread_info_internal(thact
, THREAD_BASIC_INFO
, (thread_info_t
)&basic_info
, &count
)) != KERN_SUCCESS
) {
879 ptinfo
->pth_user_time
= ((basic_info
.user_time
.seconds
* (integer_t
)NSEC_PER_SEC
) + (basic_info
.user_time
.microseconds
* (integer_t
)NSEC_PER_USEC
));
880 ptinfo
->pth_system_time
= ((basic_info
.system_time
.seconds
* (integer_t
)NSEC_PER_SEC
) + (basic_info
.system_time
.microseconds
* (integer_t
)NSEC_PER_USEC
));
882 ptinfo
->pth_cpu_usage
= basic_info
.cpu_usage
;
883 ptinfo
->pth_policy
= basic_info
.policy
;
884 ptinfo
->pth_run_state
= basic_info
.run_state
;
885 ptinfo
->pth_flags
= basic_info
.flags
;
886 ptinfo
->pth_sleep_time
= basic_info
.sleep_time
;
887 ptinfo
->pth_curpri
= thact
->sched_pri
;
888 ptinfo
->pth_priority
= thact
->base_pri
;
889 ptinfo
->pth_maxpriority
= thact
->max_priority
;
891 if ((vpp
!= NULL
) && (thact
->uthread
!= NULL
))
892 bsd_threadcdir(thact
->uthread
, vpp
, vidp
);
893 bsd_getthreadname(thact
->uthread
,ptinfo
->pth_name
);
897 thact
= (thread_t
)(void *)queue_next(&thact
->task_threads
);
907 fill_taskthreadlist(task_t task
, void * buffer
, int thcount
)
914 uptr
= (uint64_t *)buffer
;
918 for (thact
= (thread_t
)(void *)queue_first(&task
->threads
);
919 !queue_end(&task
->threads
, (queue_entry_t
)thact
); ) {
920 thaddr
= thact
->machine
.cthread_self
;
923 if (numthr
>= thcount
)
925 thact
= (thread_t
)(void *)queue_next(&thact
->task_threads
);
930 return (int)(numthr
* sizeof(uint64_t));
935 get_numthreads(task_t task
)
937 return(task
->thread_count
);
941 * Gather the various pieces of info about the designated task,
942 * and collect it all into a single rusage_info.
945 fill_task_rusage(task_t task
, rusage_info_current
*ri
)
947 struct task_power_info powerinfo
;
949 assert(task
!= TASK_NULL
);
952 task_power_info_locked(task
, &powerinfo
, NULL
, NULL
);
953 ri
->ri_pkg_idle_wkups
= powerinfo
.task_platform_idle_wakeups
;
954 ri
->ri_interrupt_wkups
= powerinfo
.task_interrupt_wakeups
;
955 ri
->ri_user_time
= powerinfo
.total_user
;
956 ri
->ri_system_time
= powerinfo
.total_system
;
958 ledger_get_balance(task
->ledger
, task_ledgers
.phys_footprint
,
959 (ledger_amount_t
*)&ri
->ri_phys_footprint
);
960 ledger_get_balance(task
->ledger
, task_ledgers
.phys_mem
,
961 (ledger_amount_t
*)&ri
->ri_resident_size
);
962 ledger_get_balance(task
->ledger
, task_ledgers
.wired_mem
,
963 (ledger_amount_t
*)&ri
->ri_wired_size
);
965 ri
->ri_pageins
= task
->pageins
;
972 fill_task_billed_usage(task_t task __unused
, rusage_info_current
*ri
)
975 ri
->ri_billed_system_time
= bank_billed_time_safe(task
);
976 ri
->ri_serviced_system_time
= bank_serviced_time_safe(task
);
978 ri
->ri_billed_system_time
= 0;
979 ri
->ri_serviced_system_time
= 0;
984 fill_task_io_rusage(task_t task
, rusage_info_current
*ri
)
986 assert(task
!= TASK_NULL
);
989 if (task
->task_io_stats
) {
990 ri
->ri_diskio_bytesread
= task
->task_io_stats
->disk_reads
.size
;
991 ri
->ri_diskio_byteswritten
= (task
->task_io_stats
->total_io
.size
- task
->task_io_stats
->disk_reads
.size
);
993 /* I/O Stats unavailable */
994 ri
->ri_diskio_bytesread
= 0;
995 ri
->ri_diskio_byteswritten
= 0;
1002 fill_task_qos_rusage(task_t task
, rusage_info_current
*ri
)
1006 assert(task
!= TASK_NULL
);
1009 /* Rollup Qos time of all the threads to task */
1010 queue_iterate(&task
->threads
, thread
, thread_t
, task_threads
) {
1011 if (thread
->options
& TH_OPT_IDLE_THREAD
)
1014 thread_update_qos_cpu_time(thread
);
1016 ri
->ri_cpu_time_qos_default
= task
->cpu_time_qos_stats
.cpu_time_qos_default
;
1017 ri
->ri_cpu_time_qos_maintenance
= task
->cpu_time_qos_stats
.cpu_time_qos_maintenance
;
1018 ri
->ri_cpu_time_qos_background
= task
->cpu_time_qos_stats
.cpu_time_qos_background
;
1019 ri
->ri_cpu_time_qos_utility
= task
->cpu_time_qos_stats
.cpu_time_qos_utility
;
1020 ri
->ri_cpu_time_qos_legacy
= task
->cpu_time_qos_stats
.cpu_time_qos_legacy
;
1021 ri
->ri_cpu_time_qos_user_initiated
= task
->cpu_time_qos_stats
.cpu_time_qos_user_initiated
;
1022 ri
->ri_cpu_time_qos_user_interactive
= task
->cpu_time_qos_stats
.cpu_time_qos_user_interactive
;
1029 get_task_dispatchqueue_serialno_offset(task_t task
)
1031 uint64_t dq_serialno_offset
= 0;
1033 if (task
->bsd_info
) {
1034 dq_serialno_offset
= get_dispatchqueue_serialno_offset_from_proc(task
->bsd_info
);
1037 return dq_serialno_offset
;
1041 get_task_uniqueid(task_t task
)
1043 if (task
->bsd_info
) {
1044 return proc_uniqueid(task
->bsd_info
);
1052 get_task_crash_label(task_t task
)
1054 return task
->crash_label
;
1058 set_task_crash_label(task_t task
, struct label
*label
)
1060 task
->crash_label
= label
;