Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8012641

Perf_CreateLong creates perf counter of incorrect type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • hs25
    • 8
    • hotspot
    • b32

    Backports

      Description

        In src/share/vm/prims/perf.cpp, Perf_CreateLong creates a perf counter of an incorrect type. As defined in perfData.hpp:
            enum Variability {
              V_Constant = 1,
              V_Monotonic = 2,
              V_Variable = 3,
              V_last = V_Variable
            };

        Perf_CreateLong incorrectly creates a V_Variable perf long counter if variability == 2 and V_Monotonic if variability == 3.

        The bug is in the switch statement:

          switch(variability) {
          case 1: /* V_Constant */
            pl = PerfDataManager::create_long_constant(NULL_NS, (char *)name_utf,
                                                       (PerfData::Units)units, value,
                                                       CHECK_NULL);
            break;

          case 2: /* V_Variable */
            pl = PerfDataManager::create_long_variable(NULL_NS, (char *)name_utf,
                                                       (PerfData::Units)units, value,
                                                       CHECK_NULL);
            break;

          case 3: /* V_Monotonic Counter */
            pl = PerfDataManager::create_long_counter(NULL_NS, (char *)name_utf,
                                                      (PerfData::Units)units, value,
                                                      CHECK_NULL);
            break;

          default: /* Illegal Argument */
            debug_only(warning("unexpected variability value: %d", variability));
            THROW_0(vmSymbols::java_lang_IllegalArgumentException());
            break;
          }

        Attachments

          Issue Links

            Activity

              People

                ccheung Calvin Cheung
                mchung Mandy Chung
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: