1 #!/usr/sbin/dtrace -q -s
4 string opnames[unsigned]; /* common opcode names */
11 opnames[1] = "always";
12 opnames[2] = "identifier...";
13 opnames[3] = "anchor apple";
14 opnames[4] = "anchor = ...";
15 opnames[5] = "!legacy infokey!";
18 opnames[8] = "cdhash";
20 opnames[10] = "info[...]";
21 opnames[11] = "cert[subject...]";
22 opnames[12] = "anchor trusted...";
23 opnames[13] = "anchor trusted...";
24 opnames[14] = "cert[field...]";
25 opnames[15] = "anchor apple generic";
26 opnames[16] = "entitlement[...]";
27 opnames[17] = "cert[policy...]";
28 opnames[18] = "anchor NAMED";
29 opnames[19] = "(NAMED)";
33 codesign*:::eval-reqint-start
35 printf("%8u %s[%d] START(%p,%d)\n",
36 timestamp, execname, pid,
40 codesign*:::eval-reqint-end
42 @eval[arg1] = count();
45 codesign*:::eval-reqint-end
48 printf("%8u %s[%d] SUCCESS\n",
49 timestamp, execname, pid);
52 codesign*:::eval-reqint-end
53 / arg1 == 4294900246 /
55 printf("%8u %s[%d] FAIL\n",
56 timestamp, execname, pid);
59 codesign*:::eval-reqint-end
60 / arg1 != 4294900246 && arg1 != 0 /
62 printf("%8u %s[%d] FAIL(%d)\n",
63 timestamp, execname, pid,
67 codesign*:::eval-reqint-unknown*
69 printf("%8u %s[%d] %s(%d)\n",
70 timestamp, execname, pid, probename,
74 codesign*:::eval-reqint-fragment-load
77 printf("%8u %s[%d] frag-load(%s,%s,%p)\n",
78 timestamp, execname, pid,
79 copyinstr(arg0), copyinstr(arg1), arg2);
80 @fragload[copyinstr(arg0), copyinstr(arg1)] = count();
81 @fraguse[copyinstr(arg0), copyinstr(arg1)] = count();
84 codesign*:::eval-reqint-fragment-load
87 printf("%8u %s[%d] frag-load(%s,%s,FAILED)\n",
88 timestamp, execname, pid,
89 copyinstr(arg0), copyinstr(arg1));
90 @fragload[copyinstr(arg0), copyinstr(arg1)] = count();
91 @fraguse[copyinstr(arg0), copyinstr(arg1)] = count();
94 codesign*:::eval-reqint-fragment-hit
96 printf("%8u %s[%d] frag-hit(%s,%s)\n",
97 timestamp, execname, pid,
98 copyinstr(arg0), copyinstr(arg1));
99 @fraguse[copyinstr(arg0), copyinstr(arg1)] = count();
104 * Trace opcodes as they're encountered and evaluated
106 codesign*:::eval-reqint-op
109 @opcodes[arg0] = count();
112 codesign*:::eval-reqint-op
115 printf("%8u %s[%d] %s\n", timestamp, execname, pid,
121 * Print out aggregates at the end
125 printf("\nREQUIREMENT EVALUATIONS:\n");
126 printa("\t%d (%@d)\n", @eval);
128 printf("\nREQUIREMENT OPCODES EVALUATED:\n");
129 printa("\t%5d (%@d)\n", @opcodes);
131 printf("\nFRAGMENTS LOADED:\n");
132 printa("\t%s %s (%@d)\n", @fragload);