5 Star 14 Fork 0

Gitee 极速下载/sysstat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/sysstat/sysstat/releases
克隆/下载
activity.c 53.71 KB
一键复制 编辑 原始数据 按行查看 历史
Sebastien GODARD 提交于 2020-05-08 10:02 . sysstat-12.3.3
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087
/*
* activity.c: Define system activities available for sar/sadc.
* (C) 1999-2020 by Sebastien GODARD (sysstat <at> orange.fr)
*
***************************************************************************
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
* for more details. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA *
***************************************************************************
*/
#include "sa.h"
#ifdef SOURCE_SAR
#include "pr_stats.h"
#endif
#ifdef SOURCE_SADF
#include "rndr_stats.h"
#include "xml_stats.h"
#include "json_stats.h"
#include "svg_stats.h"
#include "raw_stats.h"
#include "pcp_stats.h"
#endif
/*
***************************************************************************
* Definitions of system activities.
* See sa.h file for activity structure definition.
* Activity structure doesn't matter for daily data files.
***************************************************************************
*/
/*
* Bitmaps needed by activities.
* Remember to allocate them before use!
*/
/* CPU bitmap */
struct act_bitmap cpu_bitmap = {
.b_array = NULL,
.b_size = NR_CPUS
};
/* Interrupts bitmap */
struct act_bitmap irq_bitmap = {
.b_array = NULL,
.b_size = NR_IRQS
};
/*
* CPU statistics.
* This is the only activity which *must* be collected by sadc
* so that uptime can be filled.
*/
struct activity cpu_act = {
.id = A_CPU,
.options = AO_COLLECTED + AO_COUNTED + AO_PERSISTENT +
AO_MULTIPLE_OUTPUTS + AO_GRAPH_PER_ITEM +
AO_ALWAYS_COUNTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 0, /* wrap_get_cpu_nr() */
.f_count2 = NULL,
.f_read = wrap_read_stat_cpu,
#endif
#ifdef SOURCE_SAR
.f_print = print_cpu_stats,
.f_print_avg = print_cpu_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "CPU;%user;%nice;%system;%iowait;%steal;%idle|"
"CPU;%usr;%nice;%sys;%iowait;%steal;%irq;%soft;%guest;%gnice;%idle",
#endif
.gtypes_nr = {STATS_CPU_ULL, STATS_CPU_UL, STATS_CPU_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_cpu_stats,
.f_xml_print = xml_print_cpu_stats,
.f_json_print = json_print_cpu_stats,
.f_svg_print = svg_print_cpu_stats,
.f_raw_print = raw_print_cpu_stats,
.f_pcp_print = pcp_print_cpu_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "CPU utilization",
#endif
.name = "A_CPU",
.item_list_sz = 0,
.g_nr = 1,
.nr_ini = -1,
.nr2 = 1,
.nr_max = NR_CPUS + 1,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_CPU_SIZE,
.msize = STATS_CPU_SIZE,
.opt_flags = AO_F_CPU_DEF,
.buf = {NULL, NULL, NULL},
.bitmap = &cpu_bitmap
};
/* Process (task) creation and context switch activity */
struct activity pcsw_act = {
.id = A_PCSW,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_stat_pcsw,
#endif
#ifdef SOURCE_SAR
.f_print = print_pcsw_stats,
.f_print_avg = print_pcsw_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "proc/s;cswch/s",
#endif
.gtypes_nr = {STATS_PCSW_ULL, STATS_PCSW_UL, STATS_PCSW_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pcsw_stats,
.f_xml_print = xml_print_pcsw_stats,
.f_json_print = json_print_pcsw_stats,
.f_svg_print = svg_print_pcsw_stats,
.f_raw_print = raw_print_pcsw_stats,
.f_pcp_print = pcp_print_pcsw_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Task creation and switching activity",
#endif
.name = "A_PCSW",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_PCSW_SIZE,
.msize = STATS_PCSW_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Interrupts statistics */
struct activity irq_act = {
.id = A_IRQ,
.options = AO_COUNTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_INT,
#ifdef SOURCE_SADC
.f_count_index = 1, /* wrap_get_irq_nr() */
.f_count2 = NULL,
.f_read = wrap_read_stat_irq,
#endif
#ifdef SOURCE_SAR
.f_print = print_irq_stats,
.f_print_avg = print_irq_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "INTR;intr/s",
#endif
.gtypes_nr = {STATS_IRQ_ULL, STATS_IRQ_UL, STATS_IRQ_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_irq_stats,
.f_xml_print = xml_print_irq_stats,
.f_json_print = json_print_irq_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_irq_stats,
.f_pcp_print = pcp_print_irq_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Interrupts statistics",
#endif
.name = "A_IRQ",
.item_list_sz = 0,
.g_nr = 0,
.nr_ini = -1,
.nr2 = 1,
.nr_max = NR_IRQS + 1,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_IRQ_SIZE,
.msize = STATS_IRQ_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = &irq_bitmap
};
/* Swapping activity */
struct activity swap_act = {
.id = A_SWAP,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_swap,
#endif
#ifdef SOURCE_SAR
.f_print = print_swap_stats,
.f_print_avg = print_swap_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "pswpin/s;pswpout/s",
#endif
.gtypes_nr = {STATS_SWAP_ULL, STATS_SWAP_UL, STATS_SWAP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_swap_stats,
.f_xml_print = xml_print_swap_stats,
.f_json_print = json_print_swap_stats,
.f_svg_print = svg_print_swap_stats,
.f_raw_print = raw_print_swap_stats,
.f_pcp_print = pcp_print_swap_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Swap activity",
#endif
.name = "A_SWAP",
.item_list_sz = 0,
.g_nr = 1,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_SWAP_SIZE,
.msize = STATS_SWAP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Paging activity */
struct activity paging_act = {
.id = A_PAGE,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_paging,
#endif
#ifdef SOURCE_SAR
.f_print = print_paging_stats,
.f_print_avg = print_paging_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "pgpgin/s;pgpgout/s;fault/s;majflt/s;"
"pgfree/s;pgscank/s;pgscand/s;pgsteal/s;%vmeff",
#endif
.gtypes_nr = {STATS_PAGING_ULL, STATS_PAGING_UL, STATS_PAGING_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_paging_stats,
.f_xml_print = xml_print_paging_stats,
.f_json_print = json_print_paging_stats,
.f_svg_print = svg_print_paging_stats,
.f_raw_print = raw_print_paging_stats,
.f_pcp_print = pcp_print_paging_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Paging activity",
#endif
.name = "A_PAGE",
.item_list_sz = 0,
.g_nr = 3,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_PAGING_SIZE,
.msize = STATS_PAGING_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* I/O and transfer rate activity */
struct activity io_act = {
.id = A_IO,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_io,
#endif
#ifdef SOURCE_SAR
.f_print = print_io_stats,
.f_print_avg = print_io_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "tps;rtps;wtps;dtps;bread/s;bwrtn/s;bdscd/s",
#endif
.gtypes_nr = {STATS_IO_ULL, STATS_IO_UL, STATS_IO_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_io_stats,
.f_xml_print = xml_print_io_stats,
.f_json_print = json_print_io_stats,
.f_svg_print = svg_print_io_stats,
.f_raw_print = raw_print_io_stats,
.f_pcp_print = pcp_print_io_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "I/O and transfer rate statistics",
#endif
.name = "A_IO",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_IO_SIZE,
.msize = STATS_IO_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Memory and swap space utilization activity */
struct activity memory_act = {
.id = A_MEMORY,
.options = AO_COLLECTED + AO_MULTIPLE_OUTPUTS,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_meminfo,
#endif
#ifdef SOURCE_SAR
.f_print = print_memory_stats,
.f_print_avg = print_avg_memory_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "kbmemfree;kbavail;kbmemused;%memused;kbbuffers;kbcached;kbcommit;%commit;kbactive;kbinact;kbdirty&kbanonpg;kbslab;kbkstack;kbpgtbl;kbvmused|"
"kbswpfree;kbswpused;%swpused;kbswpcad;%swpcad",
#endif
.gtypes_nr = {STATS_MEMORY_ULL, STATS_MEMORY_UL, STATS_MEMORY_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_memory_stats,
.f_xml_print = xml_print_memory_stats,
.f_json_print = json_print_memory_stats,
.f_svg_print = svg_print_memory_stats,
.f_raw_print = raw_print_memory_stats,
.f_pcp_print = pcp_print_memory_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Memory and/or swap utilization",
#endif
.name = "A_MEMORY",
.item_list_sz = 0,
.g_nr = 9,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_MEMORY_SIZE,
.msize = STATS_MEMORY_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Kernel tables activity */
struct activity ktables_act = {
.id = A_KTABLES,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_kernel_tables,
#endif
#ifdef SOURCE_SAR
.f_print = print_ktables_stats,
.f_print_avg = print_avg_ktables_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "dentunusd;file-nr;inode-nr;pty-nr",
#endif
.gtypes_nr = {STATS_KTABLES_ULL, STATS_KTABLES_UL, STATS_KTABLES_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_ktables_stats,
.f_xml_print = xml_print_ktables_stats,
.f_json_print = json_print_ktables_stats,
.f_svg_print = svg_print_ktables_stats,
.f_raw_print = raw_print_ktables_stats,
.f_pcp_print = pcp_print_ktables_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Kernel tables statistics",
#endif
.name = "A_KTABLES",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_KTABLES_SIZE,
.msize = STATS_KTABLES_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Queue and load activity */
struct activity queue_act = {
.id = A_QUEUE,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_loadavg,
#endif
#ifdef SOURCE_SAR
.f_print = print_queue_stats,
.f_print_avg = print_avg_queue_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "runq-sz;plist-sz;ldavg-1;ldavg-5;ldavg-15;blocked",
#endif
.gtypes_nr = {STATS_QUEUE_ULL, STATS_QUEUE_UL, STATS_QUEUE_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_queue_stats,
.f_xml_print = xml_print_queue_stats,
.f_json_print = json_print_queue_stats,
.f_svg_print = svg_print_queue_stats,
.f_raw_print = raw_print_queue_stats,
.f_pcp_print = pcp_print_queue_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Queue length and load average statistics",
#endif
.name = "A_QUEUE",
.item_list_sz = 0,
.g_nr = 3,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_QUEUE_SIZE,
.msize = STATS_QUEUE_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Serial lines activity */
struct activity serial_act = {
.id = A_SERIAL,
.options = AO_COLLECTED + AO_COUNTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 2, /* wrap_get_serial_nr() */
.f_count2 = NULL,
.f_read = wrap_read_tty_driver_serial,
#endif
#ifdef SOURCE_SAR
.f_print = print_serial_stats,
.f_print_avg = print_serial_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "TTY;rcvin/s;txmtin/s;framerr/s;prtyerr/s;brk/s;ovrun/s",
#endif
.gtypes_nr = {STATS_SERIAL_ULL, STATS_SERIAL_UL, STATS_SERIAL_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_serial_stats,
.f_xml_print = xml_print_serial_stats,
.f_json_print = json_print_serial_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_serial_stats,
.f_pcp_print = pcp_print_serial_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "TTY devices statistics",
#endif
.name = "A_SERIAL",
.item_list_sz = 0,
.g_nr = 0,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_SERIAL_LINES,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_SERIAL_SIZE,
.msize = STATS_SERIAL_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Block devices activity */
struct activity disk_act = {
.id = A_DISK,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_DISK,
#ifdef SOURCE_SADC
.f_count_index = 3, /* wrap_get_disk_nr() */
.f_count2 = NULL,
.f_read = wrap_read_disk,
#endif
#ifdef SOURCE_SAR
.f_print = print_disk_stats,
.f_print_avg = print_disk_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "DEV;tps;rkB/s;wkB/s;dkB/s;areq-sz;aqu-sz;await;%util",
#endif
.gtypes_nr = {STATS_DISK_ULL, STATS_DISK_UL, STATS_DISK_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_disk_stats,
.f_xml_print = xml_print_disk_stats,
.f_json_print = json_print_disk_stats,
.f_svg_print = svg_print_disk_stats,
.f_raw_print = raw_print_disk_stats,
.f_pcp_print = pcp_print_disk_stats,
.f_count_new = count_new_disk,
.item_list = NULL,
.desc = "Block devices statistics",
#endif
.name = "A_DISK",
.item_list_sz = 0,
.g_nr = 5,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_DISKS,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_DISK_SIZE,
.msize = STATS_DISK_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Network interfaces activity */
struct activity net_dev_act = {
.id = A_NET_DEV,
.options = AO_COLLECTED + AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE + 3,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 4, /* wrap_get_iface_nr() */
.f_count2 = NULL,
.f_read = wrap_read_net_dev,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_dev_stats,
.f_print_avg = print_net_dev_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "IFACE;rxpck/s;txpck/s;rxkB/s;txkB/s;rxcmp/s;txcmp/s;rxmcst/s;%ifutil",
#endif
.gtypes_nr = {STATS_NET_DEV_ULL, STATS_NET_DEV_UL, STATS_NET_DEV_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_dev_stats,
.f_xml_print = xml_print_net_dev_stats,
.f_json_print = json_print_net_dev_stats,
.f_svg_print = svg_print_net_dev_stats,
.f_raw_print = raw_print_net_dev_stats,
.f_pcp_print = pcp_print_net_dev_stats,
.f_count_new = count_new_net_dev,
.item_list = NULL,
.desc = "Network interfaces statistics",
#endif
.name = "A_NET_DEV",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_IFACES,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_NET_DEV_SIZE,
.msize = STATS_NET_DEV_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Network interfaces (errors) activity */
struct activity net_edev_act = {
.id = A_NET_EDEV,
.options = AO_COLLECTED + AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 4, /* wrap_get_iface_nr() */
.f_count2 = NULL,
.f_read = wrap_read_net_edev,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_edev_stats,
.f_print_avg = print_net_edev_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "IFACE;rxerr/s;txerr/s;coll/s;rxdrop/s;txdrop/s;"
"txcarr/s;rxfram/s;rxfifo/s;txfifo/s",
#endif
.gtypes_nr = {STATS_NET_EDEV_ULL, STATS_NET_EDEV_UL, STATS_NET_EDEV_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_edev_stats,
.f_xml_print = xml_print_net_edev_stats,
.f_json_print = json_print_net_edev_stats,
.f_svg_print = svg_print_net_edev_stats,
.f_raw_print = raw_print_net_edev_stats,
.f_pcp_print = pcp_print_net_edev_stats,
.f_count_new = count_new_net_edev,
.item_list = NULL,
.desc = "Network interfaces errors statistics",
#endif
.name = "A_NET_EDEV",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_IFACES,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_NET_EDEV_SIZE,
.msize = STATS_NET_EDEV_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* NFS client activity */
struct activity net_nfs_act = {
.id = A_NET_NFS,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_nfs,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_nfs_stats,
.f_print_avg = print_net_nfs_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "call/s;retrans/s;read/s;write/s;access/s;getatt/s",
#endif
.gtypes_nr = {STATS_NET_NFS_ULL, STATS_NET_NFS_UL, STATS_NET_NFS_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_nfs_stats,
.f_xml_print = xml_print_net_nfs_stats,
.f_json_print = json_print_net_nfs_stats,
.f_svg_print = svg_print_net_nfs_stats,
.f_raw_print = raw_print_net_nfs_stats,
.f_pcp_print = pcp_print_net_nfs_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "NFS client statistics",
#endif
.name = "A_NET_NFS",
.item_list_sz = 0,
.g_nr = 3,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_NFS_SIZE,
.msize = STATS_NET_NFS_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* NFS server activity */
struct activity net_nfsd_act = {
.id = A_NET_NFSD,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_nfsd,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_nfsd_stats,
.f_print_avg = print_net_nfsd_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "scall/s;badcall/s;packet/s;udp/s;tcp/s;hit/s;miss/s;"
"sread/s;swrite/s;saccess/s;sgetatt/s",
#endif
.gtypes_nr = {STATS_NET_NFSD_ULL, STATS_NET_NFSD_UL, STATS_NET_NFSD_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_nfsd_stats,
.f_xml_print = xml_print_net_nfsd_stats,
.f_json_print = json_print_net_nfsd_stats,
.f_svg_print = svg_print_net_nfsd_stats,
.f_raw_print = raw_print_net_nfsd_stats,
.f_pcp_print = pcp_print_net_nfsd_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "NFS server statistics",
#endif
.name = "A_NET_NFSD",
.item_list_sz = 0,
.g_nr = 5,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_NFSD_SIZE,
.msize = STATS_NET_NFSD_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Network sockets activity */
struct activity net_sock_act = {
.id = A_NET_SOCK,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_sock,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_sock_stats,
.f_print_avg = print_avg_net_sock_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "totsck;tcpsck;udpsck;rawsck;ip-frag;tcp-tw",
#endif
.gtypes_nr = {STATS_NET_SOCK_ULL, STATS_NET_SOCK_UL, STATS_NET_SOCK_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_sock_stats,
.f_xml_print = xml_print_net_sock_stats,
.f_json_print = json_print_net_sock_stats,
.f_svg_print = svg_print_net_sock_stats,
.f_raw_print = raw_print_net_sock_stats,
.f_pcp_print = pcp_print_net_sock_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv4 sockets statistics",
#endif
.name = "A_NET_SOCK",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_SOCK_SIZE,
.msize = STATS_NET_SOCK_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* IP network traffic activity */
struct activity net_ip_act = {
.id = A_NET_IP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_ip,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_ip_stats,
.f_print_avg = print_net_ip_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "irec/s;fwddgm/s;idel/s;orq/s;asmrq/s;asmok/s;fragok/s;fragcrt/s",
#endif
.gtypes_nr = {STATS_NET_IP_ULL, STATS_NET_IP_UL, STATS_NET_IP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_ip_stats,
.f_xml_print = xml_print_net_ip_stats,
.f_json_print = json_print_net_ip_stats,
.f_svg_print = svg_print_net_ip_stats,
.f_raw_print = raw_print_net_ip_stats,
.f_pcp_print = pcp_print_net_ip_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv4 traffic statistics",
#endif
.name = "A_NET_IP",
.item_list_sz = 0,
.g_nr = 3,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_IP_SIZE,
.msize = STATS_NET_IP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* IP network traffic (errors) activity */
struct activity net_eip_act = {
.id = A_NET_EIP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_eip,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_eip_stats,
.f_print_avg = print_net_eip_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "ihdrerr/s;iadrerr/s;iukwnpr/s;idisc/s;odisc/s;onort/s;asmf/s;fragf/s",
#endif
.gtypes_nr = {STATS_NET_EIP_ULL, STATS_NET_EIP_UL, STATS_NET_EIP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_eip_stats,
.f_xml_print = xml_print_net_eip_stats,
.f_json_print = json_print_net_eip_stats,
.f_svg_print = svg_print_net_eip_stats,
.f_raw_print = raw_print_net_eip_stats,
.f_pcp_print = pcp_print_net_eip_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv4 traffic errors statistics",
#endif
.name = "A_NET_EIP",
.item_list_sz = 0,
.g_nr = 3,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_EIP_SIZE,
.msize = STATS_NET_EIP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* ICMP network traffic activity */
struct activity net_icmp_act = {
.id = A_NET_ICMP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_icmp,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_icmp_stats,
.f_print_avg = print_net_icmp_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "imsg/s;omsg/s;iech/s;iechr/s;oech/s;oechr/s;itm/s;itmr/s;otm/s;"
"otmr/s;iadrmk/s;iadrmkr/s;oadrmk/s;oadrmkr/s",
#endif
.gtypes_nr = {STATS_NET_ICMP_ULL, STATS_NET_ICMP_UL, STATS_NET_ICMP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_icmp_stats,
.f_xml_print = xml_print_net_icmp_stats,
.f_json_print = json_print_net_icmp_stats,
.f_svg_print = svg_print_net_icmp_stats,
.f_raw_print = raw_print_net_icmp_stats,
.f_pcp_print = pcp_print_net_icmp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "ICMPv4 traffic statistics",
#endif
.name = "A_NET_ICMP",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_ICMP_SIZE,
.msize = STATS_NET_ICMP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* ICMP network traffic (errors) activity */
struct activity net_eicmp_act = {
.id = A_NET_EICMP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_eicmp,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_eicmp_stats,
.f_print_avg = print_net_eicmp_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "ierr/s;oerr/s;idstunr/s;odstunr/s;itmex/s;otmex/s;"
"iparmpb/s;oparmpb/s;isrcq/s;osrcq/s;iredir/s;oredir/s",
#endif
.gtypes_nr = {STATS_NET_EICMP_ULL, STATS_NET_EICMP_UL, STATS_NET_EICMP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_eicmp_stats,
.f_xml_print = xml_print_net_eicmp_stats,
.f_json_print = json_print_net_eicmp_stats,
.f_svg_print = svg_print_net_eicmp_stats,
.f_raw_print = raw_print_net_eicmp_stats,
.f_pcp_print = pcp_print_net_eicmp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "ICMPv4 traffic errors statistics",
#endif
.name = "A_NET_EICMP",
.item_list_sz = 0,
.g_nr = 6,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_EICMP_SIZE,
.msize = STATS_NET_EICMP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* TCP network traffic activity */
struct activity net_tcp_act = {
.id = A_NET_TCP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_tcp,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_tcp_stats,
.f_print_avg = print_net_tcp_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "active/s;passive/s;iseg/s;oseg/s",
#endif
.gtypes_nr = {STATS_NET_TCP_ULL, STATS_NET_TCP_UL, STATS_NET_TCP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_tcp_stats,
.f_xml_print = xml_print_net_tcp_stats,
.f_json_print = json_print_net_tcp_stats,
.f_svg_print = svg_print_net_tcp_stats,
.f_raw_print = raw_print_net_tcp_stats,
.f_pcp_print = pcp_print_net_tcp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "TCPv4 traffic statistics",
#endif
.name = "A_NET_TCP",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_TCP_SIZE,
.msize = STATS_NET_TCP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* TCP network traffic (errors) activity */
struct activity net_etcp_act = {
.id = A_NET_ETCP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_etcp,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_etcp_stats,
.f_print_avg = print_net_etcp_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "atmptf/s;estres/s;retrans/s;isegerr/s;orsts/s",
#endif
.gtypes_nr = {STATS_NET_ETCP_ULL, STATS_NET_ETCP_UL, STATS_NET_ETCP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_etcp_stats,
.f_xml_print = xml_print_net_etcp_stats,
.f_json_print = json_print_net_etcp_stats,
.f_svg_print = svg_print_net_etcp_stats,
.f_raw_print = raw_print_net_etcp_stats,
.f_pcp_print = pcp_print_net_etcp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "TCPv4 traffic errors statistics",
#endif
.name = "A_NET_ETCP",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_ETCP_SIZE,
.msize = STATS_NET_ETCP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* UDP network traffic activity */
struct activity net_udp_act = {
.id = A_NET_UDP,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_SNMP,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_udp,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_udp_stats,
.f_print_avg = print_net_udp_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "idgm/s;odgm/s;noport/s;idgmerr/s",
#endif
.gtypes_nr = {STATS_NET_UDP_ULL, STATS_NET_UDP_UL, STATS_NET_UDP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_udp_stats,
.f_xml_print = xml_print_net_udp_stats,
.f_json_print = json_print_net_udp_stats,
.f_svg_print = svg_print_net_udp_stats,
.f_raw_print = raw_print_net_udp_stats,
.f_pcp_print = pcp_print_net_udp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "UDPv4 traffic statistics",
#endif
.name = "A_NET_UDP",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_UDP_SIZE,
.msize = STATS_NET_UDP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* IPv6 sockets activity */
struct activity net_sock6_act = {
.id = A_NET_SOCK6,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_IPV6,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_sock6,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_sock6_stats,
.f_print_avg = print_avg_net_sock6_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "tcp6sck;udp6sck;raw6sck;ip6-frag",
#endif
.gtypes_nr = {STATS_NET_SOCK6_ULL, STATS_NET_SOCK6_UL, STATS_NET_SOCK6_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_sock6_stats,
.f_xml_print = xml_print_net_sock6_stats,
.f_json_print = json_print_net_sock6_stats,
.f_svg_print = svg_print_net_sock6_stats,
.f_raw_print = raw_print_net_sock6_stats,
.f_pcp_print = pcp_print_net_sock6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv6 sockets statistics",
#endif
.name = "A_NET_SOCK6",
.item_list_sz = 0,
.g_nr = 1,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_SOCK6_SIZE,
.msize = STATS_NET_SOCK6_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* IPv6 network traffic activity */
struct activity net_ip6_act = {
.id = A_NET_IP6,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_IPV6,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_ip6,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_ip6_stats,
.f_print_avg = print_net_ip6_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "irec6/s;fwddgm6/s;idel6/s;orq6/s;asmrq6/s;asmok6/s;"
"imcpck6/s;omcpck6/s;fragok6/s;fragcr6/s",
#endif
.gtypes_nr = {STATS_NET_IP6_ULL, STATS_NET_IP6_UL, STATS_NET_IP6_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_ip6_stats,
.f_xml_print = xml_print_net_ip6_stats,
.f_json_print = json_print_net_ip6_stats,
.f_svg_print = svg_print_net_ip6_stats,
.f_raw_print = raw_print_net_ip6_stats,
.f_pcp_print = pcp_print_net_ip6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv6 traffic statistics",
#endif
.name = "A_NET_IP6",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_IP6_SIZE,
.msize = STATS_NET_IP6_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* IPv6 network traffic (errors) activity */
struct activity net_eip6_act = {
.id = A_NET_EIP6,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_IPV6,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_eip6,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_eip6_stats,
.f_print_avg = print_net_eip6_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "ihdrer6/s;iadrer6/s;iukwnp6/s;i2big6/s;idisc6/s;odisc6/s;"
"inort6/s;onort6/s;asmf6/s;fragf6/s;itrpck6/s",
#endif
.gtypes_nr = {STATS_NET_EIP6_ULL, STATS_NET_EIP6_UL, STATS_NET_EIP6_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_eip6_stats,
.f_xml_print = xml_print_net_eip6_stats,
.f_json_print = json_print_net_eip6_stats,
.f_svg_print = svg_print_net_eip6_stats,
.f_raw_print = raw_print_net_eip6_stats,
.f_pcp_print = pcp_print_net_eip6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "IPv6 traffic errors statistics",
#endif
.name = "A_NET_EIP6",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_EIP6_SIZE,
.msize = STATS_NET_EIP6_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* ICMPv6 network traffic activity */
struct activity net_icmp6_act = {
.id = A_NET_ICMP6,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_IPV6,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_icmp6,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_icmp6_stats,
.f_print_avg = print_net_icmp6_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "imsg6/s;omsg6/s;iech6/s;iechr6/s;oechr6/s;igmbq6/s;igmbr6/s;ogmbr6/s;"
"igmbrd6/s;ogmbrd6/s;irtsol6/s;ortsol6/s;irtad6/s;inbsol6/s;onbsol6/s;"
"inbad6/s;onbad6/s",
#endif
.gtypes_nr = {STATS_NET_ICMP6_ULL, STATS_NET_ICMP6_UL, STATS_NET_ICMP6_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_icmp6_stats,
.f_xml_print = xml_print_net_icmp6_stats,
.f_json_print = json_print_net_icmp6_stats,
.f_svg_print = svg_print_net_icmp6_stats,
.f_raw_print = raw_print_net_icmp6_stats,
.f_pcp_print = pcp_print_net_icmp6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "ICMPv6 traffic statistics",
#endif
.name = "A_NET_ICMP6",
.item_list_sz = 0,
.g_nr = 5,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_ICMP6_SIZE,
.msize = STATS_NET_ICMP6_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* ICMPv6 network traffic (errors) activity */
struct activity net_eicmp6_act = {
.id = A_NET_EICMP6,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_IPV6,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_eicmp6,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_eicmp6_stats,
.f_print_avg = print_net_eicmp6_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "ierr6/s;idtunr6/s;odtunr6/s;itmex6/s;otmex6/s;"
"iprmpb6/s;oprmpb6/s;iredir6/s;oredir6/s;ipck2b6/s;opck2b6/s",
#endif
.gtypes_nr = {STATS_NET_EICMP6_ULL, STATS_NET_EICMP6_UL, STATS_NET_EICMP6_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_eicmp6_stats,
.f_xml_print = xml_print_net_eicmp6_stats,
.f_json_print = json_print_net_eicmp6_stats,
.f_svg_print = svg_print_net_eicmp6_stats,
.f_raw_print = raw_print_net_eicmp6_stats,
.f_pcp_print = pcp_print_net_eicmp6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "ICMPv6 traffic errors statistics",
#endif
.name = "A_NET_EICMP6",
.item_list_sz = 0,
.g_nr = 6,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_EICMP6_SIZE,
.msize = STATS_NET_EICMP6_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* UDPv6 network traffic activity */
struct activity net_udp6_act = {
.id = A_NET_UDP6,
.options = AO_NULL,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_IPV6,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_net_udp6,
#endif
#ifdef SOURCE_SAR
.f_print = print_net_udp6_stats,
.f_print_avg = print_net_udp6_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "idgm6/s;odgm6/s;noport6/s;idgmer6/s",
#endif
.gtypes_nr = {STATS_NET_UDP6_ULL, STATS_NET_UDP6_UL, STATS_NET_UDP6_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_net_udp6_stats,
.f_xml_print = xml_print_net_udp6_stats,
.f_json_print = json_print_net_udp6_stats,
.f_svg_print = svg_print_net_udp6_stats,
.f_raw_print = raw_print_net_udp6_stats,
.f_pcp_print = pcp_print_net_udp6_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "UDPv6 traffic statistics",
#endif
.name = "A_NET_UDP6",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_NET_UDP6_SIZE,
.msize = STATS_NET_UDP6_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* CPU frequency */
struct activity pwr_cpufreq_act = {
.id = A_PWR_CPU,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
.f_count_index = 0, /* wrap_get_cpu_nr() */
.f_count2 = NULL,
.f_read = wrap_read_cpuinfo,
#endif
#ifdef SOURCE_SAR
.f_print = print_pwr_cpufreq_stats,
.f_print_avg = print_avg_pwr_cpufreq_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "CPU;MHz",
#endif
.gtypes_nr = {STATS_PWR_CPUFREQ_ULL, STATS_PWR_CPUFREQ_UL, STATS_PWR_CPUFREQ_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pwr_cpufreq_stats,
.f_xml_print = xml_print_pwr_cpufreq_stats,
.f_json_print = json_print_pwr_cpufreq_stats,
.f_svg_print = svg_print_pwr_cpufreq_stats,
.f_raw_print = raw_print_pwr_cpufreq_stats,
.f_pcp_print = pcp_print_pwr_cpufreq_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "CPU clock frequency",
#endif
.name = "A_PWR_CPU",
.item_list_sz = 0,
.g_nr = 1,
.nr_ini = -1,
.nr2 = 1,
.nr_max = NR_CPUS + 1,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_PWR_CPUFREQ_SIZE,
.msize = STATS_PWR_CPUFREQ_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = &cpu_bitmap
};
/* Fan */
struct activity pwr_fan_act = {
.id = A_PWR_FAN,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
.f_count_index = 5, /* wrap_get_fan_nr() */
.f_count2 = NULL,
.f_read = wrap_read_fan,
#endif
#ifdef SOURCE_SAR
.f_print = print_pwr_fan_stats,
.f_print_avg = print_avg_pwr_fan_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "FAN;DEVICE;rpm;drpm",
#endif
.gtypes_nr = {STATS_PWR_FAN_ULL, STATS_PWR_FAN_UL, STATS_PWR_FAN_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pwr_fan_stats,
.f_xml_print = xml_print_pwr_fan_stats,
.f_json_print = json_print_pwr_fan_stats,
.f_svg_print = svg_print_pwr_fan_stats,
.f_raw_print = raw_print_pwr_fan_stats,
.f_pcp_print = pcp_print_pwr_fan_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Fans speed",
#endif
.name = "A_PWR_FAN",
.item_list_sz = 0,
.g_nr = 1,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_FANS,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_PWR_FAN_SIZE,
.msize = STATS_PWR_FAN_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Temperature */
struct activity pwr_temp_act = {
.id = A_PWR_TEMP,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
.f_count_index = 6, /* wrap_get_temp_nr() */
.f_count2 = NULL,
.f_read = wrap_read_temp,
#endif
#ifdef SOURCE_SAR
.f_print = print_pwr_temp_stats,
.f_print_avg = print_avg_pwr_temp_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "TEMP;DEVICE;degC;%temp",
#endif
.gtypes_nr = {STATS_PWR_TEMP_ULL, STATS_PWR_TEMP_UL, STATS_PWR_TEMP_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pwr_temp_stats,
.f_xml_print = xml_print_pwr_temp_stats,
.f_json_print = json_print_pwr_temp_stats,
.f_svg_print = svg_print_pwr_temp_stats,
.f_raw_print = raw_print_pwr_temp_stats,
.f_pcp_print = pcp_print_pwr_temp_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Devices temperature",
#endif
.name = "A_PWR_TEMP",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_TEMP_SENSORS,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_PWR_TEMP_SIZE,
.msize = STATS_PWR_TEMP_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Voltage inputs */
struct activity pwr_in_act = {
.id = A_PWR_IN,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
.f_count_index = 7, /* wrap_get_in_nr() */
.f_count2 = NULL,
.f_read = wrap_read_in,
#endif
#ifdef SOURCE_SAR
.f_print = print_pwr_in_stats,
.f_print_avg = print_avg_pwr_in_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "IN;DEVICE;inV;%in",
#endif
.gtypes_nr = {STATS_PWR_IN_ULL, STATS_PWR_IN_UL, STATS_PWR_IN_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pwr_in_stats,
.f_xml_print = xml_print_pwr_in_stats,
.f_json_print = json_print_pwr_in_stats,
.f_svg_print = svg_print_pwr_in_stats,
.f_raw_print = raw_print_pwr_in_stats,
.f_pcp_print = pcp_print_pwr_in_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Voltage inputs statistics",
#endif
.name = "A_PWR_IN",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_IN_SENSORS,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_PWR_IN_SIZE,
.msize = STATS_PWR_IN_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Hugepages activity */
struct activity huge_act = {
.id = A_HUGE,
.options = AO_COLLECTED,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = -1,
.f_count2 = NULL,
.f_read = wrap_read_meminfo_huge,
#endif
#ifdef SOURCE_SAR
.f_print = print_huge_stats,
.f_print_avg = print_avg_huge_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "kbhugfree;kbhugused;%hugused;kbhugrsvd;kbhugsurp",
#endif
.gtypes_nr = {STATS_HUGE_ULL, STATS_HUGE_UL, STATS_HUGE_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_huge_stats,
.f_xml_print = xml_print_huge_stats,
.f_json_print = json_print_huge_stats,
.f_svg_print = svg_print_huge_stats,
.f_raw_print = raw_print_huge_stats,
.f_pcp_print = pcp_print_huge_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Huge pages utilization",
#endif
.name = "A_HUGE",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_HUGE_SIZE,
.msize = STATS_HUGE_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* CPU weighted frequency */
struct activity pwr_wghfreq_act = {
.id = A_PWR_FREQ,
.options = AO_COUNTED + AO_MATRIX,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_POWER,
#ifdef SOURCE_SADC
.f_count_index = 0, /* wrap_get_cpu_nr() */
.f_count2 = wrap_get_freq_nr,
.f_read = wrap_read_cpu_wghfreq,
#endif
#ifdef SOURCE_SAR
.f_print = print_pwr_wghfreq_stats,
.f_print_avg = print_pwr_wghfreq_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "CPU;wghMHz",
#endif
.gtypes_nr = {STATS_PWR_WGHFREQ_ULL, STATS_PWR_WGHFREQ_UL, STATS_PWR_WGHFREQ_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pwr_wghfreq_stats,
.f_xml_print = xml_print_pwr_wghfreq_stats,
.f_json_print = json_print_pwr_wghfreq_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_pwr_wghfreq_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "CPU weighted frequency",
#endif
.name = "A_PWR_FREQ",
.item_list_sz = 0,
.g_nr = 0,
.nr_ini = -1,
.nr2 = -1,
.nr_max = NR_CPUS + 1,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_PWR_WGHFREQ_SIZE,
.msize = STATS_PWR_WGHFREQ_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = &cpu_bitmap
};
/* USB devices plugged into the system */
struct activity pwr_usb_act = {
.id = A_PWR_USB,
.options = AO_COUNTED + AO_CLOSE_MARKUP,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
.f_count_index = 8, /* wrap_get_usb_nr() */
.f_count2 = NULL,
.f_read = wrap_read_bus_usb_dev,
#endif
#ifdef SOURCE_SAR
.f_print = print_pwr_usb_stats,
.f_print_avg = print_avg_pwr_usb_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "manufact;product;BUS;idvendor;idprod;maxpower",
#endif
.gtypes_nr = {STATS_PWR_USB_ULL, STATS_PWR_USB_UL, STATS_PWR_USB_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_pwr_usb_stats,
.f_xml_print = xml_print_pwr_usb_stats,
.f_json_print = json_print_pwr_usb_stats,
.f_svg_print = NULL,
.f_raw_print = raw_print_pwr_usb_stats,
.f_pcp_print = pcp_print_pwr_usb_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "USB devices",
#endif
.name = "A_PWR_USB",
.item_list_sz = 0,
.g_nr = 0,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_USB,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_PWR_USB_SIZE,
.msize = STATS_PWR_USB_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Filesystem usage activity */
struct activity filesystem_act = {
.id = A_FS,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM + AO_MULTIPLE_OUTPUTS,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_XDISK,
#ifdef SOURCE_SADC
.f_count_index = 9, /* wrap_get_filesystem_nr() */
.f_count2 = NULL,
.f_read = wrap_read_filesystem,
#endif
#ifdef SOURCE_SAR
.f_print = print_filesystem_stats,
.f_print_avg = print_avg_filesystem_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "FILESYSTEM;MBfsfree;MBfsused;%fsused;%ufsused;Ifree;Iused;%Iused|"
"MOUNTPOINT;MBfsfree;MBfsused;%fsused;%ufsused;Ifree;Iused;%Iused",
#endif
.gtypes_nr = {STATS_FILESYSTEM_ULL, STATS_FILESYSTEM_UL, STATS_FILESYSTEM_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_filesystem_stats,
.f_xml_print = xml_print_filesystem_stats,
.f_json_print = json_print_filesystem_stats,
.f_svg_print = svg_print_filesystem_stats,
.f_raw_print = raw_print_filesystem_stats,
.f_pcp_print = pcp_print_filesystem_stats,
.f_count_new = count_new_filesystem,
.item_list = NULL,
.desc = "Filesystems statistics",
#endif
.name = "A_FS",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_FS,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_FILESYSTEM_SIZE,
.msize = STATS_FILESYSTEM_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Fibre Channel HBA usage activity */
struct activity fchost_act = {
.id = A_NET_FC,
.options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DISK,
#ifdef SOURCE_SADC
.f_count_index = 10, /* wrap_get_fchost_nr() */
.f_count2 = NULL,
.f_read = wrap_read_fchost,
#endif
#ifdef SOURCE_SAR
.f_print = print_fchost_stats,
.f_print_avg = print_fchost_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "FCHOST;fch_rxf/s;fch_txf/s;fch_rxw/s;fch_txw/s",
#endif
.gtypes_nr = {STATS_FCHOST_ULL, STATS_FCHOST_UL, STATS_FCHOST_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_fchost_stats,
.f_xml_print = xml_print_fchost_stats,
.f_json_print = json_print_fchost_stats,
.f_svg_print = svg_print_fchost_stats,
.f_raw_print = raw_print_fchost_stats,
.f_pcp_print = pcp_print_fchost_stats,
.f_count_new = count_new_fchost,
.item_list = NULL,
.desc = "Fibre Channel HBA statistics",
#endif
.name = "A_NET_FC",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = -1,
.nr2 = 1,
.nr_max = MAX_NR_FCHOSTS,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_FCHOST_SIZE,
.msize = STATS_FCHOST_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Softnet activity */
struct activity softnet_act = {
.id = A_NET_SOFT,
.options = AO_COLLECTED + AO_COUNTED + AO_CLOSE_MARKUP +
AO_GRAPH_PER_ITEM + AO_PERSISTENT,
.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
.gtypes_nr = {STATS_SOFTNET_ULL, STATS_SOFTNET_UL, STATS_SOFTNET_U},
.ftypes_nr = {0, 0, 0},
#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,
.f_raw_print = raw_print_softnet_stats,
.f_pcp_print = pcp_print_softnet_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Software-based network processing statistics",
#endif
.name = "A_NET_SOFT",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = -1,
.nr2 = 1,
.nr_max = NR_CPUS + 1,
.nr = {-1, -1, -1},
.nr_allocated = 0,
.fsize = STATS_SOFTNET_SIZE,
.msize = STATS_SOFTNET_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = &cpu_bitmap
};
/* Pressure-stall CPU activity */
struct activity psi_cpu_act = {
.id = A_PSI_CPU,
.options = AO_COLLECTED + AO_DETECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 11,
.f_count2 = NULL,
.f_read = wrap_read_psicpu,
#endif
#ifdef SOURCE_SAR
.f_print = print_psicpu_stats,
.f_print_avg = print_avg_psicpu_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "%scpu-10;%scpu-60;%scpu-300;%scpu",
#endif
.gtypes_nr = {STATS_PSI_CPU_ULL, STATS_PSI_CPU_UL, STATS_PSI_CPU_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_psicpu_stats,
.f_xml_print = xml_print_psicpu_stats,
.f_json_print = json_print_psicpu_stats,
.f_svg_print = svg_print_psicpu_stats,
.f_raw_print = raw_print_psicpu_stats,
.f_pcp_print = pcp_print_psicpu_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Pressure-stall CPU statistics",
#endif
.name = "A_PSI_CPU",
.item_list_sz = 0,
.g_nr = 2,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_PSI_CPU_SIZE,
.msize = STATS_PSI_CPU_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Pressure-stall I/O activity */
struct activity psi_io_act = {
.id = A_PSI_IO,
.options = AO_COLLECTED + AO_DETECTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 11,
.f_count2 = NULL,
.f_read = wrap_read_psiio,
#endif
#ifdef SOURCE_SAR
.f_print = print_psiio_stats,
.f_print_avg = print_avg_psiio_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "%sio-10;%sio-60;%sio-300;%sio;%fio-10;%fio-60;%fio-300;%fio",
#endif
.gtypes_nr = {STATS_PSI_IO_ULL, STATS_PSI_IO_UL, STATS_PSI_IO_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_psiio_stats,
.f_xml_print = xml_print_psiio_stats,
.f_json_print = json_print_psiio_stats,
.f_svg_print = svg_print_psiio_stats,
.f_raw_print = raw_print_psiio_stats,
.f_pcp_print = pcp_print_psiio_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Pressure-stall I/O statistics",
#endif
.name = "A_PSI_IO",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_PSI_IO_SIZE,
.msize = STATS_PSI_IO_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
/* Pressure-stall memory activity */
struct activity psi_mem_act = {
.id = A_PSI_MEM,
.options = AO_COLLECTED + AO_DETECTED + AO_CLOSE_MARKUP,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
.f_count_index = 11,
.f_count2 = NULL,
.f_read = wrap_read_psimem,
#endif
#ifdef SOURCE_SAR
.f_print = print_psimem_stats,
.f_print_avg = print_avg_psimem_stats,
#endif
#if defined(SOURCE_SAR) || defined(SOURCE_SADF)
.hdr_line = "%smem-10;%smem-60;%smem-300;%smem;%fmem-10;%fmem-60;%fmem-300;%fmem",
#endif
.gtypes_nr = {STATS_PSI_MEM_ULL, STATS_PSI_MEM_UL, STATS_PSI_MEM_U},
.ftypes_nr = {0, 0, 0},
#ifdef SOURCE_SADF
.f_render = render_psimem_stats,
.f_xml_print = xml_print_psimem_stats,
.f_json_print = json_print_psimem_stats,
.f_svg_print = svg_print_psimem_stats,
.f_raw_print = raw_print_psimem_stats,
.f_pcp_print = pcp_print_psimem_stats,
.f_count_new = NULL,
.item_list = NULL,
.desc = "Pressure-stall memory statistics",
#endif
.name = "A_PSI_MEM",
.item_list_sz = 0,
.g_nr = 4,
.nr_ini = 1,
.nr2 = 1,
.nr_max = 1,
.nr = {1, 1, 1},
.nr_allocated = 0,
.fsize = STATS_PSI_MEM_SIZE,
.msize = STATS_PSI_MEM_SIZE,
.opt_flags = 0,
.buf = {NULL, NULL, NULL},
.bitmap = NULL
};
#ifdef SOURCE_SADC
/*
* Array of functions used to count number of items.
*/
__nr_t (*f_count[NR_F_COUNT]) (struct activity *) = {
wrap_get_cpu_nr,
wrap_get_irq_nr,
wrap_get_serial_nr,
wrap_get_disk_nr,
wrap_get_iface_nr,
wrap_get_fan_nr,
wrap_get_temp_nr,
wrap_get_in_nr,
wrap_get_usb_nr,
wrap_get_filesystem_nr,
wrap_get_fchost_nr,
wrap_detect_psi
};
#endif
/*
* Array of activities.
* (Order of activities doesn't matter for daily data files).
*/
struct activity *act[NR_ACT] = {
&cpu_act,
&pcsw_act,
&irq_act,
&swap_act,
&paging_act,
&io_act,
&memory_act,
&huge_act,
&ktables_act,
&queue_act,
&serial_act,
&disk_act,
/* <network> */
&net_dev_act,
&net_edev_act,
&net_nfs_act,
&net_nfsd_act,
&net_sock_act,
&net_ip_act,
&net_eip_act,
&net_icmp_act,
&net_eicmp_act,
&net_tcp_act,
&net_etcp_act,
&net_udp_act,
&net_sock6_act,
&net_ip6_act,
&net_eip6_act,
&net_icmp6_act,
&net_eicmp6_act,
&net_udp6_act,
&fchost_act,
&softnet_act, /* AO_CLOSE_MARKUP */
/* </network> */
/* <power-management> */
&pwr_cpufreq_act,
&pwr_fan_act,
&pwr_temp_act,
&pwr_in_act,
&pwr_wghfreq_act,
&pwr_usb_act, /* AO_CLOSE_MARKUP */
/* </power-management> */
&filesystem_act,
/* <psi> */
&psi_cpu_act,
&psi_io_act,
&psi_mem_act /* AO_CLOSE_MARKUP */
/* </psi> */
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/sysstat.git
git@gitee.com:mirrors/sysstat.git
mirrors
sysstat
sysstat
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385