2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
24 #include "display_latency.h"
25 #include "stats_cons.h"
28 struct display_column {
32 struct display_page *display_page;
35 struct display_table {
36 struct display_column cols[16];
44 struct display_table tables[8];
50 unsigned chosen_screen;
56 struct display_screen {
57 void (*draw_frame)(struct screen_state *screen_state);
58 void (*draw_stats)(struct screen_state *screen_state);
59 int (*get_height)(void);
63 void display_set_pps_unit(int val);
68 void display_page_draw_frame(const struct display_page *display_page, int height);
69 int display_column_get_width(const struct display_column *display_column);
70 void display_column_init(struct display_column *display_column, const char *title, unsigned width);
71 struct display_column *display_table_add_col(struct display_table *table);
72 void display_table_init(struct display_table *table, const char *title);
73 struct display_table *display_page_add_table(struct display_page *display_page);
74 void display_page_init(struct display_page *display_page);
75 __attribute__((format(printf, 3, 4))) void display_column_print(const struct display_column *display_column, int row, const char *fmt, ...);
76 void display_column_print_core_task(const struct display_column *display_column, int row, struct lcore_cfg *lconf, struct task_args *targ);
77 void display_column_print_number(const struct display_column *display_column, int row, uint64_t number);
79 char *print_time_unit_err_usec(char *dst, struct time_unit_err *t);
80 char *print_time_unit_usec(char *dst, struct time_unit *t);
83 void display_column_port_ring(const struct display_column *display_column, int row, struct port_queue *ports, int port_count, struct rte_ring **rings, int ring_count);
85 void display_init(void);
86 void display_end(void);
87 void display_stats(void);
88 void display_refresh(void);
89 void display_print(const char *str);
90 void display_cmd(const char *cmd, int cmd_len, int cursor_pos);
91 void display_screen(unsigned screen_id);
92 void toggle_display_screen(void);
93 void display_page_up(void);
94 void display_page_down(void);
95 void display_print_page(void);
96 void display_lock(void);
97 void display_unlock(void);
99 int display_getch(void);
101 static struct stats_cons display = {
102 .init = display_init,
103 .notify = display_stats,
104 .refresh = display_refresh,
105 .finish = display_end,
106 .flags = STATS_CONS_F_ALL,
109 #endif /* _DISPLAY_H_ */