On 2026-07-16 14:34:57+03:00, saeed bishara wrote:
> > +static void print_system_timestamp(int sample_num, __kernel_clockid_t 
> > clockid,
> > +                                  long long sec, unsigned int nsec,
> > +                                  const char *when)
> > +{
> > +       switch (clockid) {
> > +       case CLOCK_REALTIME:
> > +               printf("sample #%2d: real time %s: %lld.%09u\n",
> > +                      sample_num, when, sec, nsec);
> > +               break;
> > +       case CLOCK_MONOTONIC:
> > +               printf("sample #%2d: monotonic time %s: %lld.%09u\n",
> > +                      sample_num, when, sec, nsec);
> > +               break;
> > +       case CLOCK_MONOTONIC_RAW:
> > +               printf("sample #%2d: monotonic-raw time %s: %lld.%09u\n",
> > +                      sample_num, when, sec, nsec);
> > +               break;
> 
> These three printfs are also kind of duplicated, I think mapping the
> clockid to name first would save a few lines.

Done in v5 - map the clockid to a name and print once.


Reply via email to