Lines Matching refs:pkg_stats
81 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_init_stats() local
88 memset(pkg_stats, 0, sizeof(struct can_pkg_stats)); in can_init_stats()
89 pkg_stats->jiffies_init = jiffies; in can_init_stats()
118 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_stat_update() local
126 if (j < pkg_stats->jiffies_init) in can_stat_update()
130 if (pkg_stats->rx_frames > (ULONG_MAX / HZ)) in can_stat_update()
134 if (pkg_stats->tx_frames > (ULONG_MAX / HZ)) in can_stat_update()
138 if (pkg_stats->matches > (ULONG_MAX / 100)) in can_stat_update()
142 if (pkg_stats->rx_frames) in can_stat_update()
143 pkg_stats->total_rx_match_ratio = (pkg_stats->matches * 100) / in can_stat_update()
144 pkg_stats->rx_frames; in can_stat_update()
146 pkg_stats->total_tx_rate = calc_rate(pkg_stats->jiffies_init, j, in can_stat_update()
147 pkg_stats->tx_frames); in can_stat_update()
148 pkg_stats->total_rx_rate = calc_rate(pkg_stats->jiffies_init, j, in can_stat_update()
149 pkg_stats->rx_frames); in can_stat_update()
152 if (pkg_stats->rx_frames_delta) in can_stat_update()
153 pkg_stats->current_rx_match_ratio = in can_stat_update()
154 (pkg_stats->matches_delta * 100) / in can_stat_update()
155 pkg_stats->rx_frames_delta; in can_stat_update()
157 pkg_stats->current_tx_rate = calc_rate(0, HZ, pkg_stats->tx_frames_delta); in can_stat_update()
158 pkg_stats->current_rx_rate = calc_rate(0, HZ, pkg_stats->rx_frames_delta); in can_stat_update()
161 if (pkg_stats->max_tx_rate < pkg_stats->current_tx_rate) in can_stat_update()
162 pkg_stats->max_tx_rate = pkg_stats->current_tx_rate; in can_stat_update()
164 if (pkg_stats->max_rx_rate < pkg_stats->current_rx_rate) in can_stat_update()
165 pkg_stats->max_rx_rate = pkg_stats->current_rx_rate; in can_stat_update()
167 if (pkg_stats->max_rx_match_ratio < pkg_stats->current_rx_match_ratio) in can_stat_update()
168 pkg_stats->max_rx_match_ratio = pkg_stats->current_rx_match_ratio; in can_stat_update()
171 pkg_stats->tx_frames_delta = 0; in can_stat_update()
172 pkg_stats->rx_frames_delta = 0; in can_stat_update()
173 pkg_stats->matches_delta = 0; in can_stat_update()
213 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_stats_proc_show() local
217 seq_printf(m, " %8ld transmitted frames (TXF)\n", pkg_stats->tx_frames); in can_stats_proc_show()
218 seq_printf(m, " %8ld received frames (RXF)\n", pkg_stats->rx_frames); in can_stats_proc_show()
219 seq_printf(m, " %8ld matched frames (RXMF)\n", pkg_stats->matches); in can_stats_proc_show()
225 pkg_stats->total_rx_match_ratio); in can_stats_proc_show()
228 pkg_stats->total_tx_rate); in can_stats_proc_show()
230 pkg_stats->total_rx_rate); in can_stats_proc_show()
235 pkg_stats->current_rx_match_ratio); in can_stats_proc_show()
238 pkg_stats->current_tx_rate); in can_stats_proc_show()
240 pkg_stats->current_rx_rate); in can_stats_proc_show()
245 pkg_stats->max_rx_match_ratio); in can_stats_proc_show()
248 pkg_stats->max_tx_rate); in can_stats_proc_show()
250 pkg_stats->max_rx_rate); in can_stats_proc_show()
276 struct can_pkg_stats *pkg_stats = net->can.pkg_stats; in can_reset_stats_proc_show() local
284 if (pkg_stats->jiffies_init != jiffies) in can_reset_stats_proc_show()