Lines Matching refs:sbp
82 static struct sbprof_tb sbp; variable
137 #define TB_FULL (sbp.next_tb_sample == MAX_TB_SAMPLES)
198 sbp.tb_armed = 1; in arm_tb()
207 if (sbp.next_tb_sample < MAX_TB_SAMPLES) { in sbprof_tb_intr()
209 u64 *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; in sbprof_tb_intr()
231 if (!sbp.tb_enable) { in sbprof_tb_intr()
235 sbp.tb_armed = 0; in sbprof_tb_intr()
236 wake_up_interruptible(&sbp.tb_sync); in sbprof_tb_intr()
245 sbp.tb_armed = 0; in sbprof_tb_intr()
246 if (!sbp.tb_enable) in sbprof_tb_intr()
247 wake_up_interruptible(&sbp.tb_sync); in sbprof_tb_intr()
248 wake_up_interruptible(&sbp.tb_read); in sbprof_tb_intr()
270 if (xchg(&sbp.tb_enable, 1)) in sbprof_zbprof_start()
275 sbp.next_tb_sample = 0; in sbprof_zbprof_start()
279 DEVNAME " trace freeze", &sbp); in sbprof_zbprof_start()
295 if (request_irq(K_INT_PERF_CNT, sbprof_pc_intr, 0, DEVNAME " scd perfcnt", &sbp)) { in sbprof_zbprof_start()
296 free_irq(K_INT_TRACE_FREEZE, &sbp); in sbprof_zbprof_start()
378 if (sbp.tb_enable) { in sbprof_zbprof_stop()
385 err = wait_event_interruptible(sbp.tb_sync, !sbp.tb_armed); in sbprof_zbprof_stop()
391 sbp.tb_enable = 0; in sbprof_zbprof_stop()
392 free_irq(K_INT_TRACE_FREEZE, &sbp); in sbprof_zbprof_stop()
393 free_irq(K_INT_PERF_CNT, &sbp); in sbprof_zbprof_stop()
409 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) in sbprof_tb_open()
412 memset(&sbp, 0, sizeof(struct sbprof_tb)); in sbprof_tb_open()
413 sbp.sbprof_tbbuf = vzalloc(MAX_TBSAMPLE_BYTES); in sbprof_tb_open()
414 if (!sbp.sbprof_tbbuf) { in sbprof_tb_open()
415 sbp.open = SB_CLOSED; in sbprof_tb_open()
420 init_waitqueue_head(&sbp.tb_sync); in sbprof_tb_open()
421 init_waitqueue_head(&sbp.tb_read); in sbprof_tb_open()
422 mutex_init(&sbp.lock); in sbprof_tb_open()
424 sbp.open = SB_OPEN; in sbprof_tb_open()
435 if (minor != 0 || sbp.open != SB_CLOSED) in sbprof_tb_release()
438 mutex_lock(&sbp.lock); in sbprof_tb_release()
440 if (sbp.tb_armed || sbp.tb_enable) in sbprof_tb_release()
443 vfree(sbp.sbprof_tbbuf); in sbprof_tb_release()
444 sbp.open = SB_CLOSED; in sbprof_tb_release()
447 mutex_unlock(&sbp.lock); in sbprof_tb_release()
464 mutex_lock(&sbp.lock); in sbprof_tb_read()
471 while (size && (cur_sample < sbp.next_tb_sample)) { in sbprof_tb_read()
475 src = (char *)(((long)sbp.sbprof_tbbuf[cur_sample])+sample_off); in sbprof_tb_read()
479 mutex_unlock(&sbp.lock); in sbprof_tb_read()
498 mutex_unlock(&sbp.lock); in sbprof_tb_read()
511 mutex_lock(&sbp.lock); in sbprof_tb_ioctl()
513 mutex_unlock(&sbp.lock); in sbprof_tb_ioctl()
517 mutex_lock(&sbp.lock); in sbprof_tb_ioctl()
519 mutex_unlock(&sbp.lock); in sbprof_tb_ioctl()
523 err = wait_event_interruptible(sbp.tb_read, TB_FULL); in sbprof_tb_ioctl()
580 sbp.open = SB_CLOSED; in sbprof_tb_init()