diff options
Diffstat (limited to 'tools/perf/ui/browsers/hists.c')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 7ef36c360471..a440e03cd8c2 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1255,7 +1255,7 @@ static int hists__browser_title(struct hists *hists, char *bf, size_t size, | |||
1255 | if (thread) | 1255 | if (thread) |
1256 | printed += scnprintf(bf + printed, size - printed, | 1256 | printed += scnprintf(bf + printed, size - printed, |
1257 | ", Thread: %s(%d)", | 1257 | ", Thread: %s(%d)", |
1258 | (thread->comm_set ? thread->comm : ""), | 1258 | (thread->comm_set ? thread__comm_str(thread) : ""), |
1259 | thread->tid); | 1259 | thread->tid); |
1260 | if (dso) | 1260 | if (dso) |
1261 | printed += scnprintf(bf + printed, size - printed, | 1261 | printed += scnprintf(bf + printed, size - printed, |
@@ -1578,7 +1578,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1578 | if (thread != NULL && | 1578 | if (thread != NULL && |
1579 | asprintf(&options[nr_options], "Zoom %s %s(%d) thread", | 1579 | asprintf(&options[nr_options], "Zoom %s %s(%d) thread", |
1580 | (browser->hists->thread_filter ? "out of" : "into"), | 1580 | (browser->hists->thread_filter ? "out of" : "into"), |
1581 | (thread->comm_set ? thread->comm : ""), | 1581 | (thread->comm_set ? thread__comm_str(thread) : ""), |
1582 | thread->tid) > 0) | 1582 | thread->tid) > 0) |
1583 | zoom_thread = nr_options++; | 1583 | zoom_thread = nr_options++; |
1584 | 1584 | ||
@@ -1598,7 +1598,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1598 | struct symbol *sym; | 1598 | struct symbol *sym; |
1599 | 1599 | ||
1600 | if (asprintf(&options[nr_options], "Run scripts for samples of thread [%s]", | 1600 | if (asprintf(&options[nr_options], "Run scripts for samples of thread [%s]", |
1601 | browser->he_selection->thread->comm) > 0) | 1601 | thread__comm_str(browser->he_selection->thread)) > 0) |
1602 | scripts_comm = nr_options++; | 1602 | scripts_comm = nr_options++; |
1603 | 1603 | ||
1604 | sym = browser->he_selection->ms.sym; | 1604 | sym = browser->he_selection->ms.sym; |
@@ -1701,7 +1701,7 @@ zoom_out_thread: | |||
1701 | sort_thread.elide = false; | 1701 | sort_thread.elide = false; |
1702 | } else { | 1702 | } else { |
1703 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", | 1703 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", |
1704 | thread->comm_set ? thread->comm : "", | 1704 | thread->comm_set ? thread__comm_str(thread) : "", |
1705 | thread->tid); | 1705 | thread->tid); |
1706 | browser->hists->thread_filter = thread; | 1706 | browser->hists->thread_filter = thread; |
1707 | sort_thread.elide = true; | 1707 | sort_thread.elide = true; |
@@ -1717,7 +1717,7 @@ do_scripts: | |||
1717 | memset(script_opt, 0, 64); | 1717 | memset(script_opt, 0, 64); |
1718 | 1718 | ||
1719 | if (choice == scripts_comm) | 1719 | if (choice == scripts_comm) |
1720 | sprintf(script_opt, " -c %s ", browser->he_selection->thread->comm); | 1720 | sprintf(script_opt, " -c %s ", thread__comm_str(browser->he_selection->thread)); |
1721 | 1721 | ||
1722 | if (choice == scripts_symbol) | 1722 | if (choice == scripts_symbol) |
1723 | sprintf(script_opt, " -S %s ", browser->he_selection->ms.sym->name); | 1723 | sprintf(script_opt, " -S %s ", browser->he_selection->ms.sym->name); |
@@ -1847,15 +1847,15 @@ browse_hists: | |||
1847 | switch (key) { | 1847 | switch (key) { |
1848 | case K_TAB: | 1848 | case K_TAB: |
1849 | if (pos->node.next == &evlist->entries) | 1849 | if (pos->node.next == &evlist->entries) |
1850 | pos = list_entry(evlist->entries.next, struct perf_evsel, node); | 1850 | pos = perf_evlist__first(evlist); |
1851 | else | 1851 | else |
1852 | pos = list_entry(pos->node.next, struct perf_evsel, node); | 1852 | pos = perf_evsel__next(pos); |
1853 | goto browse_hists; | 1853 | goto browse_hists; |
1854 | case K_UNTAB: | 1854 | case K_UNTAB: |
1855 | if (pos->node.prev == &evlist->entries) | 1855 | if (pos->node.prev == &evlist->entries) |
1856 | pos = list_entry(evlist->entries.prev, struct perf_evsel, node); | 1856 | pos = perf_evlist__last(evlist); |
1857 | else | 1857 | else |
1858 | pos = list_entry(pos->node.prev, struct perf_evsel, node); | 1858 | pos = perf_evsel__prev(pos); |
1859 | goto browse_hists; | 1859 | goto browse_hists; |
1860 | case K_ESC: | 1860 | case K_ESC: |
1861 | if (!ui_browser__dialog_yesno(&menu->b, | 1861 | if (!ui_browser__dialog_yesno(&menu->b, |
@@ -1889,7 +1889,7 @@ out: | |||
1889 | return key; | 1889 | return key; |
1890 | } | 1890 | } |
1891 | 1891 | ||
1892 | static bool filter_group_entries(struct ui_browser *self __maybe_unused, | 1892 | static bool filter_group_entries(struct ui_browser *browser __maybe_unused, |
1893 | void *entry) | 1893 | void *entry) |
1894 | { | 1894 | { |
1895 | struct perf_evsel *evsel = list_entry(entry, struct perf_evsel, node); | 1895 | struct perf_evsel *evsel = list_entry(entry, struct perf_evsel, node); |
@@ -1943,8 +1943,7 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | |||
1943 | 1943 | ||
1944 | single_entry: | 1944 | single_entry: |
1945 | if (nr_entries == 1) { | 1945 | if (nr_entries == 1) { |
1946 | struct perf_evsel *first = list_entry(evlist->entries.next, | 1946 | struct perf_evsel *first = perf_evlist__first(evlist); |
1947 | struct perf_evsel, node); | ||
1948 | const char *ev_name = perf_evsel__name(first); | 1947 | const char *ev_name = perf_evsel__name(first); |
1949 | 1948 | ||
1950 | return perf_evsel__hists_browse(first, nr_entries, help, | 1949 | return perf_evsel__hists_browse(first, nr_entries, help, |