Unverified Commit f6603b4a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1282 Stop attempts to auxtrace mmap when not an auxtrace event

Merge Pull Request from: @ci-robot 
 
PR sync from: Junhao He <hejunhao3@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/52FHC7PBPOY7YSYWOZP3EKCP6VNZ4LGN/ 
The patches stop attempts to auxtrace mmap when it is not an
auxtrace event e.g. when mmapping the CPUs on which only sideband is
captured

Adrian Hunter (6):
  libperf evlist: Remove ->idx() per_cpu parameter
  libperf evlist: Move ->idx() into mmap_per_evsel()
  libperf evlist: Add evsel as a parameter to ->idx()
  perf auxtrace: Record whether an auxtrace mmap is needed
  perf auxtrace: Add mmap_needed to auxtrace_mmap_params
  perf auxtrace: Remove auxtrace_mmap_params__set_idx() per_cpu
    parameter


-- 
2.30.0
 
 
Link:https://gitee.com/openeuler/kernel/pulls/1282

 

Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 6848cbbb f1d1ceb3
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -468,6 +468,9 @@ mmap_per_evsel(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops,
			 */
			refcount_set(&map->refcnt, 2);

			if (ops->idx)
				ops->idx(evlist, evsel, mp, idx);

			if (ops->mmap(map, mp, *output, evlist_cpu) < 0)
				return -1;

@@ -510,9 +513,6 @@ mmap_per_thread(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops,
		int output = -1;
		int output_overwrite = -1;

		if (ops->idx)
			ops->idx(evlist, mp, thread, false);

		if (mmap_per_evsel(evlist, ops, thread, mp, 0, thread,
				   &output, &output_overwrite))
			goto out_unmap;
@@ -537,9 +537,6 @@ mmap_per_cpu(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops,
		int output = -1;
		int output_overwrite = -1;

		if (ops->idx)
			ops->idx(evlist, mp, cpu, true);

		for (thread = 0; thread < nr_threads; thread++) {
			if (mmap_per_evsel(evlist, ops, cpu, mp, cpu,
					   thread, &output, &output_overwrite))
+2 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@ struct perf_evlist {
};

typedef void
(*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_mmap_param*, int, bool);
(*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_evsel*,
			      struct perf_mmap_param*, int);
typedef struct perf_mmap*
(*perf_evlist_mmap__cb_get_t)(struct perf_evlist*, bool, int);
typedef int
+1 −0
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
			}
			evsel->core.attr.freq = 0;
			evsel->core.attr.sample_period = 1;
			evsel->needs_auxtrace_mmap = true;
			cs_etm_evsel = evsel;
			opts->full_auxtrace = true;
		}
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
			}
			evsel->core.attr.freq = 0;
			evsel->core.attr.sample_period = 1;
			evsel->needs_auxtrace_mmap = true;
			arm_spe_evsel = evsel;
			opts->full_auxtrace = true;
		}
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
	evlist__for_each_entry(evlist, pos) {
		if (pos->core.attr.config == PERF_EVENT_CPUM_SF_DIAG) {
			diagnose = 1;
			pos->needs_auxtrace_mmap = true;
			break;
		}
	}
Loading