summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.c
diff options
context:
space:
mode:
authorKan Liang <kan.liang@intel.com>2015-08-04 04:30:19 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-08-05 12:50:52 -0300
commit320677123905fd1dd122895cd5fb870ee9e1380b (patch)
tree82b523328ec900684341656326ec6bf0a1e5e382 /tools/perf/util/evsel.c
parent34221118cb13f8b37480bce7286a1b44e90773d8 (diff)
downloadtalos-op-linux-320677123905fd1dd122895cd5fb870ee9e1380b.tar.gz
talos-op-linux-320677123905fd1dd122895cd5fb870ee9e1380b.zip
perf tools: Per-event time support
This patchkit adds the ability to turn off time stamps per event. One usaful case for partial time is to work with per-event callgraph to enable "PEBS threshold > 1" (https://lkml.org/lkml/2015/5/10/196), which can significantly reduce the sampling overhead. The event samples with time stamps off will not be ordered. Signed-off-by: Kan Liang <kan.liang@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1438677022-34296-2-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.c')
-rw-r--r--tools/perf/util/evsel.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 7d3acba5a512..7febfe255703 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -587,15 +587,23 @@ perf_evsel__config_callgraph(struct perf_evsel *evsel,
}
}
-static void apply_config_terms(struct perf_event_attr *attr __maybe_unused,
- struct list_head *config_terms)
+static void apply_config_terms(struct perf_evsel *evsel)
{
struct perf_evsel_config_term *term;
+ struct list_head *config_terms = &evsel->config_terms;
+ struct perf_event_attr *attr = &evsel->attr;
list_for_each_entry(term, config_terms, list) {
switch (term->type) {
case PERF_EVSEL__CONFIG_TERM_PERIOD:
attr->sample_period = term->val.period;
+ break;
+ case PERF_EVSEL__CONFIG_TERM_TIME:
+ if (term->val.time)
+ perf_evsel__set_sample_bit(evsel, TIME);
+ else
+ perf_evsel__reset_sample_bit(evsel, TIME);
+ break;
default:
break;
}
@@ -798,7 +806,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
* Apply event specific term settings,
* it overloads any global configuration.
*/
- apply_config_terms(attr, &evsel->config_terms);
+ apply_config_terms(evsel);
}
static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
OpenPOWER on IntegriCloud