>
> +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.

Reply via email to