@@ -785,7 +785,7 @@ static void display_process_stats(struct traceeval *teval,
};
for (int i = 0; i < OTHER; i++) {
- TRACEEVAL_SET_NUMBER_64(keys[1], i);
+ TRACEEVAL_SET_NUMBER(keys[1], i);
delta = 0;
stat = traceeval_stat(teval, keys, &delta_vals[0]);
@@ -479,10 +479,16 @@ static int get_entry(struct traceeval *teval, const struct traceeval_data *keys,
struct hash_item *item;
unsigned key;
int check = 0;
+ int i;
if (!teval || !keys)
return -1;
+ for (i = 0; i < teval->nr_key_types; i++) {
+ if (keys[i].type != teval->key_types[i].type)
+ return -1;
+ }
+
key = make_hash(teval, keys, hist->bits);
for (iter = hash_iter_bucket(hist, key); (item = hash_iter_bucket_next(iter)); ) {
@@ -792,6 +798,11 @@ static int update_entry(struct traceeval *teval, struct entry *entry,
if (!size)
return 0;
+ for (i = 0; i < teval->nr_val_types; i++) {
+ if (vals[i].type != teval->val_types[i].type)
+ return -1;
+ }
+
for (i = 0; i < size; i++) {
old[i] = copy[i];
@@ -928,10 +939,16 @@ int traceeval_insert(struct traceeval *teval,
{
struct entry *entry;
int check;
+ int i;
entry = NULL;
check = get_entry(teval, keys, &entry);
+ for (i = 0; i < teval->nr_val_types; i++) {
+ if (vals[i].type != teval->val_types[i].type)
+ return -1;
+ }
+
if (check == -1)
return check;