Commit c34a986f authored by Alessandro Rubini's avatar Alessandro Rubini

diag: kill pp_verbose_dump

This kills the global build-time macro pp_verbose_dump to use flags
instead.  In msg.c this commit fakes the old pp_verbose_dump, which
however is extracted from the global flags.

So, setting "frames" level to 2 prints information on frames being
received ("-d 002").

Until I get to integrate tools/ptpdump in the daemon itself, we have
no instance-specific dump, nor symmetric dumping of input and output.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 66e2cdb7
......@@ -103,6 +103,11 @@ extern unsigned long pp_global_flags; /* Supplement ppi-specific ones */
#define __PP_DIAG_ALLOW(ppi, th, level) \
((__PP_FLAGS(ppi) >> (4 * (th)) & 0xf) >= level)
#define __PP_DIAG_ALLOW_FLAGS(f, th, level) \
((f >> (4 * (th)) & 0xf) >= level)
/* The function it is better external, since it is variadic */
extern void __pp_diag(struct pp_instance *ppi, enum pp_diag_things th,
int level, char *fmt, ...)
......@@ -141,16 +146,11 @@ extern unsigned long pp_diag_parse(char *diaglevel);
* constants instead, to avoid the hairyness of ifdef.
*/
#ifdef VERB_LOG_MSGS
#define pp_verbose_dump 1
#define pp_verbose_servo 1
#define pp_verbose_time 1
#endif
/* Accept individual flags to turn on each of them */
#ifdef VERB_DUMP
#define pp_verbose_dump 1
#endif
#ifdef VERB_SERVO
#define pp_verbose_servo 1
#endif
......@@ -160,10 +160,6 @@ extern unsigned long pp_diag_parse(char *diaglevel);
#endif
/* Provide 0 as default for all such values */
#ifndef pp_verbose_dump
#define pp_verbose_dump 0
#endif
#ifndef pp_verbose_servo
#define pp_verbose_servo 0
#endif
......
......@@ -6,6 +6,14 @@
#include <ppsi/ppsi.h>
#include "common-fun.h"
/*
* Temporarily, use the diagnostic level to set a fake pp_verbose_dump.
* We can't use ppi-specific flags at this point, but I plan to fix
* this msg.c overall -- ARub
*/
#define pp_verbose_dump \
__PP_DIAG_ALLOW_FLAGS(pp_global_flags, pp_dt_frames, 2)
static void Integer64_display(const char *label, Integer64 *bigint)
{
if (pp_verbose_dump) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment