Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-5457

undefined reference to end_cpu_nsecs

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.6.43-84.3, 5.7.25-28, 8.0.13-4
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      In sql/userstat.cc, the variable end_cpu_nsecs is declared at line 84, but used at line 89. If HAVE_CLOCK_GETTIME is not defined, compilation fails.

       

      #ifdef HAVE_CLOCK_GETTIME
      /* Get end cputime */
      struct timespec tp;
      double end_cpu_nsecs = 0.0; //line 84
      if (start_cpu_nsecs > 0.0 && !clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp))
      end_cpu_nsecs = tp.tv_sec * 1000000000.0 + tp.tv_nsec;
      #endif

      if (end_cpu_nsecs > start_cpu_nsecs) { //line 89
      *cpu_sec = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000.0;
      /* In case there are bad values, 2629743 is the #seconds in a month. */
      if (unlikely(*cpu_sec > 2629743.0))

      { *cpu_sec = 0.0; }

      }

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                xiaoyu Xiaoyuwang
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: