/* Fibre Channel HBA usage activity */
struct activity fchost_act = {
.id = A_NET_FC,
- .options = AO_CLOSE_MARKUP + AO_GRAPH_PER_ITEM,
+ .options = AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DISK,
#ifdef SOURCE_SADC
.bitmap = NULL
};
+/* Softnet activity */
+struct activity softnet_act = {
+ .id = A_NET_SOFT,
+ .options = AO_CLOSE_MARKUP + AO_GRAPH_PER_ITEM,
+ .magic = ACTIVITY_MAGIC_BASE,
+ .group = G_DEFAULT,
+#ifdef SOURCE_SADC
+ .f_count_index = 0, /* wrap_get_cpu_nr() */
+ .f_count2 = NULL,
+ .f_read = wrap_read_softnet,
+#endif
+#ifdef SOURCE_SAR
+ .f_print = print_softnet_stats,
+ .f_print_avg = print_softnet_stats,
+#endif
+#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
+ .hdr_line = "CPU;total/s;dropd/s;squeezd/s;rx_rps/s;flw_lim/s",
+#endif
+#ifdef SOURCE_SADF
+ .f_render = render_softnet_stats,
+ .f_xml_print = xml_print_softnet_stats,
+ .f_json_print = json_print_softnet_stats,
+ .f_svg_print = svg_print_softnet_stats,
+ .name = "A_NET_SOFT",
+ .g_nr = 2,
+#endif
+ .nr = -1,
+ .nr2 = 1,
+ .nr_max = NR_CPUS,
+ .fsize = STATS_SOFTNET_SIZE,
+ .msize = STATS_SOFTNET_SIZE,
+ .opt_flags = 0,
+ .buf = {NULL, NULL, NULL},
+ .bitmap = NULL
+};
+
#ifdef SOURCE_SADC
/*
* Array of functions used to count number of items.
&net_icmp6_act,
&net_eicmp6_act,
&net_udp6_act,
- &fchost_act, /* AO_CLOSE_MARKUP */
+ &fchost_act,
+ &softnet_act, /* AO_CLOSE_MARKUP */
/* </network> */
/* <power-management> */
&pwr_cpufreq_act,
json_markup_network(tab, CLOSE_JSON_MARKUP);
}
}
+
+/*
+ ***************************************************************************
+ * Display softnet statistics in JSON.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ * @tab Indentation in output.
+ * @itv Interval of time in jiffies.
+ ***************************************************************************
+ */
+__print_funct_t json_print_softnet_stats(struct activity *a, int curr, int tab,
+ unsigned long long itv)
+{
+ if (!IS_SELECTED(a->options) || (a->nr <= 0))
+ goto close_json_markup;
+
+ json_markup_network(tab, OPEN_JSON_MARKUP);
+
+ /* FIXME */
+
+close_json_markup:
+ if (CLOSE_MARKUP(a->options)) {
+ json_markup_network(tab, CLOSE_JSON_MARKUP);
+ }
+}
(struct activity *, int, int, unsigned long long);
__print_funct_t json_print_fchost_stats
(struct activity *, int, int, unsigned long long);
+__print_funct_t json_print_softnet_stats
+ (struct activity *, int, int, unsigned long long);
#endif /* _XML_STATS_H */
cprintf_in(IS_STR, " %s\n", sfcc->fchost_name, 0);
}
}
+
+/*
+ ***************************************************************************
+ * Display softnet statistics.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @prev Index in array where stats used as reference are.
+ * @curr Index in array for current sample statistics.
+ * @itv Interval of time in jiffies.
+ ***************************************************************************
+ */
+__print_funct_t print_softnet_stats(struct activity *a, int prev, int curr,
+ unsigned long long itv)
+{
+ /* FIXME */
+}
(struct activity *, int, int, unsigned long long);
__print_funct_t print_fchost_stats
(struct activity *, int, int, unsigned long long);
+__print_funct_t print_softnet_stats
+ (struct activity *, int, int, unsigned long long);
/* Functions used to display average statistics */
__print_funct_t print_avg_memory_stats
#define NET_SOCKSTAT6 "/proc/net/sockstat6"
#define NET_RPC_NFS "/proc/net/rpc/nfs"
#define NET_RPC_NFSD "/proc/net/rpc/nfsd"
+#define NET_SOFTNET "/proc/net/softnet_stat"
#define LOADAVG "/proc/loadavg"
#define VMSTAT "/proc/vmstat"
#define NET_SNMP "/proc/net/snmp"
#define STATS_FCHOST_SIZE (sizeof(struct stats_fchost))
+/* Structure for softnet statistics */
+struct stats_softnet {
+ unsigned long long processed __attribute__ ((aligned (16)));
+ unsigned long long dropped __attribute__ ((aligned (16)));
+ unsigned long long time_squeeze __attribute__ ((aligned (16)));
+ unsigned long long received_rps __attribute__ ((aligned (16)));
+ unsigned long long flow_limit __attribute__ ((aligned (16)));
+};
+
+#define STATS_SOFTNET_SIZE (sizeof(struct stats_softnet))
+
/*
***************************************************************************
* Prototypes for functions used to read system statistics
NULL);
}
}
+
+/*
+ ***************************************************************************
+ * Display softnet statistics in selected format.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @isdb Flag, true if db printing, false if ppc printing.
+ * @pre Prefix string for output entries
+ * @curr Index in array for current sample statistics.
+ * @itv Interval of time in jiffies.
+ ***************************************************************************
+ */
+__print_funct_t render_softnet_stats(struct activity *a, int isdb, char *pre,
+ int curr, unsigned long long itv)
+{
+ /* FIXME */
+}
(struct activity *, int, char *, int, unsigned long long);
__print_funct_t render_fchost_stats
(struct activity *, int, char *, int, unsigned long long);
+__print_funct_t render_softnet_stats
+ (struct activity *, int, char *, int, unsigned long long);
#endif /* _RNDR_STATS_H */
*/
/* Number of activities */
-#define NR_ACT 38
+#define NR_ACT 39
/* The value below is used for sanity check */
#define MAX_NR_ACT 256
#define A_PWR_USB 36
#define A_FILESYSTEM 37
#define A_NET_FC 38
+#define A_NET_SOFT 39
/* Macro used to flag an activity that should be collected */
#define K_FREQ "FREQ"
#define K_MOUNT "MOUNT"
#define K_FC "FC"
+#define K_SOFT "SOFT"
#define K_INT "INT"
#define K_DISK "DISK"
(struct activity *);
__read_funct_t wrap_read_fchost
(struct activity *);
+__read_funct_t wrap_read_softnet
+ (struct activity *);
/* Other functions */
void allocate_bitmaps
else if (!strcmp(t, K_FC)) {
SELECT_ACTIVITY(A_NET_FC);
}
+ else if (!strcmp(t, K_SOFT)) {
+ SELECT_ACTIVITY(A_NET_SOFT);
+ }
else if (!strcmp(t, K_ALL)) {
SELECT_ACTIVITY(A_NET_DEV);
SELECT_ACTIVITY(A_NET_EDEV);
SELECT_ACTIVITY(A_NET_EICMP6);
SELECT_ACTIVITY(A_NET_UDP6);
SELECT_ACTIVITY(A_NET_FC);
+ SELECT_ACTIVITY(A_NET_SOFT);
}
else
return 1;
return;
}
+/*
+ ***************************************************************************
+ * Read softnet statistics.
+ *
+ * IN:
+ * @a Activity structure.
+ *
+ * OUT:
+ * @a Activity structure with statistics.
+ ***************************************************************************
+ */
+__read_funct_t wrap_read_softnet(struct activity *a)
+{
+ struct stats_softnet *st_softnet
+ = (struct stats_softnet *) a->_buf0;
+
+ /* Read softnet stats */
+ /* FIXME */
+
+ return;
+}
/*
***************************************************************************
"\t\tICMP6\tICMP traffic\t(v6)\n"
"\t\tEICMP6\tICMP traffic\t(v6) (errors)\n"
"\t\tUDP6\tUDP traffic\t(v6)\n"
- "\t\tFC\tFibre channel HBAs\n"));
+ "\t\tFC\tFibre channel HBAs\n"
+ "\t\tSOFT\tSoftware-based network processing\n"));
printf(_("\t-q\tQueue length and load average statistics\n"));
printf(_("\t-R\tMemory statistics\n"));
printf(_("\t-r [ ALL ]\n"
free_graphs(out, outsize, spmin, spmax);
}
}
+
+/*
+ ***************************************************************************
+ * Display softnet statistics in SVG.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ * @action Action expected from current function.
+ * @svg_p SVG specific parameters: Current graph number (.@graph_no),
+ * flag indicating that a restart record has been previously
+ * found (.@restart) and time used for the X axis origin
+ * (@ust_time_ref).
+ * @itv Interval of time in jiffies (unused here).
+ * @record_hdr Pointer on record header of current stats sample.
+ ***************************************************************************
+ */
+__print_funct_t svg_print_softnet_stats(struct activity *a, int curr, int action, struct svg_parm *svg_p,
+ unsigned long long itv, struct record_header *record_hdr)
+{
+ /* FIXME */
+}
__print_funct_t svg_print_fchost_stats
(struct activity *, int, int, struct svg_parm *, unsigned long long,
struct record_header *);
+__print_funct_t svg_print_softnet_stats
+ (struct activity *, int, int, struct svg_parm *, unsigned long long,
+ struct record_header *);
#endif /* _SVG_STATS_H */
xml_markup_network(tab, CLOSE_XML_MARKUP);
}
}
+
+/*
+ ***************************************************************************
+ * Display softnet statistics in XML.
+ *
+ * IN:
+ * @a Activity structure with statistics.
+ * @curr Index in array for current sample statistics.
+ * @tab Indentation in XML output.
+ * @itv Interval of time in jiffies.
+ ***************************************************************************
+ */
+__print_funct_t xml_print_softnet_stats(struct activity *a, int curr, int tab,
+ unsigned long long itv)
+{
+ if (!IS_SELECTED(a->options) || (a->nr <= 0))
+ goto close_xml_markup;
+
+ xml_markup_network(tab, OPEN_XML_MARKUP);
+
+ /* FIXME */
+
+close_xml_markup:
+ if (CLOSE_MARKUP(a->options)) {
+ xml_markup_network(tab, CLOSE_XML_MARKUP);
+ }
+}
(struct activity *, int, int, unsigned long long);
__print_funct_t xml_print_fchost_stats
(struct activity *, int, int, unsigned long long);
+__print_funct_t xml_print_softnet_stats
+ (struct activity *, int, int, unsigned long long);
#endif /* _XML_STATS_H */