+void add_pcbuffer(void);
+int branch_tracing_enabled(void);
+int disable_branch_tracing(void);
+int enable_branch_tracing(void);
+int pcsamples_bootstrap(void);
+void pcsamples_clear(void);
+int pcsamples_control(int *name, u_int namelen, user_addr_t where, size_t *sizep);
+int pcsamples_read(user_addr_t buffer, size_t *number);
+int pcsamples_reinit(void);
+
+int
+enable_branch_tracing(void)
+{
+ struct proc *p;
+ if (-1 != pc_sample_pid) {
+ p = proc_find(pc_sample_pid);
+ if (p) {
+ p->p_btrace = 1;
+ proc_rele(p);
+ }
+ }
+ else {
+ pc_trace_frameworks = TRUE;
+ }
+
+ return 1;
+
+}
+
+int
+disable_branch_tracing(void)
+{
+ struct proc *p;
+ switch (pc_sample_pid) {
+ case -1:
+ pc_trace_frameworks = FALSE;
+ break;
+ case 0:
+ break;
+ default:
+ p = proc_find(pc_sample_pid);
+ if (p) {
+ p->p_btrace = 0;
+ proc_rele(p);
+ }
+ break;
+ }
+ clr_be_bit();
+ return 1;
+}
+
+/*
+ * this only works for the current proc as it
+ * is called from context_switch in the scheduler
+ */
+int
+branch_tracing_enabled(void)
+{
+ struct proc *p = current_proc();
+ if (TRUE == pc_trace_frameworks) return TRUE;
+ if (p) {
+ return (p->p_btrace);
+ }
+ return 0;
+}
+
+