Diff of /libop/op_events.c [3b11e2] .. [6ee980]  Maximize  Restore

  Switch to unified view

a/libop/op_events.c b/libop/op_events.c
...
...
254
254
255
static void free_unit_mask(struct op_unit_mask * um)
255
static void free_unit_mask(struct op_unit_mask * um)
256
{
256
{
257
    list_del(&um->um_next);
257
    list_del(&um->um_next);
258
    free(um);
258
    free(um);
259
  um = NULL;
259
}
260
}
260
261
261
/*
262
/*
262
 * name:zero type:mandatory default:0x0
263
 * name:zero type:mandatory default:0x0
263
 * \t0x0 No unit mask
264
 * \t0x0 No unit mask
...
...
287
            um = new_unit_mask();
288
            um = new_unit_mask();
288
            parse_um(um, line);
289
            parse_um(um, line);
289
        } else {
290
        } else {
290
            if (!um)
291
            if (!um)
291
                parse_error("no unit mask name line");
292
                parse_error("no unit mask name line");
292
          if (um->num >= MAX_UNIT_MASK)
293
              parse_error("oprofile: maximum unit mask entries exceeded");
294
293
295
            parse_um_entry(&um->um[um->num], line);
294
            parse_um_entry(&um->um[um->num], line);
296
            ++(um->num);
295
            ++(um->num);
297
        }
296
        }
298
297
...
...
559
                include_events(value);
558
                include_events(value);
560
                free(value);
559
                free(value);
561
                c = skip_ws(c);
560
                c = skip_ws(c);
562
                if (*c != '\0' && *c != '#')
561
                if (*c != '\0' && *c != '#')
563
                    parse_error("non whitespace after include:");
562
                    parse_error("non whitespace after include:");
563
              break;
564
            } else {
564
            } else {
565
                parse_error("unknown tag");
565
                parse_error("unknown tag");
566
            }
566
            }
567
            tags++;
567
            tags++;
568
568
...
...
1035
1035
1036
    // Next, we sort the unit mask values in ascending order.
1036
    // Next, we sort the unit mask values in ascending order.
1037
    for (i = 1; i < evt.unit->num; i++) {
1037
    for (i = 1; i < evt.unit->num; i++) {
1038
        int j = i - 1;
1038
        int j = i - 1;
1039
        u32 tmp = evt.unit->um[i].value;
1039
        u32 tmp = evt.unit->um[i].value;
1040
        while (tmp < evt.unit->um[j].value && j >= 0) {
1040
        while (j >= 0 && tmp < evt.unit->um[j].value) {
1041
            evt.unit->um[j + 1].value = evt.unit->um[j].value;
1041
            evt.unit->um[j + 1].value = evt.unit->um[j].value;
1042
            j -= 1;
1042
            j -= 1;
1043
        }
1043
        }
1044
        evt.unit->um[j + 1].value = tmp;
1044
        evt.unit->um[j + 1].value = tmp;
1045
    }
1045
    }
...
...
1087
                break;
1087
                break;
1088
            }
1088
            }
1089
        }
1089
        }
1090
    }
1090
    }
1091
1091
1092
  free(tmp_um);
1093
  free(tmp_um_no_dups);
1094
    if (dup_value_used) {
1092
    if (dup_value_used) {
1095
        fprintf(stderr, "Ambiguous bitmask: Unit mask values"
1093
        fprintf(stderr, "Ambiguous bitmask: Unit mask values"
1096
                " cannot include non-unique numerical values (i.e., 0x%x).\n",
1094
                " cannot include non-unique numerical values (i.e., 0x%x).\n",
1097
                evt.unit->um[i].value);
1095
                evt.unit->um[i].value);
1098
        fprintf(stderr, "Use ophelp to see the unit mask values for event %s.\n",
1096
        fprintf(stderr, "Use ophelp to see the unit mask values for event %s.\n",
1099
                event->name);
1097
                event->name);
1100
    } else if (masked_val == passed_um && passed_um != 0) {
1098
    } else if (masked_val == passed_um && passed_um != 0) {
1101
        retval = 1;
1099
        retval = 1;
1102
    }
1100
    }
1101
  free(tmp_um);
1102
  free(tmp_um_no_dups);
1103
    return retval;
1103
    return retval;
1104
}
1104
}
1105
1105
1106
int op_check_events(int ctr, u32 nr, u32 um, op_cpu cpu_type)
1106
int op_check_events(int ctr, u32 nr, u32 um, op_cpu cpu_type)
1107
{
1107
{

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks