Pull perf tooling fixes from Arnaldo Carvalho de Melo: - Fix libtraceevent build with binutils 2.35 - Fix memory leak in process_dynamic_array_len in libtraceevent - Fix 'perf test 68' zstd compression for s390 - Fix record failure when mixed with ARM SPE event * tag 'perf-tools-fixes-2020-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: libtraceevent: Fix build with binutils 2.35 perf tools: Fix record failure when mixed with ARM SPE event perf tests: Fix test 68 zstd compression for s390 tools lib traceevent: Fix memory leak in process_dynamic_array_len
Unified · Split
| @@ -2861,6 +2861,7 @@ process_dynamic_array_len(struct tep_event *event, struct tep_print_arg *arg, · 2860 unmodified lines | ||
| 2861 | 2861 | if (read_expected(TEP_EVENT_DELIM, ")") < 0) |
| 2862 | 2862 | goto out_err; |
| 2863 | 2863 | |
| 2864 | + free_token(token); | |
| 2864 | 2865 | type = read_token(&token); |
| 2865 | 2866 | *tok = token; |
| 2866 | 2867 | |
| @@ -197,7 +197,7 @@ define do_generate_dynamic_list_file · 196 unmodified lines | ||
| 197 | 197 | xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\ |
| 198 | 198 | if [ "$$symbol_type" = "U W" ];then \ |
| 199 | 199 | (echo '{'; \ |
| 200 | − $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\ | |
| 200 | + $(NM) -u -D $1 | awk 'NF>1 {sub("@.*", "", $$2); print "\t"$$2";"}' | sort -u;\ | |
| 201 | 201 | echo '};'; \ |
| 202 | 202 | ) > $2; \ |
| 203 | 203 | else \ |
| @@ -56,7 +56,7 @@ struct auxtrace_record · 55 unmodified lines | ||
| 56 | 56 | struct perf_pmu *cs_etm_pmu; |
| 57 | 57 | struct evsel *evsel; |
| 58 | 58 | bool found_etm = false; |
| 59 | − bool found_spe = false; | |
| 59 | + struct perf_pmu *found_spe = NULL; | |
| 60 | 60 | static struct perf_pmu **arm_spe_pmus = NULL; |
| 61 | 61 | static int nr_spes = 0; |
| 62 | 62 | int i = 0; |
| @@ -74,12 +74,12 @@ struct auxtrace_record · 11 unmodified lines | ||
| 74 | 74 | evsel->core.attr.type == cs_etm_pmu->type) |
| 75 | 75 | found_etm = true; |
| 76 | 76 | |
| 77 | − if (!nr_spes) | |
| 77 | + if (!nr_spes || found_spe) | |
| 78 | 78 | continue; |
| 79 | 79 | |
| 80 | 80 | for (i = 0; i < nr_spes; i++) { |
| 81 | 81 | if (evsel->core.attr.type == arm_spe_pmus[i]->type) { |
| 82 | − found_spe = true; | |
| 82 | + found_spe = arm_spe_pmus[i]; | |
| 83 | 83 | break; |
| 84 | 84 | } |
| 85 | 85 | } |
| @@ -96,7 +96,7 @@ struct auxtrace_record · 10 unmodified lines | ||
| 96 | 96 | |
| 97 | 97 | #if defined(__aarch64__) |
| 98 | 98 | if (found_spe) |
| 99 | − return arm_spe_recording_init(err, arm_spe_pmus[i]); | |
| 99 | + return arm_spe_recording_init(err, found_spe); | |
| 100 | 100 | #endif |
| 101 | 101 | |
| 102 | 102 | /* |
| @@ -12,7 +12,8 @@ skip_if_no_z_record() { · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | collect_z_record() { |
| 14 | 14 | echo "Collecting compressed record file:" |
| 15 | − $perf_tool record -o $trace_file -g -z -F 5000 -- \ | |
| 15 | + [[ "$(uname -m)" != s390x ]] && gflag='-g' | |
| 16 | + $perf_tool record -o $trace_file $gflag -z -F 5000 -- \ | |
| 16 | 17 | dd count=500 if=/dev/urandom of=/dev/null |
| 17 | 18 | } |
| 18 | 19 | |