Definition at line 29 of file ERecoEventSampler.h.
◆ ERecoEventSampler()
Definition at line 24 of file ERecoEventSampler.cc.
25{
26
27
28 m_conffile = conffile;
29 m_conf =
new RFConf(conffile.c_str());
30 char* nodename = m_conf->getconf("eventsampler", "nodename");
31
32
33 string execdir = string(m_conf->getconf("system", "execdir_base")) + "/sampler";
34
35 mkdir(execdir.c_str(), 0755);
36 chdir(execdir.c_str());
37
38
39 char* rbufout = m_conf->getconf("eventsampler", "ringbufout");
40 int rbufsize = m_conf->getconfi("eventsampler", "ringbufoutsize");
42
43
45
46
47 m_log =
new RFLogManager(nodename, m_conf->getconf(
"system",
"lognode"));
48
49 m_pid_sampler = 0;
50
51}
Class to manage a Ring Buffer placed in an IPC shared memory.
◆ ~ERecoEventSampler()
Definition at line 53 of file ERecoEventSampler.cc.
54{
55 delete m_log;
56 delete m_proc;
57 delete m_conf;
58 delete m_rbufout;
59}
◆ Configure()
Reimplemented from RFServerBase.
Definition at line 64 of file ERecoEventSampler.cc.
65{
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 printf("ERecoEventSampler : Configure done\n");
82 return 0;
83}
◆ GetNodeInfo()
◆ Pause()
◆ Restart()
◆ Resume()
◆ server()
Definition at line 152 of file ERecoEventSampler.cc.
153{
154 while (true) {
155 pid_t pid = m_proc->CheckProcess();
156 if (pid > 0) {
157 if (pid == m_pid_sampler)
158 printf("ERecoEventSampler : eventsampler process dead. pid = %d\n", pid);
159 else
160 printf("ERecoEventSampler : unknown process dead. pid = %d\n", pid);
161 }
162
163 int st = m_proc->CheckOutput();
164 if (st < 0) {
165 perror("ERecoEventSampler::server");
166
167 } else if (st > 0) {
168 m_log->ProcessLog(m_proc->GetFd());
169 }
170 }
171}
◆ SetNodeInfo()
◆ Start()
Reimplemented from RFServerBase.
Definition at line 108 of file ERecoEventSampler.cc.
109{
110
111 char* sampler = m_conf->getconf("eventsampler", "script");
112 m_pid_sampler = m_proc->
Execute(sampler, (
char*)m_conffile.c_str());
113
114
115
116
117
118
119
120
121
122 printf("ERecoEventSampler : Configure done\n");
123
124
125
126 return 0;
127}
int Execute(char *script, int nargs, char **args)
◆ Status()
◆ Stop()
Reimplemented from RFServerBase.
Definition at line 129 of file ERecoEventSampler.cc.
130{
131 int status;
132 printf("ERecoEventSampler: Unconfigure pids = %d %d\n", m_pid_sampler, m_pid_server);
133 fflush(stdout);
134 if (m_pid_sampler != 0) {
135 kill(m_pid_sampler, SIGINT);
136 waitpid(m_pid_sampler, &status, 0);
137 m_pid_sampler = 0;
138 }
139
140
141 return 0;
142}
◆ UnConfigure()
Reimplemented from RFServerBase.
Definition at line 85 of file ERecoEventSampler.cc.
86{
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104 printf("ERecoEventSampler : Unconfigure done\n");
105 return 0;
106}
◆ m_conf
◆ m_conffile
◆ m_log
◆ m_nsmmem
◆ m_pid_sampler
◆ m_pid_server
◆ m_proc
◆ m_rbufout
◆ s_instance
The documentation for this class was generated from the following files: