diff options
author | glebius <glebius@FreeBSD.org> | 2005-05-12 13:52:49 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-05-12 13:52:49 +0000 |
commit | 1fd70549f81b5f11ba2eac3355822f193aae07b6 (patch) | |
tree | c1223bde74d426470c360b9753cd3e162273c506 /sys/netgraph/netflow | |
parent | 9382d6cbc4e76ca9d7c1ce0a6d0efbc1c4062b66 (diff) | |
download | FreeBSD-src-1fd70549f81b5f11ba2eac3355822f193aae07b6.zip FreeBSD-src-1fd70549f81b5f11ba2eac3355822f193aae07b6.tar.gz |
- Gather statistics about failed mbuf+cluster+ng_item allocations.
- Adjust comments and variables names in nfinfo.
Diffstat (limited to 'sys/netgraph/netflow')
-rw-r--r-- | sys/netgraph/netflow/netflow.c | 5 | ||||
-rw-r--r-- | sys/netgraph/netflow/ng_netflow.h | 18 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c index 4ed9e19..ff94bef 100644 --- a/sys/netgraph/netflow/netflow.c +++ b/sys/netgraph/netflow/netflow.c @@ -204,8 +204,7 @@ expire_flow(priv_p priv, item_p *item, struct flow_entry *fle) if (*item == NULL) *item = get_export_dgram(priv); if (*item == NULL) { - /* XXX: do stats! */ - log(LOG_DEBUG, "get_export_dgram failed\n"); + atomic_add_32(&priv->info.nfinfo_export_failed, 1); uma_zfree_arg(priv->zone, fle, priv); return; } @@ -259,7 +258,7 @@ hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, fle = uma_zalloc_arg(priv->zone, priv, M_NOWAIT); if (fle == NULL) { - atomic_add_32(&priv->info.nfinfo_failed, 1); + atomic_add_32(&priv->info.nfinfo_alloc_failed, 1); return (ENOMEM); } diff --git a/sys/netgraph/netflow/ng_netflow.h b/sys/netgraph/netflow/ng_netflow.h index 20b7b0d..79037ee 100644 --- a/sys/netgraph/netflow/ng_netflow.h +++ b/sys/netgraph/netflow/ng_netflow.h @@ -54,14 +54,15 @@ enum { /* This structure is returned by the NGM_NETFLOW_INFO message */ struct ng_netflow_info { - uint64_t nfinfo_bytes; /* total number of accounted bytes */ - uint32_t nfinfo_packets; /* total number of accounted packets */ - uint32_t nfinfo_used; /* number of used cache records */ - uint32_t nfinfo_failed; /* number of failed allocations */ - uint32_t nfinfo_act_exp; - uint32_t nfinfo_inact_exp; - uint32_t nfinfo_inact_t; /* flow inactive timeout */ - uint32_t nfinfo_act_t; /* flow active timeout */ + uint64_t nfinfo_bytes; /* accounted bytes */ + uint32_t nfinfo_packets; /* accounted packets */ + uint32_t nfinfo_used; /* used cache records */ + uint32_t nfinfo_alloc_failed; /* failed allocations */ + uint32_t nfinfo_export_failed; /* failed exports */ + uint32_t nfinfo_act_exp; /* active expiries */ + uint32_t nfinfo_inact_exp; /* inactive expiries */ + uint32_t nfinfo_inact_t; /* flow inactive timeout */ + uint32_t nfinfo_act_t; /* flow active timeout */ }; /* This structure is returned by the NGM_NETFLOW_IFINFO message */ @@ -168,6 +169,7 @@ struct flow_entry { { "Packets", &ng_parse_uint32_type }, \ { "Records used", &ng_parse_uint32_type },\ { "Failed allocations", &ng_parse_uint32_type },\ + { "Failed exports", &ng_parse_uint32_type },\ { "Active expiries", &ng_parse_uint32_type },\ { "Inactive expiries", &ng_parse_uint32_type },\ { "Inactive timeout", &ng_parse_uint32_type },\ |