diff options
Diffstat (limited to 'core/salis.c')
| -rw-r--r-- | core/salis.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/core/salis.c b/core/salis.c index 5bccc15..7168dea 100644 --- a/core/salis.c +++ b/core/salis.c @@ -51,6 +51,7 @@ struct Core { uint64_t aeva[MVEC_SIZE]; // allocation events array uint64_t eeva[MVEC_SIZE]; // execution events array + uint64_t beva[MVEC_SIZE]; // birth events array #define CORE_DATA_FIELD(type, name, suff) type name suff; CORE_DATA_FIELDS @@ -361,6 +362,21 @@ void proc_new(struct Core *core, const struct Proc *proc) { core->pnum++; core->plst++; memcpy(&core->pvec[core->plst % core->pcap], proc, sizeof(struct Proc)); + +#if defined(DATA_PUSH_PATH) + // Store birth event in database + uint64_t child_addr = arch_proc_mb0_addr(core, core->plst); + uint64_t child_size = arch_proc_mb0_size(core, core->plst); + + for (uint64_t i = 0; i < child_size; i++) { + uint64_t addr = child_addr + i; +#if defined(MVEC_LOOP) + ++core->beva[mvec_loop(addr)]; +#else + ++core->beva[addr]; +#endif + } +#endif } void proc_kill(struct Core *core) { @@ -423,6 +439,7 @@ void core_save(FILE *f, const struct Core *core) { #if defined(DATA_PUSH_PATH) fwrite(core->aeva, sizeof(uint64_t), MVEC_SIZE, f); fwrite(core->eeva, sizeof(uint64_t), MVEC_SIZE, f); + fwrite(core->beva, sizeof(uint64_t), MVEC_SIZE, f); #endif arch_core_save(f, core); @@ -519,6 +536,7 @@ void core_load(FILE *f, struct Core *core) { #if defined(DATA_PUSH_PATH) fread(core->aeva, sizeof(uint64_t), MVEC_SIZE, f); fread(core->eeva, sizeof(uint64_t), MVEC_SIZE, f); + fread(core->beva, sizeof(uint64_t), MVEC_SIZE, f); #endif arch_core_load(f, core); @@ -763,7 +781,7 @@ void salis_push_data_header(void) { ); // Memory events - char *eprefs[] = { "aev", "eev" }; + char *eprefs[] = { "aev", "eev", "bev" }; int eprefs_cnt = sizeof(eprefs) / sizeof(eprefs[0]); for (int i = 0; i < CORES; ++i) { @@ -850,7 +868,7 @@ void salis_push_data_line(void) { ); // TODO: insert execute memory events - char *eprefs[] = { "aev", "eev" }; + char *eprefs[] = { "aev", "eev", "bev" }; int eprefs_cnt = sizeof(eprefs) / sizeof(eprefs[0]); for (int i = 0; i < CORES; ++i) { @@ -861,6 +879,8 @@ void salis_push_data_line(void) { in = g_cores[i].aeva; } else if (!strcmp("eev", eprefs[j])) { in = g_cores[i].eeva; + } else if (!strcmp("bev", eprefs[j])) { + in = g_cores[i].beva; } // Compress event data @@ -912,6 +932,7 @@ void salis_push_data_line(void) { memset(core->aeva, 0, sizeof(uint64_t) * MVEC_SIZE); memset(core->eeva, 0, sizeof(uint64_t) * MVEC_SIZE); + memset(core->beva, 0, sizeof(uint64_t) * MVEC_SIZE); } // Push arch-specific data |
