[Cbe-oss-dev] patches for oprofile on PS3?
Carl Love
cel at us.ibm.com
Wed Sep 3 02:25:39 EST 2008
On Mon, 2008-09-01 at 12:02 -0600, Marcus G. Daniels wrote:
> Marcus G. Daniels wrote:
> > opcontrol: line 1342: echo: write error: Function not implemented".
> > On that line it is attempting to write "1" into /dev/oprofile/enable.
> Clarification: This is specific to use of the following:
>
> opcontrol --event=SPU_CYCLES:N
>
> Other events like store_miss or Branch_Commit do apparently make
> measurements as does PPU-side profiling, i.e. they don't trigger the
> error message above upon opcontrol --start.
>
> Marcus
Please note that PPU profiling was added first. Later the SPU profiling
was added. I don't remember what kernel version it was. If you look at
your kernel you should see the directory arch/powerpc/oprofile/cell if
you have the SPU profiling code.
The other thing we need to make sure is that the PS3 arch is mapping the
architecture specific funcitions for the sync start and sync stop.
Specifically, in include/linux/oprofile.h there is the arch specific
structure of function pointers that need to be filled in.
/* Operations structure to be filled in */
struct oprofile_operations {
/* create any necessary configuration files in the oprofile fs.
* Optional. */
int (*create_files)(struct super_block * sb, struct dentry *
root);
/* Do any necessary interrupt setup. Optional. */
int (*setup)(void);
/* Do any necessary interrupt shutdown. Optional. */
void (*shutdown)(void);
/* Start delivering interrupts. */
int (*start)(void);
/* Stop delivering interrupts. */
void (*stop)(void);
/* Arch-specific buffer sync functions.
* Return value = 0: Success
* Return value = -1: Failure
* Return value = 1: Run generic sync function
*/
int (*sync_start)(void);
int (*sync_stop)(void);
/* Initiate a stack backtrace. Optional. */
void (*backtrace)(struct pt_regs * const regs, unsigned int
depth);
/* CPU identification string. */
char * cpu_type;
};
Each architecture needs to set these up for Cell we set them up in
arch/powerpc/oprofile/op_model_cell.c.
struct op_powerpc_model op_model_cell = {
.reg_setup = cell_reg_setup,
.cpu_setup = cell_cpu_setup,
.global_start = cell_global_start,
.global_stop = cell_global_stop,
.sync_start = cell_sync_start,
.sync_stop = cell_sync_stop,
.handle_interrupt = cell_handle_interrupt,
};
Specifically the cell_sync_start gets called which then calls the SPU
profiling specific function spu_sync_start(). Similarly for the
cell_sync_stop() function. Can you check to make sure these function
pointers are being setup in the ps3 model code. That is assuming the
spu profiling code is in your kernel.
Carl Love
> _______________________________________________
> cbe-oss-dev mailing list
> cbe-oss-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/cbe-oss-dev
More information about the cbe-oss-dev
mailing list