Lines Matching +full:touch +full:- +full:hold +full:- +full:ms

2 /*-
3 * SPDX-License-Identifier: BSD-2-Clause
5 * Copyright (c) 2016-2018 Netflix, Inc.
158 "Logging mode for auto-selected sessions (default is TCP_LOG_STATE_TAIL)");
162 "Auto-select from all sessions (rather than just those with IDs)");
271 #define TCPID_BUCKET_LOCK_INIT(tlb) mtx_init(&((tlb)->tlb_mtx), "tcp log id bucket", NULL, MTX_DEF)
272 #define TCPID_BUCKET_LOCK_DESTROY(tlb) mtx_destroy(&((tlb)->tlb_mtx))
273 #define TCPID_BUCKET_LOCK(tlb) mtx_lock(&((tlb)->tlb_mtx))
274 #define TCPID_BUCKET_UNLOCK(tlb) mtx_unlock(&((tlb)->tlb_mtx))
275 #define TCPID_BUCKET_LOCK_ASSERT(tlb) mtx_assert(&((tlb)->tlb_mtx), MA_OWNED)
276 #define TCPID_BUCKET_UNLOCK_ASSERT(tlb) mtx_assert(&((tlb)->tlb_mtx), MA_NOTOWNED)
278 #define TCPID_BUCKET_REF(tlb) refcount_acquire(&((tlb)->tlb_refcnt))
279 #define TCPID_BUCKET_UNREF(tlb) refcount_release(&((tlb)->tlb_refcnt))
332 /* Do we want to select this session for auto-logging? */
338 * If we are doing auto-capturing, figure out whether we will capture in tcp_log_selectauto()
354 return strncmp(a->tlb_id, b->tlb_id, TCP_LOG_ID_LEN); in tcp_log_id_cmp()
386 KASSERT(SLIST_EMPTY(&tlb->tlb_head), in tcp_log_remove_bucket()
387 ("%s: Attempt to remove non-empty bucket", __func__)); in tcp_log_remove_bucket()
395 counter_u64_add(tcp_log_pcb_ids_cur, (int64_t)-1); in tcp_log_remove_bucket()
421 * Did we hold the last reference on the tlb? If so, we may need in tcp_log_unref_bucket()
466 * The caller is responsible for freeing the tp->t_lin/tln node!
495 tlb = tp->t_lib; in tcp_log_remove_id_node()
496 tln = tp->t_lin; in tcp_log_remove_id_node()
509 SLIST_REMOVE(&tlb->tlb_head, tln, tcp_log_id_node, tln_list); in tcp_log_remove_id_node()
511 tp->t_lib = NULL; in tcp_log_remove_id_node()
512 tp->t_lin = NULL; in tcp_log_remove_id_node()
521 if (inp->inp_flags & INP_DROPPED) { \
538 if (V_tcp_perconn_stats_enable == 2 && tp->t_stats == NULL) in tcp_log_grow_tlb()
547 atomic_fetchadd_int(&tlb->tlb_reqcnt, 1); in tcp_log_increment_reqcnt()
560 tlb = tp->t_lib; in tcp_log_apply_ratio()
575 hash = hash32_buf(tlb->tlb_id, strlen(tlb->tlb_id), 0); in tcp_log_apply_ratio()
576 if (hash > ratio_hash_thresh && tp->_t_logstate == TCP_LOG_STATE_OFF && in tcp_log_apply_ratio()
577 tlb->tlb_logstate == TCP_LOG_STATE_OFF) { in tcp_log_apply_ratio()
584 tlb->tlb_logstate = TCP_LOG_STATE_RATIO_OFF; in tcp_log_apply_ratio()
623 tlb = tp->t_lib; in tcp_log_set_tag()
632 strlcpy(tlb->tlb_tag, tag, TCP_LOG_TAG_LEN); in tcp_log_set_tag()
669 same = ((tp->t_lib != NULL && !strcmp(tp->t_lib->tlb_id, id)) || in tcp_log_set_id()
670 (tp->t_lib == NULL && *id == 0)); in tcp_log_set_id()
671 if (tp->_t_logstate && STAILQ_FIRST(&tp->t_logs) && !same) { in tcp_log_set_id()
676 switch(tp->_t_logstate) { in tcp_log_set_id()
678 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from head at id switch", in tcp_log_set_id()
682 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from tail at id switch", in tcp_log_set_id()
686 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual at id switch", in tcp_log_set_id()
690 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints at id switch", in tcp_log_set_id()
696 if (tp->t_lib != NULL) { in tcp_log_set_id()
697 tcp_log_increment_reqcnt(tp->t_lib); in tcp_log_set_id()
698 if ((tp->t_lib->tlb_logstate > TCP_LOG_STATE_OFF) && in tcp_log_set_id()
699 (tp->t_log_state_set == 0)) { in tcp_log_set_id()
702 tp->_t_logstate = tp->t_lib->tlb_logstate; in tcp_log_set_id()
704 if ((tp->t_lib->tlb_loglimit) && in tcp_log_set_id()
705 (tp->t_log_state_set == 0)) { in tcp_log_set_id()
708 tp->t_loglimit = tp->t_lib->tlb_loglimit; in tcp_log_set_id()
724 if (tp->t_lib != NULL) { in tcp_log_set_id()
725 tlb = tp->t_lib; in tcp_log_set_id()
760 * In cases 2-4, we will start over. In case 1, we will in tcp_log_set_id()
763 if (tlb == NULL || tp->t_lib != tlb) { in tcp_log_set_id()
788 tln = tp->t_lin; in tcp_log_set_id()
798 if (tp->t_lib != NULL || tp->t_lin != NULL) in tcp_log_set_id()
811 KASSERT(tp->t_lib == NULL, ("%s: tp->t_lib is not NULL", __func__)); in tcp_log_set_id()
826 tln->tln_inp = inp; in tcp_log_set_id()
827 tln->tln_tp = tp; in tcp_log_set_id()
848 KASSERT(tlb == NULL, ("%s:%d tlb unexpectedly non-NULL", in tcp_log_set_id()
856 * need to recheck some things when we re-acquire the lock. in tcp_log_set_id()
887 tlb->tlb_logstate = tcp_log_auto_mode; in tcp_log_set_id()
889 tlb->tlb_logstate = TCP_LOG_STATE_OFF; in tcp_log_set_id()
890 tlb->tlb_loglimit = 0; in tcp_log_set_id()
891 tlb->tlb_tag[0] = '\0'; /* Default to an empty tag. */ in tcp_log_set_id()
900 * can use strlcpy(). :-) in tcp_log_set_id()
902 strncpy(tlb->tlb_id, id, TCP_LOG_ID_LEN - 1); in tcp_log_set_id()
903 tlb->tlb_id[TCP_LOG_ID_LEN - 1] = '\0'; in tcp_log_set_id()
910 * been initialized. :-( in tcp_log_set_id()
912 SLIST_INIT(&tlb->tlb_head); in tcp_log_set_id()
913 refcount_init(&tlb->tlb_refcnt, 1); in tcp_log_set_id()
914 tlb->tlb_reqcnt = 1; in tcp_log_set_id()
915 memset(&tlb->tlb_mtx, 0, sizeof(struct mtx)); in tcp_log_set_id()
923 counter_u64_add(tcp_log_pcb_ids_cur, (int64_t)-1); \ in tcp_log_set_id()
924 counter_u64_add(tcp_log_pcb_ids_tot, (int64_t)-1); \ in tcp_log_set_id()
934 if (tp->t_lib != NULL) { in tcp_log_set_id()
971 if (tp->t_lib != NULL) { in tcp_log_set_id()
985 tcp_log_grow_tlb(tlb->tlb_id, tp); in tcp_log_set_id()
988 SLIST_INSERT_HEAD(&tlb->tlb_head, tln, tln_list); in tcp_log_set_id()
989 tp->t_lib = tlb; in tcp_log_set_id()
990 tp->t_lin = tln; in tcp_log_set_id()
991 if (tp->t_lib->tlb_logstate > TCP_LOG_STATE_OFF) { in tcp_log_set_id()
994 tp->_t_logstate = tp->t_lib->tlb_logstate; in tcp_log_set_id()
996 if (tp->t_lib->tlb_loglimit) { in tcp_log_set_id()
999 tp->t_loglimit = tp->t_lib->tlb_loglimit; in tcp_log_set_id()
1041 if (tp->t_lib != NULL) { in tcp_log_get_id()
1042 len = strlcpy(buf, tp->t_lib->tlb_id, TCP_LOG_ID_LEN); in tcp_log_get_id()
1044 ("%s:%d: tp->t_lib->tlb_id too long (%zu)", in tcp_log_get_id()
1070 tlb = tp->t_lib; in tcp_log_get_tag()
1076 len = strlcpy(buf, tlb->tlb_tag, TCP_LOG_TAG_LEN); in tcp_log_get_tag()
1078 ("%s:%d: tp->t_lib->tlb_tag too long (%zu)", in tcp_log_get_tag()
1110 return ((tp->t_lib == NULL) ? 0 : tp->t_lib->tlb_refcnt); in tcp_log_get_id_cnt()
1116 * entry. This should catch when we do a double-free/double-remove or
1117 * a double-add.
1125 refcnt = atomic_fetchadd_int(&log_entry->tlm_refcnt, 1); in _tcp_log_entry_refcnt_add()
1127 panic("%s:%d: log_entry(%p)->tlm_refcnt is %d (expected 0)", in _tcp_log_entry_refcnt_add()
1139 refcnt = atomic_fetchadd_int(&log_entry->tlm_refcnt, -1); in _tcp_log_entry_refcnt_rem()
1141 panic("%s:%d: log_entry(%p)->tlm_refcnt is %d (expected 1)", in _tcp_log_entry_refcnt_rem()
1164 (*count)--; in tcp_log_free_log_common()
1188 tp->t_lognum--; in tcp_log_remove_log_cleanup()
1189 KASSERT(tp->t_lognum >= 0, in tcp_log_remove_log_cleanup()
1190 ("%s: tp->t_lognum unexpectedly negative", __func__)); in tcp_log_remove_log_cleanup()
1198 KASSERT(log_entry == STAILQ_FIRST(&tp->t_logs), in tcp_log_remove_log_head()
1199 ("%s: attempt to remove non-HEAD log entry", __func__)); in tcp_log_remove_log_head()
1200 STAILQ_REMOVE_HEAD(&tp->t_logs, tlm_queue); in tcp_log_remove_log_head()
1218 tlm->tlm_refcnt = 0; in tcp_log_zone_init()
1233 if (tlm->tlm_refcnt != 0) in tcp_log_zone_ctor()
1234 panic("%s:%d: tlm(%p)->tlm_refcnt is %d (expected 0)", in tcp_log_zone_ctor()
1235 __func__, __LINE__, tlm, tlm->tlm_refcnt); in tcp_log_zone_ctor()
1247 if (tlm->tlm_refcnt != 0) in tcp_log_zone_dtor()
1248 panic("%s:%d: tlm(%p)->tlm_refcnt is %d (expected 0)", in tcp_log_zone_dtor()
1249 __func__, __LINE__, tlm, tlm->tlm_refcnt); in tcp_log_zone_dtor()
1291 /* Do per-TCPCB initialization. */
1296 /* A new TCPCB should start out zero-initialized. */ in tcp_log_tcpcbinit()
1297 STAILQ_INIT(&tp->t_logs); in tcp_log_tcpcbinit()
1300 * If we are doing auto-capturing, figure out whether we will capture in tcp_log_tcpcbinit()
1303 tp->t_loglimit = tcp_log_session_limit; in tcp_log_tcpcbinit()
1307 tp->_t_logstate = tcp_log_auto_mode; in tcp_log_tcpcbinit()
1308 tp->t_flags2 |= TF2_LOG_AUTO; in tcp_log_tcpcbinit()
1336 tln->tln_expiretime <= expiry_limit) { in tcp_log_expire()
1352 tln->tln_expiretime = SBT_MAX; in tcp_log_expire()
1358 tlb = tln->tln_bucket; in tcp_log_expire()
1370 INP_WLOCK(tln->tln_inp); in tcp_log_expire()
1371 if (!in_pcbrele_wlocked(tln->tln_inp)) in tcp_log_expire()
1372 INP_WUNLOCK(tln->tln_inp); in tcp_log_expire()
1375 tcp_log_free_entries(&tln->tln_entries, &tln->tln_count); in tcp_log_expire()
1391 * Get max(now + TCP_LOG_EXPIRE_INTVL, tln->tln_expiretime) and in tcp_log_expire()
1396 if (expiry_limit < tln->tln_expiretime) in tcp_log_expire()
1397 expiry_limit = tln->tln_expiretime; in tcp_log_expire()
1409 * entries and log count; however, it will not touch other things from the
1412 * NOTE: Must hold a lock on the INP.
1421 tln->tln_ie = inp->inp_inc.inc_ie; in tcp_log_move_tp_to_node()
1422 if (inp->inp_inc.inc_flags & INC_ISIPV6) in tcp_log_move_tp_to_node()
1423 tln->tln_af = AF_INET6; in tcp_log_move_tp_to_node()
1425 tln->tln_af = AF_INET; in tcp_log_move_tp_to_node()
1426 tln->tln_entries = tp->t_logs; in tcp_log_move_tp_to_node()
1427 tln->tln_count = tp->t_lognum; in tcp_log_move_tp_to_node()
1428 tln->tln_bucket = tp->t_lib; in tcp_log_move_tp_to_node()
1431 STAILQ_INIT(&tp->t_logs); in tcp_log_move_tp_to_node()
1432 tp->t_lognum = 0; in tcp_log_move_tp_to_node()
1435 /* Do per-TCPCB cleanup */
1445 if (tp->_t_logstate) { in tcp_log_tcpcbfini()
1453 if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { in tcp_log_tcpcbfini()
1455 log.u_raw.u64_flex[i] = tp->tcp_cnt_counters[i]; in tcp_log_tcpcbfini()
1463 lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS; in tcp_log_tcpcbfini()
1464 lgb->tlb_flex2 = 1; in tcp_log_tcpcbfini()
1468 log.u_raw.u64_flex[i] = tp->tcp_proc_time[i]; in tcp_log_tcpcbfini()
1476 lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS; in tcp_log_tcpcbfini()
1477 lgb->tlb_flex2 = 2; in tcp_log_tcpcbfini()
1483 log.u_bbr.cur_del_rate = tp->t_end_info; in tcp_log_tcpcbfini()
1496 switch(tp->_t_logstate) { in tcp_log_tcpcbfini()
1498 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from head", in tcp_log_tcpcbfini()
1502 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from tail", in tcp_log_tcpcbfini()
1506 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints", in tcp_log_tcpcbfini()
1510 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual", in tcp_log_tcpcbfini()
1516 * There are two ways we could keep logs: per-socket or per-ID. If in tcp_log_tcpcbfini()
1523 * this code. :-) in tcp_log_tcpcbfini()
1527 * the bucket while we hold the lock (Rule D). Basically, no one can in tcp_log_tcpcbfini()
1549 if (tp->t_lin != NULL) { in tcp_log_tcpcbfini()
1553 tln = tp->t_lin; in tcp_log_tcpcbfini()
1554 KASSERT(tln->tln_inp == inp, in tcp_log_tcpcbfini()
1555 ("%s: Mismatched inp (tln->tln_inp=%p, tp inpcb=%p)", in tcp_log_tcpcbfini()
1556 __func__, tln->tln_inp, inp)); in tcp_log_tcpcbfini()
1560 tp->t_lin = NULL; in tcp_log_tcpcbfini()
1561 tp->t_lib = NULL; in tcp_log_tcpcbfini()
1578 * via the expiry timer lets us avoid locking messy-ness here.) in tcp_log_tcpcbfini()
1580 tln->tln_expiretime = getsbinuptime(); in tcp_log_tcpcbfini()
1582 if (tln->tln_count) { in tcp_log_tcpcbfini()
1583 tln->tln_expiretime += TCP_LOG_EXPIRE_TIME; in tcp_log_tcpcbfini()
1592 tln->tln_expiretime, SBT_1S, tcp_log_expire, in tcp_log_tcpcbfini()
1598 callouttime = tln->tln_expiretime + in tcp_log_tcpcbfini()
1603 callouttime < tln_first->tln_expiretime) && in tcp_log_tcpcbfini()
1621 * mis-orderings as a bunch of "expire now" entries in tcp_log_tcpcbfini()
1627 tln->tln_expiretime < tln_first->tln_expiretime) in tcp_log_tcpcbfini()
1638 * can't touch it. (Note that the "release" semantics should in tcp_log_tcpcbfini()
1644 atomic_store_rel_int(&tln->tln_closed, 1); in tcp_log_tcpcbfini()
1647 while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL) in tcp_log_tcpcbfini()
1649 KASSERT(tp->t_lognum == 0, in tcp_log_tcpcbfini()
1650 ("%s: After freeing entries, tp->t_lognum=%d (expected 0)", in tcp_log_tcpcbfini()
1651 __func__, tp->t_lognum)); in tcp_log_tcpcbfini()
1656 * in a last-minute log). in tcp_log_tcpcbfini()
1658 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_tcpcbfini()
1667 if (tp->t_lognum == 0) in tcp_log_purge_tp_logbuf()
1670 while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL) in tcp_log_purge_tp_logbuf()
1672 KASSERT(tp->t_lognum == 0, in tcp_log_purge_tp_logbuf()
1673 ("%s: After freeing entries, tp->t_lognum=%d (expected 0)", in tcp_log_purge_tp_logbuf()
1674 __func__, tp->t_lognum)); in tcp_log_purge_tp_logbuf()
1675 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_purge_tp_logbuf()
1712 KASSERT(tp->_t_logstate == TCP_LOG_STATE_HEAD || in tcp_log_event()
1713 tp->_t_logstate == TCP_LOG_STATE_TAIL || in tcp_log_event()
1714 tp->_t_logstate == TCP_LOG_STATE_CONTINUAL || in tcp_log_event()
1715 tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO || in tcp_log_event()
1716 tp->_t_logstate == TCP_LOG_VIA_BBPOINTS || in tcp_log_event()
1717 tp->_t_logstate == TCP_LOG_STATE_TAIL_AUTO, in tcp_log_event()
1718 ("%s called with unexpected tp->_t_logstate (%d)", __func__, in tcp_log_event()
1719 tp->_t_logstate)); in tcp_log_event()
1726 logsn = tp->t_logsn++; in tcp_log_event()
1733 if (tp->t_lognum < tp->t_loglimit) { in tcp_log_event()
1735 tp->t_lognum++; in tcp_log_event()
1742 * Sacrifice auto-logged sessions without a log ID if in tcp_log_event()
1745 * or we are resource-constrained.) in tcp_log_event()
1747 if (tp->t_lib == NULL && (tp->t_flags2 & TF2_LOG_AUTO) && in tcp_log_event()
1755 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_event()
1764 if (tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO && in tcp_log_event()
1765 !tcp_log_dump_tp_logbuf(tp, "auto-dumped from head", in tcp_log_event()
1767 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_event()
1769 } else if ((tp->_t_logstate == TCP_LOG_STATE_CONTINUAL) && in tcp_log_event()
1770 !tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual", in tcp_log_event()
1781 } else if ((tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) && in tcp_log_event()
1782 !tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints", in tcp_log_event()
1792 } else if (tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO) in tcp_log_event()
1796 if (tp->_t_logstate == TCP_LOG_STATE_HEAD) { in tcp_log_event()
1797 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_event()
1806 * here. Because we are re-using the buffer, the total in tcp_log_event()
1809 if ((log_entry = STAILQ_FIRST(&tp->t_logs)) == NULL) in tcp_log_event()
1811 STAILQ_REMOVE_HEAD(&tp->t_logs, tlm_queue); in tcp_log_event()
1819 log_buf = &log_entry->tlm_buf; in tcp_log_event()
1820 log_verbose = &log_entry->tlm_v; in tcp_log_event()
1824 microuptime(&log_buf->tlb_tv); in tcp_log_event()
1826 memcpy(&log_buf->tlb_tv, itv, sizeof(struct timeval)); in tcp_log_event()
1827 log_buf->tlb_ticks = ticks; in tcp_log_event()
1828 log_buf->tlb_sn = logsn; in tcp_log_event()
1829 log_buf->tlb_stackid = tp->t_fb->tfb_id; in tcp_log_event()
1830 log_buf->tlb_eventid = eventid; in tcp_log_event()
1831 log_buf->tlb_eventflags = 0; in tcp_log_event()
1832 log_buf->tlb_errno = errornum; in tcp_log_event()
1836 log_buf->tlb_eventflags |= TLB_FLAG_RXBUF; in tcp_log_event()
1837 log_buf->tlb_rxbuf.tls_sb_acc = rxbuf->sb_acc; in tcp_log_event()
1838 log_buf->tlb_rxbuf.tls_sb_ccc = rxbuf->sb_ccc; in tcp_log_event()
1839 log_buf->tlb_rxbuf.tls_sb_spare = 0; in tcp_log_event()
1841 log_buf->tlb_rxbuf.tls_sb_acc = 0; in tcp_log_event()
1842 log_buf->tlb_rxbuf.tls_sb_ccc = 0; in tcp_log_event()
1845 log_buf->tlb_eventflags |= TLB_FLAG_TXBUF; in tcp_log_event()
1846 log_buf->tlb_txbuf.tls_sb_acc = txbuf->sb_acc; in tcp_log_event()
1847 log_buf->tlb_txbuf.tls_sb_ccc = txbuf->sb_ccc; in tcp_log_event()
1848 log_buf->tlb_txbuf.tls_sb_spare = 0; in tcp_log_event()
1850 log_buf->tlb_txbuf.tls_sb_acc = 0; in tcp_log_event()
1851 log_buf->tlb_txbuf.tls_sb_ccc = 0; in tcp_log_event()
1854 log_buf->tlb_state = tp->t_state; in tcp_log_event()
1855 log_buf->tlb_starttime = tp->t_starttime; in tcp_log_event()
1856 log_buf->tlb_iss = tp->iss; in tcp_log_event()
1857 log_buf->tlb_flags = tp->t_flags; in tcp_log_event()
1858 log_buf->tlb_snd_una = tp->snd_una; in tcp_log_event()
1859 log_buf->tlb_snd_max = tp->snd_max; in tcp_log_event()
1860 log_buf->tlb_snd_cwnd = tp->snd_cwnd; in tcp_log_event()
1861 log_buf->tlb_snd_nxt = tp->snd_nxt; in tcp_log_event()
1862 log_buf->tlb_snd_recover = tp->snd_recover; in tcp_log_event()
1863 log_buf->tlb_snd_wnd = tp->snd_wnd; in tcp_log_event()
1864 log_buf->tlb_snd_ssthresh = tp->snd_ssthresh; in tcp_log_event()
1865 log_buf->tlb_srtt = tp->t_srtt; in tcp_log_event()
1866 log_buf->tlb_rttvar = tp->t_rttvar; in tcp_log_event()
1867 log_buf->tlb_rcv_up = tp->rcv_up; in tcp_log_event()
1868 log_buf->tlb_rcv_adv = tp->rcv_adv; in tcp_log_event()
1869 log_buf->tlb_flags2 = tp->t_flags2; in tcp_log_event()
1870 log_buf->tlb_rcv_nxt = tp->rcv_nxt; in tcp_log_event()
1871 log_buf->tlb_rcv_wnd = tp->rcv_wnd; in tcp_log_event()
1872 log_buf->tlb_dupacks = tp->t_dupacks; in tcp_log_event()
1873 log_buf->tlb_segqlen = tp->t_segqlen; in tcp_log_event()
1874 log_buf->tlb_snd_numholes = tp->snd_numholes; in tcp_log_event()
1875 log_buf->tlb_flex1 = 0; in tcp_log_event()
1876 log_buf->tlb_flex2 = 0; in tcp_log_event()
1877 log_buf->tlb_fbyte_in = tp->t_fbyte_in; in tcp_log_event()
1878 log_buf->tlb_fbyte_out = tp->t_fbyte_out; in tcp_log_event()
1879 log_buf->tlb_snd_scale = tp->snd_scale; in tcp_log_event()
1880 log_buf->tlb_rcv_scale = tp->rcv_scale; in tcp_log_event()
1881 log_buf->_pad[0] = 0; in tcp_log_event()
1882 log_buf->_pad[1] = 0; in tcp_log_event()
1883 log_buf->_pad[2] = 0; in tcp_log_event()
1884 /* Copy stack-specific info. */ in tcp_log_event()
1886 memcpy(&log_buf->tlb_stackinfo, stackinfo, in tcp_log_event()
1887 sizeof(log_buf->tlb_stackinfo)); in tcp_log_event()
1888 log_buf->tlb_eventflags |= TLB_FLAG_STACKINFO; in tcp_log_event()
1892 log_buf->tlb_len = len; in tcp_log_event()
1896 log_buf->tlb_eventflags |= TLB_FLAG_HDR; in tcp_log_event()
1897 log_buf->tlb_th = *th; in tcp_log_event()
1899 tcp_fields_to_net(&log_buf->tlb_th); in tcp_log_event()
1900 optlen = (th->th_off << 2) - sizeof (struct tcphdr); in tcp_log_event()
1902 memcpy(log_buf->tlb_opts, th + 1, optlen); in tcp_log_event()
1904 memset(&log_buf->tlb_th, 0, sizeof(*th)); in tcp_log_event()
1909 log_buf->tlb_eventflags |= TLB_FLAG_VERBOSE; in tcp_log_event()
1911 strlcpy(log_verbose->tlv_snd_frm, output_caller, in tcp_log_event()
1914 *log_verbose->tlv_snd_frm = 0; in tcp_log_event()
1915 strlcpy(log_verbose->tlv_trace_func, func, TCP_FUNC_LEN); in tcp_log_event()
1916 log_verbose->tlv_trace_line = line; in tcp_log_event()
1920 STAILQ_INSERT_TAIL(&tp->t_logs, log_entry, tlm_queue); in tcp_log_event()
1939 while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL) in tcp_log_state_change()
1944 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_state_change()
1958 if (tp->t_lib == NULL || in tcp_log_state_change()
1959 tp->t_lib->tlb_logstate != TCP_LOG_STATE_RATIO_OFF) { in tcp_log_state_change()
1960 tp->_t_logstate = state; in tcp_log_state_change()
1963 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_state_change()
1972 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_state_change()
1975 tp->t_flags2 &= ~(TF2_LOG_AUTO); in tcp_log_state_change()
1988 if ((target = tp->t_lognum / 2) == 0) in tcp_log_drain()
2002 * since I don't think the mbuf <-> BB log cleanup in tcp_log_drain()
2010 if (tp->_t_logstate == TCP_LOG_STATE_HEAD) { in tcp_log_drain()
2011 skip = tp->t_lognum - target; in tcp_log_drain()
2012 STAILQ_FOREACH(log_entry, &tp->t_logs, tlm_queue) in tcp_log_drain()
2013 if (!--skip) in tcp_log_drain()
2020 STAILQ_REMOVE_AFTER(&tp->t_logs, log_entry, tlm_queue); in tcp_log_drain()
2024 target--; in tcp_log_drain()
2030 } else if (tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO) { in tcp_log_drain()
2031 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from head at drain", in tcp_log_drain()
2033 } else if (tp->_t_logstate == TCP_LOG_STATE_TAIL_AUTO) { in tcp_log_drain()
2034 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from tail at drain", in tcp_log_drain()
2036 } else if (tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) { in tcp_log_drain()
2037 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints", in tcp_log_drain()
2039 } else if (tp->_t_logstate == TCP_LOG_STATE_CONTINUAL) { in tcp_log_drain()
2040 (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual", in tcp_log_drain()
2043 while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL && in tcp_log_drain()
2044 target--) in tcp_log_drain()
2049 KASSERT(tp->t_lognum > 0, in tcp_log_drain()
2050 ("%s: After removing from head, tp->t_lognum was %d", in tcp_log_drain()
2062 if (sopt->sopt_td != NULL) in tcp_log_copyout()
2082 out_entry = (struct tcp_log_buffer *) sopt->sopt_val; in tcp_log_logs_to_buf()
2084 count--; in tcp_log_logs_to_buf()
2099 if (log_entry->tlm_buf.tlb_eventflags & TLB_FLAG_HDR) in tcp_log_logs_to_buf()
2103 error = tcp_log_copyout(sopt, &log_entry->tlm_buf, out_entry, in tcp_log_logs_to_buf()
2107 if (!(log_entry->tlm_buf.tlb_eventflags & TLB_FLAG_HDR)) { in tcp_log_logs_to_buf()
2110 sizeof(struct tcp_log_buffer) - entrysize); in tcp_log_logs_to_buf()
2117 if (log_entry->tlm_buf.tlb_eventflags & TLB_FLAG_VERBOSE) { in tcp_log_logs_to_buf()
2118 error = tcp_log_copyout(sopt, &log_entry->tlm_v, in tcp_log_logs_to_buf()
2119 out_entry->tlb_verbose, in tcp_log_logs_to_buf()
2166 if (sopt->sopt_valsize / (sizeof(struct tcp_log_buffer) + in tcp_log_getlogbuf()
2167 sizeof(struct tcp_log_verbose)) >= tp->t_lognum) { in tcp_log_getlogbuf()
2168 log_entry = STAILQ_LAST(&tp->t_logs, tcp_log_mem, tlm_queue); in tcp_log_getlogbuf()
2171 outnum = tp->t_lognum; in tcp_log_getlogbuf()
2176 STAILQ_FOREACH(log_next, &tp->t_logs, tlm_queue) { in tcp_log_getlogbuf()
2178 if (log_next->tlm_buf.tlb_eventflags & in tcp_log_getlogbuf()
2181 if ((sopt->sopt_valsize - outsize) < entrysize) in tcp_log_getlogbuf()
2187 KASSERT(outsize <= sopt->sopt_valsize, in tcp_log_getlogbuf()
2189 "space (%zu)", __func__, outsize, sopt->sopt_valsize)); in tcp_log_getlogbuf()
2195 * Copy traditional sooptcopyout() behavior: if sopt->sopt_val in tcp_log_getlogbuf()
2201 if (sopt->sopt_val == NULL) { in tcp_log_getlogbuf()
2207 if (sopt->sopt_valsize > outsize) in tcp_log_getlogbuf()
2208 sopt->sopt_valsize = outsize; in tcp_log_getlogbuf()
2223 * need to update the list book-keeping entries. in tcp_log_getlogbuf()
2227 KASSERT(outnum == tp->t_lognum, in tcp_log_getlogbuf()
2228 ("%s:%d: outnum (%d) should match tp->t_lognum (%d)", in tcp_log_getlogbuf()
2229 __func__, __LINE__, outnum, tp->t_lognum)); in tcp_log_getlogbuf()
2230 log_tailq = tp->t_logs; in tcp_log_getlogbuf()
2231 tp->t_lognum = 0; in tcp_log_getlogbuf()
2232 STAILQ_INIT(&tp->t_logs); in tcp_log_getlogbuf()
2235 KASSERT(outnum < tp->t_lognum, in tcp_log_getlogbuf()
2236 ("%s:%d: outnum (%d) not less than tp->t_lognum (%d)", in tcp_log_getlogbuf()
2237 __func__, __LINE__, outnum, tp->t_lognum)); in tcp_log_getlogbuf()
2238 STAILQ_FIRST(&log_tailq) = STAILQ_FIRST(&tp->t_logs); in tcp_log_getlogbuf()
2239 STAILQ_FIRST(&tp->t_logs) = STAILQ_NEXT(log_entry, tlm_queue); in tcp_log_getlogbuf()
2241 ("%s:%d: tp->t_logs is unexpectedly shorter than expected" in tcp_log_getlogbuf()
2242 "(tp: %p, log_tailq: %p, outnum: %d, tp->t_lognum: %d)", in tcp_log_getlogbuf()
2243 __func__, __LINE__, tp, &log_tailq, outnum, tp->t_lognum)); in tcp_log_getlogbuf()
2246 tp->t_lognum -= outnum; in tcp_log_getlogbuf()
2259 if ((inp->inp_flags & INP_DROPPED) == 0) { in tcp_log_getlogbuf()
2263 STAILQ_CONCAT(&log_tailq, &tp->t_logs); in tcp_log_getlogbuf()
2264 tp->t_logs = log_tailq; in tcp_log_getlogbuf()
2265 tp->t_lognum += outnum; in tcp_log_getlogbuf()
2270 KASSERT(((caddr_t)out_entry - (caddr_t)sopt->sopt_val) == in tcp_log_getlogbuf()
2273 (size_t)((caddr_t)out_entry - (caddr_t)sopt->sopt_val), in tcp_log_getlogbuf()
2283 sopt->sopt_valsize = (size_t)((caddr_t)out_entry - in tcp_log_getlogbuf()
2284 (caddr_t)sopt->sopt_val); in tcp_log_getlogbuf()
2300 tcp_log_free_entries(&entry->tldl_entries, &entry->tldl_count); in tcp_log_free_queue()
2303 if (entry->tldl_common.tldq_buf != NULL) in tcp_log_free_queue()
2304 free(entry->tldl_common.tldq_buf, M_TCPLOGDEV); in tcp_log_free_queue()
2321 /* Take a worst-case guess at space needs. */ in tcp_log_expandlogbuf()
2323 entry->tldl_count * (sizeof(struct tcp_log_buffer) + in tcp_log_expandlogbuf()
2328 counter_u64_add(tcp_log_que_fail5, entry->tldl_count); in tcp_log_expandlogbuf()
2333 sopt.sopt_valsize -= sizeof(struct tcp_log_header); in tcp_log_expandlogbuf()
2336 error = tcp_log_logs_to_buf(&sopt, &entry->tldl_entries, in tcp_log_expandlogbuf()
2337 (struct tcp_log_buffer **)&end, entry->tldl_count); in tcp_log_expandlogbuf()
2344 tcp_log_free_entries(&entry->tldl_entries, &entry->tldl_count); in tcp_log_expandlogbuf()
2345 entry->tldl_count = 0; in tcp_log_expandlogbuf()
2348 hdr->tlh_version = TCP_LOG_BUF_VER; in tcp_log_expandlogbuf()
2349 hdr->tlh_type = TCP_LOG_DEV_TYPE_BBR; in tcp_log_expandlogbuf()
2350 hdr->tlh_length = end - (uint8_t *)hdr; in tcp_log_expandlogbuf()
2351 hdr->tlh_ie = entry->tldl_ie; in tcp_log_expandlogbuf()
2352 hdr->tlh_af = entry->tldl_af; in tcp_log_expandlogbuf()
2353 getboottime(&hdr->tlh_offset); in tcp_log_expandlogbuf()
2354 strlcpy(hdr->tlh_id, entry->tldl_id, TCP_LOG_ID_LEN); in tcp_log_expandlogbuf()
2355 strlcpy(hdr->tlh_tag, entry->tldl_tag, TCP_LOG_TAG_LEN); in tcp_log_expandlogbuf()
2356 strlcpy(hdr->tlh_reason, entry->tldl_reason, TCP_LOG_REASON_LEN); in tcp_log_expandlogbuf()
2368 * If force is false, this will only dump auto-logged sessions if
2383 if (tp->t_lognum == 0) in tcp_log_dump_tp_logbuf()
2387 if (tp->t_lib == NULL && (tp->t_flags2 & TF2_LOG_AUTO) && in tcp_log_dump_tp_logbuf()
2397 while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL) in tcp_log_dump_tp_logbuf()
2399 KASSERT(tp->t_lognum == 0, in tcp_log_dump_tp_logbuf()
2400 ("%s: After freeing entries, tp->t_lognum=%d (expected 0)", in tcp_log_dump_tp_logbuf()
2401 __func__, tp->t_lognum)); in tcp_log_dump_tp_logbuf()
2402 tp->_t_logstate = TCP_LOG_STATE_OFF; in tcp_log_dump_tp_logbuf()
2425 * Note that this check is slightly overly-restrictive in in tcp_log_dump_tp_logbuf()
2432 if (inp->inp_flags & INP_DROPPED) { in tcp_log_dump_tp_logbuf()
2440 if (tp->t_lognum == 0) { in tcp_log_dump_tp_logbuf()
2447 if (tp->t_lib != NULL) { in tcp_log_dump_tp_logbuf()
2448 strlcpy(entry->tldl_id, tp->t_lib->tlb_id, TCP_LOG_ID_LEN); in tcp_log_dump_tp_logbuf()
2449 strlcpy(entry->tldl_tag, tp->t_lib->tlb_tag, TCP_LOG_TAG_LEN); in tcp_log_dump_tp_logbuf()
2451 strlcpy(entry->tldl_id, "UNKNOWN", TCP_LOG_ID_LEN); in tcp_log_dump_tp_logbuf()
2452 strlcpy(entry->tldl_tag, "UNKNOWN", TCP_LOG_TAG_LEN); in tcp_log_dump_tp_logbuf()
2455 strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); in tcp_log_dump_tp_logbuf()
2457 strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_REASON_LEN); in tcp_log_dump_tp_logbuf()
2458 entry->tldl_ie = inp->inp_inc.inc_ie; in tcp_log_dump_tp_logbuf()
2459 if (inp->inp_inc.inc_flags & INC_ISIPV6) in tcp_log_dump_tp_logbuf()
2460 entry->tldl_af = AF_INET6; in tcp_log_dump_tp_logbuf()
2462 entry->tldl_af = AF_INET; in tcp_log_dump_tp_logbuf()
2463 entry->tldl_entries = tp->t_logs; in tcp_log_dump_tp_logbuf()
2464 entry->tldl_count = tp->t_lognum; in tcp_log_dump_tp_logbuf()
2467 entry->tldl_common.tldq_buf = NULL; in tcp_log_dump_tp_logbuf()
2468 entry->tldl_common.tldq_xform = tcp_log_expandlogbuf; in tcp_log_dump_tp_logbuf()
2469 entry->tldl_common.tldq_dtor = tcp_log_free_queue; in tcp_log_dump_tp_logbuf()
2473 num_entries = tp->t_lognum; in tcp_log_dump_tp_logbuf()
2475 tp->t_lognum = 0; in tcp_log_dump_tp_logbuf()
2476 STAILQ_INIT(&tp->t_logs); in tcp_log_dump_tp_logbuf()
2507 tlb = tln->tln_bucket; in tcp_log_dump_node_logbuf()
2509 KASSERT(tlb->tlb_refcnt > 0, in tcp_log_dump_node_logbuf()
2512 KASSERT(tln->tln_closed, in tcp_log_dump_node_logbuf()
2517 if (tln->tln_count == 0) in tcp_log_dump_node_logbuf()
2537 entry->tldl_common.tldq_buf = NULL; in tcp_log_dump_node_logbuf()
2538 entry->tldl_common.tldq_xform = tcp_log_expandlogbuf; in tcp_log_dump_node_logbuf()
2539 entry->tldl_common.tldq_dtor = tcp_log_free_queue; in tcp_log_dump_node_logbuf()
2542 strlcpy(entry->tldl_id, tlb->tlb_id, TCP_LOG_ID_LEN); in tcp_log_dump_node_logbuf()
2543 strlcpy(entry->tldl_tag, tlb->tlb_tag, TCP_LOG_TAG_LEN); in tcp_log_dump_node_logbuf()
2545 strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); in tcp_log_dump_node_logbuf()
2547 strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_REASON_LEN); in tcp_log_dump_node_logbuf()
2548 entry->tldl_ie = tln->tln_ie; in tcp_log_dump_node_logbuf()
2549 entry->tldl_entries = tln->tln_entries; in tcp_log_dump_node_logbuf()
2550 entry->tldl_count = tln->tln_count; in tcp_log_dump_node_logbuf()
2551 entry->tldl_af = tln->tln_af; in tcp_log_dump_node_logbuf()
2598 SLIST_FOREACH_SAFE(cur_tln, &tlb->tlb_head, tln_list, tmp_tln) { in tcp_log_dumpbucketlogs()
2605 if (cur_tln->tln_closed) { in tcp_log_dumpbucketlogs()
2621 KASSERT(cur_tln->tln_expiretime > (sbintime_t) 0, in tcp_log_dumpbucketlogs()
2624 if (cur_tln->tln_expiretime == SBT_MAX) { in tcp_log_dumpbucketlogs()
2637 SLIST_REMOVE_HEAD(&tlb->tlb_head, tln_list); in tcp_log_dumpbucketlogs()
2641 * lock-ordering rules, we need to drop the expire in tcp_log_dumpbucketlogs()
2648 INP_WLOCK(cur_tln->tln_inp); in tcp_log_dumpbucketlogs()
2649 if (!in_pcbrele_wlocked(cur_tln->tln_inp)) in tcp_log_dumpbucketlogs()
2650 INP_WUNLOCK(cur_tln->tln_inp); in tcp_log_dumpbucketlogs()
2661 tcp_log_free_entries(&cur_tln->tln_entries, in tcp_log_dumpbucketlogs()
2662 &cur_tln->tln_count); in tcp_log_dumpbucketlogs()
2679 &cur_tln->tln_entries, in tcp_log_dumpbucketlogs()
2680 &cur_tln->tln_count); in tcp_log_dumpbucketlogs()
2708 /* Lock the INP and then re-check the state. */ in tcp_log_dumpbucketlogs()
2709 inp = cur_tln->tln_inp; in tcp_log_dumpbucketlogs()
2717 if (cur_tln->tln_closed) { in tcp_log_dumpbucketlogs()
2731 tp = cur_tln->tln_tp; in tcp_log_dumpbucketlogs()
2813 tlb = tp->t_lib; in tcp_log_dump_tp_bucket_logbufs()
2847 * stack-specific info to this trace event by overriding this
2853 if (tp->_t_logstate != TCP_LOG_STATE_OFF) { in tcp_log_flowend()
2855 TCP_LOG_EVENT(tp, NULL, &so->so_rcv, &so->so_snd, in tcp_log_flowend()
2875 if ((inp->inp_flags & INP_DROPPED) || in tcp_log_sendfile()
2876 (tp->_t_logstate == TCP_LOG_STATE_OFF)) { in tcp_log_sendfile()
2882 if (inp->inp_flags & INP_DROPPED) in tcp_log_sendfile()
2895 &tptosocket(tp)->so_rcv, in tcp_log_sendfile()
2896 &tptosocket(tp)->so_snd, in tcp_log_sendfile()
2900 if (tp->t_tcpreq_req == 0) { in tcp_log_sendfile()
2905 if (tp->t_tcpreq_closed == 0) { in tcp_log_sendfile()
2911 ent = &tp->t_tcpreq_info[i]; in tcp_log_sendfile()
2912 if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) { in tcp_log_sendfile()
2916 if (ent->flags & TCP_TRK_TRACK_FLG_OPEN) { in tcp_log_sendfile()
2920 if (ent->flags & TCP_TRK_TRACK_FLG_COMP) { in tcp_log_sendfile()
2925 if ((ent->start == offset) || in tcp_log_sendfile()
2926 ((offset > ent->start) && (offset < ent->end))){ in tcp_log_sendfile()
2934 ent->flags |= TCP_TRK_TRACK_FLG_SEQV; in tcp_log_sendfile()
2939 * we must use sb_ccc since the data may still be in-flight in TLS. in tcp_log_sendfile()
2946 if (SEQ_GT((tp->snd_una + so->so_snd.sb_ccc), ent->end_seq)) in tcp_log_sendfile()
2947 ent->end_seq = tp->snd_una + so->so_snd.sb_ccc; in tcp_log_sendfile()
2948 if ((offset + nbytes) >= ent->end) { in tcp_log_sendfile()
2949 ent->flags |= TCP_TRK_TRACK_FLG_COMP; in tcp_log_sendfile()
2962 ent = &tp->t_tcpreq_info[i]; in tcp_log_sendfile()
2963 if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) { in tcp_log_sendfile()
2967 if ((ent->flags & TCP_TRK_TRACK_FLG_OPEN) == 0) in tcp_log_sendfile()
2970 if (ent->start == offset) { in tcp_log_sendfile()
2972 ent->start_seq = tp->snd_una + in tcp_log_sendfile()
2973 tptosocket(tp)->so_snd.sb_ccc; in tcp_log_sendfile()
2974 ent->flags |= TCP_TRK_TRACK_FLG_SEQV; in tcp_log_sendfile()
2976 } else if (offset > ent->start) { in tcp_log_sendfile()
2977 ent->flags |= TCP_TRK_TRACK_FLG_SEQV; in tcp_log_sendfile()
3007 if ((tlm_buf->tlb_eventflags & TLB_FLAG_HDR) == 0) { in db_print_tcphdr()
3010 th = &tlm_buf->tlb_th; in db_print_tcphdr()
3039 db_printf(" %u:%u(%u)", ntohl(th->th_seq), in db_print_tcphdr()
3040 ntohl(th->th_seq) + tlm_buf->tlb_len, tlm_buf->tlb_len); in db_print_tcphdr()
3042 db_printf(" ack %u", ntohl(th->th_ack)); in db_print_tcphdr()
3044 db_printf(" win %u", ntohs(th->th_win)); in db_print_tcphdr()
3046 db_printf(" urg %u", ntohs(th->th_urp)); in db_print_tcphdr()
3048 cnt = (th->th_off << 2) - sizeof(struct tcphdr); in db_print_tcphdr()
3052 opt = tlm_buf->tlb_opts[i]; in db_print_tcphdr()
3056 if (cnt - i < 2) { in db_print_tcphdr()
3059 optlen = tlm_buf->tlb_opts[i + 1]; in db_print_tcphdr()
3060 if (optlen < 2 || optlen > cnt - i) { in db_print_tcphdr()
3078 bcopy(tlm_buf->tlb_opts + i + 2, &mss, in db_print_tcphdr()
3087 tlm_buf->tlb_opts[i + 2]); in db_print_tcphdr()
3097 (optlen - 2) % TCPOLEN_SACK != 0) { in db_print_tcphdr()
3100 num_sacks = (optlen - 2) / TCPOLEN_SACK; in db_print_tcphdr()
3103 bcopy(tlm_buf->tlb_opts + i + 2 + in db_print_tcphdr()
3114 bcopy(tlm_buf->tlb_opts + i + 2, &val, in db_print_tcphdr()
3116 bcopy(tlm_buf->tlb_opts + i + 6, &ecr, in db_print_tcphdr()
3126 for (j = 0; j < optlen - 2; j++) { in db_print_tcphdr()
3128 tlm_buf->tlb_opts[i + 2 + j]); in db_print_tcphdr()
3136 for (j = 0; j < optlen - 2; j++) { in db_print_tcphdr()
3138 tlm_buf->tlb_opts[i + 2 + j]); in db_print_tcphdr()
3152 switch (tlm_buf->tlb_flex1) { in db_print_pru()
3232 db_printf("Unknown PRU (%u)", tlm_buf->tlb_flex1); in db_print_pru()
3235 if (tlm_buf->tlb_errno >= 0) { in db_print_pru()
3236 db_printf(", error: %d", tlm_buf->tlb_errno); in db_print_pru()
3246 what = (tlm_buf->tlb_flex1 & 0xffffff00) >> 8; in db_print_rto()
3247 which = tlm_buf->tlb_flex1 & 0x000000ff; in db_print_rto()
3287 db_printf(": %u ms", tlm_buf->tlb_flex2); in db_print_rto()
3294 if ((tlm_buf->tlb_eventflags & TLB_FLAG_RXBUF) == 0) { in db_print_usersend()
3297 if ((tlm_buf->tlb_eventflags & TLB_FLAG_TXBUF) == 0) { in db_print_usersend()
3301 tlm_buf->tlb_rxbuf.tls_sb_acc, tlm_buf->tlb_rxbuf.tls_sb_ccc, in db_print_usersend()
3302 tlm_buf->tlb_txbuf.tls_sb_acc, tlm_buf->tlb_txbuf.tls_sb_ccc); in db_print_usersend()
3316 tlm_buf = &log_entry->tlm_buf; in db_print_bblog_entries()
3320 delta_t = sbttoms(tvtosbt(tlm_buf->tlb_tv) - in db_print_bblog_entries()
3321 tvtosbt(prev_tlm_buf->tlb_tv)); in db_print_bblog_entries()
3325 switch (tlm_buf->tlb_eventid) { in db_print_bblog_entries()