예제 #1
0
/* main, life starts here */
int main(int argc, char **argv) {
    perfexpert_list_t profiles;

    /* Set default values for globals */
    globals = (globals_t) {
        .threshold       = 0.0,              // double
        .tool            = "hpctoolkit",     // char *
        .inputfile       = NULL,             // char *
        .outputfile      = NULL,             // char *
        .outputfile_FP   = stdout,           // char *
        .aggregate       = PERFEXPERT_FALSE, // int
        .thread          = -1,               // int
        .machinefile     = NULL,             // char *
        .machine_by_name = NULL,             // metric_t *
        .lcpifile        = NULL,             // char *
        .lcpi_by_name    = NULL,             // lcpi_t *
        .verbose         = 0,                // int
        .colorful        = PERFEXPERT_FALSE, // int
        .order           = "none",           // char *
        .found_hotspots  = PERFEXPERT_FALSE, // int
        .outputmetrics   = NULL              // char *
    };

    /* Initialize list of profiles */
    perfexpert_list_construct(&profiles);

    /* Parse command-line parameters */
    if (PERFEXPERT_SUCCESS != parse_cli_params(argc, argv)) {
        OUTPUT(("%s", _ERROR("Error: parsing command line arguments")));
        return PERFEXPERT_ERROR;
    }

    /* Set default values */
    if (NULL == globals.machinefile) {
        PERFEXPERT_ALLOC(char, globals.machinefile,
            (strlen(PERFEXPERT_ETCDIR) + strlen(MACHINE_FILE) + 2));
        sprintf(globals.machinefile, "%s/%s", PERFEXPERT_ETCDIR, MACHINE_FILE);
    }
    if (NULL == globals.lcpifile) {
        PERFEXPERT_ALLOC(char, globals.lcpifile,
            (strlen(PERFEXPERT_ETCDIR) + strlen(LCPI_FILE) + 2));
        sprintf(globals.lcpifile, "%s/%s", PERFEXPERT_ETCDIR, LCPI_FILE);
    }
예제 #2
0
/* perfexpert_list_destruct */
void perfexpert_list_destruct(perfexpert_list_t *list) {
    perfexpert_list_construct(list);
}