lkml.org 
[lkml]   [2007]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Cbe-oss-dev] [RFC, PATCH] CELL Oprofile SPU profiling updated patch
Date
On Thursday 15 February 2007 17:15, Maynard Johnson wrote:
> >>+void spu_set_profile_private(struct spu_context * ctx, void * profile_info,
> >>+                          struct kref * prof_info_kref,
> >>+                          void (* prof_info_release) (struct kref * kref))
> >>+{
> >>+     ctx->profile_private = profile_info;
> >>+     ctx->prof_priv_kref = prof_info_kref;
> >>+     ctx->prof_priv_release = prof_info_release;
> >>+}
> >>+EXPORT_SYMBOL_GPL(spu_set_profile_private);
> >>    
> >>
> >
> >I think you don't need the profile_private member here, if you just use
> >container_of with ctx->prof_priv_kref in all users.
> >  
> >
> Sorry, I don't follow. We want the profile_private to be stored in the
> spu_context, don't we?  How else would I be able to do that?  And
> besides, wouldn't container_of need the struct name of profile_private?  
> SPUFS doesn't have access to the type.

The idea was to have spu_get_profile_private return the kref pointer,
and then change the user of that to do

+ if (!spu_info[spu_num] && the_spu) {
+ spu_info[spu_num] = container_of(
+ spu_get_profile_private(the_spu->ctx),
+ struct cached_info, cache_kref);
+ if (spu_info[spu_num])
+ kref_get(&spu_info[spu_num]->cache_ref);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-02-15 19:17    [from the cache]
©2003-2011 Jasper Spaans