16#include "daq/rfarm/manager/RFConf.h"
17#include "daq/rfarm/manager/RFSharedMem.h"
18#include "daq/rfarm/manager/RFFlowStat.h"
23int main(
int argc,
char** argv)
27 printf(
"Usage : nodedump unitname nodename\n");
32 gethostname(host,
sizeof(host));
34 char* confdir = getenv(
"RFARM_CONFDIR");
35 string confpath = string(confdir) +
"/" + string(argv[1]) +
".conf";
37 RFConf conf(confpath.c_str());
48 if (strstr(argv[2],
"dist") != NULL) {
49 strcpy(nodename,
"distributor");
50 int nnodes = conf.getconfi(
"processor",
"nnodes");
51 idlist[0] = RF_INPUT_ID;
52 strcpy(item[0],
"IN ");
53 for (
int i = 0; i < nnodes; i++) {
55 sprintf(item[i + 1],
"OUT%2.2d ", i);
58 }
else if (strstr(argv[2],
"col") != NULL) {
59 strcpy(nodename,
"collector");
60 int nnodes = conf.getconfi(
"processor",
"nnodes");
61 for (
int i = 0; i < nnodes; i++) {
63 sprintf(item[i],
"IN%2.2d ", i);
65 idlist[nnodes] = RF_OUTPUT_ID;
66 strcpy(item[nnodes],
"OUT ");
68 }
else if (strstr(argv[2],
"roi") != NULL) {
69 strcpy(nodename,
"roisender");
70 idlist[0] = RF_ROI_ID;
71 strcpy(item[0],
"OUT ");
77 strcpy(nodename,
"evp_");
78 char hostnamebuf[256];
79 gethostname(hostnamebuf,
sizeof(hostnamebuf));
80 strcat(&nodename[4], &hostnamebuf[6]);
81 int lend = strlen(nodename);
82 nodename[lend + 1] = (char)0;
83 nodename[lend] = nodename[lend - 1];
84 strncpy(&nodename[lend - 1],
"0", 1);
87 sprintf(nodename,
"evp_%s", host);
90 strcpy(item[0],
"IN ");
92 strcpy(item[1],
"OUT ");
95 string shmname = string(conf.getconf(
"system",
"unitname")) +
":" +
99 printf(
"nodename = %s, nid = %d\n", nodename, nid);
100 printf(
"id range : %d to %d\n", idlist[0], idlist[nid - 1]);
103 printf(
" At : Nevent Nqueue Flow(MB/s) Size(KB) Rate(Hz)\n");
104 for (
int i = 0; i < nid; i++) {
110 printf(
"%s : %10d %10d %10.2f %10.2f %10.2f\n",
112 cell.nevent, cell.nqueue, cell.flowrate, cell.avesize,
Abstract base class for different kinds of events.