Lines Matching refs:sbp

70 static struct sbprof_tb sbp;  variable
125 #define TB_FULL (sbp.next_tb_sample == MAX_TB_SAMPLES)
186 sbp.tb_armed = 1; in arm_tb()
195 if (sbp.next_tb_sample < MAX_TB_SAMPLES) { in sbprof_tb_intr()
197 u64 *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; in sbprof_tb_intr()
219 if (!sbp.tb_enable) { in sbprof_tb_intr()
223 sbp.tb_armed = 0; in sbprof_tb_intr()
224 wake_up_interruptible(&sbp.tb_sync); in sbprof_tb_intr()
233 sbp.tb_armed = 0; in sbprof_tb_intr()
234 if (!sbp.tb_enable) in sbprof_tb_intr()
235 wake_up_interruptible(&sbp.tb_sync); in sbprof_tb_intr()
236 wake_up_interruptible(&sbp.tb_read); in sbprof_tb_intr()
258 if (xchg(&sbp.tb_enable, 1)) in sbprof_zbprof_start()
263 sbp.next_tb_sample = 0; in sbprof_zbprof_start()
267 DEVNAME " trace freeze", &sbp); in sbprof_zbprof_start()
283 if (request_irq(K_INT_PERF_CNT, sbprof_pc_intr, 0, DEVNAME " scd perfcnt", &sbp)) { in sbprof_zbprof_start()
284 free_irq(K_INT_TRACE_FREEZE, &sbp); in sbprof_zbprof_start()
366 if (sbp.tb_enable) { in sbprof_zbprof_stop()
373 err = wait_event_interruptible(sbp.tb_sync, !sbp.tb_armed); in sbprof_zbprof_stop()
379 sbp.tb_enable = 0; in sbprof_zbprof_stop()
380 free_irq(K_INT_TRACE_FREEZE, &sbp); in sbprof_zbprof_stop()
381 free_irq(K_INT_PERF_CNT, &sbp); in sbprof_zbprof_stop()
397 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) in sbprof_tb_open()
400 memset(&sbp, 0, sizeof(struct sbprof_tb)); in sbprof_tb_open()
401 sbp.sbprof_tbbuf = vzalloc(MAX_TBSAMPLE_BYTES); in sbprof_tb_open()
402 if (!sbp.sbprof_tbbuf) { in sbprof_tb_open()
403 sbp.open = SB_CLOSED; in sbprof_tb_open()
408 init_waitqueue_head(&sbp.tb_sync); in sbprof_tb_open()
409 init_waitqueue_head(&sbp.tb_read); in sbprof_tb_open()
410 mutex_init(&sbp.lock); in sbprof_tb_open()
412 sbp.open = SB_OPEN; in sbprof_tb_open()
423 if (minor != 0 || sbp.open != SB_CLOSED) in sbprof_tb_release()
426 mutex_lock(&sbp.lock); in sbprof_tb_release()
428 if (sbp.tb_armed || sbp.tb_enable) in sbprof_tb_release()
431 vfree(sbp.sbprof_tbbuf); in sbprof_tb_release()
432 sbp.open = SB_CLOSED; in sbprof_tb_release()
435 mutex_unlock(&sbp.lock); in sbprof_tb_release()
452 mutex_lock(&sbp.lock); in sbprof_tb_read()
459 while (size && (cur_sample < sbp.next_tb_sample)) { in sbprof_tb_read()
463 src = (char *)(((long)sbp.sbprof_tbbuf[cur_sample])+sample_off); in sbprof_tb_read()
467 mutex_unlock(&sbp.lock); in sbprof_tb_read()
486 mutex_unlock(&sbp.lock); in sbprof_tb_read()
499 mutex_lock(&sbp.lock); in sbprof_tb_ioctl()
501 mutex_unlock(&sbp.lock); in sbprof_tb_ioctl()
505 mutex_lock(&sbp.lock); in sbprof_tb_ioctl()
507 mutex_unlock(&sbp.lock); in sbprof_tb_ioctl()
511 err = wait_event_interruptible(sbp.tb_read, TB_FULL); in sbprof_tb_ioctl()
568 sbp.open = SB_CLOSED; in sbprof_tb_init()