aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-02-05 16:25:47 -0500
committerIngo Molnar <mingo@kernel.org>2018-02-05 16:25:47 -0500
commit59410f5ac70a0949a6f06ba43eecb8f99be31291 (patch)
tree332d7f87f504741fbb3c6e06b7b2bfa820000aff /tools/perf
parent72906f38934a49faf4d2d38ea9ae32adcf7d5d0c (diff)
parent2fe2230d4183d2c311bbb7b426491ac486216a16 (diff)
Merge tag 'perf-urgent-for-mingo-4.16-20180205' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Fix 'period' and 'freq' handling for 'perf record', also related: add Add PERF_SAMPLE_PERIOD into PEBS_FREERUNNING_FLAGS in the x86 perf kernel driver (Jiri Olsa) - Fix 'perf trace -i perf.data' callgraph handling (Ravi Bangoria) - Synchronize tooling headers for asound, s390 and powerpc KVM, sched and x86 features (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/.gitignore1
-rw-r--r--tools/perf/builtin-record.c3
-rw-r--r--tools/perf/builtin-trace.c5
-rw-r--r--tools/perf/perf.h1
-rw-r--r--tools/perf/util/evsel.c13
5 files changed, 18 insertions, 5 deletions
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 643cc4ba6872..3e5135dded16 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -31,5 +31,6 @@ config.mak.autogen
31.config-detected 31.config-detected
32util/intel-pt-decoder/inat-tables.c 32util/intel-pt-decoder/inat-tables.c
33arch/*/include/generated/ 33arch/*/include/generated/
34trace/beauty/generated/
34pmu-events/pmu-events.c 35pmu-events/pmu-events.c
35pmu-events/jevents 36pmu-events/jevents
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 65681a1a292a..bf4ca749d1ac 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1566,7 +1566,8 @@ static struct option __record_options[] = {
1566 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time, 1566 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
1567 &record.opts.sample_time_set, 1567 &record.opts.sample_time_set,
1568 "Record the sample timestamps"), 1568 "Record the sample timestamps"),
1569 OPT_BOOLEAN('P', "period", &record.opts.period, "Record the sample period"), 1569 OPT_BOOLEAN_SET('P', "period", &record.opts.period, &record.opts.period_set,
1570 "Record the sample period"),
1570 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples, 1571 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
1571 "don't sample"), 1572 "don't sample"),
1572 OPT_BOOLEAN_SET('N', "no-buildid-cache", &record.no_buildid_cache, 1573 OPT_BOOLEAN_SET('N', "no-buildid-cache", &record.no_buildid_cache,
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 17d11deeb88d..e7f1b182fc15 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1661,9 +1661,12 @@ static int trace__resolve_callchain(struct trace *trace, struct perf_evsel *evse
1661 struct callchain_cursor *cursor) 1661 struct callchain_cursor *cursor)
1662{ 1662{
1663 struct addr_location al; 1663 struct addr_location al;
1664 int max_stack = evsel->attr.sample_max_stack ?
1665 evsel->attr.sample_max_stack :
1666 trace->max_stack;
1664 1667
1665 if (machine__resolve(trace->host, &al, sample) < 0 || 1668 if (machine__resolve(trace->host, &al, sample) < 0 ||
1666 thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, evsel->attr.sample_max_stack)) 1669 thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack))
1667 return -1; 1670 return -1;
1668 1671
1669 return 0; 1672 return 0;
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 2357f4ccc9c7..cfe46236a5e5 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -50,6 +50,7 @@ struct record_opts {
50 bool sample_time_set; 50 bool sample_time_set;
51 bool sample_cpu; 51 bool sample_cpu;
52 bool period; 52 bool period;
53 bool period_set;
53 bool running_time; 54 bool running_time;
54 bool full_auxtrace; 55 bool full_auxtrace;
55 bool auxtrace_snapshot_mode; 56 bool auxtrace_snapshot_mode;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 66fa45198a11..ff359c9ece2e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -745,12 +745,14 @@ static void apply_config_terms(struct perf_evsel *evsel,
745 if (!(term->weak && opts->user_interval != ULLONG_MAX)) { 745 if (!(term->weak && opts->user_interval != ULLONG_MAX)) {
746 attr->sample_period = term->val.period; 746 attr->sample_period = term->val.period;
747 attr->freq = 0; 747 attr->freq = 0;
748 perf_evsel__reset_sample_bit(evsel, PERIOD);
748 } 749 }
749 break; 750 break;
750 case PERF_EVSEL__CONFIG_TERM_FREQ: 751 case PERF_EVSEL__CONFIG_TERM_FREQ:
751 if (!(term->weak && opts->user_freq != UINT_MAX)) { 752 if (!(term->weak && opts->user_freq != UINT_MAX)) {
752 attr->sample_freq = term->val.freq; 753 attr->sample_freq = term->val.freq;
753 attr->freq = 1; 754 attr->freq = 1;
755 perf_evsel__set_sample_bit(evsel, PERIOD);
754 } 756 }
755 break; 757 break;
756 case PERF_EVSEL__CONFIG_TERM_TIME: 758 case PERF_EVSEL__CONFIG_TERM_TIME:
@@ -969,9 +971,6 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
969 if (target__has_cpu(&opts->target) || opts->sample_cpu) 971 if (target__has_cpu(&opts->target) || opts->sample_cpu)
970 perf_evsel__set_sample_bit(evsel, CPU); 972 perf_evsel__set_sample_bit(evsel, CPU);
971 973
972 if (opts->period)
973 perf_evsel__set_sample_bit(evsel, PERIOD);
974
975 /* 974 /*
976 * When the user explicitly disabled time don't force it here. 975 * When the user explicitly disabled time don't force it here.
977 */ 976 */
@@ -1073,6 +1072,14 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
1073 apply_config_terms(evsel, opts, track); 1072 apply_config_terms(evsel, opts, track);
1074 1073
1075 evsel->ignore_missing_thread = opts->ignore_missing_thread; 1074 evsel->ignore_missing_thread = opts->ignore_missing_thread;
1075
1076 /* The --period option takes the precedence. */
1077 if (opts->period_set) {
1078 if (opts->period)
1079 perf_evsel__set_sample_bit(evsel, PERIOD);
1080 else
1081 perf_evsel__reset_sample_bit(evsel, PERIOD);
1082 }
1076} 1083}
1077 1084
1078static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads) 1085static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)