Exemplo n.º 1
0
void x86_cpu_dump(FILE *f)
{
	int core;
	int thread;
	
	/* General information */
	fprintf(f, "\n");
	fprintf(f, "sim.last_dump  %lld  # Cycle of last dump\n", x86_cpu->last_dump);
	fprintf(f, "sim.ipc_last_dump  %.4g  # IPC since last dump\n", x86_cpu->cycle - x86_cpu->last_dump > 0 ?
		(double) (x86_cpu->num_committed_uinst - x86_cpu->last_committed) / (x86_cpu->cycle - x86_cpu->last_dump) : 0);
	fprintf(f, "\n");

	/* Cores */
	X86_CORE_FOR_EACH
	{
		fprintf(f, "Core %d:\n", core);
		
		fprintf(f, "eventq:\n");
		x86_uop_linked_list_dump(X86_CORE.event_queue, f);
		fprintf(f, "rob:\n");
		x86_rob_dump(core, f);

		X86_THREAD_FOR_EACH
		{
			fprintf(f, "Thread %d:\n", thread);
			
			fprintf(f, "fetch queue:\n");
			x86_uop_list_dump(X86_THREAD.fetch_queue, f);
			fprintf(f, "uop queue:\n");
			x86_uop_list_dump(X86_THREAD.uop_queue, f);
			fprintf(f, "iq:\n");
			x86_uop_linked_list_dump(X86_THREAD.iq, f);
			fprintf(f, "lq:\n");
			x86_uop_linked_list_dump(X86_THREAD.lq, f);
			fprintf(f, "sq:\n");
			x86_uop_linked_list_dump(X86_THREAD.sq, f);
			x86_reg_file_dump(core, thread, f);
			if (X86_THREAD.ctx)
			{
				fprintf(f, "mapped context: %d\n", X86_THREAD.ctx->pid);
				x86_ctx_dump(X86_THREAD.ctx, f);
			}
			
			fprintf(f, "\n");
		}
	}

	/* Register last dump */
	x86_cpu->last_dump = x86_cpu->cycle;
	x86_cpu->last_committed = x86_cpu->num_committed_uinst;
}
Exemplo n.º 2
0
Arquivo: emu.c Projeto: ajithcj/miaow
void x86_emu_dump(FILE *f)
{
	struct x86_ctx_t *ctx;
	int index = 0;

	fprintf(f, "List of kernel contexts (arbitrary order):\n");
	ctx = x86_emu->context_list_head;
	while (ctx)
	{
		fprintf(f, "kernel context #%d:\n", index);
		x86_ctx_dump(ctx, f);
		ctx = ctx->context_list_next;
		index++;
	}
}