namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
3.05k stars 473 forks source link

TUI problem in nested graph construction #476

Closed honggyukim closed 6 years ago

honggyukim commented 6 years ago

In tui mode, g key requests to restructure graph based on the currently pointing function. But it doesn't work in nested manner.

Here is the sequence to reproduce it.

After running step 3. it doesn't restructure the graph based on the next target function, but just go to the top in the same graph.

namhyung commented 6 years ago

Right, I missed to check the partial_graph condition. The following patch will fix:

diff --git a/cmds/tui.c b/cmds/tui.c
index 1b3411a9..45de2ad5 100644
--- a/cmds/tui.c
+++ b/cmds/tui.c
@@ -2395,7 +2395,7 @@ static void tui_main_loop(struct opts *opts, struct ftrace_file_handle *handle)
                        }
                        break;
                case 'g':
-                       if (win == &graph->win) {
+                       if (win == &graph->win || win == &partial_graph.win) {
                                struct tui_report_node *func;
                                struct tui_graph_node *curr = win->curr;
honggyukim commented 6 years ago

Right. It fixes the problem. Thanks!