summaryrefslogtreecommitdiff
path: root/tools/perf/ui/browser.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-10-07 01:40:17 +0300
committerPeter Zijlstra <peterz@infradead.org>2021-10-07 01:40:17 +0300
commitb08cadbd3b8721db738d9a00ef3ce3ed667e6d9c (patch)
tree1b44ef760764ea19f82fd80088135d23ab565d2d /tools/perf/ui/browser.c
parentdb2b0c5d7b6f19b3c2cab08c531b65342eb5252b (diff)
parentfe255fe6ad97685e5a4be0d871f43288dbc10ad6 (diff)
downloadlinux-b08cadbd3b8721db738d9a00ef3ce3ed667e6d9c.tar.xz
Merge branch 'objtool/urgent'
Fixup conflicts. # Conflicts: # tools/objtool/check.c
Diffstat (limited to 'tools/perf/ui/browser.c')
-rw-r--r--tools/perf/ui/browser.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index 781afe42e90e..fa5bd5c20e96 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -757,25 +757,40 @@ void __ui_browser__line_arrow(struct ui_browser *browser, unsigned int column,
}
void ui_browser__mark_fused(struct ui_browser *browser, unsigned int column,
- unsigned int row, bool arrow_down)
+ unsigned int row, int diff, bool arrow_down)
{
- unsigned int end_row;
+ int end_row;
- if (row >= browser->top_idx)
- end_row = row - browser->top_idx;
- else
+ if (diff <= 0)
return;
SLsmg_set_char_set(1);
if (arrow_down) {
+ if (row + diff <= browser->top_idx)
+ return;
+
+ end_row = row + diff - browser->top_idx;
ui_browser__gotorc(browser, end_row, column - 1);
- SLsmg_write_char(SLSMG_ULCORN_CHAR);
- ui_browser__gotorc(browser, end_row, column);
- SLsmg_draw_hline(2);
- ui_browser__gotorc(browser, end_row + 1, column - 1);
SLsmg_write_char(SLSMG_LTEE_CHAR);
+
+ while (--end_row >= 0 && end_row > (int)(row - browser->top_idx)) {
+ ui_browser__gotorc(browser, end_row, column - 1);
+ SLsmg_draw_vline(1);
+ }
+
+ end_row = (int)(row - browser->top_idx);
+ if (end_row >= 0) {
+ ui_browser__gotorc(browser, end_row, column - 1);
+ SLsmg_write_char(SLSMG_ULCORN_CHAR);
+ ui_browser__gotorc(browser, end_row, column);
+ SLsmg_draw_hline(2);
+ }
} else {
+ if (row < browser->top_idx)
+ return;
+
+ end_row = row - browser->top_idx;
ui_browser__gotorc(browser, end_row, column - 1);
SLsmg_write_char(SLSMG_LTEE_CHAR);
ui_browser__gotorc(browser, end_row, column);