cleanup, live textdump working
[lttngtop.git] / src / cursesdisplay.c
index 2d79d65f99cc0ae53838f0be551641de842a1b99..25fe1f94e075836daf83d85861407e1bd1817103 100644 (file)
@@ -302,23 +302,6 @@ void basic_header()
        wrefresh(header);
 }
 
-struct tm format_timestamp(uint64_t timestamp)
-{
-       struct tm tm;
-       uint64_t ts_sec = 0, ts_nsec;
-       time_t time_s;
-
-       ts_nsec = timestamp;
-       ts_sec += ts_nsec / NSEC_PER_SEC;
-       ts_nsec = ts_nsec % NSEC_PER_SEC;
-
-       time_s = (time_t) ts_sec;
-
-       localtime_r(&time_s, &tm);
-
-       return tm;
-}
-
 static void scale_unit(uint64_t bytes, char *ret)
 {
        if (bytes >= 1000000000)
@@ -779,8 +762,8 @@ void update_perf()
        while (g_hash_table_iter_next (&iter, &key, (gpointer) &perfn1)) {
                if (perfn1->visible) {
                        if (perfn1->sort) {
+                               /* pref_current_sort = i; */
                                wattron(center, A_UNDERLINE);
-                               /* FIXME : sort in the opposite direction */
                        }
                        /* + 5 to strip the "perf_" prefix */
                        mvwprintw(center, 1, perf_row, "%s",
@@ -1443,19 +1426,24 @@ void *handle_keyboard(void *p)
                                update_preference_panel(&pref_line_selected, 0, 1);
                        break;
                case '>':
-                       if (!pref_panel_visible) {
+                       /* perf uses a hashtable, it is ordered backward */
+                       if (current_view == perf) {
+                               pref_current_sort--;
+                       } else if (!pref_panel_visible) {
                                pref_current_sort++;
-                               update_sort(&pref_current_sort);
-                               update_current_view();
                        }
+                       update_sort(&pref_current_sort);
+                       update_current_view();
                        break;
                case '<':
-                       if (!pref_panel_visible) {
-                               if (pref_current_sort > 0)
-                                       pref_current_sort--;
-                               update_sort(&pref_current_sort);
-                               update_current_view();
+                       /* perf uses a hashtable, it is ordered backward */
+                       if (current_view == perf) {
+                               pref_current_sort++;
+                       } else if (!pref_panel_visible) {
+                               pref_current_sort--;
                        }
+                       update_sort(&pref_current_sort);
+                       update_current_view();
                        break;
 
                case 13: /* FIXME : KEY_ENTER ?? */
@@ -1468,6 +1456,7 @@ void *handle_keyboard(void *p)
                                current_view = previous_view;
                                previous_view = process_details;
                        }
+                       selected_line = 0;
                        update_current_view();
                        break;
 
This page took 0.023101 seconds and 4 git commands to generate.