Commit ac468805 authored by Alessandro Rubini's avatar Alessandro Rubini

diag: moved pp_timed_printf to fsm.c

fsm.c is the only user of timed_printf, and actually I don't expect
other messages to need timing (since we know the time from the fsm
states).

I may repent, I'm aware. But at this point I'm killing diag-yes, to
make the one and true diagnostic environment, without duplications and
conflicts.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 38426a50
......@@ -17,21 +17,3 @@ void pp_diag_error_str2(struct pp_instance *ppi, char *s1, char *s2)
{
pp_printf("ERR for %p: %s %s\n", ppi, s1, s2);
}
void pp_timed_printf(struct pp_instance *ppi, char *fmt, ...)
{
va_list args;
TimeInternal t;
unsigned long oflags = pp_global_flags;
/* temporarily set NOTIMELOG, as we'll print the time ourselves */
pp_global_flags |= PP_FLAG_NOTIMELOG;
ppi->t_ops->get(&t);
pp_global_flags = oflags;
pp_printf("%09d.%03d ", (int)t.seconds,
(int)t.nanoseconds / 1000000);
va_start(args, fmt);
pp_vprintf(fmt, args);
va_end(args);
}
......@@ -6,6 +6,24 @@
unsigned long pp_global_flags; /* This is the only "global" file in ppsi */
static void pp_timed_printf(struct pp_instance *ppi, char *fmt, ...)
{
va_list args;
TimeInternal t;
unsigned long oflags = pp_global_flags;
/* temporarily set NOTIMELOG, as we'll print the time ourselves */
pp_global_flags |= PP_FLAG_NOTIMELOG;
ppi->t_ops->get(&t);
pp_global_flags = oflags;
pp_printf("%09d.%03d ", (int)t.seconds,
(int)t.nanoseconds / 1000000);
va_start(args, fmt);
pp_vprintf(fmt, args);
va_end(args);
}
/*
* Diagnostics about state machine, enter, leave, remain
*/
......
......@@ -14,7 +14,6 @@
*/
extern void pp_diag_error(struct pp_instance *ppi, int err);
extern void pp_diag_error_str2(struct pp_instance *ppi, char *s1, char *s2);
extern void pp_timed_printf(struct pp_instance *ppi, char *fmt, ...);
/* Our printf, that is implemented internally */
extern int pp_printf(const char *fmt, ...)
......
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