.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
2 | 2 | #include "../evlist.h" |
---|
3 | | -#include "../cache.h" |
---|
| 3 | +#include "../callchain.h" |
---|
4 | 4 | #include "../evsel.h" |
---|
5 | 5 | #include "../sort.h" |
---|
6 | 6 | #include "../hist.h" |
---|
.. | .. |
---|
8 | 8 | #include "../string2.h" |
---|
9 | 9 | #include "gtk.h" |
---|
10 | 10 | #include <signal.h> |
---|
| 11 | +#include <stdlib.h> |
---|
| 12 | +#include <linux/string.h> |
---|
11 | 13 | |
---|
12 | 14 | #define MAX_COLUMNS 32 |
---|
13 | 15 | |
---|
.. | .. |
---|
353 | 355 | |
---|
354 | 356 | g_object_unref(GTK_TREE_MODEL(store)); |
---|
355 | 357 | |
---|
356 | | - for (nd = rb_first(&hists->entries); nd; nd = rb_next(nd)) { |
---|
| 358 | + for (nd = rb_first_cached(&hists->entries); nd; nd = rb_next(nd)) { |
---|
357 | 359 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); |
---|
358 | 360 | GtkTreeIter iter; |
---|
359 | 361 | u64 total = hists__total_period(h->hists); |
---|
.. | .. |
---|
401 | 403 | } |
---|
402 | 404 | |
---|
403 | 405 | static void perf_gtk__add_hierarchy_entries(struct hists *hists, |
---|
404 | | - struct rb_root *root, |
---|
| 406 | + struct rb_root_cached *root, |
---|
405 | 407 | GtkTreeStore *store, |
---|
406 | 408 | GtkTreeIter *parent, |
---|
407 | 409 | struct perf_hpp *hpp, |
---|
.. | .. |
---|
415 | 417 | u64 total = hists__total_period(hists); |
---|
416 | 418 | int size; |
---|
417 | 419 | |
---|
418 | | - for (node = rb_first(root); node; node = rb_next(node)) { |
---|
| 420 | + for (node = rb_first_cached(root); node; node = rb_next(node)) { |
---|
419 | 421 | GtkTreeIter iter; |
---|
420 | 422 | float percent; |
---|
421 | 423 | char *bf; |
---|
.. | .. |
---|
458 | 460 | advance_hpp(hpp, ret + 2); |
---|
459 | 461 | } |
---|
460 | 462 | |
---|
461 | | - gtk_tree_store_set(store, &iter, col_idx, ltrim(rtrim(bf)), -1); |
---|
| 463 | + gtk_tree_store_set(store, &iter, col_idx, strim(bf), -1); |
---|
462 | 464 | |
---|
463 | 465 | if (!he->leaf) { |
---|
464 | 466 | hpp->buf = bf; |
---|
.. | .. |
---|
554 | 556 | first_col = false; |
---|
555 | 557 | |
---|
556 | 558 | fmt->header(fmt, &hpp, hists, 0, NULL); |
---|
557 | | - strcat(buf, ltrim(rtrim(hpp.buf))); |
---|
| 559 | + strcat(buf, strim(hpp.buf)); |
---|
558 | 560 | } |
---|
559 | 561 | } |
---|
560 | 562 | |
---|
.. | .. |
---|
588 | 590 | gtk_container_add(GTK_CONTAINER(window), view); |
---|
589 | 591 | } |
---|
590 | 592 | |
---|
591 | | -int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, |
---|
| 593 | +int perf_evlist__gtk_browse_hists(struct evlist *evlist, |
---|
592 | 594 | const char *help, |
---|
593 | 595 | struct hist_browser_timer *hbt __maybe_unused, |
---|
594 | 596 | float min_pcnt) |
---|
595 | 597 | { |
---|
596 | | - struct perf_evsel *pos; |
---|
| 598 | + struct evsel *pos; |
---|
597 | 599 | GtkWidget *vbox; |
---|
598 | 600 | GtkWidget *notebook; |
---|
599 | 601 | GtkWidget *info_bar; |
---|
.. | .. |
---|
633 | 635 | |
---|
634 | 636 | evlist__for_each_entry(evlist, pos) { |
---|
635 | 637 | struct hists *hists = evsel__hists(pos); |
---|
636 | | - const char *evname = perf_evsel__name(pos); |
---|
| 638 | + const char *evname = evsel__name(pos); |
---|
637 | 639 | GtkWidget *scrolled_window; |
---|
638 | 640 | GtkWidget *tab_label; |
---|
639 | 641 | char buf[512]; |
---|
640 | 642 | size_t size = sizeof(buf); |
---|
641 | 643 | |
---|
642 | 644 | if (symbol_conf.event_group) { |
---|
643 | | - if (!perf_evsel__is_group_leader(pos)) |
---|
| 645 | + if (!evsel__is_group_leader(pos)) |
---|
644 | 646 | continue; |
---|
645 | 647 | |
---|
646 | | - if (pos->nr_members > 1) { |
---|
647 | | - perf_evsel__group_desc(pos, buf, size); |
---|
| 648 | + if (pos->core.nr_members > 1) { |
---|
| 649 | + evsel__group_desc(pos, buf, size); |
---|
648 | 650 | evname = buf; |
---|
649 | 651 | } |
---|
650 | 652 | } |
---|