static void check_ma(struct quadd_hrt_ctx *hrt_ctx) { pid_t pid; struct pid *pid_s; struct task_struct *task = NULL; struct mm_struct *mm; struct quadd_ctx *quadd_ctx = hrt_ctx->quadd_ctx; unsigned long vm_size, rss_size; pid = quadd_ctx->param.pids[0]; rcu_read_lock(); pid_s = find_vpid(pid); if (pid_s) task = pid_task(pid_s, PIDTYPE_PID); rcu_read_unlock(); if (!task) return; mm = task->mm; if (!mm) return; vm_size = mm->total_vm; rss_size = get_mm_rss(mm); if (vm_size != hrt_ctx->vm_size_prev || rss_size != hrt_ctx->rss_size_prev) { make_sample(hrt_ctx, pid, vm_size, rss_size); hrt_ctx->vm_size_prev = vm_size; hrt_ctx->rss_size_prev = rss_size; } }
static void check_clks(void) { int changed = 0; if (is_data_changed(&power_ctx.cpu)) { update_data(&power_ctx.cpu); changed = 1; } if (is_data_changed(&power_ctx.gpu)) { update_data(&power_ctx.gpu); changed = 1; } if (is_data_changed(&power_ctx.emc)) { update_data(&power_ctx.emc); changed = 1; } /* pr_debug("cpu: %lu/%lu/%lu/%lu, gpu: %lu, emc: %lu, changed: %s\n", power_ctx.cpu.data[0].value, power_ctx.cpu.data[1].value, power_ctx.cpu.data[2].value, power_ctx.cpu.data[3].value, power_ctx.gpu.data[0].value, power_ctx.emc.data[0].value, changed ? "yes" : "no"); */ if (changed) make_sample(); }
//----Constructors----// GSEA::GSEA(const char* database_file_, const char* population_file_, const char* sample_file_) : database_file(database_file_), population_file(population_file_), sample_file(sample_file_) { /* This constructor handles the GSEA object. Sets the given file paths. Calls the make methods in sequence. */ clock_t tStart = clock(); make_population(); printf("make_population: %.2fs\n", (double)(clock() - tStart) / CLOCKS_PER_SEC); clock_t tpop_suc = clock(); make_db_pop(); printf("population success: %.2fs\n", (double)(clock() - tpop_suc) / CLOCKS_PER_SEC); clock_t tmake_sample = clock(); make_sample(); printf("make_sample: %.2fs\n", (double)(clock() - tmake_sample) / CLOCKS_PER_SEC); clock_t tsample = clock(); make_result(sample); printf("make_result: %.2fs\n", (double)(clock() - tsample) / CLOCKS_PER_SEC); };