static unsigned long clear_pte_range(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end) { pte_t *pte; pte_t ptecont; do { pte = pte_offset_map(pmd, addr); ptecont = *pte; if (pte_none(ptecont)) continue; /* * pte_young is a confusing name, though it AND _PAGE_ACCESSED * Instead, I think we should call it pte_accessed */ if (pte_present(ptecont) && pte_young(ptecont)) { /* * The physical page, which this pte points to, has * been read or written to during this time period. */ DEBUG_INFO("[%#016lx - %#016lx], pfn = %#013lx", addr, end, pte_pfn(ptecont)); collect_statistics(pte_pfn(ptecont)); pte_clear_flags(ptecont, _PAGE_ACCESSED); } } while (pte++, addr += PAGE_SIZE, addr != end); return addr; }
int main(int argc, char **argv) { g_program_name=argv[0]; int consumed_args=parse_options(argc, argv); /* if we get here, all parameters have been parsed correctly. skip used parameters. Everything that is left is the command we would like to execute. */ argc-=consumed_args; argv+=consumed_args; CallStatP call_stats=(CallStatP)malloc(sizeof(CallStat)*g_num_repeats); callstat_print_head(g_output_stream, g_output_format); int i=0; for (; i<g_num_repeats; ++i) { run_and_measure(argc, argv, &call_stats[i]); char num_buf[10]; snprintf(num_buf, 10, "%d", i+1); callstat_print(g_output_stream, &call_stats[i], num_buf, g_output_format); } callstat_print_sep(g_output_stream, g_output_format); /* collect statistics */ collect_statistics(call_stats); if (g_output_stream!=stdout) { fclose(g_output_stream); } free(call_stats); return 0; }
void statistics_dialog (void) { GtkWidget *window; GtkWidget *main_vbox; GtkWidget *page; GtkWidget *hbox; GtkWidget *label; GtkWidget *button; int page_num = 0; server_stats_create (); collect_statistics (); window = dialog_create_modal_transient_window (_("Statistics"), TRUE, TRUE, GTK_SIGNAL_FUNC(statistics_save_geometry)); statistics_restore_geometry(window); main_vbox = gtk_vbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8); gtk_container_add (GTK_CONTAINER (window), main_vbox); label = gtk_label_new (_("Statistics")); gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 8); gtk_widget_show (label); stat_notebook = gtk_notebook_new (); gtk_notebook_set_tab_pos (GTK_NOTEBOOK (stat_notebook), GTK_POS_TOP); gtk_notebook_set_tab_hborder (GTK_NOTEBOOK (stat_notebook), 4); gtk_box_pack_start (GTK_BOX (main_vbox), stat_notebook, TRUE, TRUE, 0); page = server_stats_page (); label = gtk_label_new (_(srv_label)); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label); page = archs_stats_page (); label = gtk_label_new (_(arch_label)); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label); #ifdef USE_GEOIP page = country_stats_page (); label = gtk_label_new (_(country_label)); gtk_widget_show (label); gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label); #endif page_num = config_get_int ("/" CONFIG_FILE "/Statistics/page"); gtk_notebook_set_page (GTK_NOTEBOOK (stat_notebook), page_num); gtk_widget_show (stat_notebook); /* Close Button */ hbox = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); button = gtk_button_new_with_label (_("Close")); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_set_usize (button, 80, -1); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (grab_defaults), NULL); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window)); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (hbox); gtk_widget_show (main_vbox); gtk_widget_show (window); gtk_main (); unregister_window (window); server_stats_destroy (); }
void context::display_istatistics(std::ostream & out) const { ::statistics st; collect_statistics(st); st.display_internal(out); }
void people2D_engine::detect_save_all() { FILE *f=fopen(params.outputfile.c_str(), "wt"); //~ init in case of pr recall curve if(params.precall) { stats_detector = std::vector <stats_str> (PEOPLE2D_PRDISCR); for (uint i=0;i<stats_detector.size();i++) { stats_detector[i].tp = 0; stats_detector[i].fp = 0; stats_detector[i].fn = 0; stats_detector[i].poslabel = 0; stats_detector[i].neglabel = 0; } } //~ detection and save for (uint i=0;i<laserscan.size();i++) { std::vector < std::vector <Real> > descriptor; if(params.verbosity >= 1) printf("Segmenting scan and computing descriptor [%d/%lu]\n", i,laserscan.size()); std::vector<LSL_Point3D_container> clusters; //~ compute segments segmentscanJDC(i, clusters); if(params.verbosity == 2) printf("Found %lu segments\n", clusters.size()); //~ compute descriptors lfeatures->compute_descriptor(clusters, descriptor); //~ sanity check if(params.sanity) { int ret = sanity_check (descriptor); if(!ret) { printf("Sanity check failed @ %d scan \n",i); exit(1); } else { if(params.verbosity == 2) printf("Sanity check passed \n"); } } //~ associate label to segment if(params.verbosity == 2) printf("Adaboost predict \n"); std::vector <Real> label(clusters.size()); predict(descriptor,label); //~ collects statistics if(params.precall) collect_statistics(clusters, label); if(params.verbosity == 2) printf("Save on disk\n"); if(!params.benchmark) { fprintf(f,"%d ", i); uint count =0; for (unsigned int w = 0; w < clusters.size();w++) { count += clusters[w].pts.size(); for (unsigned int j = 0; j < clusters[w].pts.size(); j++) fprintf(f,"%f %f %g ", clusters[w].pts[j].x,clusters[w].pts[j].y, label[w]); } //~ padding for easy visualization for (unsigned int j = 0; j < PEOPLE2D_PADDING-count; j++) fprintf(f,"0.0 0.0 -2 "); fprintf(f,"\n"); } } fclose(f); }