src/windows/native/sun/management/OperatingSystemImpl.c
static int
initProcLoadCounter(void) {
    char time[COUNTER_BUF_SIZE];
    char counter[COUNTER_BUF_SIZE*2];

    if (find_name(PDH_PROCESSOR_TIME_IDX, time, sizeof(time)-1) < 0) {
        return -1;
    }
    _snprintf(counter, sizeof(counter)-1, "%s\\%s", getProcessPDHHeader(), time);
    return initSingleCounterQuery(&cntProcLoad, counter);
}
/**
 * Sets up the supplied SingleCounterQuery to listen for the time spent
 * by the HotSpot process.
 *
 * @param counterQuery   the counter query to set up as a process counter.
 * @param ebuf           the error buffer.
 * @param elen           the length of the error buffer.
 * @returns              CONFIG_SUCCESSFUL if successful, negative on failure.
 */
Sets up the supplied SingleCounterQuery to listen for the time spent
by the HotSpot process.

@param counterQuery   the counter query to set up as a process counter.
@param ebuf           the error buffer.
@param elen           the length of the error buffer.
@returns              CONFIG_SUCCESSFUL if successful, negative on failure.
Sets up the supplied SingleCounterQuery to listen for the time spent by the HotSpot process . @param counterQuery the counter query to set up as a process counter . @param ebuf the error buffer . @param elen the length of the error buffer . @returns CONFIG_SUCCESSFUL if successful negative on failure .
static int
initProcLoadCounter(void) {
    char time[COUNTER_BUF_SIZE];
    char counter[COUNTER_BUF_SIZE*2];
    if (find_name(PDH_PROCESSOR_TIME_IDX, time, sizeof(time)-1) < 0) {
        return -1;
    }
    _snprintf(counter, sizeof(counter)-1, "%s\\%s", getProcessPDHHeader(), time);
    return initSingleCounterQuery(&cntProcLoad, counter);
}
static int initProcLoadCounter ( void ) { char time [ COUNTER_BUF_SIZE ] ; char counter [ COUNTER_BUF_SIZE * 2 ] ; if ( find_name ( PDH_PROCESSOR_TIME_IDX , time , sizeof ( time ) - 1 ) < 0 ) { return -1 ; } _snprintf ( counter , sizeof ( counter ) - 1 , " \\ " , getProcessPDHHeader ( ) , time ) ; return initSingleCounterQuery ( & cntProcLoad , counter ) ; }
Sets up the supplied SingleCounterQuery to listen for the time spent
 by the HotSpot process.
Sets up the supplied SingleCounterQuery to listen for the time spent by the HotSpot process .