static int g_jump_count = 0;
static nacl_reg_t g_last_prog_ctr = 0;
+static const char* g_description = NULL;
+
static void SignalSafePrintf(const char *format, ...) {
va_list args;
g_instruction_byte_count,
g_jump_count);
if (is_untrusted && g_call_count == kNumberOfCallsToTest - 1) {
- SignalSafePrintf("RESULT InstructionsPerSyscall: value= "
- "%i count\n", g_instruction_count);
- SignalSafePrintf("RESULT InstructionBytesPerSyscall: value= "
- "%i count\n", g_instruction_byte_count);
- SignalSafePrintf("RESULT JumpsPerSyscall: value= "
- "%i count\n", g_jump_count);
+ SignalSafePrintf("RESULT InstructionsPerSyscall: %s= "
+ "%i count\n", g_description, g_instruction_count);
+ SignalSafePrintf("RESULT InstructionBytesPerSyscall: %s= "
+ "%i count\n",
+ g_description, g_instruction_byte_count);
+ SignalSafePrintf("RESULT JumpsPerSyscall: %s= "
+ "%i count\n", g_description, g_jump_count);
}
g_instruction_count = 0;
g_instruction_byte_count = 0;
NaClAllModulesInit();
- if (argc != 2) {
- NaClLog(LOG_FATAL, "Expected 1 argument: executable filename\n");
+ if (argc != 3) {
+ NaClLog(LOG_FATAL, "Expected 2 arguments: <executable filename> "
+ "<description-string>\n");
}
+ g_description = argv[2];
CHECK(NaClAppWithSyscallTableCtor(&app, syscall_table));