/* dump simulator-specific auxiliary simulator statistics */ void sim_aux_stats(FILE *stream) /* output stream */ { /* nada */ print_counter(stream, "sim_elapsed_time", sim_elapsed_time, "simulation time in seconds"); print_rate(stream, "sim_insn_rate", (double)sim_num_insn/sim_elapsed_time, "simulation speed (insts/sec)"); print_counter(stream, "sim_num_insn", sim_num_insn, "instructions simulated (fast-forwarding included)"); print_counter(stream, "sim_sample_insn", sim_sample_insn, "instructions (in sample)"); print_counter(stream, "sim_sample_int", sim_sample_insn_split[ic_icomp] + sim_sample_insn_split[ic_icomplong], "integer operations"); print_counter(stream, "sim_sample_load", sim_sample_insn_split[ic_load], "loads"); print_counter(stream, "sim_sample_store", sim_sample_insn_split[ic_store], "stores"); print_counter(stream, "sim_sample_branch", sim_sample_insn_split[ic_ctrl], "branches"); print_counter(stream, "sim_sample_fp", sim_sample_insn_split[ic_fcomp] + sim_sample_insn_split[ic_fcomplong], "floating point operations"); print_counter(stream, "sim_sample_prefetch", sim_sample_insn_split[ic_prefetch], "prefetches"); print_counter(stream, "sim_sample_sys", sim_sample_insn_split[ic_sys], "syscalls"); /* register cache stats */ if (cache_dl1) cache_stats_print(cache_dl1, stream); if (dtlb) cache_stats_print(dtlb, stream); if (cache_il1 && cache_il1 != cache_dl1) cache_stats_print(cache_il1, stream); if (itlb && itlb != dtlb) cache_stats_print(itlb, stream); if (cache_l2) cache_stats_print(cache_l2, stream); }
int main(int argc, char **argv) { int cache_strategy, cache_metric, cache_size, help; Eina_List *filters = NULL, *list_iter; Filter *f, *last, *load, *sink; char *file = NULL; int verbose; lime_init(); if (parse_cli(argc, argv, &filters, NULL, &cache_size, &cache_metric, &cache_strategy, &file, NULL, &verbose, &help)) return EXIT_FAILURE; if (help) { print_help(); return EXIT_SUCCESS; } print_init_info(NULL, cache_size, cache_metric, cache_strategy, NULL); lime_cache_set(cache_size, cache_strategy | cache_metric); if (!strcmp(((Filter*)eina_list_data_get(filters))->fc->shortname, "load")) { load = eina_list_data_get(filters); if (file) lime_setting_string_set(load, "filename", file); } else { if (!file) { printf("ERROR: need file to execute filter chain!\n"); return EXIT_FAILURE; } load = lime_filter_new("load"); lime_setting_string_set(load, "filename", file); filters = eina_list_prepend(filters, load); } last = NULL; EINA_LIST_FOREACH(filters, list_iter, f) { if (last) lime_filter_connect(last, f); last = f; } sink = last; lime_render(sink); cache_stats_print(); lime_shutdown(); return 0; }
//render area with external threading void lime_render_area(Rect *area, Filter *f, int thread_id) { int j; Render_Node *waiter; Render_Node *job; Dim *ch_dim; if (!f) return; lime_lock(); lime_config_test(f); lime_filter_config_ref(f); ch_dim = meta_child_data_by_type(ea_data(f->node->con_ch_in, 0), MT_IMGSIZE); assert(area->corner.x < DIV_SHIFT_ROUND_UP(ch_dim->width, area->corner.scale)); assert(area->corner.y < DIV_SHIFT_ROUND_UP(ch_dim->height, area->corner.scale)); Render_State *state = render_state_new(area, f); while ((job = render_state_getjob(state))) { assert(job->need == 0); if (job->mode == MODE_CLOBBER || job->mode == MODE_INPUT) { assert(job->tile->refs > 0); filter_render_tile(job, thread_id); } //MODE_ITER else if (job->mode == MODE_ITER) { if (job->f->mode_iter->finish) job->f->mode_iter->finish(job->f); } else abort(); if (job->tile && job->tile->want) while(ea_count(job->tile->want)) { waiter = ea_pop(job->tile->want); if (waiter->mode != MODE_ITER) { for(j=0;j<ea_count(waiter->f_source);j++) if (filter_hash_value_get(ea_data(waiter->f_source, j)) == job->tile->filterhash) //FIXME channel selection, use paired channels not blindly the same number! clobbertile_add(ea_data(waiter->inputs, j), ea_data(job->tile->channels, j)); } waiter->need--; if (!waiter->need) { ea_push(waiter->state->ready, waiter); waiter->state->pending--; } //FIXME add proper interface! else if (!strcmp(waiter->f->fc->shortname, "savejpeg") || !strcmp(waiter->f->fc->shortname, "savetiff")) cache_stats_print(); } if (job->tile) job->tile->refs--; render_node_del(job); } render_state_del(state); lime_filter_config_unref(f); lime_unlock(); }