return NULL;
}
-static void add_ppm_hash(pid_t pid, const char *name)
+static struct process_pid_map *add_ppm_hash(pid_t pid, const char *name)
{
const int hash_idx = ppm_hash_pid(pid);
struct process_pid_map *ppm;
ppm->hash_next = ppm_hash_table[hash_idx];
ppm_hash_table[hash_idx] = ppm;
}
+
+ return ppm;
}
static void handle_notify(struct blk_io_trace *bit)
if (!iot) {
iot = malloc(sizeof(*iot));
iot->ppm = find_ppm(pid);
+ if (!iot->ppm)
+ iot->ppm = add_ppm_hash(pid, "unknown");
iot->sector = sector;
track_rb_insert(pdi, iot);
}
ppi = malloc(sizeof(*ppi));
memset(ppi, 0, sizeof(*ppi));
ppi->ppm = find_ppm(pid);
+ if (!ppi->ppm)
+ ppi->ppm = add_ppm_hash(pid, "unknown");
add_ppi_to_hash(ppi);
add_ppi_to_list(ppi);
}