diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-09 12:13:41 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-09 12:13:41 -0400 |
commit | 4ea062ed431d00153af0ac370cb6fef0620e5fa1 (patch) | |
tree | c4e7ad89b37d57751802524212291d1a8a89b7e3 /tools/perf/tests/hists_output.c | |
parent | 49c23f2d541ebf7ae5e9fff03301f4e7145cc979 (diff) |
perf evsel: Add hists helper
Not all tools need a hists instance per perf_evsel, so lets pave the way
to remove evsel->hists while leaving a way to access the hists from a
specially allocated evsel, one that comes with space at the end where
lives the evsel.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-qlktkhe31w4mgtbd84035sr2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/hists_output.c')
-rw-r--r-- | tools/perf/tests/hists_output.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c index e3bbd6c54c1b..a748f2be1222 100644 --- a/tools/perf/tests/hists_output.c +++ b/tools/perf/tests/hists_output.c | |||
@@ -122,7 +122,7 @@ typedef int (*test_fn_t)(struct perf_evsel *, struct machine *); | |||
122 | static int test1(struct perf_evsel *evsel, struct machine *machine) | 122 | static int test1(struct perf_evsel *evsel, struct machine *machine) |
123 | { | 123 | { |
124 | int err; | 124 | int err; |
125 | struct hists *hists = &evsel->hists; | 125 | struct hists *hists = evsel__hists(evsel); |
126 | struct hist_entry *he; | 126 | struct hist_entry *he; |
127 | struct rb_root *root; | 127 | struct rb_root *root; |
128 | struct rb_node *node; | 128 | struct rb_node *node; |
@@ -159,7 +159,7 @@ static int test1(struct perf_evsel *evsel, struct machine *machine) | |||
159 | print_hists_out(hists); | 159 | print_hists_out(hists); |
160 | } | 160 | } |
161 | 161 | ||
162 | root = &evsel->hists.entries; | 162 | root = &hists->entries; |
163 | node = rb_first(root); | 163 | node = rb_first(root); |
164 | he = rb_entry(node, struct hist_entry, rb_node); | 164 | he = rb_entry(node, struct hist_entry, rb_node); |
165 | TEST_ASSERT_VAL("Invalid hist entry", | 165 | TEST_ASSERT_VAL("Invalid hist entry", |
@@ -224,7 +224,7 @@ out: | |||
224 | static int test2(struct perf_evsel *evsel, struct machine *machine) | 224 | static int test2(struct perf_evsel *evsel, struct machine *machine) |
225 | { | 225 | { |
226 | int err; | 226 | int err; |
227 | struct hists *hists = &evsel->hists; | 227 | struct hists *hists = evsel__hists(evsel); |
228 | struct hist_entry *he; | 228 | struct hist_entry *he; |
229 | struct rb_root *root; | 229 | struct rb_root *root; |
230 | struct rb_node *node; | 230 | struct rb_node *node; |
@@ -259,7 +259,7 @@ static int test2(struct perf_evsel *evsel, struct machine *machine) | |||
259 | print_hists_out(hists); | 259 | print_hists_out(hists); |
260 | } | 260 | } |
261 | 261 | ||
262 | root = &evsel->hists.entries; | 262 | root = &hists->entries; |
263 | node = rb_first(root); | 263 | node = rb_first(root); |
264 | he = rb_entry(node, struct hist_entry, rb_node); | 264 | he = rb_entry(node, struct hist_entry, rb_node); |
265 | TEST_ASSERT_VAL("Invalid hist entry", | 265 | TEST_ASSERT_VAL("Invalid hist entry", |
@@ -280,7 +280,7 @@ out: | |||
280 | static int test3(struct perf_evsel *evsel, struct machine *machine) | 280 | static int test3(struct perf_evsel *evsel, struct machine *machine) |
281 | { | 281 | { |
282 | int err; | 282 | int err; |
283 | struct hists *hists = &evsel->hists; | 283 | struct hists *hists = evsel__hists(evsel); |
284 | struct hist_entry *he; | 284 | struct hist_entry *he; |
285 | struct rb_root *root; | 285 | struct rb_root *root; |
286 | struct rb_node *node; | 286 | struct rb_node *node; |
@@ -313,7 +313,7 @@ static int test3(struct perf_evsel *evsel, struct machine *machine) | |||
313 | print_hists_out(hists); | 313 | print_hists_out(hists); |
314 | } | 314 | } |
315 | 315 | ||
316 | root = &evsel->hists.entries; | 316 | root = &hists->entries; |
317 | node = rb_first(root); | 317 | node = rb_first(root); |
318 | he = rb_entry(node, struct hist_entry, rb_node); | 318 | he = rb_entry(node, struct hist_entry, rb_node); |
319 | TEST_ASSERT_VAL("Invalid hist entry", | 319 | TEST_ASSERT_VAL("Invalid hist entry", |
@@ -354,7 +354,7 @@ out: | |||
354 | static int test4(struct perf_evsel *evsel, struct machine *machine) | 354 | static int test4(struct perf_evsel *evsel, struct machine *machine) |
355 | { | 355 | { |
356 | int err; | 356 | int err; |
357 | struct hists *hists = &evsel->hists; | 357 | struct hists *hists = evsel__hists(evsel); |
358 | struct hist_entry *he; | 358 | struct hist_entry *he; |
359 | struct rb_root *root; | 359 | struct rb_root *root; |
360 | struct rb_node *node; | 360 | struct rb_node *node; |
@@ -391,7 +391,7 @@ static int test4(struct perf_evsel *evsel, struct machine *machine) | |||
391 | print_hists_out(hists); | 391 | print_hists_out(hists); |
392 | } | 392 | } |
393 | 393 | ||
394 | root = &evsel->hists.entries; | 394 | root = &hists->entries; |
395 | node = rb_first(root); | 395 | node = rb_first(root); |
396 | he = rb_entry(node, struct hist_entry, rb_node); | 396 | he = rb_entry(node, struct hist_entry, rb_node); |
397 | TEST_ASSERT_VAL("Invalid hist entry", | 397 | TEST_ASSERT_VAL("Invalid hist entry", |
@@ -456,7 +456,7 @@ out: | |||
456 | static int test5(struct perf_evsel *evsel, struct machine *machine) | 456 | static int test5(struct perf_evsel *evsel, struct machine *machine) |
457 | { | 457 | { |
458 | int err; | 458 | int err; |
459 | struct hists *hists = &evsel->hists; | 459 | struct hists *hists = evsel__hists(evsel); |
460 | struct hist_entry *he; | 460 | struct hist_entry *he; |
461 | struct rb_root *root; | 461 | struct rb_root *root; |
462 | struct rb_node *node; | 462 | struct rb_node *node; |
@@ -494,7 +494,7 @@ static int test5(struct perf_evsel *evsel, struct machine *machine) | |||
494 | print_hists_out(hists); | 494 | print_hists_out(hists); |
495 | } | 495 | } |
496 | 496 | ||
497 | root = &evsel->hists.entries; | 497 | root = &hists->entries; |
498 | node = rb_first(root); | 498 | node = rb_first(root); |
499 | he = rb_entry(node, struct hist_entry, rb_node); | 499 | he = rb_entry(node, struct hist_entry, rb_node); |
500 | 500 | ||