Stephane,

Thank you.  I think that clears up my misunderstanding.

One thing was throwing me off was this bit of code in pfmlib_gen_ia32.c

                if (e[j].flags & ~PFMLIB_GEN_IA32_ALL_FLAGS) {
                        DPRINT("event=%d invalid flags=0x%lx\n", e[j].event, e[j].flags);
                        return PFMLIB_ERR_INVAL;
                }

PFMLIB_GEN_IA32_ALL_FLAGS is defined as

#define PFMLIB_GEN_IA32_ALL_FLAGS \
        (PFM_GEN_IA32_SEL_INV|PFM_GEN_IA32_SEL_EDGE)

e is the events array from the inp parameter.  This made it appear that the .flags field of the event was being used for the edge and inv flags.

Is that the bug you were talking about?

- Corey

"stephane eranian" <[EMAIL PROTECTED]> wrote on 12/03/2008 06:20:00 PM:

> Corey,
>
> On Thu, Dec 4, 2008 at 3:03 AM, Corey J Ashford <[EMAIL PROTECTED]> wrote:
> >
> > Sorry, I'm not following still.  The need I have is model specific, if I
> > understand the meaning of "model" correctly.  This flag would matter only
> > for Power6 (PPC970, Power4,5 would be coded to ignore the flag).  It seems
> > that this use would be similar to Atom's need for invert, edge, etc.
> >
> It is similar. You will notice that pfmon for Atom sets INV, EDGE in
>
> pfmlib_intel_atom_input_param_t.pfp_intel_atom_counters[i].flags
>
> pfmlib_intel_atom_input_param_t is passed as a mod_in to dispatch_events().
>
> I am arguing, you should define:
>
> struct pfmlib_power6_input_param_t {
>             int flags[PMU_POWER6_NUM_COUNTERS];
> };
>
> #define PFMLIB_POWER6_USE_INTR  0x1 /* events requests interrupt */
>
> and pass that as mod_in.
>
> And then you can do:
>
>      for_each_counter(i) {
>           if (has(i, OVFL_NOTIFY))
>                mod_in.flags[i] = PFMLIB_POWER6_USE_INTR;
>      }
>
> > Are you arguing for purposes of backward-compatibility?  That if mod_in is
> > set to null, we do what we used to do?  I don't think we have a large user
> > base for perfmon2 on Power yet, so this is probably not a big issue.  I
> > can create an appropriate fix for PAPI/perfmon2 at the same time.
> >
> My argument was that this USE_INTR is exactly like INV or EDGE on x86.
>
> But I think your problem may be slightly more complex. Let's take a
> program such as task_smpl which is all generic. If you're saying that without
> USE_INTR, libpfm may choose an event group which will not generate interrupt,
> and therefore have task_smpl report no sample, then we do have a problem.
> Given that task_smpl is all generic and must remain so, this means
> that we need
> to pass USE_INTR in pfmlib_event.flags. It will not be used except in Power6.
> But that implies we need to patch all existing sampling program to
> pass USE_INTR
> as a generic event flag (that's what I wanted to avoid).
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to