Source
*error = zbx_dsprintf(NULL, "invalid control target - unspecified process identifier or type");
/*
** Zabbix
** Copyright (C) 2001-2025 Zabbix SIA
**
** 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 even 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-1301, USA.
**/
static int rtc_parse_scope(const char *str, int *scope)
{
if (NULL == scope)
return FAIL;
if (0 == strcmp(str, "rwlock"))
*scope = ZBX_PROF_RWLOCK;
else if (0 == strcmp(str, "mutex"))
*scope = ZBX_PROF_MUTEX;
else if (0 == strcmp(str, "processing"))
*scope = ZBX_PROF_PROCESSING;
else
return FAIL;
return SUCCEED;
}
/******************************************************************************
* *
* Purpose: parse runtime control option *
* *
* Parameters: opt - [IN] runtime control option *
* len - [IN] runtime control option length without *
* parameter *
* pid - [OUT] target pid (if specified) *
* proc_type - [OUT] target process type (if specified) *
* proc_num - [OUT] target process num (if specified) *
* scope - [OUT] scope (if specified) *
* error - [OUT] error message *
* *
* Return value: SUCCEED - runtime control option was processed *
* FAIL - otherwise *
* *
******************************************************************************/
int zbx_rtc_parse_option(const char *opt, size_t len, pid_t *pid, int *proc_type, int *proc_num,
int *scope, char **error)
{
const char *rtc_options;