[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ae583ce9-097b-c0a7-b183-84c08f8647ca@linux.intel.com>
Date: Tue, 19 Mar 2019 09:08:03 +0800
From: "Jin, Yao" <yao.jin@...ux.intel.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
mingo@...hat.com, alexander.shishkin@...ux.intel.com,
Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v2 1/4] perf: Add a 'percore' event qualifier
On 3/18/2019 5:21 PM, Jiri Olsa wrote:
> On Sun, Mar 17, 2019 at 12:34:25AM +0800, Jin Yao wrote:
>
> SNIP
>
>> static bool config_term_shrinked;
>> @@ -950,6 +951,7 @@ config_term_avail(int term_type, struct parse_events_error *err)
>> case PARSE_EVENTS__TERM_TYPE_CONFIG2:
>> case PARSE_EVENTS__TERM_TYPE_NAME:
>> case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD:
>> + case PARSE_EVENTS__TERM_TYPE_PERCORE:
>> return true;
>> default:
>> if (!err)
>> @@ -1041,6 +1043,14 @@ do { \
>> case PARSE_EVENTS__TERM_TYPE_MAX_EVENTS:
>> CHECK_TYPE_VAL(NUM);
>> break;
>> + case PARSE_EVENTS__TERM_TYPE_PERCORE:
>> + CHECK_TYPE_VAL(NUM);
>> + if ((unsigned int)term->val.num > 1) {
>> + err->str = strdup("expected 0 or 1");
>> + err->idx = term->err_val;
>> + return -EINVAL;
>> + }
>> + break;
>> default:
>> err->str = strdup("unknown term");
>> err->idx = term->err_term;
>> @@ -1179,6 +1189,10 @@ do { \
>> case PARSE_EVENTS__TERM_TYPE_DRV_CFG:
>> ADD_CONFIG_TERM(DRV_CFG, drv_cfg, term->val.str);
>> break;
>> + case PARSE_EVENTS__TERM_TYPE_PERCORE:
>> + ADD_CONFIG_TERM(PERCORE, percore,
>> + term->val.num ? 1 : 0);
>
> term->val.num ? true : false
>
>> + break;
>> default:
>> break;
>> }
>> @@ -1233,6 +1247,18 @@ int parse_events_add_numeric(struct parse_events_state *parse_state,
>> get_config_name(head_config), &config_terms);
>> }
>>
>> +static bool config_term_percore(struct list_head *config_terms)
>> +{
>> + struct perf_evsel_config_term *term;
>> +
>> + list_for_each_entry(term, config_terms, list) {
>> + if (term->type == PERF_EVSEL__CONFIG_TERM_PERCORE)
>> + return term->val.percore ? true : false;
>
> term->val.percore is bool right? so just simple
> return term->val.percore;
>
> should be enough.. together with above change
>
> jirka
>
Thanks Jiri, I add this change in v3.
Thanks
Jin Yao
Powered by blists - more mailing lists