MCPcopy Create free account
hub / github.com/acl-dev/acl / proctl_monitor_main

Function proctl_monitor_main

lib_acl/src/proctl/proctl_monitor.c:224–289  ·  view source on GitHub ↗

���ƽ��̵ļ����̴߳������������ */

Source from the content-addressed store, hash-verified

222
223/* ���ƽ��̵ļ����̴߳������������ */
224static int proctl_monitor_main(ACL_VSTREAM *client, int argc, char *argv[])
225{
226 const char *myname = "proctl_monitor_main";
227 char i, cmd[256], filepath[MAX_PATH], args[512];
228
229 cmd[0] = 0;
230 filepath[0] = 0;
231 args[0] = 0;
232
233 if (acl_do_debug(ACL_DEBUG_PROCTL, 2)) {
234 int i;
235 for (i = 0; i < argc; i++)
236 acl_msg_info("%s(%d): argv[%d]=%s", myname, __LINE__, i, argv[i]);
237 }
238
239 /* "d:f:a:h" */
240 for (i = 0; i < argc; i++) {
241 if (argv[i][0] != '-')
242 continue;
243 switch(argv[i][1]) {
244 case 'h':
245 usage(client);
246 return (0);
247 case 'd':
248 if (argv[++i] == NULL) {
249 usage(client);
250 return (0);
251 }
252 ACL_SAFE_STRNCPY(cmd, argv[i], sizeof(cmd));
253 break;
254 case 'f':
255 if (argv[++i] == NULL) {
256 usage(client);
257 return (0);
258 }
259 ACL_SAFE_STRNCPY(filepath, argv[i], sizeof(filepath));
260 break;
261 case 'a':
262 if (argv[++i] == NULL) {
263 usage(client);
264 return (0);
265 }
266 ACL_SAFE_STRNCPY(args, argv[i], sizeof(args));
267 break;
268 default:
269 break;
270 }
271 }
272
273 if (strcasecmp(cmd, "STOP") == 0) {
274 proctl_monitor_cmd_stop(client, filepath, args);
275 } else if (strcasecmp(cmd, "START") == 0) {
276 proctl_monitor_cmd_start(client, filepath, args);
277 } else if (strcasecmp(cmd, "QUIT") == 0) {
278 proctl_monitor_cmd_quit(client);
279 } else if (strcasecmp(cmd, "LIST") == 0) {
280 proctl_monitor_cmd_list(client);
281 } else if (strcasecmp(cmd, "PROBE") == 0) {

Callers 1

proctl_monitor_loopFunction · 0.85

Calls 9

acl_do_debugFunction · 0.85
acl_msg_infoFunction · 0.85
proctl_monitor_cmd_stopFunction · 0.85
proctl_monitor_cmd_startFunction · 0.85
proctl_monitor_cmd_quitFunction · 0.85
proctl_monitor_cmd_listFunction · 0.85
proctl_monitor_cmd_probeFunction · 0.85
acl_msg_warnFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…