Пример #1
0
/*!
 * Destroy a red-black tree
 *
 * \param tree The tree
 */
void rbtree_destroy
    (
    rbtree_t * tree
    )
    {
    rbtree_clean(tree);
    kfree(tree);
    }
Пример #2
0
void destroy_filelist(struct benchfiles *bf)
{
	free(bf->basedir);
	free(bf->basename);

	while (!cl_empty(bf->holes)) {
		struct ffsb_file *cur = cl_remove_head(bf->holes);
		file_destructor(cur);
	}
	free(bf->holes);
	rbtree_clean(bf->files, file_destructor);
	free(bf->files);
}
Пример #3
0
int stop_profiling(void) {
#if DUMP_OVERHEAD
   rdtscll(time_before_stop_profiling);
#endif
   
   //rbtree_print(); //debug
   //show_tid_sharing_map(); //debug

   if(permanently_disable_carrefour || (!enable_replication && !enable_interleaving && !enable_migration)) {
      enable_carrefour = 0;
   }

   //printk("Current processor %d\n", smp_processor_id());
#if ADAPTIVE_SAMPLING
   printk("-- Carrefour %s, replication %s, interleaving %s, migration %s, frequency %s\n", 
            enable_carrefour    ? "enabled" : "disabled",
            enable_replication  ? "enabled" : "disabled",
            enable_interleaving ? "enabled" : "disabled",
            enable_migration    ? "enabled" : "disabled",
            sampling_rate == sampling_rate_accurate ? "accurate" : "cheap");
#else
   printk("-- Carrefour %s, replication %s, interleaving %s, migration %s\n", 
            enable_carrefour    ? "enabled" : "disabled",
            enable_replication  ? "enabled" : "disabled",
            enable_interleaving ? "enabled" : "disabled",
            enable_migration    ? "enabled" : "disabled");
#endif
   ibs_stop();

#if DETAILED_STATS
   if(!permanently_disable_carrefour) {
      carrefour();
   }
#else 
   if(enable_carrefour) {
      carrefour();
   }
#endif
   
   /** free all memory **/
   rbtree_clean();
#if ENABLE_THREAD_PLACEMENT
   tids_clean();
#endif
   carrefour_clean();

#if DUMP_OVERHEAD
   rdtscll(time_after_stop_profiling);
   if(num_online_cpus() > 0 && (time_after_stop_profiling - time_start_profiling > 0)) {
      unsigned long total_time = time_after_stop_profiling - time_start_profiling;
      unsigned long stop_profiling_time = time_after_stop_profiling - time_before_stop_profiling;

      printk("-- Carrefour %lu total profiling time, %lu stop_profiling, %lu in NMI - Overhead master core %d%%, average overhead %d%%\n",
            (unsigned long) total_time,
            (unsigned long) stop_profiling_time,
            (unsigned long) time_spent_in_NMI,
            (int)(stop_profiling_time * 100 / total_time),
            (int)((time_spent_in_NMI / num_online_cpus()) * 100 / total_time)
            );

      printk("-- Carrefour %lu total migration time, migration overhead (%d%%)\n",
            (unsigned long) time_spent_in_migration,
            (int) (time_spent_in_migration * 100 / (time_after_stop_profiling - time_start_profiling))
            );

   }

   printk("Current core is %d\n", smp_processor_id());
#endif

   return 0;
}
Пример #4
0
Файл: rbt.c Проект: 1587/ltp
void rbtree_destruct(rb_tree * tree, destructor d)
{
	rbtree_clean(tree, d);
	free(tree);
}