src/ProcDumpConfiguration.c
//--------------------------------------------------------------------
//
// PrintConfiguration - Prints the current configuration to the command line
//
//--------------------------------------------------------------------
Prints the current configuration to the command line
Prints the current configuration to the command line
bool PrintConfiguration(struct ProcDumpConfiguration *self)
{
    if (WaitForSingleObject(&self->evtConfigurationPrinted,0) == WAIT_TIMEOUT) {
        printf("Process:\t\t%s", self->ProcessName);
        if (!self->WaitingForProcessName) {
            printf(" (%d)", self->ProcessId);
        } else {
            printf(" (pending)");
        }
        printf("\n");
        if (self->CpuThreshold != -1) {
            if (self->bCpuTriggerBelowValue) {
                printf("CPU Threshold:\t\t<%d\n", self->CpuThreshold);
            } else {
                printf("CPU Threshold:\t\t>=%d\n", self->CpuThreshold);
            }
        } else {
            printf("CPU Threshold:\t\tn/a\n");
        }
        if (self->MemoryThreshold != -1) {
            if (self->bMemoryTriggerBelowValue) {
                printf("Commit Threshold:\t<%d\n", self->MemoryThreshold);
            } else {
                printf("Commit Threshold:\t>=%d\n", self->MemoryThreshold);
            }
        } else {
            printf("Commit Threshold:\tn/a\n");
        }
        if (self->ThreadThreshold != -1) {
            printf("Thread Threshold:\t>=%d\n", self->ThreadThreshold);
        }
        if (self->FileDescriptorThreshold != -1) {
            printf("File descriptor Threshold:\t>=%d\n", self->FileDescriptorThreshold);
        }
        printf("Polling interval (ms):\t%d\n", self->PollingInterval);
        printf("Threshold (s):\t%d\n", self->ThresholdSeconds);
        printf("Number of Dumps:\t%d\n", self->NumberOfDumpsToCollect);
        SetEvent(&self->evtConfigurationPrinted.event);
        return true;
    }
    return false;
}
bool PrintConfiguration ( struct ProcDumpConfiguration * self ) { if ( WaitForSingleObject ( & self -> evtConfigurationPrinted , 0 ) == WAIT_TIMEOUT ) { printf ( " \t \t " , self -> ProcessName ) ; if ( ! self -> WaitingForProcessName ) { printf ( " " , self -> ProcessId ) ; } else { printf ( " " ) ; } printf ( " \n " ) ; if ( self -> CpuThreshold != -1 ) { if ( self -> bCpuTriggerBelowValue ) { printf ( " \t \t \n " , self -> CpuThreshold ) ; } else { printf ( " \t \t \n " , self -> CpuThreshold ) ; } } else { printf ( " \t \t \n " ) ; } if ( self -> MemoryThreshold != -1 ) { if ( self -> bMemoryTriggerBelowValue ) { printf ( " \t \n " , self -> MemoryThreshold ) ; } else { printf ( " \t \n " , self -> MemoryThreshold ) ; } } else { printf ( " \t \n " ) ; } if ( self -> ThreadThreshold != -1 ) { printf ( " \t \n " , self -> ThreadThreshold ) ; } if ( self -> FileDescriptorThreshold != -1 ) { printf ( " \t \n " , self -> FileDescriptorThreshold ) ; } printf ( " \t \n " , self -> PollingInterval ) ; printf ( " \t \n " , self -> ThresholdSeconds ) ; printf ( " \t \n " , self -> NumberOfDumpsToCollect ) ; SetEvent ( & self -> evtConfigurationPrinted . event ) ; return true ; } return false ; }
PrintConfiguration - Prints the current configuration to the command line
PrintConfiguration - Prints the current configuration to the command line
// CPU // Memory // Thread // File descriptor // Polling inverval // time // number of dumps and others