Skip to content

Commit

Permalink
Drop __FUNCTION__ from clixon_debug() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Prindeville committed Jan 11, 2024
1 parent d5a8d6b commit 5c62d34
Show file tree
Hide file tree
Showing 74 changed files with 580 additions and 577 deletions.
24 changes: 12 additions & 12 deletions apps/backend/backend_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ ce_event_cb(clixon_handle h,
struct client_entry *ce = (struct client_entry *)arg;
cbuf *cbce = NULL;

clixon_debug(CLIXON_DBG_CLIENT, "%s op:%d", __FUNCTION__, op);
clixon_debug(CLIXON_DBG_CLIENT, "op:%d", op);
switch (op){
case 1:
/* Risk of recursion here */
Expand Down Expand Up @@ -282,7 +282,7 @@ backend_monitoring_state_get(clixon_handle h,
goto fail;
retval = 1;
done:
clixon_debug(CLIXON_DBG_CLIENT, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_CLIENT, "%d", retval);
if (cb)
cbuf_free(cb);
return retval;
Expand Down Expand Up @@ -336,7 +336,7 @@ backend_client_rm(clixon_handle h,
}
}

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
/* for all streams: XXX better to do it top-level? */
stream_ss_delete_all(h, ce_event_cb, (void*)ce);
c0 = backend_client_list(h);
Expand Down Expand Up @@ -378,7 +378,7 @@ clixon_stats_datastore_get(clixon_handle h,
size_t sz = 0;
cxobj *xn = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, dbname);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", dbname);
/* This is the db cache */
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
/* Trigger cache if no exist (trick to ensure cache is present) */
Expand Down Expand Up @@ -655,7 +655,7 @@ from_client_edit_config(clixon_handle h,
xml_free(xret);
if (cbx)
cbuf_free(cbx);
clixon_debug(CLIXON_DBG_CLIENT, "%s done cbret:%s", __FUNCTION__, cbuf_get(cbret));
clixon_debug(CLIXON_DBG_CLIENT, "done cbret:%s", cbuf_get(cbret));
return retval;
} /* from_client_edit_config */

Expand Down Expand Up @@ -1584,7 +1584,7 @@ from_client_msg(clixon_handle h,
int nr = 0;
cbuf *cbce = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
yspec = clicon_dbspec_yang(h);
/* Return netconf message. Should be filled in by the dispatch(sub) functions
* as wither rpc-error or by positive response.
Expand Down Expand Up @@ -1633,7 +1633,7 @@ from_client_msg(clixon_handle h,
if (op_id != 0 && ce->ce_id != op_id && strcmp(rpcname, "create-subscription")){
client_entry *ce0;

clixon_debug(CLIXON_DBG_CLIENT, "%s Warning: incoming session-id:%u does not match ce_id:%u on socket: %d", __FUNCTION__, op_id, ce->ce_id, ce->ce_s);
clixon_debug(CLIXON_DBG_CLIENT, "Warning: incoming session-id:%u does not match ce_id:%u on socket: %d", op_id, ce->ce_id, ce->ce_s);
/* Copy transport from orig client-entry */
if (ce->ce_transport == NULL &&
(ce0 = ce_find_byid(backend_client_list(h), op_id)) != NULL &&
Expand Down Expand Up @@ -1720,7 +1720,7 @@ from_client_msg(clixon_handle h,
goto done;
}
module = yang_argument_get(ymod);
clixon_debug(CLIXON_DBG_CLIENT, "%s module:%s rpc:%s ce_id:%u s:%d", __FUNCTION__, module,
clixon_debug(CLIXON_DBG_CLIENT, "module:%s rpc:%s ce_id:%u s:%d", module,
rpc, ce->ce_id, ce->ce_s);
/* Pre-NACM access step */
xnacm = NULL;
Expand Down Expand Up @@ -1812,7 +1812,7 @@ from_client_msg(clixon_handle h,
// ok:
retval = 0;
done:
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "retval:%d", retval);
if (xnacm){
xml_free(xnacm);
if (clicon_nacm_cache_set(h, NULL) < 0)
Expand All @@ -1830,7 +1830,7 @@ from_client_msg(clixon_handle h,
if (retval < 0 && clixon_err_category() < 0)
clixon_log(h, LOG_NOTICE, "%s: Internal error: No clixon_err call on RPC error (message: %s)",
__FUNCTION__, rpc?rpc:"");
// clixon_debug(CLIXON_DBG_CLIENT, "%s retval:%d", __FUNCTION__, retval);
// clixon_debug(CLIXON_DBG_CLIENT, "retval:%d", retval);
return retval;// -1 here terminates backend
}

Expand All @@ -1853,7 +1853,7 @@ from_client(int s,
int eof = 0;
cbuf *cbce = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
if (s != ce->ce_s){
clixon_err(OE_NETCONF, EINVAL, "Internal error: s != ce->ce_s");
goto done;
Expand All @@ -1871,7 +1871,7 @@ from_client(int s,
goto done;
retval = 0;
done:
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s retval=%d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "retval=%d", retval);
if (cbce)
cbuf_free(cbce);
if (msg)
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/backend_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ candidate_validate(clixon_handle h,
cxobj *xret = NULL;
int ret;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
if (db == NULL || cbret == NULL){
clixon_err(OE_CFG, EINVAL, "db or cbret is NULL");
goto done;
Expand Down Expand Up @@ -913,7 +913,7 @@ from_client_validate(clixon_handle h,
int ret;
char *db;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
if ((db = netconf_db_find(xe, "source")) == NULL){
if (netconf_missing_element(cbret, "protocol", "source", NULL) < 0)
goto done;
Expand Down
8 changes: 4 additions & 4 deletions apps/backend/backend_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ get_statedata(clixon_handle h,
cbuf *cb = NULL;
cxobj *xerr = NULL;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
if ((yspec = clicon_dbspec_yang(h)) == NULL){
clixon_err(OE_YANG, ENOENT, "No yang spec");
goto done;
Expand Down Expand Up @@ -373,7 +373,7 @@ get_statedata(clixon_handle h,
} /* switch wdef */
retval = 1; /* OK */
done:
clixon_debug(CLIXON_DBG_CLIENT, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_CLIENT, "%d", retval);
if (xerr)
xml_free(xerr);
if (x1)
Expand Down Expand Up @@ -872,7 +872,7 @@ get_common(clixon_handle h,
char *wdefstr;

wdef = WITHDEFAULTS_EXPLICIT;
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
username = clicon_username_get(h);
if ((yspec = clicon_dbspec_yang(h)) == NULL){
clixon_err(OE_YANG, ENOENT, "No yang spec9");
Expand Down Expand Up @@ -1049,7 +1049,7 @@ get_common(clixon_handle h,
ok:
retval = 0;
done:
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "retval:%d", retval);
if (xvec)
free(xvec);
if (xret)
Expand Down
8 changes: 4 additions & 4 deletions apps/backend/backend_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ backend_terminate(clixon_handle h)
int ss;
cvec *nsctx;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
if ((ss = clicon_socket_get(h)) != -1)
close(ss);
/* Disconnect datastore */
Expand Down Expand Up @@ -142,7 +142,7 @@ backend_terminate(clixon_handle h)
if (sockfamily==AF_UNIX && lstat(sockpath, &st) == 0)
unlink(sockpath);
clixon_event_exit();
clixon_debug(CLIXON_DBG_CLIENT, "%s done", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "done");
clixon_err_exit();
clixon_log_exit();
backend_handle_exit(h); /* Also deletes streams. Cannot use h after this. */
Expand Down Expand Up @@ -172,7 +172,7 @@ backend_sig_term(int arg)
static void
backend_sig_child(int arg)
{
clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
clicon_sig_child_set(1);
}

Expand Down Expand Up @@ -428,7 +428,7 @@ backend_timer_setup(int fd,
struct timeval t;
struct timeval t1 = {10, 0};

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
gettimeofday(&now, NULL);

backend_client_print(h, stderr);
Expand Down
18 changes: 9 additions & 9 deletions apps/backend/backend_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ clixon_plugin_reset_all(clixon_handle h,
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
/* Loop through all plugins, call callbacks in each */
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_reset_one(cp, h, db) < 0)
Expand Down Expand Up @@ -179,7 +179,7 @@ clixon_plugin_pre_daemon_all(clixon_handle h)
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
/* Loop through all plugins, call callbacks in each */
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_pre_daemon_one(cp, h) < 0)
Expand Down Expand Up @@ -242,7 +242,7 @@ clixon_plugin_daemon_all(clixon_handle h)
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
/* Loop through all plugins, call callbacks in each */
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_daemon_one(cp, h) < 0)
Expand Down Expand Up @@ -347,7 +347,7 @@ clixon_plugin_statedata_all(clixon_handle h,
cbuf *cberr = NULL;
cxobj *xerr = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if ((ret = clixon_plugin_statedata_one(cp, h, nsc, xpath, &x)) < 0)
goto done;
Expand All @@ -373,7 +373,7 @@ clixon_plugin_statedata_all(clixon_handle h,
x = NULL;
continue;
}
clixon_debug_xml(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, x, "%s %s STATE:", __FUNCTION__, clixon_plugin_name_get(cp));
clixon_debug_xml(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, x, "%s STATE:", clixon_plugin_name_get(cp));
/* XXX: ret == 0 invalid yang binding should be handled as internal error */
if ((ret = xml_bind_yang(h, x, YB_MODULE, yspec, &xerr)) < 0)
goto done;
Expand Down Expand Up @@ -473,7 +473,7 @@ clixon_plugin_lockdb_all(clixon_handle h,
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_lockdb_one(cp, h, db, lock, id) < 0)
goto done;
Expand Down Expand Up @@ -657,7 +657,7 @@ plugin_transaction_begin_all(clixon_handle h,
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (plugin_transaction_begin_one(cp, h, td) < 0)
goto done;
Expand Down Expand Up @@ -1003,7 +1003,7 @@ plugin_transaction_end_all(clixon_handle h,
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (plugin_transaction_end_one(cp, h, td) < 0)
goto done;
Expand Down Expand Up @@ -1056,7 +1056,7 @@ plugin_transaction_abort_all(clixon_handle h,
int retval = -1;
clixon_plugin_t *cp = NULL;

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (plugin_transaction_abort_one(cp, h, td) < 0)
; /* dont abort on error */
Expand Down
10 changes: 5 additions & 5 deletions apps/backend/backend_plugin_restconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ restconf_pseudo_set_inline(clixon_handle h,
cxobj *xrestconf;
cbuf *cb = NULL;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
if (clixon_process_argv_get(h, RESTCONF_PROCESS, &argv, &argc) < 0)
goto done;
if ((xrestconf = xpath_first(xt, NULL, "restconf")) != NULL)
Expand All @@ -174,7 +174,7 @@ restconf_pseudo_set_inline(clixon_handle h,
clixon_err(OE_XML, errno, "stdup");
goto done;
}
clixon_debug(CLIXON_DBG_CLIENT, "%s str:%s", __FUNCTION__, str);
clixon_debug(CLIXON_DBG_CLIENT, "str:%s", str);
if (argv[i+1])
free(argv[i+1]);
argv[i+1] = str;
Expand Down Expand Up @@ -203,7 +203,7 @@ restconf_rpc_wrapper(clixon_handle h,
int retval = -1;
cxobj *xt = NULL;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
switch (*operation){
case PROC_OP_STOP:
/* if RPC op is stop, stop the service */
Expand Down Expand Up @@ -349,7 +349,7 @@ restconf_pseudo_process_validate(clixon_handle h,
int retval = -1;
cxobj *xtarget;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
xtarget = transaction_target(td);
/* If ssl-enable is true and (at least a) socket has ssl,
* then server-cert-path and server-key-path must exist */
Expand Down Expand Up @@ -381,7 +381,7 @@ restconf_pseudo_process_commit(clixon_handle h,
cxobj *cx;
int enabled = 0;

clixon_debug(CLIXON_DBG_CLIENT, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT, "");
xtarget = transaction_target(td);
xsource = transaction_src(td);
if (xpath_first(xtarget, NULL, "/restconf[enable='true']") != NULL)
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/backend_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ backend_accept_client(int fd,
uid_t guid;
#endif

clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
len = sizeof(from);
if ((s = accept(fd, &from, &len)) < 0){
clixon_err(OE_UNIX, errno, "accept");
Expand Down
12 changes: 6 additions & 6 deletions apps/backend/clixon_backend_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,17 @@ transaction_dbg(clixon_handle h,
goto done;
}
if (i)
clixon_debug(dbglevel, "%s %" PRIu64 " %s del: %s",
__FUNCTION__, td->td_id, msg, cbuf_get(cb));
clixon_debug(dbglevel, "%" PRIu64 " %s del: %s",
td->td_id, msg, cbuf_get(cb));
cbuf_reset(cb);
for (i=0; i<td->td_alen; i++){
xn = td->td_avec[i];
if (clixon_xml2cbuf(cb, xn, 0, 0, NULL, -1, 0) < 0)
goto done;
}
if (i)
clixon_debug(dbglevel, "%s %" PRIu64 " %s add: %s",
__FUNCTION__, td->td_id, msg, cbuf_get(cb));
clixon_debug(dbglevel, "%" PRIu64 " %s add: %s",
td->td_id, msg, cbuf_get(cb));
cbuf_reset(cb);
for (i=0; i<td->td_clen; i++){
if (td->td_scvec){
Expand All @@ -302,8 +302,8 @@ transaction_dbg(clixon_handle h,
goto done;
}
if (i)
clixon_debug(dbglevel, "%s %" PRIu64 " %s change: %s",
__FUNCTION__, td->td_id, msg, cbuf_get(cb));
clixon_debug(dbglevel, "%" PRIu64 " %s change: %s",
td->td_id, msg, cbuf_get(cb));
done:
if (cb)
cbuf_free(cb);
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/cli_auto.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ cli_auto_edit(clixon_handle h,
str = cv_string_get(cvec_i(argv, argc++));
if (str && strncmp(str, "mtpoint:", strlen("mtpoint:")) == 0){
mtpoint = str + strlen("mtpoint:");
clixon_debug(CLIXON_DBG_CLIENT, "%s mtpoint:%s", __FUNCTION__, mtpoint);
clixon_debug(CLIXON_DBG_CLIENT, "mtpoint:%s", mtpoint);
treename = cv_string_get(cvec_i(argv, argc++));
}
else
Expand Down
Loading

0 comments on commit 5c62d34

Please sign in to comment.