Commit 9b93418e authored by Carl Love's avatar Carl Love Committed by Robert Richter

powerpc/oprofile: IBM CELL: cleanup and restructuring

This patch restructures and cleans up the code a bit to make it
easier to add new functionality later.  The patch makes no
functional changes to the existing code.
Signed-off-by: default avatarCarl Love <carll@us.ibm.com>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent 4a6908a3
...@@ -31,8 +31,8 @@ static unsigned int profiling_interval; ...@@ -31,8 +31,8 @@ static unsigned int profiling_interval;
#define SPU_PC_MASK 0xFFFF #define SPU_PC_MASK 0xFFFF
static DEFINE_SPINLOCK(sample_array_lock); static DEFINE_SPINLOCK(oprof_spu_smpl_arry_lck);
unsigned long sample_array_lock_flags; unsigned long oprof_spu_smpl_arry_lck_flags;
void set_spu_profiling_frequency(unsigned int freq_khz, unsigned int cycles_reset) void set_spu_profiling_frequency(unsigned int freq_khz, unsigned int cycles_reset)
{ {
...@@ -145,13 +145,13 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer) ...@@ -145,13 +145,13 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
* sample array must be loaded and then processed for a given * sample array must be loaded and then processed for a given
* cpu. The sample array is not per cpu. * cpu. The sample array is not per cpu.
*/ */
spin_lock_irqsave(&sample_array_lock, spin_lock_irqsave(&oprof_spu_smpl_arry_lck,
sample_array_lock_flags); oprof_spu_smpl_arry_lck_flags);
num_samples = cell_spu_pc_collection(cpu); num_samples = cell_spu_pc_collection(cpu);
if (num_samples == 0) { if (num_samples == 0) {
spin_unlock_irqrestore(&sample_array_lock, spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
sample_array_lock_flags); oprof_spu_smpl_arry_lck_flags);
continue; continue;
} }
...@@ -162,8 +162,8 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer) ...@@ -162,8 +162,8 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
num_samples); num_samples);
} }
spin_unlock_irqrestore(&sample_array_lock, spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
sample_array_lock_flags); oprof_spu_smpl_arry_lck_flags);
} }
smp_wmb(); /* insure spu event buffer updates are written */ smp_wmb(); /* insure spu event buffer updates are written */
...@@ -182,13 +182,13 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer) ...@@ -182,13 +182,13 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
static struct hrtimer timer; static struct hrtimer timer;
/* /*
* Entry point for SPU profiling. * Entry point for SPU cycle profiling.
* NOTE: SPU profiling is done system-wide, not per-CPU. * NOTE: SPU profiling is done system-wide, not per-CPU.
* *
* cycles_reset is the count value specified by the user when * cycles_reset is the count value specified by the user when
* setting up OProfile to count SPU_CYCLES. * setting up OProfile to count SPU_CYCLES.
*/ */
int start_spu_profiling(unsigned int cycles_reset) int start_spu_profiling_cycles(unsigned int cycles_reset)
{ {
ktime_t kt; ktime_t kt;
...@@ -212,10 +212,10 @@ int start_spu_profiling(unsigned int cycles_reset) ...@@ -212,10 +212,10 @@ int start_spu_profiling(unsigned int cycles_reset)
return 0; return 0;
} }
void stop_spu_profiling(void) void stop_spu_profiling_cycles(void)
{ {
spu_prof_running = 0; spu_prof_running = 0;
hrtimer_cancel(&timer); hrtimer_cancel(&timer);
kfree(samples); kfree(samples);
pr_debug("SPU_PROF: stop_spu_profiling issued\n"); pr_debug("SPU_PROF: stop_spu_profiling_cycles issued\n");
} }
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment