perf record: Add aux-sample-size config term
To allow individual events to be selected for AUX area sampling, add aux-sample-size config term. attr.aux_sample_size is updated by auxtrace_parse_sample_options() so that the existing validation will see the value. Any event that has a non-zero aux_sample_size will cause AUX area sampling to be configured, irrespective of the --aux-sample option. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20191115124225.5247-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
c0a6de06c4
commit
eb7a52d46c
@@ -996,6 +996,7 @@ static const char *config_term_names[__PARSE_EVENTS__TERM_TYPE_NR] = {
|
||||
[PARSE_EVENTS__TERM_TYPE_DRV_CFG] = "driver-config",
|
||||
[PARSE_EVENTS__TERM_TYPE_PERCORE] = "percore",
|
||||
[PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT] = "aux-output",
|
||||
[PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE] = "aux-sample-size",
|
||||
};
|
||||
|
||||
static bool config_term_shrinked;
|
||||
@@ -1126,6 +1127,15 @@ do { \
|
||||
case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT:
|
||||
CHECK_TYPE_VAL(NUM);
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE:
|
||||
CHECK_TYPE_VAL(NUM);
|
||||
if (term->val.num > UINT_MAX) {
|
||||
parse_events__handle_error(err, term->err_val,
|
||||
strdup("too big"),
|
||||
NULL);
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
parse_events__handle_error(err, term->err_term,
|
||||
strdup("unknown term"),
|
||||
@@ -1177,6 +1187,7 @@ static int config_term_tracepoint(struct perf_event_attr *attr,
|
||||
case PARSE_EVENTS__TERM_TYPE_OVERWRITE:
|
||||
case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE:
|
||||
case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT:
|
||||
case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE:
|
||||
return config_term_common(attr, term, err);
|
||||
default:
|
||||
if (err) {
|
||||
@@ -1272,6 +1283,9 @@ do { \
|
||||
case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT:
|
||||
ADD_CONFIG_TERM(AUX_OUTPUT, aux_output, term->val.num ? 1 : 0);
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE:
|
||||
ADD_CONFIG_TERM(AUX_SAMPLE_SIZE, aux_sample_size, term->val.num);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user