15 #include <linux/hrtimer.h>
17 #include <linux/slab.h>
22 #define SCALE_SHIFT 14
38 static unsigned int profiling_interval;
40 #define NUM_SPU_BITS_TRBUF 16
41 #define SPUS_PER_TB_ENTRY 4
43 #define SPU_PC_MASK 0xFFFF
50 unsigned long ns_per_cyc;
70 profiling_interval = (ns_per_cyc * cycles_reset) >>
SCALE_SHIFT;
77 static void spu_pc_extract(
int cpu,
int entry)
101 = (spu_mask & trace_buffer[0]) << 2;
103 = (spu_mask & trace_buffer[1]) << 2;
110 static int cell_spu_pc_collection(
int cpu)
122 spu_pc_extract(cpu, entry);
140 int cpu,
node,
k, num_samples, spu_num;
161 num_samples = cell_spu_pc_collection(cpu);
163 if (num_samples == 0) {
164 spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
176 spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
183 kt = ktime_set(0, profiling_interval);
207 kt = ktime_set(0, profiling_interval);
209 hrtimer_set_expires(&timer, kt);
213 samples = kzalloc(SPUS_PER_NODE *
246 pr_debug(
"SPU_PROF: stop_spu_profiling_cycles issued\n");