Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info().

This commit is contained in:
Gregory Nutt 2016-06-20 11:48:15 -06:00
parent 6e2f729add
commit bb06f7368f
9 changed files with 49 additions and 75 deletions

View File

@ -175,7 +175,7 @@ static int telnetd_daemon(int argc, char *argv[])
for (;;) for (;;)
{ {
nllinfo("Accepting connections on port %d\n", ntohs(daemon->port)); ninfo("Accepting connections on port %d\n", ntohs(daemon->port));
addrlen = sizeof(struct sockaddr_in); addrlen = sizeof(struct sockaddr_in);
acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen); acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen);
@ -199,7 +199,7 @@ static int telnetd_daemon(int argc, char *argv[])
/* Create a character device to "wrap" the accepted socket descriptor */ /* Create a character device to "wrap" the accepted socket descriptor */
nllinfo("Creating the telnet driver\n"); ninfo("Creating the telnet driver\n");
devpath = telnetd_driver(acceptsd, daemon); devpath = telnetd_driver(acceptsd, daemon);
if (devpath == NULL) if (devpath == NULL)
{ {
@ -209,7 +209,7 @@ static int telnetd_daemon(int argc, char *argv[])
/* Open the driver */ /* Open the driver */
nllinfo("Opening the telnet driver\n"); ninfo("Opening the telnet driver\n");
drvrfd = open(devpath, O_RDWR); drvrfd = open(devpath, O_RDWR);
if (drvrfd < 0) if (drvrfd < 0)
{ {
@ -238,7 +238,7 @@ static int telnetd_daemon(int argc, char *argv[])
* will inherit the new stdin, stdout, and stderr. * will inherit the new stdin, stdout, and stderr.
*/ */
nllinfo("Starting the telnet session\n"); ninfo("Starting the telnet session\n");
pid = task_create("Telnet session", daemon->priority, daemon->stacksize, pid = task_create("Telnet session", daemon->priority, daemon->stacksize,
daemon->entry, NULL); daemon->entry, NULL);
if (pid < 0) if (pid < 0)

View File

@ -227,12 +227,12 @@ static ssize_t telnetd_receive(FAR struct telnetd_dev_s *priv, FAR const char *s
int nread; int nread;
uint8_t ch; uint8_t ch;
nllinfo("srclen: %d destlen: %d\n", srclen, destlen); ninfo("srclen: %d destlen: %d\n", srclen, destlen);
for (nread = 0; srclen > 0 && nread < destlen; srclen--) for (nread = 0; srclen > 0 && nread < destlen; srclen--)
{ {
ch = *src++; ch = *src++;
nllinfo("ch=%02x state=%d\n", ch, priv->td_state); ninfo("ch=%02x state=%d\n", ch, priv->td_state);
switch (priv->td_state) switch (priv->td_state)
{ {
@ -412,7 +412,7 @@ static int telnetd_open(FAR struct file *filep)
int tmp; int tmp;
int ret; int ret;
nllinfo("td_crefs: %d\n", priv->td_crefs); ninfo("td_crefs: %d\n", priv->td_crefs);
/* O_NONBLOCK is not supported */ /* O_NONBLOCK is not supported */
@ -468,7 +468,7 @@ static int telnetd_close(FAR struct file *filep)
FAR char *devpath; FAR char *devpath;
int ret; int ret;
nllinfo("td_crefs: %d\n", priv->td_crefs); ninfo("td_crefs: %d\n", priv->td_crefs);
/* Get exclusive access to the device structures */ /* Get exclusive access to the device structures */
@ -547,7 +547,7 @@ static ssize_t telnetd_read(FAR struct file *filep, FAR char *buffer, size_t len
FAR struct telnetd_dev_s *priv = inode->i_private; FAR struct telnetd_dev_s *priv = inode->i_private;
ssize_t ret; ssize_t ret;
nllinfo("len: %d\n", len); ninfo("len: %d\n", len);
/* First, handle the case where there are still valid bytes left in the /* First, handle the case where there are still valid bytes left in the
* I/O buffer from the last time that read was called. NOTE: Much of * I/O buffer from the last time that read was called. NOTE: Much of
@ -620,7 +620,7 @@ static ssize_t telnetd_write(FAR struct file *filep, FAR const char *buffer, siz
char ch; char ch;
bool eol; bool eol;
nllinfo("len: %d\n", len); ninfo("len: %d\n", len);
/* Process each character from the user buffer */ /* Process each character from the user buffer */

View File

@ -63,20 +63,9 @@
#endif #endif
#ifdef CONFIG_DEBUG_CXX #ifdef CONFIG_DEBUG_CXX
# define cxxdbg _err # define cxxinfo _info
# define cxxllerr llerr
# ifdef CONFIG_DEBUG_INFO
# define cxxinfo _info
# define cxxllinfo llinfo
# else
# define cxxinfo(x...)
# define cxxllinfo(x...)
# endif
#else #else
# define cxxdbg(x...)
# define cxxllerr(x...)
# define cxxinfo(x...) # define cxxinfo(x...)
# define cxxllinfo(x...)
#endif #endif
//*************************************************************************** //***************************************************************************
@ -88,17 +77,17 @@ class CHelloWorld
public: public:
CHelloWorld(void) : mSecret(42) CHelloWorld(void) : mSecret(42)
{ {
cxxdbg("Constructor: mSecret=%d\n", mSecret); cxxinfo("Constructor: mSecret=%d\n", mSecret);
} }
~CHelloWorld(void) ~CHelloWorld(void)
{ {
cxxdbg("Destructor\n"); cxxinfo("Destructor\n");
} }
bool HelloWorld(void) bool HelloWorld(void)
{ {
cxxdbg("HelloWorld: mSecret=%d\n", mSecret); cxxinfo("HelloWorld: mSecret=%d\n", mSecret);
if (mSecret != 42) if (mSecret != 42)
{ {

View File

@ -95,7 +95,7 @@ static void icmpv6_echo_request(FAR struct net_driver_s *dev,
uint16_t reqlen; uint16_t reqlen;
int i; int i;
nllinfo("Send ECHO request: seqno=%d\n", pstate->png_seqno); ninfo("Send ECHO request: seqno=%d\n", pstate->png_seqno);
/* Set up the IPv6 header (most is probably already in place) */ /* Set up the IPv6 header (most is probably already in place) */

View File

@ -241,7 +241,7 @@ static int telnetd_daemon(int argc, char *argv[])
for (;;) for (;;)
{ {
nllinfo("Accepting connections on port %d\n", ntohs(daemon->port)); ninfo("Accepting connections on port %d\n", ntohs(daemon->port));
addrlen = sizeof(struct sockaddr_in); addrlen = sizeof(struct sockaddr_in);
acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen); acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen);
@ -287,7 +287,7 @@ static int telnetd_daemon(int argc, char *argv[])
/* Create a character device to "wrap" the accepted socket descriptor */ /* Create a character device to "wrap" the accepted socket descriptor */
nllinfo("Creating the telnet driver\n"); ninfo("Creating the telnet driver\n");
session.ts_sd = acceptsd; session.ts_sd = acceptsd;
session.ts_devpath[0] = '\0'; session.ts_devpath[0] = '\0';
@ -303,7 +303,7 @@ static int telnetd_daemon(int argc, char *argv[])
/* Open the driver */ /* Open the driver */
nllinfo("Opening the telnet driver at %s\n", session.ts_devpath); ninfo("Opening the telnet driver at %s\n", session.ts_devpath);
drvrfd = open(session.ts_devpath, O_RDWR); drvrfd = open(session.ts_devpath, O_RDWR);
if (drvrfd < 0) if (drvrfd < 0)
{ {
@ -328,7 +328,7 @@ static int telnetd_daemon(int argc, char *argv[])
* will inherit the new stdin, stdout, and stderr. * will inherit the new stdin, stdout, and stderr.
*/ */
nllinfo("Starting the telnet session\n"); ninfo("Starting the telnet session\n");
pid = task_create("Telnet session", daemon->priority, daemon->stacksize, pid = task_create("Telnet session", daemon->priority, daemon->stacksize,
daemon->entry, NULL); daemon->entry, NULL);
if (pid < 0) if (pid < 0)

View File

@ -57,33 +57,24 @@
****************************************************************************/ ****************************************************************************/
/* Debug output from this file is normally suppressed. If enabled, be aware /* Debug output from this file is normally suppressed. If enabled, be aware
* that output to stdout will interfere with CGI programs (you could use the * that output to stdout will interfere with CGI programs.
* the low-level debug (llerr) functions which probably do not use stdout
*/ */
#ifdef CONFIG_THTTPD_FDWATCH_DEBUG #ifdef CONFIG_THTTPD_FDWATCH_DEBUG
# ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_CPP_HAVE_VARARGS
# define fwdbg(format, ...) nerr(format, ##__VA_ARGS__) # define fwdbg(format, ...) nerr(format, ##__VA_ARGS__)
# define fwllerr(format, ...) nllerr(format, ##__VA_ARGS__)
# define fwinfo(format, ...) ninfo(format, ##__VA_ARGS__) # define fwinfo(format, ...) ninfo(format, ##__VA_ARGS__)
# define fwllinfo(format, ...) nllinfo(format, ##__VA_ARGS__)
# else # else
# define fwdbg nerr # define fwdbg nerr
# define fwllerr nllerr
# define fwinfo ninfo # define fwinfo ninfo
# define fwllinfo nllinfo
# endif # endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_CPP_HAVE_VARARGS
# define fwdbg(x...) # define fwdbg(x...)
# define fwllerr(x...)
# define fwinfo(x...) # define fwinfo(x...)
# define fwllinfo(x...)
# else # else
# define fwdbg (void) # define fwdbg (void)
# define fwllerr (void) # define fwinfo (void)
# define fwinfo (void)
# define fwllinfo (void)
# endif # endif
#endif #endif
@ -141,7 +132,7 @@ static int fdwatch_pollndx(FAR struct fdwatch_s *fw, int fd)
} }
} }
fwdbg("No poll index for fd %d: %d\n", fd); fwerr("ERROR: No poll index for fd %d: %d\n", fd);
return -1; return -1;
} }
@ -160,7 +151,7 @@ struct fdwatch_s *fdwatch_initialize(int nfds)
fw = (struct fdwatch_s*)zalloc(sizeof(struct fdwatch_s)); fw = (struct fdwatch_s*)zalloc(sizeof(struct fdwatch_s));
if (!fw) if (!fw)
{ {
fwdbg("Failed to allocate fdwatch\n"); fwerr("ERROR: Failed to allocate fdwatch\n");
return NULL; return NULL;
} }
@ -229,7 +220,7 @@ void fdwatch_add_fd(struct fdwatch_s *fw, int fd, void *client_data)
if (fw->nwatched >= fw->nfds) if (fw->nwatched >= fw->nfds)
{ {
fwdbg("too many fds\n"); fwerr("ERROR: too many fds\n");
return; return;
} }

View File

@ -366,14 +366,14 @@ static inline int cgi_interpose_input(struct cgi_conn_s *cc)
ssize_t nbytes_read; ssize_t nbytes_read;
ssize_t nbytes_written; ssize_t nbytes_written;
nllinfo("nbytes: %d contentlength: %d\n", cc->inbuf.nbytes, cc->inbuf.contentlength); ninfo("nbytes: %d contentlength: %d\n", cc->inbuf.nbytes, cc->inbuf.contentlength);
if (cc->inbuf.nbytes < cc->inbuf.contentlength) if (cc->inbuf.nbytes < cc->inbuf.contentlength)
{ {
do do
{ {
nbytes_read = read(cc->connfd, cc->inbuf.buffer, nbytes_read = read(cc->connfd, cc->inbuf.buffer,
MIN(CONFIG_THTTPD_CGIINBUFFERSIZE, cc->inbuf.contentlength - cc->inbuf.nbytes)); MIN(CONFIG_THTTPD_CGIINBUFFERSIZE, cc->inbuf.contentlength - cc->inbuf.nbytes));
nllinfo("nbytes_read: %d\n", nbytes_read); ninfo("nbytes_read: %d\n", nbytes_read);
if (nbytes_read < 0) if (nbytes_read < 0)
{ {
if (errno != EINTR) if (errno != EINTR)
@ -388,7 +388,7 @@ static inline int cgi_interpose_input(struct cgi_conn_s *cc)
if (nbytes_read > 0) if (nbytes_read > 0)
{ {
nbytes_written = httpd_write(cc->wrfd, cc->inbuf.buffer, nbytes_read); nbytes_written = httpd_write(cc->wrfd, cc->inbuf.buffer, nbytes_read);
nllinfo("nbytes_written: %d\n", nbytes_written); ninfo("nbytes_written: %d\n", nbytes_written);
if (nbytes_written != nbytes_read) if (nbytes_written != nbytes_read)
{ {
nllerr("ERROR: httpd_write failed\n"); nllerr("ERROR: httpd_write failed\n");
@ -447,7 +447,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
/* Loop while there are things we can do without waiting for more input */ /* Loop while there are things we can do without waiting for more input */
nllinfo("state: %d\n", cc->outbuf.state); ninfo("state: %d\n", cc->outbuf.state);
switch (cc->outbuf.state) switch (cc->outbuf.state)
{ {
case CGI_OUTBUFFER_READHEADER: case CGI_OUTBUFFER_READHEADER:
@ -461,7 +461,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
*/ */
nbytes_read = read(cc->rdfd, cc->inbuf.buffer, CONFIG_THTTPD_CGIINBUFFERSIZE); nbytes_read = read(cc->rdfd, cc->inbuf.buffer, CONFIG_THTTPD_CGIINBUFFERSIZE);
nllinfo("Read %d bytes from fd %d\n", nbytes_read, cc->rdfd); ninfo("Read %d bytes from fd %d\n", nbytes_read, cc->rdfd);
if (nbytes_read < 0) if (nbytes_read < 0)
{ {
@ -485,7 +485,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
if (nbytes_read <= 0) if (nbytes_read <= 0)
{ {
nllinfo("End-of-file\n"); ninfo("End-of-file\n");
br = &(cc->outbuf.buffer[cc->outbuf.len]); br = &(cc->outbuf.buffer[cc->outbuf.len]);
cc->outbuf.state = CGI_OUTBUFFER_HEADERREAD; cc->outbuf.state = CGI_OUTBUFFER_HEADERREAD;
} }
@ -497,14 +497,14 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
(void)memcpy(&(cc->outbuf.buffer[cc->outbuf.len]), cc->inbuf.buffer, nbytes_read); (void)memcpy(&(cc->outbuf.buffer[cc->outbuf.len]), cc->inbuf.buffer, nbytes_read);
cc->outbuf.len += nbytes_read; cc->outbuf.len += nbytes_read;
cc->outbuf.buffer[cc->outbuf.len] = '\0'; cc->outbuf.buffer[cc->outbuf.len] = '\0';
nllinfo("Header bytes accumulated: %d\n", cc->outbuf.len); ninfo("Header bytes accumulated: %d\n", cc->outbuf.len);
/* Check for end of header */ /* Check for end of header */
if ((br = strstr(cc->outbuf.buffer, "\r\n\r\n")) != NULL || if ((br = strstr(cc->outbuf.buffer, "\r\n\r\n")) != NULL ||
(br = strstr(cc->outbuf.buffer, "\012\012")) != NULL) (br = strstr(cc->outbuf.buffer, "\012\012")) != NULL)
{ {
nllinfo("End-of-header\n"); ninfo("End-of-header\n");
cc->outbuf.state = CGI_OUTBUFFER_HEADERREAD; cc->outbuf.state = CGI_OUTBUFFER_HEADERREAD;
} }
else else
@ -559,7 +559,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
/* Write the status line. */ /* Write the status line. */
nllinfo("Status: %d\n", status); ninfo("Status: %d\n", status);
switch (status) switch (status)
{ {
case 200: case 200:
@ -643,7 +643,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
*/ */
nbytes_read = read(cc->rdfd, cc->inbuf.buffer, CONFIG_THTTPD_CGIINBUFFERSIZE); nbytes_read = read(cc->rdfd, cc->inbuf.buffer, CONFIG_THTTPD_CGIINBUFFERSIZE);
nllinfo("Read %d bytes from fd %d\n", nbytes_read, cc->rdfd); ninfo("Read %d bytes from fd %d\n", nbytes_read, cc->rdfd);
if (nbytes_read < 0) if (nbytes_read < 0)
{ {
@ -667,7 +667,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
if (nbytes_read == 0) if (nbytes_read == 0)
{ {
nllinfo("End-of-file\n"); ninfo("End-of-file\n");
cc->outbuf.state = CGI_OUTBUFFER_DONE; cc->outbuf.state = CGI_OUTBUFFER_DONE;
return 1; return 1;
} }
@ -713,7 +713,7 @@ static int cgi_child(int argc, char **argv)
* all file descriptors * all file descriptors
*/ */
nllinfo("Started: %s\n", argv[1]); ninfo("Started: %s\n", argv[1]);
/* Allocate memory and initialize memory for interposing */ /* Allocate memory and initialize memory for interposing */
@ -746,7 +746,7 @@ static int cgi_child(int argc, char **argv)
* now prevents re-use of fd=0 and 1 by pipe(). * now prevents re-use of fd=0 and 1 by pipe().
*/ */
nllinfo("Closing descriptors\n"); ninfo("Closing descriptors\n");
for (fd = 3; fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS); fd++) for (fd = 3; fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS); fd++)
{ {
/* Keep hc->conn_fd open for obvious reasons */ /* Keep hc->conn_fd open for obvious reasons */
@ -764,7 +764,7 @@ static int cgi_child(int argc, char **argv)
* socket to the CGI program. * socket to the CGI program.
*/ */
nllinfo("Create STDIN pipe\n"); ninfo("Create STDIN pipe\n");
ret = pipe(pipefd); ret = pipe(pipefd);
if (ret < 0) if (ret < 0)
{ {
@ -795,7 +795,7 @@ static int cgi_child(int argc, char **argv)
if (ret == 0) if (ret == 0)
{ {
nllinfo("Create STDOUT pipe\n"); ninfo("Create STDOUT pipe\n");
ret = pipe(pipefd); ret = pipe(pipefd);
if (ret < 0) if (ret < 0)
{ {
@ -857,7 +857,7 @@ static int cgi_child(int argc, char **argv)
/* Run the CGI program. */ /* Run the CGI program. */
nllinfo("Starting CGI: %s\n", hc->expnfilename); ninfo("Starting CGI: %s\n", hc->expnfilename);
#ifdef CONFIG_THTTPD_NXFLAT #ifdef CONFIG_THTTPD_NXFLAT
child = exec(hc->expnfilename, (FAR char * const *)argp, g_thttpdsymtab, g_thttpdnsymbols); child = exec(hc->expnfilename, (FAR char * const *)argp, g_thttpdsymtab, g_thttpdnsymbols);
@ -891,7 +891,7 @@ static int cgi_child(int argc, char **argv)
/* Send any data that is already buffer to the CGI task */ /* Send any data that is already buffer to the CGI task */
nbytes = hc->read_idx - hc->checked_idx; nbytes = hc->read_idx - hc->checked_idx;
nllinfo("nbytes: %d contentlength: %d\n", nbytes, hc->contentlength); ninfo("nbytes: %d contentlength: %d\n", nbytes, hc->contentlength);
if (nbytes > 0) if (nbytes > 0)
{ {
if (httpd_write(cc->wrfd, &(hc->read_buf[hc->checked_idx]), nbytes) != nbytes) if (httpd_write(cc->wrfd, &(hc->read_buf[hc->checked_idx]), nbytes) != nbytes)
@ -909,7 +909,7 @@ static int cgi_child(int argc, char **argv)
indone = false; indone = false;
outdone = false; outdone = false;
nllinfo("Interposing\n"); ninfo("Interposing\n");
cgi_semgive(); /* Not safe to reference hc after this point */ cgi_semgive(); /* Not safe to reference hc after this point */
do do
{ {
@ -921,7 +921,7 @@ static int cgi_child(int argc, char **argv)
{ {
/* Transfer data from the client to the CGI program (POST) */ /* Transfer data from the client to the CGI program (POST) */
nllinfo("Interpose input\n"); ninfo("Interpose input\n");
indone = cgi_interpose_input(cc); indone = cgi_interpose_input(cc);
if (indone) if (indone)
{ {
@ -935,7 +935,7 @@ static int cgi_child(int argc, char **argv)
{ {
/* Handle receipt of headers and CGI program response (GET) */ /* Handle receipt of headers and CGI program response (GET) */
nllinfo("Interpose output\n"); ninfo("Interpose output\n");
outdone = cgi_interpose_output(cc); outdone = cgi_interpose_output(cc);
} }
@ -949,7 +949,7 @@ static int cgi_child(int argc, char **argv)
else if (kill(child, 0) != 0) else if (kill(child, 0) != 0)
{ {
nllinfo("CGI no longer running: %d\n", errno); ninfo("CGI no longer running: %d\n", errno);
outdone = true; outdone = true;
} }
} }
@ -977,7 +977,7 @@ errout_with_cgiconn:
httpd_free(cc); httpd_free(cc);
errout: errout:
nllinfo("Return %d\n", errcode); ninfo("Return %d\n", errcode);
if (errcode != 0) if (errcode != 0)
{ {
INTERNALERROR("errout"); INTERNALERROR("errout");
@ -1074,7 +1074,7 @@ static void cgi_kill(ClientData client_data, struct timeval *nowP)
/* task_delete() is a very evil API. It can leave memory stranded! */ /* task_delete() is a very evil API. It can leave memory stranded! */
nllinfo("Killing CGI child: %d\n", pid); ninfo("Killing CGI child: %d\n", pid);
if (task_delete(pid) != 0) if (task_delete(pid) != 0)
{ {
nllerr("ERROR: task_delete() failed: %d\n", errno); nllerr("ERROR: task_delete() failed: %d\n", errno);

View File

@ -366,14 +366,14 @@ static void nsh_netinit_signal(int signo, FAR siginfo_t *siginfo,
/* What is the count on the semaphore? Don't over-post */ /* What is the count on the semaphore? Don't over-post */
ret = sem_getvalue(&g_notify_sem, &semcount); ret = sem_getvalue(&g_notify_sem, &semcount);
nllinfo("Entry: semcount=%d\n", semcount); ninfo("Entry: semcount=%d\n", semcount);
if (ret == OK && semcount <= 0) if (ret == OK && semcount <= 0)
{ {
sem_post(&g_notify_sem); sem_post(&g_notify_sem);
} }
nllinfo("Exit\n"); ninfo("Exit\n");
} }
#endif #endif

View File

@ -62,16 +62,10 @@
# define m_err _err # define m_err _err
# define m_warn _llwarn # define m_warn _llwarn
# define m_info _info # define m_info _info
# define m_llerr _llerr
# define m_llwarn _llwarn
# define m_llinfo _llinfo
#else #else
# define m_err(x...) # define m_err(x...)
# define m_warn(x...) # define m_warn(x...)
# define m_info(x...) # define m_info(x...)
# define m_llerr(x...)
# define m_llwarn(x...)
# define m_llinfo(x...)
#endif #endif
#define UBLOXMODEM_MAX_REGISTERS 16 #define UBLOXMODEM_MAX_REGISTERS 16