Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
gen_stats.c File Reference
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/socket.h>
#include <linux/rtnetlink.h>
#include <linux/gen_stats.h>
#include <net/netlink.h>
#include <net/gen_stats.h>

Go to the source code of this file.

Functions

int gnet_stats_start_copy_compat (struct sk_buff *skb, int type, int tc_stats_type, int xstats_type, spinlock_t *lock, struct gnet_dump *d) __acquires(lock)
 
 EXPORT_SYMBOL (gnet_stats_start_copy_compat)
 
int gnet_stats_start_copy (struct sk_buff *skb, int type, spinlock_t *lock, struct gnet_dump *d)
 
 EXPORT_SYMBOL (gnet_stats_start_copy)
 
int gnet_stats_copy_basic (struct gnet_dump *d, struct gnet_stats_basic_packed *b)
 
 EXPORT_SYMBOL (gnet_stats_copy_basic)
 
int gnet_stats_copy_rate_est (struct gnet_dump *d, const struct gnet_stats_basic_packed *b, struct gnet_stats_rate_est *r)
 
 EXPORT_SYMBOL (gnet_stats_copy_rate_est)
 
int gnet_stats_copy_queue (struct gnet_dump *d, struct gnet_stats_queue *q)
 
 EXPORT_SYMBOL (gnet_stats_copy_queue)
 
int gnet_stats_copy_app (struct gnet_dump *d, void *st, int len)
 
 EXPORT_SYMBOL (gnet_stats_copy_app)
 
int gnet_stats_finish_copy (struct gnet_dump *d)
 
 EXPORT_SYMBOL (gnet_stats_finish_copy)
 

Function Documentation

EXPORT_SYMBOL ( gnet_stats_start_copy_compat  )
EXPORT_SYMBOL ( gnet_stats_start_copy  )
EXPORT_SYMBOL ( gnet_stats_copy_basic  )
EXPORT_SYMBOL ( gnet_stats_copy_rate_est  )
EXPORT_SYMBOL ( gnet_stats_copy_queue  )
EXPORT_SYMBOL ( gnet_stats_copy_app  )
EXPORT_SYMBOL ( gnet_stats_finish_copy  )
int gnet_stats_copy_app ( struct gnet_dump d,
void st,
int  len 
)

gnet_stats_copy_app - copy application specific statistics into statistics TLV : dumping handle : application specific statistics data : length of data

Appends the application sepecific statistics to the top level TLV created by gnet_stats_start_copy() and remembers the data for XSTATS if the dumping handle is in backward compatibility mode.

Returns 0 on success or -1 with the statistic lock released if the room in the socket buffer was not sufficient.

Definition at line 205 of file gen_stats.c.

int gnet_stats_copy_basic ( struct gnet_dump d,
struct gnet_stats_basic_packed b 
)

gnet_stats_copy_basic - copy basic statistics into statistic TLV : dumping handle : basic statistics

Appends the basic statistics to the top level TLV created by gnet_stats_start_copy().

Returns 0 on success or -1 with the statistic lock released if the room in the socket buffer was not sufficient.

Definition at line 112 of file gen_stats.c.

int gnet_stats_copy_queue ( struct gnet_dump d,
struct gnet_stats_queue q 
)

gnet_stats_copy_queue - copy queue statistics into statistics TLV : dumping handle : queue statistics

Appends the queue statistics to the top level TLV created by gnet_stats_start_copy().

Returns 0 on success or -1 with the statistic lock released if the room in the socket buffer was not sufficient.

Definition at line 175 of file gen_stats.c.

int gnet_stats_copy_rate_est ( struct gnet_dump d,
const struct gnet_stats_basic_packed b,
struct gnet_stats_rate_est r 
)

gnet_stats_copy_rate_est - copy rate estimator statistics into statistics TLV : dumping handle : basic statistics : rate estimator statistics

Appends the rate estimator statistics to the top level TLV created by gnet_stats_start_copy().

Returns 0 on success or -1 with the statistic lock released if the room in the socket buffer was not sufficient.

Definition at line 144 of file gen_stats.c.

int gnet_stats_finish_copy ( struct gnet_dump d)

gnet_stats_finish_copy - finish dumping procedure : dumping handle

Corrects the length of the top level TLV to include all TLVs added by gnet_stats_copy_XXX() calls. Adds the backward compatibility TLVs if gnet_stats_start_copy_compat() was used and releases the statistics lock.

Returns 0 on success or -1 with the statistic lock released if the room in the socket buffer was not sufficient.

Definition at line 232 of file gen_stats.c.

int gnet_stats_start_copy ( struct sk_buff skb,
int  type,
spinlock_t lock,
struct gnet_dump d 
)

gnet_stats_start_copy_compat - start dumping procedure in compatibility mode : socket buffer to put statistics TLVs into : TLV type for top level statistic TLV : statistics lock : dumping handle

Initializes the dumping handle, grabs the statistic lock and appends an empty TLV header to the socket buffer for use a container for all other statistic TLVS.

Returns 0 on success or -1 if the room in the socket buffer was not sufficient.

Definition at line 93 of file gen_stats.c.

int gnet_stats_start_copy_compat ( struct sk_buff skb,
int  type,
int  tc_stats_type,
int  xstats_type,
spinlock_t lock,
struct gnet_dump d 
)

gnet_stats_start_copy_compat - start dumping procedure in compatibility mode : socket buffer to put statistics TLVs into : TLV type for top level statistic TLV : TLV type for backward compatibility struct tc_stats TLV : TLV type for backward compatibility xstats TLV : statistics lock : dumping handle

Initializes the dumping handle, grabs the statistic lock and appends an empty TLV header to the socket buffer for use a container for all other statistic TLVS.

The dumping handle is marked to be in backward compatibility mode telling all gnet_stats_copy_XXX() functions to fill a local copy of struct tc_stats.

Returns 0 on success or -1 if the room in the socket buffer was not sufficient.

Definition at line 58 of file gen_stats.c.