From: Maynard J. <may...@us...> - 2007-04-20 19:43:06
Attachments:
oprof-cell-spu.patch2
|
This is patch 2 of 3 to add support for profiling Cell BE SPUs. This patch contains changes to the oprofile daemon code required for interpreting the special kernel buffer record format for SPU profile sample data. Regards, -Maynard |
From: John L. <le...@mo...> - 2007-04-28 01:28:18
|
/** anonymous mapping */ struct anon_mapping * anon; + unsigned int embedded_offset; Add doc comment. Is "unsigned int" really the right type?? diff -paurNX diff_fileExclusionFilter oprof-cvs-04.20.2007/daemon/opd_trans.c oprof-cell-patch2/daemon/opd_trans.c --- oprof-cvs-04.20.2007/daemon/opd_trans.c 2006-11-17 19:18:58.000000000 -0600 +++ oprof-cell-patch2/daemon/opd_trans.c 2007-04-20 12:33:16.000000000 -0500 @@ -267,6 +270,73 @@ static void code_xen_enter(struct transi typedef void (*handler_t)(struct transient *); +static handler_t handlers[]; The SPU code should probably be in an opd_spu.c +static void code_spu_profiling(struct transient * trans) +{ + /* Next value in buffer is the number of SPUs. */ + + unsigned long long num_spus = pop_buffer_value(trans); + spu_context_cache = malloc(sizeof(struct spu_context_info) * num_spus); Check malloc return? @@ -310,6 +474,11 @@ void opd_process_samples(char const * bu */ unsigned long long code; + if (special_processor) { + special_processor(&trans); + return; + } + Rather than special casing, have a default processor and your SPU one, and switch between, so this code always do process_samples(&trans); regards john |
From: Maynard J. <may...@us...> - 2007-04-30 14:28:26
|
John Levon wrote: > /** anonymous mapping */ > struct anon_mapping * anon; >+ unsigned int embedded_offset; > >Add doc comment. Is "unsigned int" really the right type?? > > OK, I'll add a doc comment. Yeah, probably should be unsigned long, here and every where. >diff -paurNX diff_fileExclusionFilter oprof-cvs-04.20.2007/daemon/opd_trans.c oprof-cell-patch2/daemon/opd_trans.c >--- oprof-cvs-04.20.2007/daemon/opd_trans.c 2006-11-17 19:18:58.000000000 -0600 >+++ oprof-cell-patch2/daemon/opd_trans.c 2007-04-20 12:33:16.000000000 -0500 >@@ -267,6 +270,73 @@ static void code_xen_enter(struct transi > > typedef void (*handler_t)(struct transient *); > >+static handler_t handlers[]; > >The SPU code should probably be in an opd_spu.c > > OK. >+static void code_spu_profiling(struct transient * trans) >+{ >+ /* Next value in buffer is the number of SPUs. */ >+ >+ unsigned long long num_spus = pop_buffer_value(trans); >+ spu_context_cache = malloc(sizeof(struct spu_context_info) * num_spus); > >Check malloc return? > > Right. >@@ -310,6 +474,11 @@ void opd_process_samples(char const * bu > */ > unsigned long long code; > >+ if (special_processor) { >+ special_processor(&trans); >+ return; >+ } >+ > >Rather than special casing, have a default processor and your SPU one, >and switch between, so this code always do > > process_samples(&trans); > > OK. >regards >john > > |
From: Maynard J. <may...@us...> - 2007-05-01 22:02:09
|
Maynard Johnson wrote: > John Levon wrote: > [snip] >> @@ -310,6 +474,11 @@ void opd_process_samples(char const * bu >> */ >> unsigned long long code; >> >> + if (special_processor) { >> + special_processor(&trans); >> + return; >> + } >> + >> >> Rather than special casing, have a default processor and your SPU one, >> and switch between, so this code always do >> >> process_samples(&trans); >> >> > OK. hmmmm . . . now that I'm looking at this, I'm not sure I understand what you're suggesting. This is C code in the daemon, so obviously you're not referring to some kind of function overloading. Can you clarify? Thanks. -Maynard > >> regards >> john >> >> > > |
From: Maynard J. <may...@us...> - 2007-05-02 16:51:48
Attachments:
oprof-cell-spu.patch2
|
This is a rework of Cell BE SPU patch 2, originally posted on April 20. The main change here was to move the Cell SPU-specific daemon code into its own source file. Since this code uses many of the same functions and variables as opd_trans.c, I had to move some declarations, as well as some static inline functions, into opd_trans.h so that both opd_trans.c and the new file, opd_spu.c, could access them. Regards, -Maynard |