All of lore.kernel.org
 help / color / mirror / Atom feed
From: jolsa@redhat.com (Jiri Olsa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 3/6] perf tools: add infrastructure for PMU specific configuration
Date: Thu, 21 Jul 2016 09:47:31 +0200	[thread overview]
Message-ID: <20160721074731.GC7192@krava> (raw)
In-Reply-To: <1469047100-18131-4-git-send-email-mathieu.poirier@linaro.org>

On Wed, Jul 20, 2016 at 02:38:17PM -0600, Mathieu Poirier wrote:

SNIP

> +static int get_config_terms(struct list_head *head_config,
> +			    struct list_head *head_terms)
> +{
>  	struct parse_events_term *term;
>  
>  	list_for_each_entry(term, head_config, list) {
>  		switch (term->type_term) {
>  		case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD:
> -			ADD_CONFIG_TERM(PERIOD, period, term->val.num);
> +			ADD_CONFIG_TERM(PERIOD, period,
> +					term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ:
> -			ADD_CONFIG_TERM(FREQ, freq, term->val.num);
> +			ADD_CONFIG_TERM(FREQ, freq, term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_TIME:
> -			ADD_CONFIG_TERM(TIME, time, term->val.num);
> +			ADD_CONFIG_TERM(TIME, time, term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
> -			ADD_CONFIG_TERM(CALLGRAPH, callgraph, term->val.str);
> +			ADD_CONFIG_TERM(CALLGRAPH, callgraph,
> +					term->val.str, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
> -			ADD_CONFIG_TERM(STACK_USER, stack_user, term->val.num);
> +			ADD_CONFIG_TERM(STACK_USER, stack_user,
> +					term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_INHERIT:
> -			ADD_CONFIG_TERM(INHERIT, inherit, term->val.num ? 1 : 0);
> +			ADD_CONFIG_TERM(INHERIT, inherit,
> +					term->val.num ? 1 : 0, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_NOINHERIT:
> -			ADD_CONFIG_TERM(INHERIT, inherit, term->val.num ? 0 : 1);
> +			ADD_CONFIG_TERM(INHERIT, inherit,
> +					term->val.num ? 0 : 1, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_MAX_STACK:
> -			ADD_CONFIG_TERM(MAX_STACK, max_stack, term->val.num);
> +			ADD_CONFIG_TERM(MAX_STACK, max_stack,
> +					term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_OVERWRITE:
> -			ADD_CONFIG_TERM(OVERWRITE, overwrite, term->val.num ? 1 : 0);
> +			ADD_CONFIG_TERM(OVERWRITE, overwrite,
> +					term->val.num ? 1 : 0, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE:
> -			ADD_CONFIG_TERM(OVERWRITE, overwrite, term->val.num ? 0 : 1);
> +			ADD_CONFIG_TERM(OVERWRITE, overwrite,
> +					term->val.num ? 0 : 1, head_terms);
>  			break;

I think it'd be better to have all terms altogether,
and handle the 'case PARSE_EVENTS__TERM_TYPE_DRV_CFG:'
in here, rather than in separate function

also ADD_CONFIG_TERM macro could stay local to the
function with no need of adding new head arguments

thanks,
jirka

>  		default:
>  			break;
> @@ -1142,6 +1158,21 @@ do {								\
>  	return 0;
>  }
>  
> +static int get_drv_config_terms(struct list_head *head_config,
> +				struct list_head *head_terms)
> +{
> +	struct parse_events_term *term;
> +
> +	list_for_each_entry(term, head_config, list) {
> +		if (term->type_term != PARSE_EVENTS__TERM_TYPE_DRV_CFG)
> +			continue;
> +
> +		ADD_CONFIG_TERM(DRV_CFG, drv_cfg, term->val.str, head_terms);
> +	}
> +
> +	return 0;
> +}

SNIP

WARNING: multiple messages have this Message-ID (diff)
From: Jiri Olsa <jolsa@redhat.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
	mingo@redhat.com, alexander.shishkin@linux.intel.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 3/6] perf tools: add infrastructure for PMU specific configuration
Date: Thu, 21 Jul 2016 09:47:31 +0200	[thread overview]
Message-ID: <20160721074731.GC7192@krava> (raw)
In-Reply-To: <1469047100-18131-4-git-send-email-mathieu.poirier@linaro.org>

On Wed, Jul 20, 2016 at 02:38:17PM -0600, Mathieu Poirier wrote:

SNIP

> +static int get_config_terms(struct list_head *head_config,
> +			    struct list_head *head_terms)
> +{
>  	struct parse_events_term *term;
>  
>  	list_for_each_entry(term, head_config, list) {
>  		switch (term->type_term) {
>  		case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD:
> -			ADD_CONFIG_TERM(PERIOD, period, term->val.num);
> +			ADD_CONFIG_TERM(PERIOD, period,
> +					term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ:
> -			ADD_CONFIG_TERM(FREQ, freq, term->val.num);
> +			ADD_CONFIG_TERM(FREQ, freq, term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_TIME:
> -			ADD_CONFIG_TERM(TIME, time, term->val.num);
> +			ADD_CONFIG_TERM(TIME, time, term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
> -			ADD_CONFIG_TERM(CALLGRAPH, callgraph, term->val.str);
> +			ADD_CONFIG_TERM(CALLGRAPH, callgraph,
> +					term->val.str, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
> -			ADD_CONFIG_TERM(STACK_USER, stack_user, term->val.num);
> +			ADD_CONFIG_TERM(STACK_USER, stack_user,
> +					term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_INHERIT:
> -			ADD_CONFIG_TERM(INHERIT, inherit, term->val.num ? 1 : 0);
> +			ADD_CONFIG_TERM(INHERIT, inherit,
> +					term->val.num ? 1 : 0, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_NOINHERIT:
> -			ADD_CONFIG_TERM(INHERIT, inherit, term->val.num ? 0 : 1);
> +			ADD_CONFIG_TERM(INHERIT, inherit,
> +					term->val.num ? 0 : 1, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_MAX_STACK:
> -			ADD_CONFIG_TERM(MAX_STACK, max_stack, term->val.num);
> +			ADD_CONFIG_TERM(MAX_STACK, max_stack,
> +					term->val.num, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_OVERWRITE:
> -			ADD_CONFIG_TERM(OVERWRITE, overwrite, term->val.num ? 1 : 0);
> +			ADD_CONFIG_TERM(OVERWRITE, overwrite,
> +					term->val.num ? 1 : 0, head_terms);
>  			break;
>  		case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE:
> -			ADD_CONFIG_TERM(OVERWRITE, overwrite, term->val.num ? 0 : 1);
> +			ADD_CONFIG_TERM(OVERWRITE, overwrite,
> +					term->val.num ? 0 : 1, head_terms);
>  			break;

I think it'd be better to have all terms altogether,
and handle the 'case PARSE_EVENTS__TERM_TYPE_DRV_CFG:'
in here, rather than in separate function

also ADD_CONFIG_TERM macro could stay local to the
function with no need of adding new head arguments

thanks,
jirka

>  		default:
>  			break;
> @@ -1142,6 +1158,21 @@ do {								\
>  	return 0;
>  }
>  
> +static int get_drv_config_terms(struct list_head *head_config,
> +				struct list_head *head_terms)
> +{
> +	struct parse_events_term *term;
> +
> +	list_for_each_entry(term, head_config, list) {
> +		if (term->type_term != PARSE_EVENTS__TERM_TYPE_DRV_CFG)
> +			continue;
> +
> +		ADD_CONFIG_TERM(DRV_CFG, drv_cfg, term->val.str, head_terms);
> +	}
> +
> +	return 0;
> +}

SNIP

  parent reply	other threads:[~2016-07-21  7:47 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 20:38 [PATCH V2 0/6] perf: Driver specific configuration for PMU Mathieu Poirier
2016-07-20 20:38 ` Mathieu Poirier
2016-07-20 20:38 ` [PATCH V2 1/6] perf/core: Adding PMU driver specific configuration Mathieu Poirier
2016-07-20 20:38   ` Mathieu Poirier
2016-07-20 20:38 ` [PATCH V2 2/6] perf: Passing struct perf_event to function setup_aux() Mathieu Poirier
2016-07-20 20:38   ` Mathieu Poirier
2016-07-20 20:38 ` [PATCH V2 3/6] perf tools: add infrastructure for PMU specific configuration Mathieu Poirier
2016-07-20 20:38   ` Mathieu Poirier
2016-07-21  7:47   ` Jiri Olsa
2016-07-21  7:47     ` Jiri Olsa
2016-07-21  7:47   ` Jiri Olsa
2016-07-21  7:47     ` Jiri Olsa
2016-07-21 14:44     ` Mathieu Poirier
2016-07-21 14:44       ` Mathieu Poirier
2016-07-21 14:54       ` Jiri Olsa
2016-07-21 14:54         ` Jiri Olsa
2016-07-21 15:47         ` Mathieu Poirier
2016-07-21 15:47           ` Mathieu Poirier
2016-07-22 18:24         ` Mathieu Poirier
2016-07-22 18:24           ` Mathieu Poirier
2016-07-26 20:41           ` Jiri Olsa
2016-07-26 20:41             ` Jiri Olsa
2016-07-27 17:59             ` Mathieu Poirier
2016-07-27 17:59               ` Mathieu Poirier
2016-07-27 19:26               ` Jiri Olsa
2016-07-27 19:26                 ` Jiri Olsa
2016-07-28 16:15                 ` Mathieu Poirier
2016-07-28 16:15                   ` Mathieu Poirier
2016-07-28 16:52                   ` Jiri Olsa
2016-07-28 16:52                     ` Jiri Olsa
2016-07-21  7:47   ` Jiri Olsa [this message]
2016-07-21  7:47     ` Jiri Olsa
2016-07-20 20:38 ` [PATCH V2 4/6] perf tools: pushing driver configuration down to the kernel Mathieu Poirier
2016-07-20 20:38   ` Mathieu Poirier
2016-07-21  7:47   ` Jiri Olsa
2016-07-21  7:47     ` Jiri Olsa
2016-07-22 19:57     ` Mathieu Poirier
2016-07-22 19:57       ` Mathieu Poirier
2016-07-20 20:38 ` [PATCH V2 5/6] coresight: adding sink parameter to function coresight_build_path() Mathieu Poirier
2016-07-20 20:38   ` Mathieu Poirier
2016-07-21 10:49   ` Suzuki K Poulose
2016-07-21 10:49     ` Suzuki K Poulose
2016-07-21 15:05     ` Mathieu Poirier
2016-07-21 15:05       ` Mathieu Poirier
2016-07-20 20:38 ` [PATCH V2 6/6] coresight: etm-perf: incorporating sink definition from cmd line Mathieu Poirier
2016-07-20 20:38   ` Mathieu Poirier

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=20160721074731.GC7192@krava \
    --to=jolsa@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.