Re: [PATCH v5 1/4] tools/perf: support parsing parameterized events

From: Jiri Olsa
Date: Mon Dec 08 2014 - 06:00:20 EST


On Sat, Dec 06, 2014 at 11:37:24PM -0800, Sukadev Bhattiprolu wrote:
> Jiri Olsa [jolsa@xxxxxxxxxx] wrote:
>
> | anyway we could assign directly to the param term name as you do,
> | but I think we just need to mark the term as parametrized, like:
> |
> | in /sys/bus/event_source/devices/pmu/events/event_name you have:
> | param2=?,bar=1,param1=?
>
> I like the idea of just using a single ? for required parameters, but
> the problem I had with this approach can be seen with these two sysfs
> entries:
>
> $ cat HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE
> domain=0x2,offset=0xe0,starting_index=core,lpar=0x0
>
> $ cat HPM_0THRD_NON_IDLE_CCYC__VCPU_HOME_CORE
> domain=0x3,offset=0xe0,starting_index=vcpu,lpar=sibling_guest_id
>
> The parameter 'starting_index' refers to a core in one event and vcpu in
> another event. We were trying to give a hint as to what it refers to.
>
> Given that, 'starting_index' is not very intuitive, how about discarding
> starting_index and replacing with what it really means for the event and,
> use a simple '?' to indicate required parameter).
>
> $ cat HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE
> domain=0x2,offset=0xe0,core=?,lpar=0x0
>
> $ cat HPM_0THRD_NON_IDLE_CCYC__VCPU_HOME_CORE
> domain=0x3,offset=0xe0,vcpu=?,lpar=?
>
> perf list shows these as:
>
> hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=?/
> hv_24x7/HPM_0THRD_NON_IDLE_CCYC__VCPU_HOME_CHIP,vcpu=?,lpar=?/
>
> command line would be
>
> -e hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=2/
>
> or
>
> -e hv_24x7/HPM_0THRD_NON_IDLE_CCYC__VCPU_HOME_CHIP,vcpu=2,lpar=7/
>
> and would fail if a required parameter is missing.

that sounds good to me

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/