Hello,

I think we need to hide this into an arch_specific function. Which can
then have a indirect function pointer for
cell just like what you do today on PPC.

But I don't understand why you need this extra check JUST for
pfm_read_pmds() and not for all 3 accesses.
Could you elaborate on that?


On Wed, Apr 2, 2008 at 4:09 AM, TakashiYamamoto
<[EMAIL PROTECTED]> wrote:
> Hello,
>  I updated the patch for the latest git tree.
>
>  Thanks,
>  Takashi Yamamoto.
>  -----------------------------------------------------
>  This patch changes the check of PMU access in pfm_read_pmds().
>
>  In the cell-spe-follow mode,
>  we need to call the special function to check
>  whether the target SPU program is running.
>
>  Signed-off-by: Takashi Yamamoto <[EMAIL PROTECTED]>
>  ---
>   include/asm-powerpc/perfmon_kern.h |   13 +++++++++++++
>   perfmon/perfmon_rw.c               |   12 +++++++++++-
>   2 files changed, 24 insertions(+), 1 deletion(-)
>
>  --- a/include/asm-powerpc/perfmon_kern.h
>  +++ b/include/asm-powerpc/perfmon_kern.h
>  @@ -450,6 +450,19 @@ struct pfm_arch_context {
>         void                    *arg;
>   };
>
>  +/*
>  + * This function returns whether the target SPU program is running.
>  + */
>  +static inline int pfm_cell_can_access_pmu(
>  +       struct pfm_context *ctx)
>  +{
>  +       struct pfm_arch_context *ctx_arch = pfm_ctx_arch(ctx);
>  +       if (ctx->flags.not_dflt_ctxsw && ctx_arch->arg)
>  +               return 1;
>  +       else
>  +               return 0;
>  +}
>  +
>   #define PFM_ARCH_CTX_SIZE sizeof(struct pfm_arch_context)
>   /*
>   * PowerPC does not need extra alignment requirements for the sampling buffer
>  --- a/perfmon/perfmon_rw.c
>  +++ b/perfmon/perfmon_rw.c
>  @@ -506,7 +506,17 @@ int __pfm_read_pmds(struct pfm_context *
>
>         if (likely(ctx->state == PFM_CTX_LOADED)) {
>                 can_access_pmu = __get_cpu_var(pmu_owner) == ctx->task
>  -                              || ctx->flags.system;
>  +                       || ctx->flags.system;
>  +
>  +#ifdef CONFIG_PPC
>  +               /*
>  +                * In the cell_spe_follow mode,
>  +                * The target SPU program may run on the other CPU's SPU,
>  +                * So pfm_cell_can_access_pmu(ctx) is used here.
>  +                */
>  +               if (!ctx->flags.system)
>  +                       can_access_pmu = pfm_cell_can_access_pmu(ctx);
>  +#endif
>
>                 if (can_access_pmu)
>                         pfm_arch_serialize();
>
>
>
> -------------------------------------------------------------------------
>  Check out the new SourceForge.net Marketplace.
>  It's the best place to buy or sell services for
>  just about anything Open Source.
>  http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
>  perfmon2-devel mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to