diff options
Diffstat (limited to 'tools/perf/tests/hists_output.c')
-rw-r--r-- | tools/perf/tests/hists_output.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c index a16850551797..1308f88a9169 100644 --- a/tools/perf/tests/hists_output.c +++ b/tools/perf/tests/hists_output.c | |||
@@ -46,7 +46,7 @@ static struct sample fake_samples[] = { | |||
46 | static int add_hist_entries(struct hists *hists, struct machine *machine) | 46 | static int add_hist_entries(struct hists *hists, struct machine *machine) |
47 | { | 47 | { |
48 | struct addr_location al; | 48 | struct addr_location al; |
49 | struct hist_entry *he; | 49 | struct perf_evsel *evsel = hists_to_evsel(hists); |
50 | struct perf_sample sample = { .period = 100, }; | 50 | struct perf_sample sample = { .period = 100, }; |
51 | size_t i; | 51 | size_t i; |
52 | 52 | ||
@@ -56,6 +56,10 @@ static int add_hist_entries(struct hists *hists, struct machine *machine) | |||
56 | .misc = PERF_RECORD_MISC_USER, | 56 | .misc = PERF_RECORD_MISC_USER, |
57 | }, | 57 | }, |
58 | }; | 58 | }; |
59 | struct hist_entry_iter iter = { | ||
60 | .ops = &hist_iter_normal, | ||
61 | .hide_unresolved = false, | ||
62 | }; | ||
59 | 63 | ||
60 | sample.cpu = fake_samples[i].cpu; | 64 | sample.cpu = fake_samples[i].cpu; |
61 | sample.pid = fake_samples[i].pid; | 65 | sample.pid = fake_samples[i].pid; |
@@ -66,9 +70,8 @@ static int add_hist_entries(struct hists *hists, struct machine *machine) | |||
66 | &sample) < 0) | 70 | &sample) < 0) |
67 | goto out; | 71 | goto out; |
68 | 72 | ||
69 | he = __hists__add_entry(hists, &al, NULL, NULL, NULL, | 73 | if (hist_entry_iter__add(&iter, &al, evsel, &sample, |
70 | sample.period, 1, 0); | 74 | PERF_MAX_STACK_DEPTH) < 0) |
71 | if (he == NULL) | ||
72 | goto out; | 75 | goto out; |
73 | 76 | ||
74 | fake_samples[i].thread = al.thread; | 77 | fake_samples[i].thread = al.thread; |