From: Jiri Olsa <jolsa@redhat.com>
To: Jin Yao <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com,
Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v2 1/4] perf: Add a 'percore' event qualifier
Date: Mon, 18 Mar 2019 10:21:17 +0100 [thread overview]
Message-ID: <20190318092117.GA25277@krava> (raw)
In-Reply-To: <1552754068-10325-2-git-send-email-yao.jin@linux.intel.com>
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
next prev parent reply other threads:[~2019-03-18 9:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-16 16:34 [PATCH v2 0/4] perf: Support a new 'percore' event qualifier Jin Yao
2019-03-16 16:34 ` [PATCH v2 1/4] perf: Add a " Jin Yao
2019-03-18 9:21 ` Jiri Olsa [this message]
2019-03-19 1:08 ` Jin, Yao
2019-03-16 16:34 ` [PATCH v2 2/4] perf stat: Factor out aggregate counts printing Jin Yao
2019-03-16 16:34 ` [PATCH v2 3/4] perf stat: Support 'percore' event qualifier Jin Yao
2019-03-16 16:34 ` [PATCH v2 4/4] perf test: Add a simple test for term 'percore' Jin Yao
2019-03-18 9:21 ` [PATCH v2 0/4] perf: Support a new 'percore' event qualifier Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190318092117.GA25277@krava \
--to=jolsa@redhat.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=yao.jin@intel.com \
--cc=yao.jin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox