2 // Copyright (c) 2010-2019 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.
20 #define PROX_MAX_COLS 32
25 #include "display_latency.h"
26 #include "stats_cons.h"
29 struct display_column {
33 struct display_page *display_page;
36 struct display_table {
37 struct display_column cols[PROX_MAX_COLS];
45 struct display_table tables[8];
51 unsigned chosen_screen;
57 struct display_screen {
58 void (*draw_frame)(struct screen_state *screen_state);
59 void (*draw_stats)(struct screen_state *screen_state);
60 int (*get_height)(void);
64 void display_set_pps_unit(int val);
69 void display_page_draw_frame(const struct display_page *display_page, int height);
70 int display_column_get_width(const struct display_column *display_column);
71 void display_column_init(struct display_column *display_column, const char *title, unsigned width);
72 struct display_column *display_table_add_col(struct display_table *table);
73 void display_table_init(struct display_table *table, const char *title);
74 struct display_table *display_page_add_table(struct display_page *display_page);
75 void display_page_init(struct display_page *display_page);
76 __attribute__((format(printf, 3, 4))) void display_column_print(const struct display_column *display_column, int row, const char *fmt, ...);
77 void display_column_print_core_task(const struct display_column *display_column, int row, struct lcore_cfg *lconf, struct task_args *targ);
78 void display_column_print_number(const struct display_column *display_column, int row, uint64_t number);
80 char *print_time_unit_err_usec(char *dst, struct time_unit_err *t);
81 char *print_time_unit_usec(char *dst, struct time_unit *t);
84 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);
86 void display_init(void);
87 void display_end(void);
88 void display_stats(void);
89 void display_refresh(void);
90 void display_renew(void);
91 void display_print(const char *str);
92 void display_cmd(const char *cmd, int cmd_len, int cursor_pos);
93 void display_screen(unsigned screen_id);
94 void toggle_display_screen(void);
95 void display_page_up(void);
96 void display_page_down(void);
97 void display_print_page(void);
98 void display_lock(void);
99 void display_unlock(void);
101 int display_getch(void);
103 static struct stats_cons display = {
104 .init = display_init,
105 .notify = display_stats,
106 .refresh = display_refresh,
107 .finish = display_end,
108 .flags = STATS_CONS_F_ALL,
111 #endif /* _DISPLAY_H_ */