summaryrefslogtreecommitdiff
path: root/tools/perf/arch/arm64/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/arch/arm64/util')
-rw-r--r--tools/perf/arch/arm64/util/arm-spe.c28
-rw-r--r--tools/perf/arch/arm64/util/kvm-stat.c5
2 files changed, 5 insertions, 28 deletions
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index d4c234076541..3b1676ff03f9 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -36,29 +36,6 @@ struct arm_spe_recording {
bool *wrapped;
};
-static void arm_spe_set_timestamp(struct auxtrace_record *itr,
- struct evsel *evsel)
-{
- struct arm_spe_recording *ptr;
- struct perf_pmu *arm_spe_pmu;
- struct evsel_config_term *term = evsel__get_config_term(evsel, CFG_CHG);
- u64 user_bits = 0, bit;
-
- ptr = container_of(itr, struct arm_spe_recording, itr);
- arm_spe_pmu = ptr->arm_spe_pmu;
-
- if (term)
- user_bits = term->val.cfg_chg;
-
- bit = perf_pmu__format_bits(&arm_spe_pmu->format, "ts_enable");
-
- /* Skip if user has set it */
- if (bit & user_bits)
- return;
-
- evsel->core.attr.config |= bit;
-}
-
static size_t
arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused,
struct evlist *evlist __maybe_unused)
@@ -238,7 +215,8 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
*/
if (!perf_cpu_map__empty(cpus)) {
evsel__set_sample_bit(arm_spe_evsel, CPU);
- arm_spe_set_timestamp(itr, arm_spe_evsel);
+ evsel__set_config_if_unset(arm_spe_pmu, arm_spe_evsel,
+ "ts_enable", 1);
}
/*
@@ -479,7 +457,7 @@ static void arm_spe_recording_free(struct auxtrace_record *itr)
struct arm_spe_recording *sper =
container_of(itr, struct arm_spe_recording, itr);
- free(sper->wrapped);
+ zfree(&sper->wrapped);
free(sper);
}
diff --git a/tools/perf/arch/arm64/util/kvm-stat.c b/tools/perf/arch/arm64/util/kvm-stat.c
index 73d18e0ed6f6..6611aa21cba9 100644
--- a/tools/perf/arch/arm64/util/kvm-stat.c
+++ b/tools/perf/arch/arm64/util/kvm-stat.c
@@ -11,7 +11,6 @@ define_exit_reasons_table(arm64_trap_exit_reasons, kvm_arm_exception_class);
const char *kvm_trap_exit_reason = "esr_ec";
const char *vcpu_id_str = "id";
-const int decode_str_len = 20;
const char *kvm_exit_reason = "ret";
const char *kvm_entry_trace = "kvm:kvm_entry";
const char *kvm_exit_trace = "kvm:kvm_exit";
@@ -45,14 +44,14 @@ static bool event_begin(struct evsel *evsel,
struct perf_sample *sample __maybe_unused,
struct event_key *key __maybe_unused)
{
- return !strcmp(evsel->name, kvm_entry_trace);
+ return evsel__name_is(evsel, kvm_entry_trace);
}
static bool event_end(struct evsel *evsel,
struct perf_sample *sample,
struct event_key *key)
{
- if (!strcmp(evsel->name, kvm_exit_trace)) {
+ if (evsel__name_is(evsel, kvm_exit_trace)) {
event_get_key(evsel, sample, key);
return true;
}