Commit 57ef61c3 authored by Alessandro Rubini's avatar Alessandro Rubini

diag: avoid needless get_time reports

pp_timed_printf is a great resource, but we need to temporarily
silence diagnostic printing in  time_ops.get, in order to be able to
tell stamping-related calls to just printf-related ones.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e246a91b
......@@ -15,7 +15,7 @@ static int bare_time_get(TimeInternal *t)
}
t->seconds = tv.tv_sec;
t->nanoseconds = tv.tv_usec * 1000;
if (pp_verbose_time)
if (pp_verbose_time && !(pp_global_flags & PP_FLAG_NOTIMELOG))
pp_printf("%s: %9li.%06li\n", __func__, tv.tv_sec, tv.tv_usec);
return 0;
}
......
......@@ -15,7 +15,7 @@ static int bare_time_get(TimeInternal *t)
}
t->seconds = tv.tv_sec;
t->nanoseconds = tv.tv_usec * 1000;
if (pp_verbose_time)
if (pp_verbose_time && !(pp_global_flags & PP_FLAG_NOTIMELOG))
pp_printf("%s: %9li.%06li\n", __func__, tv.tv_sec, tv.tv_usec);
return 0;
}
......
......@@ -24,7 +24,7 @@ static int posix_time_get(TimeInternal *t)
clock_fatal_error("clock_gettime");
t->seconds = tp.tv_sec;
t->nanoseconds = tp.tv_nsec;
if (pp_verbose_time)
if (pp_verbose_time && !(pp_global_flags & PP_FLAG_NOTIMELOG))
pp_printf("%s: %9li.%09li\n", __func__, tp.tv_sec, tp.tv_nsec);
return 0;
}
......
......@@ -62,8 +62,13 @@ void pp_timed_printf(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;
pp_t_ops.get(&t);
pp_global_flags = oflags;
pp_printf("%09d.%03d ", (int)t.seconds,
(int)t.nanoseconds / 1000000);
va_start(args, 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