4 * Copyright (c) 2017 Apple Inc. All rights reserved.
6 * @APPLE_APACHE_LICENSE_HEADER_START@
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
20 * @APPLE_APACHE_LICENSE_HEADER_END@
24 * Usage: voucher_trace.d -p [pid]
25 * traced process must have been executed with
26 * DYLD_LIBRARY_PATH=/usr/lib/system/introspection or with
27 * DYLD_IMAGE_SUFFIX=_profile or DYLD_IMAGE_SUFFIX=_debug
30 #pragma D option quiet
31 #pragma D option zdefs
32 #pragma D option bufsize=16m
35 printf("Starting to trace voucher operations...\n");
38 voucher$target:libdispatch*.dylib::create
40 printf("ALLOC voucher 0x%p, thread %#llx, ref 1, port %#x, aid %#llx", arg0, tid, arg1, arg2);
45 voucher$target:libdispatch*.dylib::dispose
47 printf("FREE voucher 0x%p, thread %#llx, ref 0", arg0, tid);
52 voucher$target:libdispatch*.dylib::retain
54 printf("RETAIN voucher 0x%p, thread %#llx, ref %d", arg0, tid, arg1);
59 voucher$target:libdispatch*.dylib::release
61 printf("RELEASE voucher 0x%p, thread %#llx, ref %d", arg0, tid, arg1);
66 voucher$target:libdispatch*.dylib::adopt
68 printf("ADOPT voucher 0x%p, thread %#llx", arg0, tid);
73 voucher$target:libdispatch*.dylib::orphan
75 printf("ORPHAN voucher 0x%p, thread %#llx", arg0, tid);