diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-05-15 02:20:45 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-05-15 02:20:45 -0400 |
commit | f3903c9161f0d636a7b0ff03841628928457e64c (patch) | |
tree | 3a4d0e3c31663f7f5b51fe12f22f6e1d9bd456b5 /tools | |
parent | 67b8d5c7081221efa252e111cd52532ec6d4266f (diff) | |
parent | c23080a6e4e853cff2834436e3cf33eae7723900 (diff) |
Merge tag 'perf-urgent-for-mingo-4.17-20180514' 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 segfault when processing unknown threads in cs-etm (Leo Yan)
- Fix "perf test inet_pton" on s390 failing due to missing inline (Thomas Richter)
- Display all available events on 'perf annotate --stdio' (Jin Yao)
- Add missing newline when parsing empty BPF proggie (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')
-rwxr-xr-x | tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 | ||||
-rw-r--r-- | tools/perf/util/annotate.c | 3 | ||||
-rw-r--r-- | tools/perf/util/cs-etm.c | 28 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 2 |
4 files changed, 29 insertions, 6 deletions
diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh index 016882dbbc16..ee86473643be 100755 --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh | |||
@@ -16,7 +16,7 @@ nm -g $libc 2>/dev/null | fgrep -q inet_pton || exit 254 | |||
16 | trace_libc_inet_pton_backtrace() { | 16 | trace_libc_inet_pton_backtrace() { |
17 | idx=0 | 17 | idx=0 |
18 | expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)" | 18 | expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)" |
19 | expected[1]=".*inet_pton[[:space:]]\($libc\)$" | 19 | expected[1]=".*inet_pton[[:space:]]\($libc|inlined\)$" |
20 | case "$(uname -m)" in | 20 | case "$(uname -m)" in |
21 | s390x) | 21 | s390x) |
22 | eventattr='call-graph=dwarf,max-stack=4' | 22 | eventattr='call-graph=dwarf,max-stack=4' |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 536ee148bff8..5d74a30fe00f 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1263,6 +1263,9 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start | |||
1263 | max_percent = sample->percent; | 1263 | max_percent = sample->percent; |
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | if (al->samples_nr > nr_percent) | ||
1267 | nr_percent = al->samples_nr; | ||
1268 | |||
1266 | if (max_percent < min_pcnt) | 1269 | if (max_percent < min_pcnt) |
1267 | return -1; | 1270 | return -1; |
1268 | 1271 | ||
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 40020b1ca54f..bf16dc9ee507 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c | |||
@@ -239,6 +239,7 @@ static void cs_etm__free(struct perf_session *session) | |||
239 | for (i = 0; i < aux->num_cpu; i++) | 239 | for (i = 0; i < aux->num_cpu; i++) |
240 | zfree(&aux->metadata[i]); | 240 | zfree(&aux->metadata[i]); |
241 | 241 | ||
242 | thread__zput(aux->unknown_thread); | ||
242 | zfree(&aux->metadata); | 243 | zfree(&aux->metadata); |
243 | zfree(&aux); | 244 | zfree(&aux); |
244 | } | 245 | } |
@@ -612,8 +613,8 @@ cs_etm__get_trace(struct cs_etm_buffer *buff, struct cs_etm_queue *etmq) | |||
612 | return buff->len; | 613 | return buff->len; |
613 | } | 614 | } |
614 | 615 | ||
615 | static void cs_etm__set_pid_tid_cpu(struct cs_etm_auxtrace *etm, | 616 | static void cs_etm__set_pid_tid_cpu(struct cs_etm_auxtrace *etm, |
616 | struct auxtrace_queue *queue) | 617 | struct auxtrace_queue *queue) |
617 | { | 618 | { |
618 | struct cs_etm_queue *etmq = queue->priv; | 619 | struct cs_etm_queue *etmq = queue->priv; |
619 | 620 | ||
@@ -1357,6 +1358,23 @@ int cs_etm__process_auxtrace_info(union perf_event *event, | |||
1357 | etm->auxtrace.free = cs_etm__free; | 1358 | etm->auxtrace.free = cs_etm__free; |
1358 | session->auxtrace = &etm->auxtrace; | 1359 | session->auxtrace = &etm->auxtrace; |
1359 | 1360 | ||
1361 | etm->unknown_thread = thread__new(999999999, 999999999); | ||
1362 | if (!etm->unknown_thread) | ||
1363 | goto err_free_queues; | ||
1364 | |||
1365 | /* | ||
1366 | * Initialize list node so that at thread__zput() we can avoid | ||
1367 | * segmentation fault at list_del_init(). | ||
1368 | */ | ||
1369 | INIT_LIST_HEAD(&etm->unknown_thread->node); | ||
1370 | |||
1371 | err = thread__set_comm(etm->unknown_thread, "unknown", 0); | ||
1372 | if (err) | ||
1373 | goto err_delete_thread; | ||
1374 | |||
1375 | if (thread__init_map_groups(etm->unknown_thread, etm->machine)) | ||
1376 | goto err_delete_thread; | ||
1377 | |||
1360 | if (dump_trace) { | 1378 | if (dump_trace) { |
1361 | cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); | 1379 | cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); |
1362 | return 0; | 1380 | return 0; |
@@ -1371,16 +1389,18 @@ int cs_etm__process_auxtrace_info(union perf_event *event, | |||
1371 | 1389 | ||
1372 | err = cs_etm__synth_events(etm, session); | 1390 | err = cs_etm__synth_events(etm, session); |
1373 | if (err) | 1391 | if (err) |
1374 | goto err_free_queues; | 1392 | goto err_delete_thread; |
1375 | 1393 | ||
1376 | err = auxtrace_queues__process_index(&etm->queues, session); | 1394 | err = auxtrace_queues__process_index(&etm->queues, session); |
1377 | if (err) | 1395 | if (err) |
1378 | goto err_free_queues; | 1396 | goto err_delete_thread; |
1379 | 1397 | ||
1380 | etm->data_queued = etm->queues.populated; | 1398 | etm->data_queued = etm->queues.populated; |
1381 | 1399 | ||
1382 | return 0; | 1400 | return 0; |
1383 | 1401 | ||
1402 | err_delete_thread: | ||
1403 | thread__zput(etm->unknown_thread); | ||
1384 | err_free_queues: | 1404 | err_free_queues: |
1385 | auxtrace_queues__free(&etm->queues); | 1405 | auxtrace_queues__free(&etm->queues); |
1386 | session->auxtrace = NULL; | 1406 | session->auxtrace = NULL; |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 2fb0272146d8..b8b8a9558d32 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -1715,7 +1715,7 @@ int parse_events(struct perf_evlist *evlist, const char *str, | |||
1715 | struct perf_evsel *last; | 1715 | struct perf_evsel *last; |
1716 | 1716 | ||
1717 | if (list_empty(&parse_state.list)) { | 1717 | if (list_empty(&parse_state.list)) { |
1718 | WARN_ONCE(true, "WARNING: event parser found nothing"); | 1718 | WARN_ONCE(true, "WARNING: event parser found nothing\n"); |
1719 | return -1; | 1719 | return -1; |
1720 | } | 1720 | } |
1721 | 1721 | ||