linux-lts-quantal-3.5.0/kernel/replay.c
/* Deallocates record per-thread data and per-process data if refcnt = 0 */
Deallocates record per-thread data and per-process data if refcnt = 0
Deallocates record per - thread data and per - process data if refcnt = 0
static void
__destroy_record_thread (struct record_thread* prp)
{
	struct record_thread* prev;
	struct repsignal* psig;
	DPRINT ("      Pid %d __destroy_record_thread: %p\n", current->pid, prp);
	if (!atomic_dec_and_test(&prp->rp_refcnt)) {
		MPRINT ("        pid %d don't destroy record thread! pid = %d, prp = %p, refcnt=%d\n", 
			current->pid, prp->rp_record_pid, prp, atomic_read(&prp->rp_refcnt));
		return;
	}
	MPRINT ("        pid %d !YES! destroy record thread! pid = %d, prp = %p, refcnt=%d\n",
		current->pid, prp->rp_record_pid, prp, atomic_read(&prp->rp_refcnt));
	DPRINT (" destroy_record_thread freeing log %p: start\n", prp->rp_log);
	argsfreeall (prp);
	VFREE (prp->rp_log); 
	DPRINT ("       destroy_record_thread freeing log %p: end\n", prp->rp_log);
	while (prp->rp_signals) {
		psig = prp->rp_signals;
		prp->rp_signals = psig->next;
		KFREE (psig);
	}
	for (prev = prp; prev->rp_next_thread != prp;
	     prev = prev->rp_next_thread);
	prev->rp_next_thread = prp->rp_next_thread;
	put_record_cache_files (prp->rp_cache_files);
	put_record_group (prp->rp_group);
#ifdef LOG_COMPRESS_1
	clogfreeall (prp);
	int bitsin, bitsout;
	printk ("Pid %d compresssion summary:\n", current->pid);
	status_summarize (&prp->rp_clog.syscall_status, &bitsin, &bitsout);
	printk ("Pid %d compression saves %d bytes.\n", current->pid, (bitsin-bitsout)/8);
#endif
#ifdef LOG_COMPRESS
	free_syscall_cache (&prp->rp_clog.syscall_cache);
	pipe_fds_free(&prp->rp_clog.pfds);
	free_x_comp (&prp->rp_clog.x);
#endif
	KFREE (prp);
	MPRINT ("      Pid %d __destroy_record_thread: exit!\n", current->pid);
}
static void __destroy_record_thread ( struct record_thread * prp ) { struct record_thread * prev ; struct repsignal * psig ; DPRINT ( " \n " , current -> pid , prp ) ; if ( ! atomic_dec_and_test ( & prp -> rp_refcnt ) ) { MPRINT ( " \n " , current -> pid , prp -> rp_record_pid , prp , atomic_read ( & prp -> rp_refcnt ) ) ; return ; } MPRINT ( " \n " , current -> pid , prp -> rp_record_pid , prp , atomic_read ( & prp -> rp_refcnt ) ) ; DPRINT ( " \n " , prp -> rp_log ) ; argsfreeall ( prp ) ; VFREE ( prp -> rp_log ) ; DPRINT ( " \n " , prp -> rp_log ) ; while ( prp -> rp_signals ) { psig = prp -> rp_signals ; prp -> rp_signals = psig -> next ; KFREE ( psig ) ; } for ( prev = prp ; prev -> rp_next_thread != prp ; prev = prev -> rp_next_thread ) ; prev -> rp_next_thread = prp -> rp_next_thread ; put_record_cache_files ( prp -> rp_cache_files ) ; put_record_group ( prp -> rp_group ) ; #ifdef LOG_COMPRESS_1 clogfreeall ( prp ) ; int bitsin , bitsout ; printk ( " \n " , current -> pid ) ; status_summarize ( & prp -> rp_clog . syscall_status , & bitsin , & bitsout ) ; printk ( " \n " , current -> pid , ( bitsin - bitsout ) / 8 ) ; #endif #ifdef LOG_COMPRESS free_syscall_cache ( & prp -> rp_clog . syscall_cache ) ; pipe_fds_free ( & prp -> rp_clog . pfds ) ; free_x_comp ( & prp -> rp_clog . x ) ; #endif KFREE ( prp ) ; MPRINT ( " \n " , current -> pid ) ; }
Deallocates record per-thread data and per-process data if refcnt = 0
Deallocates record per - thread data and per - process data if refcnt = 0