FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/arb.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/qmath.h>
#include <sys/queue.h>
#include <sys/refcount.h>
#include <sys/rwlock.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/tree.h>
#include <sys/stats.h>
#include <sys/counter.h>
#include <dev/tcp_log/tcp_log_dev.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/in_pcb.h>
#include <netinet/in_var.h>
#include <netinet/tcp_var.h>
#include <netinet/tcp_log_buf.h>
Go to the source code of this file.
Data Structures | |
struct | tcp_log_id_bucket |
struct | tcp_log_id_node |
Macros | |
#define | TCP_LOG_EXPIRE_TIME ((sbintime_t)60 * SBT_1S) |
#define | TCP_LOG_EXPIRE_INTVL ((sbintime_t)5 * SBT_1S) |
#define | ACTIVE_REQUEST_COUNT 10 |
#define | TCPID_TREE_WLOCK() rw_wlock(&tcp_id_tree_lock) |
#define | TCPID_TREE_RLOCK() rw_rlock(&tcp_id_tree_lock) |
#define | TCPID_TREE_UPGRADE() rw_try_upgrade(&tcp_id_tree_lock) |
#define | TCPID_TREE_WUNLOCK() rw_wunlock(&tcp_id_tree_lock) |
#define | TCPID_TREE_RUNLOCK() rw_runlock(&tcp_id_tree_lock) |
#define | TCPID_TREE_WLOCK_ASSERT() rw_assert(&tcp_id_tree_lock, RA_WLOCKED) |
#define | TCPID_TREE_RLOCK_ASSERT() rw_assert(&tcp_id_tree_lock, RA_RLOCKED) |
#define | TCPID_TREE_UNLOCK_ASSERT() rw_assert(&tcp_id_tree_lock, RA_UNLOCKED) |
#define | TCPID_BUCKET_LOCK_INIT(tlb) mtx_init(&((tlb)->tlb_mtx), "tcp log id bucket", NULL, MTX_DEF) |
#define | TCPID_BUCKET_LOCK_DESTROY(tlb) mtx_destroy(&((tlb)->tlb_mtx)) |
#define | TCPID_BUCKET_LOCK(tlb) mtx_lock(&((tlb)->tlb_mtx)) |
#define | TCPID_BUCKET_UNLOCK(tlb) mtx_unlock(&((tlb)->tlb_mtx)) |
#define | TCPID_BUCKET_LOCK_ASSERT(tlb) mtx_assert(&((tlb)->tlb_mtx), MA_OWNED) |
#define | TCPID_BUCKET_UNLOCK_ASSERT(tlb) mtx_assert(&((tlb)->tlb_mtx), MA_NOTOWNED) |
#define | TCPID_BUCKET_REF(tlb) refcount_acquire(&((tlb)->tlb_refcnt)) |
#define | TCPID_BUCKET_UNREF(tlb) refcount_release(&((tlb)->tlb_refcnt)) |
#define | TCPLOG_EXPIREQ_LOCK() mtx_lock(&tcp_log_expireq_mtx) |
#define | TCPLOG_EXPIREQ_UNLOCK() mtx_unlock(&tcp_log_expireq_mtx) |
#define | RECHECK_INP_CLEAN(cleanup) |
#define | RECHECK_INP() RECHECK_INP_CLEAN(/* noop */) |
#define | FREE_NEW_TLB() |
#define | tcp_log_entry_refcnt_add(l) |
#define | tcp_log_entry_refcnt_rem(l) |
#define | COPY_STAT(f) log_buf->tlb_ ## f = tp->f |
#define | COPY_STAT_T(f) log_buf->tlb_ ## f = tp->t_ ## f |
#define | LOCAL_SAVE 10 |
Enumerations | |
enum | tree_lock_state { TREE_UNLOCKED = 0 , TREE_RLOCKED , TREE_WLOCKED } |
Functions | |
__FBSDID ("$FreeBSD$") | |
RB_HEAD (tcp_log_id_tree, tcp_log_id_bucket) | |
static | STAILQ_HEAD (tcp_log_id_node) |
SLIST_HEAD (tcp_log_id_head, tcp_log_id_node) | |
static __inline bool | tcp_log_selectauto (void) |
static __inline int | tcp_log_id_cmp (struct tcp_log_id_bucket *a, struct tcp_log_id_bucket *b) |
static __inline void | tcp_log_id_validate_tree_lock (int tree_locked) |
static __inline void | tcp_log_remove_bucket (struct tcp_log_id_bucket *tlb) |
static bool | tcp_log_unref_bucket (struct tcp_log_id_bucket *tlb, int *tree_locked, struct inpcb *inp) |
static bool | tcp_log_remove_id_node (struct inpcb *inp, struct tcpcb *tp, struct tcp_log_id_bucket *tlb, struct tcp_log_id_node *tln, int *tree_locked) |
static void | tcp_log_grow_tlb (char *tlb_id, struct tcpcb *tp) |
static void | tcp_log_increment_reqcnt (struct tcp_log_id_bucket *tlb) |
int | tcp_log_set_tag (struct tcpcb *tp, char *tag) |
int | tcp_log_set_id (struct tcpcb *tp, char *id) |
size_t | tcp_log_get_id (struct tcpcb *tp, char *buf) |
size_t | tcp_log_get_tag (struct tcpcb *tp, char *buf) |
u_int | tcp_log_get_id_cnt (struct tcpcb *tp) |
static void | tcp_log_free_log_common (struct tcp_log_mem *log_entry, int *count __unused) |
static void | tcp_log_free_entries (struct tcp_log_stailq *head, int *count) |
static void | tcp_log_remove_log_cleanup (struct tcpcb *tp, struct tcp_log_mem *log_entry) |
static void | tcp_log_remove_log_head (struct tcpcb *tp, struct tcp_log_mem *log_entry) |
void | tcp_log_init (void) |
void | tcp_log_tcpcbinit (struct tcpcb *tp) |
static void | tcp_log_expire (void *unused __unused) |
static void | tcp_log_move_tp_to_node (struct tcpcb *tp, struct tcp_log_id_node *tln) |
void | tcp_log_tcpcbfini (struct tcpcb *tp) |
static void | tcp_log_purge_tp_logbuf (struct tcpcb *tp) |
struct tcp_log_buffer * | tcp_log_event_ (struct tcpcb *tp, struct tcphdr *th, struct sockbuf *rxbuf, struct sockbuf *txbuf, uint8_t eventid, int errornum, uint32_t len, union tcp_log_stackspecific *stackinfo, int th_hostorder, const char *output_caller, const char *func, int line, const struct timeval *itv) |
int | tcp_log_state_change (struct tcpcb *tp, int state) |
void | tcp_log_drain (struct tcpcb *tp) |
static int | tcp_log_copyout (struct sockopt *sopt, void *src, void *dst, size_t len) |
static int | tcp_log_logs_to_buf (struct sockopt *sopt, struct tcp_log_stailq *log_tailqp, struct tcp_log_buffer **end, int count) |
int | tcp_log_getlogbuf (struct sockopt *sopt, struct tcpcb *tp) |
static void | tcp_log_free_queue (struct tcp_log_dev_queue *param) |
static struct tcp_log_common_header * | tcp_log_expandlogbuf (struct tcp_log_dev_queue *param) |
int | tcp_log_dump_tp_logbuf (struct tcpcb *tp, char *reason, int how, bool force) |
static int | tcp_log_dump_node_logbuf (struct tcp_log_id_node *tln, char *reason, int how) |
static void | tcp_log_dumpbucketlogs (struct tcp_log_id_bucket *tlb, char *reason) |
void | tcp_log_dump_tp_bucket_logbufs (struct tcpcb *tp, char *reason) |
void | tcp_log_flowend (struct tcpcb *tp) |
Variables | |
bool | tcp_log_verbose |
static uma_zone_t | tcp_log_bucket_zone |
static uma_zone_t | tcp_log_node_zone |
static uma_zone_t | tcp_log_zone |
static int | tcp_log_session_limit = TCP_LOG_BUF_DEFAULT_SESSION_LIMIT |
static uint32_t | tcp_log_version = TCP_LOG_BUF_VER |
static struct tcp_log_id_tree | tcp_log_id_head |
static uint8_t | zerobuf [76] |
static struct rwlock | tcp_id_tree_lock |
#define ACTIVE_REQUEST_COUNT 10 |
#define COPY_STAT | ( | f | ) | log_buf->tlb_ ## f = tp->f |
#define COPY_STAT_T | ( | f | ) | log_buf->tlb_ ## f = tp->t_ ## f |
#define FREE_NEW_TLB | ( | ) |
#define LOCAL_SAVE 10 |
Definition at line 2348 of file tcp_log_buf.c.
#define RECHECK_INP | ( | ) | RECHECK_INP_CLEAN(/* noop */) |
Definition at line 496 of file tcp_log_buf.c.
#define RECHECK_INP_CLEAN | ( | cleanup | ) |
Definition at line 487 of file tcp_log_buf.c.
#define tcp_log_entry_refcnt_add | ( | l | ) |
Definition at line 1032 of file tcp_log_buf.c.
#define tcp_log_entry_refcnt_rem | ( | l | ) |
Definition at line 1033 of file tcp_log_buf.c.
#define TCP_LOG_EXPIRE_INTVL ((sbintime_t)5 * SBT_1S) |
Definition at line 65 of file tcp_log_buf.c.
#define TCP_LOG_EXPIRE_TIME ((sbintime_t)60 * SBT_1S) |
Definition at line 62 of file tcp_log_buf.c.
#define TCPID_BUCKET_LOCK | ( | tlb | ) | mtx_lock(&((tlb)->tlb_mtx)) |
Definition at line 240 of file tcp_log_buf.c.
#define TCPID_BUCKET_LOCK_ASSERT | ( | tlb | ) | mtx_assert(&((tlb)->tlb_mtx), MA_OWNED) |
Definition at line 242 of file tcp_log_buf.c.
#define TCPID_BUCKET_LOCK_DESTROY | ( | tlb | ) | mtx_destroy(&((tlb)->tlb_mtx)) |
Definition at line 239 of file tcp_log_buf.c.
#define TCPID_BUCKET_LOCK_INIT | ( | tlb | ) | mtx_init(&((tlb)->tlb_mtx), "tcp log id bucket", NULL, MTX_DEF) |
Definition at line 238 of file tcp_log_buf.c.
#define TCPID_BUCKET_REF | ( | tlb | ) | refcount_acquire(&((tlb)->tlb_refcnt)) |
Definition at line 245 of file tcp_log_buf.c.
#define TCPID_BUCKET_UNLOCK | ( | tlb | ) | mtx_unlock(&((tlb)->tlb_mtx)) |
Definition at line 241 of file tcp_log_buf.c.
#define TCPID_BUCKET_UNLOCK_ASSERT | ( | tlb | ) | mtx_assert(&((tlb)->tlb_mtx), MA_NOTOWNED) |
Definition at line 243 of file tcp_log_buf.c.
#define TCPID_BUCKET_UNREF | ( | tlb | ) | refcount_release(&((tlb)->tlb_refcnt)) |
Definition at line 246 of file tcp_log_buf.c.
#define TCPID_TREE_RLOCK | ( | ) | rw_rlock(&tcp_id_tree_lock) |
Definition at line 230 of file tcp_log_buf.c.
#define TCPID_TREE_RLOCK_ASSERT | ( | ) | rw_assert(&tcp_id_tree_lock, RA_RLOCKED) |
Definition at line 235 of file tcp_log_buf.c.
#define TCPID_TREE_RUNLOCK | ( | ) | rw_runlock(&tcp_id_tree_lock) |
Definition at line 233 of file tcp_log_buf.c.
#define TCPID_TREE_UNLOCK_ASSERT | ( | ) | rw_assert(&tcp_id_tree_lock, RA_UNLOCKED) |
Definition at line 236 of file tcp_log_buf.c.
#define TCPID_TREE_UPGRADE | ( | ) | rw_try_upgrade(&tcp_id_tree_lock) |
Definition at line 231 of file tcp_log_buf.c.
#define TCPID_TREE_WLOCK | ( | ) | rw_wlock(&tcp_id_tree_lock) |
Definition at line 229 of file tcp_log_buf.c.
#define TCPID_TREE_WLOCK_ASSERT | ( | ) | rw_assert(&tcp_id_tree_lock, RA_WLOCKED) |
Definition at line 234 of file tcp_log_buf.c.
#define TCPID_TREE_WUNLOCK | ( | ) | rw_wunlock(&tcp_id_tree_lock) |
Definition at line 232 of file tcp_log_buf.c.
#define TCPLOG_EXPIREQ_LOCK | ( | ) | mtx_lock(&tcp_log_expireq_mtx) |
Definition at line 248 of file tcp_log_buf.c.
#define TCPLOG_EXPIREQ_UNLOCK | ( | ) | mtx_unlock(&tcp_log_expireq_mtx) |
Definition at line 249 of file tcp_log_buf.c.
enum tree_lock_state |
Enumerator | |
---|---|
TREE_UNLOCKED | |
TREE_RLOCKED | |
TREE_WLOCKED |
Definition at line 293 of file tcp_log_buf.c.
__FBSDID | ( | "$FreeBSD$" | ) |
RB_HEAD | ( | tcp_log_id_tree | , |
tcp_log_id_bucket | |||
) |
SLIST_HEAD | ( | tcp_log_id_head | , |
tcp_log_id_node | |||
) |
|
static |
Definition at line 73 of file tcp_log_buf.c.
|
inlinestatic |
Definition at line 1838 of file tcp_log_buf.c.
Referenced by tcp_log_logs_to_buf().
void tcp_log_drain | ( | struct tcpcb * | tp | ) |
Definition at line 1783 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, next, tcpcb::t_inpcb, tcpcb::t_lognum, tcpcb::t_logs, tcpcb::t_logstate, tcp_log_dump_tp_logbuf(), tcp_log_entry_refcnt_rem, tcp_log_remove_log_cleanup(), tcp_log_remove_log_head(), TCP_LOG_STATE_CONTINUAL, TCP_LOG_STATE_HEAD, and TCP_LOG_STATE_HEAD_AUTO.
Referenced by tcp_drain().
|
static |
Definition at line 2283 of file tcp_log_buf.c.
References tcp_log_expandlogbuf(), tcp_log_free_queue(), TCP_LOG_REASON_LEN, TCP_LOG_TAG_LEN, TCPID_BUCKET_LOCK, TCPID_BUCKET_LOCK_ASSERT, TCPID_BUCKET_UNLOCK, tcp_log_id_bucket::tlb_id, and tcp_log_id_bucket::tlb_tag.
Referenced by tcp_log_dumpbucketlogs().
void tcp_log_dump_tp_bucket_logbufs | ( | struct tcpcb * | tp, |
char * | reason | ||
) |
Definition at line 2586 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, INP_WUNLOCK, tcpcb::t_inpcb, tcpcb::t_lib, tcp_log_dump_tp_logbuf(), tcp_log_dumpbucketlogs(), tcp_log_unref_bucket(), TCPID_BUCKET_LOCK, TCPID_BUCKET_REF, TCPID_TREE_RUNLOCK, TCPID_TREE_WUNLOCK, TREE_RLOCKED, TREE_UNLOCKED, and TREE_WLOCKED.
Referenced by tcp_default_ctloutput().
int tcp_log_dump_tp_logbuf | ( | struct tcpcb * | tp, |
char * | reason, | ||
int | how, | ||
bool | force | ||
) |
Definition at line 2152 of file tcp_log_buf.c.
References in_conninfo::inc_flags, in_conninfo::inc_ie, INC_ISIPV6, INP_DROPPED, inpcb::inp_flags, inpcb::inp_inc, INP_TIMEWAIT, INP_WLOCK, INP_WLOCK_ASSERT, INP_WUNLOCK, intotcpcb, tcpcb::t_flags2, tcpcb::t_inpcb, tcpcb::t_lib, tcpcb::t_lognum, tcpcb::t_logs, tcpcb::t_logstate, tcp_log_expandlogbuf(), tcp_log_free_queue(), TCP_LOG_REASON_LEN, tcp_log_remove_log_head(), TCP_LOG_STATE_OFF, TCP_LOG_TAG_LEN, TF2_LOG_AUTO, tcp_log_id_bucket::tlb_id, and tcp_log_id_bucket::tlb_tag.
Referenced by rack_timeout_tlp(), tcp_default_ctloutput(), tcp_log_drain(), tcp_log_dump_tp_bucket_logbufs(), tcp_log_dumpbucketlogs(), tcp_log_event_(), and tcp_log_tcpcbfini().
|
static |
Definition at line 2350 of file tcp_log_buf.c.
References in_pcbrele_wlocked(), INP_WLOCK, INP_WUNLOCK, LOCAL_SAVE, tcp_log_dump_node_logbuf(), tcp_log_dump_tp_logbuf(), tcp_log_free_entries(), tcp_log_move_tp_to_node(), tcp_log_node_zone, tcp_log_unref_bucket(), TCPID_BUCKET_LOCK_ASSERT, TCPID_BUCKET_REF, TCPID_BUCKET_UNLOCK, TCPID_TREE_RUNLOCK, TCPID_TREE_WUNLOCK, TCPLOG_EXPIREQ_LOCK, TCPLOG_EXPIREQ_UNLOCK, TREE_RLOCKED, TREE_UNLOCKED, and TREE_WLOCKED.
Referenced by tcp_log_dump_tp_bucket_logbufs().
struct tcp_log_buffer * tcp_log_event_ | ( | struct tcpcb * | tp, |
struct tcphdr * | th, | ||
struct sockbuf * | rxbuf, | ||
struct sockbuf * | txbuf, | ||
uint8_t | eventid, | ||
int | errornum, | ||
uint32_t | len, | ||
union tcp_log_stackspecific * | stackinfo, | ||
int | th_hostorder, | ||
const char * | output_caller, | ||
const char * | func, | ||
int | line, | ||
const struct timeval * | itv | ||
) |
Definition at line 1520 of file tcp_log_buf.c.
References COPY_STAT, COPY_STAT_T, INP_WLOCK_ASSERT, state, tcpcb::t_fb, tcpcb::t_flags2, tcpcb::t_inpcb, tcpcb::t_lib, tcpcb::t_loglimit, tcpcb::t_lognum, tcpcb::t_logs, tcpcb::t_logsn, tcpcb::t_logstate, tcp_fields_to_net(), TCP_FUNC_LEN, tcp_log_dump_tp_logbuf(), tcp_log_entry_refcnt_add, tcp_log_entry_refcnt_rem, tcp_log_purge_tp_logbuf(), tcp_log_state_change(), TCP_LOG_STATE_CLEAR, TCP_LOG_STATE_CONTINUAL, TCP_LOG_STATE_HEAD, TCP_LOG_STATE_HEAD_AUTO, TCP_LOG_STATE_OFF, TCP_LOG_STATE_TAIL, TCP_LOG_STATE_TAIL_AUTO, tcp_log_zone, TF2_LOG_AUTO, tcp_function_block::tfb_id, tcp_log_buffer::tlb_errno, tcp_log_buffer::tlb_eventflags, tcp_log_buffer::tlb_eventid, TLB_FLAG_HDR, TLB_FLAG_RXBUF, TLB_FLAG_STACKINFO, TLB_FLAG_TXBUF, TLB_FLAG_VERBOSE, tcp_log_buffer::tlb_flex1, tcp_log_buffer::tlb_flex2, tcp_log_buffer::tlb_len, tcp_log_buffer::tlb_opts, tcp_log_buffer::tlb_rxbuf, tcp_log_buffer::tlb_sn, tcp_log_buffer::tlb_stackid, tcp_log_buffer::tlb_stackinfo, tcp_log_buffer::tlb_th, tcp_log_buffer::tlb_ticks, tcp_log_buffer::tlb_tv, tcp_log_buffer::tlb_txbuf, tcp_log_sockbuf::tls_sb_acc, tcp_log_sockbuf::tls_sb_ccc, tcp_log_sockbuf::tls_sb_spare, tcp_log_verbose::tlv_snd_frm, tcp_log_verbose::tlv_trace_func, and tcp_log_verbose::tlv_trace_line.
Referenced by bbr_output_wtime(), rack_ack_received(), rack_do_compressed_ack_processing(), rack_do_segment_nounlock(), rack_fast_output(), rack_fast_rsm_output(), rack_log_fsb(), rack_output(), rack_post_recovery(), rack_set_cc_pacing(), rack_undo_cc_pacing(), and tcp_respond().
|
static |
Definition at line 2091 of file tcp_log_buf.c.
References TCP_LOG_BUF_VER, tcp_log_free_entries(), tcp_log_logs_to_buf(), TCP_LOG_REASON_LEN, and TCP_LOG_TAG_LEN.
Referenced by tcp_log_dump_node_logbuf(), and tcp_log_dump_tp_logbuf().
|
static |
Definition at line 1197 of file tcp_log_buf.c.
References in_pcbrele_wlocked(), INP_WLOCK, INP_WUNLOCK, tcp_log_expire(), TCP_LOG_EXPIRE_INTVL, tcp_log_free_entries(), tcp_log_id_validate_tree_lock(), tcp_log_node_zone, tcp_log_remove_id_node(), TCPID_BUCKET_LOCK, TCPID_TREE_RUNLOCK, TCPID_TREE_WUNLOCK, TCPLOG_EXPIREQ_LOCK, TCPLOG_EXPIREQ_UNLOCK, TREE_UNLOCKED, and TREE_WLOCKED.
Referenced by tcp_log_expire(), and tcp_log_tcpcbfini().
void tcp_log_flowend | ( | struct tcpcb * | tp | ) |
Definition at line 2631 of file tcp_log_buf.c.
References inpcb::inp_socket, tcpcb::t_inpcb, tcpcb::t_logstate, TCP_LOG_EVENT, TCP_LOG_FLOWEND, and TCP_LOG_STATE_OFF.
Referenced by rack_fini().
|
static |
Definition at line 1054 of file tcp_log_buf.c.
References count, tcp_log_entry_refcnt_rem, and tcp_log_free_log_common().
Referenced by tcp_log_dumpbucketlogs(), tcp_log_expandlogbuf(), tcp_log_expire(), and tcp_log_free_queue().
|
inlinestatic |
Definition at line 1042 of file tcp_log_buf.c.
References count, and tcp_log_zone.
Referenced by tcp_log_free_entries().
|
static |
Definition at line 2069 of file tcp_log_buf.c.
References tcp_log_free_entries().
Referenced by tcp_log_dump_node_logbuf(), and tcp_log_dump_tp_logbuf().
size_t tcp_log_get_id | ( | struct tcpcb * | tp, |
char * | buf | ||
) |
Definition at line 920 of file tcp_log_buf.c.
References INP_LOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_lib, and tcp_log_id_bucket::tlb_id.
Referenced by tcp_default_ctloutput(), and tcp_inptoxtp().
u_int tcp_log_get_id_cnt | ( | struct tcpcb * | tp | ) |
Definition at line 989 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, tcpcb::t_inpcb, and tcpcb::t_lib.
size_t tcp_log_get_tag | ( | struct tcpcb * | tp, |
char * | buf | ||
) |
Definition at line 944 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, INP_WUNLOCK, tcpcb::t_inpcb, tcpcb::t_lib, TCP_LOG_TAG_LEN, tcp_log_unref_bucket(), TCPID_BUCKET_LOCK, TCPID_BUCKET_REF, TCPID_BUCKET_UNLOCK, TCPID_TREE_RLOCK_ASSERT, TCPID_TREE_RUNLOCK, TCPID_TREE_UNLOCK_ASSERT, TCPID_TREE_WLOCK_ASSERT, TCPID_TREE_WUNLOCK, tcp_log_id_bucket::tlb_tag, TREE_RLOCKED, TREE_UNLOCKED, and TREE_WLOCKED.
int tcp_log_getlogbuf | ( | struct sockopt * | sopt, |
struct tcpcb * | tp | ||
) |
Definition at line 1927 of file tcp_log_buf.c.
References INP_DROPPED, inpcb::inp_flags, INP_TIMEWAIT, INP_WLOCK, INP_WLOCK_ASSERT, INP_WUNLOCK, intotcpcb, tcpcb::t_inpcb, tcpcb::t_lognum, tcpcb::t_logs, tcp_log_entry_refcnt_rem, tcp_log_logs_to_buf(), tcp_log_zone, and TLB_FLAG_VERBOSE.
Referenced by tcp_default_ctloutput().
|
static |
Definition at line 499 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_stats, and tcp_stats_sample_rollthedice().
Referenced by tcp_log_set_id().
|
static |
Definition at line 317 of file tcp_log_buf.c.
References tcp_log_id_bucket::tlb_id.
|
static |
Definition at line 327 of file tcp_log_buf.c.
References TCPID_TREE_RLOCK_ASSERT, TCPID_TREE_UNLOCK_ASSERT, TCPID_TREE_WLOCK_ASSERT, TREE_RLOCKED, TREE_UNLOCKED, and TREE_WLOCKED.
Referenced by tcp_log_expire(), tcp_log_remove_id_node(), tcp_log_set_id(), and tcp_log_unref_bucket().
|
static |
Definition at line 511 of file tcp_log_buf.c.
Referenced by tcp_log_set_id().
void tcp_log_init | ( | void | ) |
Definition at line 1138 of file tcp_log_buf.c.
References tcp_id_tree_lock, tcp_log_bucket_zone, TCP_LOG_BUF_DEFAULT_GLOBAL_LIMIT, tcp_log_node_zone, and tcp_log_zone.
Referenced by tcp_init().
|
static |
Definition at line 1848 of file tcp_log_buf.c.
References count, tcp_log_copyout(), TLB_FLAG_HDR, TLB_FLAG_VERBOSE, tcp_log_buffer::tlb_th, tcp_log_buffer::tlb_verbose, and zerobuf.
Referenced by tcp_log_expandlogbuf(), and tcp_log_getlogbuf().
|
static |
Definition at line 1298 of file tcp_log_buf.c.
References in_conninfo::inc_flags, in_conninfo::inc_ie, INC_ISIPV6, inpcb::inp_inc, INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_lib, tcpcb::t_lognum, and tcpcb::t_logs.
Referenced by tcp_log_dumpbucketlogs(), and tcp_log_tcpcbfini().
|
static |
Definition at line 1495 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_lognum, tcpcb::t_logs, tcpcb::t_logstate, tcp_log_remove_log_head(), and TCP_LOG_STATE_OFF.
Referenced by tcp_log_event_().
|
static |
Definition at line 349 of file tcp_log_buf.c.
References tcp_log_bucket_zone, tcp_log_id_head, TCPID_BUCKET_LOCK_DESTROY, and TCPID_TREE_WLOCK_ASSERT.
Referenced by tcp_log_unref_bucket().
|
static |
Definition at line 449 of file tcp_log_buf.c.
References tcpcb::t_lib, tcpcb::t_lin, tcp_log_id_validate_tree_lock(), tcp_log_unref_bucket(), TCPID_BUCKET_LOCK_ASSERT, and TCPID_BUCKET_UNLOCK.
Referenced by tcp_log_expire(), and tcp_log_set_id().
|
inlinestatic |
Definition at line 1068 of file tcp_log_buf.c.
References tcpcb::t_lognum, and tcp_log_zone.
Referenced by tcp_log_drain(), and tcp_log_remove_log_head().
|
inlinestatic |
Definition at line 1078 of file tcp_log_buf.c.
References tcpcb::t_logs, tcp_log_entry_refcnt_rem, and tcp_log_remove_log_cleanup().
Referenced by tcp_log_drain(), tcp_log_dump_tp_logbuf(), tcp_log_purge_tp_logbuf(), tcp_log_state_change(), and tcp_log_tcpcbfini().
|
static |
Definition at line 301 of file tcp_log_buf.c.
Referenced by tcp_log_set_id(), and tcp_log_tcpcbinit().
int tcp_log_set_id | ( | struct tcpcb * | tp, |
char * | id | ||
) |
Definition at line 561 of file tcp_log_buf.c.
References FREE_NEW_TLB, INP_UNLOCK_ASSERT, INP_WLOCK, INP_WLOCK_ASSERT, INP_WUNLOCK, RECHECK_INP, RECHECK_INP_CLEAN, tcpcb::t_inpcb, tcpcb::t_lib, tcpcb::t_lin, tcpcb::t_log_state_set, tcpcb::t_loglimit, tcpcb::t_logstate, tcp_log_bucket_zone, tcp_log_grow_tlb(), tcp_log_id_head, tcp_log_id_validate_tree_lock(), tcp_log_increment_reqcnt(), tcp_log_node_zone, tcp_log_remove_id_node(), tcp_log_selectauto(), TCP_LOG_STATE_OFF, tcp_log_unref_bucket(), TCPID_BUCKET_LOCK, TCPID_BUCKET_LOCK_ASSERT, TCPID_BUCKET_LOCK_INIT, TCPID_BUCKET_REF, TCPID_BUCKET_UNLOCK, TCPID_BUCKET_UNLOCK_ASSERT, TCPID_TREE_RLOCK, TCPID_TREE_RLOCK_ASSERT, TCPID_TREE_RUNLOCK, TCPID_TREE_UNLOCK_ASSERT, TCPID_TREE_UPGRADE, TCPID_TREE_WLOCK, TCPID_TREE_WLOCK_ASSERT, TCPID_TREE_WUNLOCK, tcp_log_id_bucket::tlb_id, tcp_log_id_bucket::tlb_tag, TREE_RLOCKED, TREE_UNLOCKED, and TREE_WLOCKED.
Referenced by tcp_default_ctloutput().
int tcp_log_set_tag | ( | struct tcpcb * | tp, |
char * | tag | ||
) |
Definition at line 523 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, INP_WUNLOCK, tcpcb::t_inpcb, tcpcb::t_lib, TCP_LOG_TAG_LEN, tcp_log_unref_bucket(), TCPID_BUCKET_LOCK, TCPID_BUCKET_REF, TCPID_BUCKET_UNLOCK, TCPID_TREE_RLOCK_ASSERT, TCPID_TREE_RUNLOCK, TCPID_TREE_UNLOCK_ASSERT, TCPID_TREE_WLOCK_ASSERT, TCPID_TREE_WUNLOCK, tcp_log_id_bucket::tlb_tag, TREE_RLOCKED, TREE_UNLOCKED, and TREE_WLOCKED.
int tcp_log_state_change | ( | struct tcpcb * | tp, |
int | state | ||
) |
Definition at line 1746 of file tcp_log_buf.c.
References INP_WLOCK_ASSERT, state, tcpcb::t_flags2, tcpcb::t_inpcb, tcpcb::t_logs, tcpcb::t_logstate, tcp_log_remove_log_head(), TCP_LOG_STATE_CLEAR, TCP_LOG_STATE_CONTINUAL, TCP_LOG_STATE_HEAD, TCP_LOG_STATE_HEAD_AUTO, TCP_LOG_STATE_OFF, TCP_LOG_STATE_TAIL, TCP_LOG_STATE_TAIL_AUTO, and TF2_LOG_AUTO.
Referenced by tcp_default_ctloutput(), and tcp_log_event_().
void tcp_log_tcpcbfini | ( | struct tcpcb * | tp | ) |
Definition at line 1319 of file tcp_log_buf.c.
References in_pcbref(), INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_lib, tcpcb::t_lin, tcpcb::t_lognum, tcpcb::t_logs, tcpcb::t_logstate, TCP_LOG_CONNEND, tcp_log_dump_tp_logbuf(), TCP_LOG_EVENT, tcp_log_expire(), TCP_LOG_EXPIRE_INTVL, TCP_LOG_EXPIRE_TIME, tcp_log_move_tp_to_node(), tcp_log_remove_log_head(), TCP_LOG_STATE_CONTINUAL, TCP_LOG_STATE_HEAD_AUTO, TCP_LOG_STATE_OFF, TCP_LOG_STATE_TAIL_AUTO, TCPLOG_EXPIREQ_LOCK, and TCPLOG_EXPIREQ_UNLOCK.
Referenced by tcp_freecb().
void tcp_log_tcpcbinit | ( | struct tcpcb * | tp | ) |
Definition at line 1176 of file tcp_log_buf.c.
References tcpcb::t_flags2, tcpcb::t_loglimit, tcpcb::t_logs, tcpcb::t_logstate, tcp_log_selectauto(), tcp_log_session_limit, and TF2_LOG_AUTO.
Referenced by tcp_newtcpcb().
|
static |
Definition at line 377 of file tcp_log_buf.c.
References INP_WLOCK, INP_WUNLOCK, tcp_log_id_validate_tree_lock(), tcp_log_remove_bucket(), TCPID_BUCKET_LOCK, TCPID_BUCKET_REF, TCPID_BUCKET_UNLOCK, TCPID_BUCKET_UNREF, TCPID_TREE_RUNLOCK, TCPID_TREE_UPGRADE, TCPID_TREE_WLOCK, TREE_RLOCKED, and TREE_WLOCKED.
Referenced by tcp_log_dump_tp_bucket_logbufs(), tcp_log_dumpbucketlogs(), tcp_log_get_tag(), tcp_log_remove_id_node(), tcp_log_set_id(), and tcp_log_set_tag().
|
static |
Definition at line 228 of file tcp_log_buf.c.
Referenced by tcp_log_init().
|
static |
Definition at line 68 of file tcp_log_buf.c.
Referenced by tcp_log_init(), tcp_log_remove_bucket(), and tcp_log_set_id().
|
static |
Definition at line 72 of file tcp_log_buf.c.
Referenced by tcp_log_remove_bucket(), and tcp_log_set_id().
|
static |
Definition at line 68 of file tcp_log_buf.c.
Referenced by tcp_log_dumpbucketlogs(), tcp_log_expire(), tcp_log_init(), and tcp_log_set_id().
|
static |
Definition at line 69 of file tcp_log_buf.c.
Referenced by tcp_log_tcpcbinit().
bool tcp_log_verbose |
Definition at line 67 of file tcp_log_buf.c.
|
static |
Definition at line 70 of file tcp_log_buf.c.
|
static |
Definition at line 68 of file tcp_log_buf.c.
Referenced by tcp_log_event_(), tcp_log_free_log_common(), tcp_log_getlogbuf(), tcp_log_init(), and tcp_log_remove_log_cleanup().
|
static |
Definition at line 188 of file tcp_log_buf.c.
Referenced by tcp_log_logs_to_buf().