コード例 #1
0
ファイル: assert.c プロジェクト: long568/MadOS
__assert_func (const char *file, int line, const char *func,
               const char *failedexpr)
{
  trace_printf ("assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
                failedexpr, file, line, func ? ", function: " : "",
                func ? func : "");
  abort ();
  /* NOTREACHED */
}
コード例 #2
0
void DataTerminal::fail()
{
    mByteCount = 0;
    mState = STATE_WAITING;
    GPIO_ResetBits(GPIOB, GPIO_Pin_14|GPIO_Pin_15);
    FLASH_Lock();
    trace_printf("Resetting\n");
    writeCmd(NACK);
}
コード例 #3
0
ファイル: main.c プロジェクト: glocklueng/STM32F4-Dev
int main(void)
{

  /* USER CODE BEGIN 1 */
  trace_printf("Hello\n");
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  BSP_PB_Init(BUTTON_KEY,BUTTON_MODE_EXTI);    // initialize on board switch
  BSP_LED_Init(LED5);                          // initialize on baord LED 4 and LED 5
  BSP_LED_Init(LED4);

  /* Check if the system has resumed from WWDG reset */
  if(__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET)
  {
    /* WWDGRST flag set: Turn LED1 on */
    BSP_LED_On(LED5);

    /* Clear reset flags */
    __HAL_RCC_CLEAR_RESET_FLAGS();
  }
  else
  {
    /* WWDGRST flag is not set: Turn LED1 off */
    BSP_LED_Off(LED5);
  }
  /* Initialize and start IWDG */
  BSP_IWDG_Init(2000);
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
    BSP_LED_Toggle(LED4);

    HAL_Delay(1850);
    /* Refresh the IWDG reload count value */
    HAL_IWDG_Refresh(&hiwdg_bsp);
  }
  /* USER CODE END 3 */

}
コード例 #4
0
//
// print timer list
//
void sb_timer_timer_list_print() {
    char            la_info[50];
    char            la_to[40];
    Timer_TLE_Type *lp_tle;
    Timer_TLE_Type *lp_tle_prev;

    lp_tle = gp_timer_head;
    lp_tle_prev = NULL;
    if (lp_tle != NULL)
        trace_printf("TIMER timer list\n");
    while (lp_tle != NULL) {
        sb_timer_to_fmt(la_to, lp_tle->iv_to);
        switch (lp_tle->iv_kind) {
        case TIMER_TLE_KIND_CB:
            sprintf(la_info, "cb=%p", SB_CB_TO_PTR(lp_tle->iv_cb));
            break;
        case TIMER_TLE_KIND_COMPQ:
            sprintf(la_info, "q=%p", pfp(lp_tle->ip_comp_q));
            break;
        default:
            strcpy(la_info, "?");
            SB_util_abort("invalid iv_kind"); // sw fault
            break;
        }
        trace_printf("tle id=%d, addr=%p, p=%p, n=%p, %s, stid=%d, ttid=%d, mgr=%p, to=%s, toval=%d, p1=%d(0x%x), p2=%ld(0x%lx)\n",
                     lp_tle->iv_tleid,
                     pfp(lp_tle),
                     pfp(lp_tle->ip_prev),
                     pfp(lp_tle->ip_next),
                     la_info,
                     lp_tle->iv_stid,
                     lp_tle->iv_ttid,
                     pfp(lp_tle->ip_mgr),
                     la_to,
                     lp_tle->iv_toval,
                     lp_tle->iv_parm1,
                     lp_tle->iv_parm1,
                     lp_tle->iv_parm2,
                     lp_tle->iv_parm2);
        SB_util_assert_peq(lp_tle->ip_prev, lp_tle_prev);
        lp_tle_prev = lp_tle;
        lp_tle = lp_tle->ip_next;
    }
}
コード例 #5
0
struct MFNWorkunitRobustElement MFNWorkunitRobust::GetNextWorkunit(uint32_t ClientId) {
    trace_printf("MFNWorkunitRobust::GetNextWorkunit(%u)\n", ClientId);

    struct MFNWorkunitRobustElement Workunit;

    this->workunitMutexBoost.lock();
    
    // Check to see if we need to make more workunits.
    if ((this->ActualWorkunitsCreated != this->NumberOfWorkunitsTotal) &&
            (this->pendingWorkunits.size() < MFN_WORKUNIT_MIN_PENDING_WUS)) {
        this->CreateMorePendingWorkunits(MFN_WORKUNIT_WU_REFILL_SIZE);
    }

    // Check to see if there are valid workunits left.
    if (this->pendingWorkunits.size() == 0) {
        // If not, return a unit with isValid = 0.
        if (this->DebugOutput) {
            printf("pendingWorkunits.size() == 0; returning.\n");
        }
        memset(&Workunit, 0, sizeof(MFNWorkunitRobustElement));
        Workunit.Flags = WORKUNIT_TERMINATE;
        this->workunitMutexBoost.unlock();
        if (this->DebugOutput) {
            PrintRobustWorkunit(Workunit);
        }
        return Workunit;
    }

    // We still have workunits left.

    // Get the next waiting workunit from the main queue.
    Workunit = this->pendingWorkunits.front();
    this->pendingWorkunits.pop_front();

    if (this->DebugOutput) {
        printf("Popped WU ID %lu\n", Workunit.WorkUnitID);
    }

    // Set some variables we can make use of.
    Workunit.IsAssigned = 1;
    Workunit.WorkunitRequestedTimestamp = this->WorkunitTimer.getElapsedTime();
    Workunit.ClientId = ClientId;

    // Add the workunit to the in-flight queue.
    this->assignedWorkunits.push_back(Workunit);
    if (this->DebugOutput) {
        printf("In flight WUs: %lu\n", this->assignedWorkunits.size());
    }  

    this->workunitMutexBoost.unlock();
    this->WriteSaveState(0);
    if (this->DebugOutput) {
        PrintRobustWorkunit(Workunit);
    }
    return Workunit;
}
コード例 #6
0
//
// Purpose: return an ms error
//
short ms_err_rtn(short pv_fserr) {
    if (pv_fserr != XZFIL_ERR_OK) {
        SB_UTRACE_API_ADD2(SB_UTRACE_API_OP_MS_EXIT, pv_fserr);
        if (gv_ms_trace_errors)
            trace_printf("setting ms ret=%d\n", pv_fserr);
        if (gv_ms_assert_error)
            SB_util_assert_ieq(pv_fserr, XZFIL_ERR_OK); // sw fault
    }
    return pv_fserr;
}
コード例 #7
0
ファイル: subiClock.c プロジェクト: schapa/st32Box
void simpleTest(void) {
	uint8_t summ = 0;
	uint8_t i;
	for (i = 0; i < 14; i++) {
		s_testingSequence[i] = i;
		summ += s_testingSequence[i];
	}
	s_testingSequence[14] = summ;
	trace_printf("summ [%x]\n\r", summ);

	USART_HandleTypeDef usart;
	USART2_Init(&usart, 9600);
	HELP_dumpUsartProps(&usart);
	while (1) {
		HAL_StatusTypeDef status = HAL_USART_Transmit(&usart, s_testingSequence, 15, 0xFF);
		trace_printf("tr [%d]\n\r", status);
		System_delayMsDummy(100);
	}
}
コード例 #8
0
ファイル: ShareMem.c プロジェクト: saprasath/CCPP_PROGRAMS
void deleteFile(char *filename) {
	int status = remove(filename);

	if (status == 0)
		trace_printf("%s file deleted successfully.", filename);
	else {
		err_printf("Unable to delete the file");
		perror("Error");
	}
}
コード例 #9
0
ファイル: main.c プロジェクト: vstehle/ducati_FreeRTOS
static void IpcTask (void * pvParameters)
{
	unsigned int msg, *local_vq_buf;
	int ret;
	struct virtqueue_buf virtq_buf;

	virtqueue_init();
	nvic_enable_irq(MAILBOX_IRQ);
	enable_mailbox_irq();

	for (;;) {
		xQueueReceive(MboxQueue, &msg, portMAX_DELAY);
		trace_printf("msg from mailbox : ");
		trace_value(msg);

		switch(msg) {

		case RP_MBOX_ECHO_REQUEST :
			mailbox_send(M3_TO_HOST_MBX, RP_MBOX_ECHO_REPLY);
			break;

		case HOST_TO_M3_VRING :
			ret = virtqueue_get_avail_buf(&virtqueue_list[msg], &virtq_buf);

			/* make a local copy of the buffer */
			local_vq_buf = pvPortMalloc(RP_MSG_BUF_SIZE);
			memcpy(local_vq_buf, virtq_buf.buf_ptr, RP_MSG_BUF_SIZE);

			virtqueue_add_used_buf(&virtqueue_list[msg], virtq_buf.head);

			/* dispatch to the service queue */
			rpmsg_dispatch_msg(local_vq_buf);

			break;

		case M3_TO_HOST_VRING :
			trace_printf("kick on vq0, dropping it \n");
			xSemaphoreGive(InitDoneSemaphore);
			break;
		}
	}
	vTaskDelete(NULL);
}
コード例 #10
0
void MFNHashTypePlainCUDA_DupMD5::launchKernel() {
    trace_printf("MFNHashTypePlainCUDA_DupMD5::launchKernel()\n");

    // Copy the per-step data to the device.
    MFNHashTypePlainCUDA_DupMD5_CopyValueToConstant("deviceNumberStepsToRunPlainDupMD5",
        &this->perStep, sizeof(uint32_t));

    MFNHashTypePlainCUDA_DupMD5_LaunchKernel(this->passwordLength, this->GPUBlocks, this->GPUThreads);
    
}
コード例 #11
0
void CHHashFileVSalted::ImportHashListFromRemoteSystem(std::string & remoteData)  {
    trace_printf("CHHashFileVSalted::ImportHashListFromRemoteSystem()\n");
    std::string hashBuffer;
    CHHashImplementation *HashFunction = NULL;

    this->HashFileMutex.lock();
    this->HashesProtobuf.Clear();
    this->HashesProtobuf.ParseFromString(remoteData);

    // If the salt is to be hashed, set up the class to do it.
    if (this->saltPrehashAlgorithm == CH_HASHFILE_MD5_ASCII) {
        HashFunction = new CHHashImplementationMD5();
    }
    
    //Unpack the CHHashFileVSalted general member variables other than Hashes.
    this->HashLengthBytes = this->HashesProtobuf.hash_length_bytes();
    this->MaxSaltLengthBytes = this->HashesProtobuf.salt_length_bytes();
    
    //Then unpack individual HashSalted structs.
    this->TotalHashes = this->HashesProtobuf.salted_hash_value_size();
    for(int i=0;i<this->TotalHashes;i++)
    {
        CHHashFileVSalted::HashSalted hashSalted;
        this->SaltedHashProtobuf.Clear();
        this->SaltedHashProtobuf = this->HashesProtobuf.salted_hash_value(i);
        hashBuffer = std::string(this->SaltedHashProtobuf.hash());
        hashSalted.hash = std::vector<uint8_t>(hashBuffer.begin(), hashBuffer.end());
        hashBuffer = std::string(this->SaltedHashProtobuf.salt());
        hashSalted.saltLength = hashBuffer.length();
        hashSalted.salt = std::vector<uint8_t>(hashBuffer.begin(), hashBuffer.end());

        // Hash the salt if needed.
        if (this->saltPrehashAlgorithm == CH_HASHFILE_MD5_ASCII) {
            hashSalted.salt = HashFunction->
                hashDataAsciiVector(hashSalted.salt);
        }

        hashSalted.password = std::vector<uint8_t>();
        hashSalted.passwordFound = 0;
        hashSalted.passwordOutputToFile = 0;
        hashSalted.passwordPrinted = 0;
        this->Hashes.push_back(hashSalted);
    }
    this->HashesProtobuf.Clear();
    this->SaltedHashProtobuf.Clear();
    
    this->clearCaches();

    if (HashFunction) {
        delete HashFunction;
    }
    this->TotalHashesRemaining = this->TotalHashes;

    this->HashFileMutex.unlock();
}
コード例 #12
0
void MFNHashTypeSaltedCUDA_IPBWL::copyConstantDataToDevice() {
    trace_printf("MFNHashTypeSaltedCUDA_IPBWL::copyConstantDataToDevice()\n");
    cudaError_t err;

    uint8_t localPasswordLength = (uint8_t) this->passwordLength;
    uint64_t localNumberHashes = (uint64_t) this->activeHashesProcessed.size();
    uint64_t localNumberThreads = this->GPUBlocks * this->GPUThreads;
    // Begin copying constant data to the device.

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_CONSTANT_BITMAP_A,
            &this->sharedBitmap8kb_a[0], 8192);

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_DEVICE_PASSWORD_LENGTH,
            &localPasswordLength, sizeof(uint8_t));

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_NUMBER_OF_HASHES,
            &localNumberHashes, sizeof(uint64_t));

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_HASHLIST_ADDRESS,
            &this->DeviceHashlistAddress, sizeof(uint8_t *));

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_BITMAP_A,
            &this->DeviceBitmap128mb_a_Address, sizeof(uint8_t *));
    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_BITMAP_B,
            &this->DeviceBitmap128mb_b_Address, sizeof(uint8_t *));
    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_BITMAP_C,
            &this->DeviceBitmap128mb_c_Address, sizeof(uint8_t *));
    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_BITMAP_D,
            &this->DeviceBitmap128mb_d_Address, sizeof(uint8_t *));

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_BITMAP_256KB_A,
            &this->DeviceBitmap256kb_Address, sizeof(uint8_t *));

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_FOUND_PASSWORDS,
            &this->DeviceFoundPasswordsAddress, sizeof(uint8_t *));
    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_GLOBAL_FOUND_PASSWORD_FLAGS,
            &this->DeviceSuccessAddress, sizeof(uint8_t *));

    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_DEVICE_NUMBER_THREADS,
            &localNumberThreads, sizeof(uint64_t));
    
    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_DEVICE_WORDLIST_DATA,
            &this->DeviceWordlistBlocks, sizeof(uint32_t *));
    MFNHashTypeSaltedCUDA_IPBWL_CopyValueToConstantById(MFN_CUDA_DEVICE_WORDLIST_LENGTHS,
            &this->DeviceWordlistLengths, sizeof(uint8_t *));
    
    this->copySaltConstantsToDevice();
    
    err = cudaGetLastError();
    if (err != cudaSuccess) {
        printf("Thread %d, dev %d: CUDA error %d: %s. Exiting.\n",
                this->threadId, this->gpuDeviceId, err, cudaGetErrorString( err));
        exit(1);
    }
}
コード例 #13
0
ファイル: main.c プロジェクト: glocklueng/STM32F4-Dev
int main(void)
{

  /* USER CODE BEGIN 1 */
  uint32_t test;
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  BSP_UART_Init(115200);

  /* Initialize on board LED4 */
  BSP_LED_Init(LED4);

  trace_printf("Hello\n");

  /* Configure MPU region */
  MPU_Config();

  /* Try to access memory region 1 */
  uprintf("Trying to read memory from region 1\n\r");
  test = (*(unsigned int *)0x08000010);
  uprintf("some value at location 0x08000010: %08x \n\r",test );
  uprintf("Read successful!!!\n\r");

  /* Try to access memory region 2 */
  uprintf("Trying to read memory from region 2\n\r");
  uprintf("Memory management fault occur: LED4 will Glow");
  test = (*(unsigned int *)0x20002001);
  uprintf("some value at location 0x20002001: %08x \n\r",test );

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
コード例 #14
0
void DataTerminal::flushPage()
{
#ifdef DRY_RUN
    trace_printf("Mock write for flash page at %.8x\n", mWriteAddress);
    mWriteAddress += FLASH_PAGE_SIZE;
#else
    trace_printf("Writing Flash page at %.8x\n", mWriteAddress);
    FLASH_ErasePage(mWriteAddress);
    FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
    char *p = mCurrPage;
    for ( size_t i = 0; i < FLASH_PAGE_SIZE; i += 4, p += 4) {
        FLASH_ProgramWord(mWriteAddress + i, *(uint32_t*)p);
        FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
    }

    trace_printf("Wrote Flash page at %.8x\n", mWriteAddress);
    mWriteAddress += FLASH_PAGE_SIZE;
    memset(mCurrPage, 0, sizeof mCurrPage);
#endif
}
コード例 #15
0
ファイル: trace.c プロジェクト: geomatsi/Pandaboard-FreeRTOS
void trace_value(unsigned int register_value)
{
	int i,reg;
	char hexa_char;
	char string[10] = "0x00000000";

	reg = register_value;

	for ( i=9 ; i>1 ; i--) {
		hexa_char = (char)(reg & ASCII_MASK);
		if (hexa_char < 10)
			string[i] = hexa_char + 48 ;
		else
			string[i] = hexa_char + 55;
		reg = reg >> 4 ;
	}

	trace_printf(string);
	trace_printf("\n");
}
コード例 #16
0
MFNWorkunitWordlist::MFNWorkunitWordlist() {
    trace_printf("MFNWorkunitWordlist::MFNWorkunitWordlist()\n");
    this->networkPort = MFN_WORKUNIT_DEFAULT_NETWORK_PORT;
    this->NetworkServer = NULL;
    this->wordlistBlocks.passwordsArePadded = 0;
    memset(this->wordlistBlocks.passwordsCurrentlyLoaded, 0, sizeof(this->wordlistBlocks.passwordsCurrentlyLoaded));
    memset(this->wordlistBlocks.lastExportedTime, 0, sizeof(this->wordlistBlocks.lastExportedTime));
    this->totalQueuedWords = 0;
    this->lastWorkunitIDAssigned = 0;
    this->StartNetwork();
}
コード例 #17
0
ファイル: main.c プロジェクト: bhavindarji/STM32F4-Dev
int main(void)
{

  /* USER CODE BEGIN 1 */
  trace_printf("Hello\n");
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  BSP_UART_Init(9600);
  BSP_VCP_Init();

  vgetche(BLOCKING); // Dummy read to get the VCP Connected
  /* display string */
  vuprintf("AT\n\r");
  HAL_Delay(500);
  if(BSP_GSM_ConnectTest()==1)
  {
    /* display string */
    vuprintf("Connecting... \n\r");
    HAL_Delay(500);

    vuprintf("Successful! \n\r");
    HAL_Delay(500);
  }
  else
  {
    vuprintf("Fail \n\r");
    while(1);
  }
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
コード例 #18
0
ファイル: backtrace.c プロジェクト: abak/jato
static void show_code(void *eip)
{
	unsigned long code_prologue = code_bytes * 43 / 64;
	unsigned char *code;
	unsigned int i;

	if (!eip)
		return;

	code	= eip - code_prologue;

	trace_printf("Code: ");
	for (i = 0; i < code_bytes; i++) {
		if (code+i == eip)
			trace_printf("<%02x> ", code[i]);
		else
			trace_printf("%02x ", code[i]);
	}
	trace_printf("\n");
}
コード例 #19
0
void MFNHashTypePlainOpenCL::setupDevice() {
    trace_printf("CHHashTypeVPlainCUDA::setupDevice()\n");
    char buildOptions[1024];
    cl_int errorCode;

    // Set the OpenCL platform & device
    trace_printf("Thread %d setting OpenCL platform/device to %d, %d\n",
            this->threadId, this->openCLPlatformId, this->gpuDeviceId);
    this->OpenCL->selectPlatformById(this->openCLPlatformId);
    this->OpenCL->selectDeviceById(this->gpuDeviceId);
    
    /**
     * Handle generating the kernels.  This involves building with the specified
     * password length, vector width, and BFI_INT status.
     */

    if (MultiforcerGlobalClassFactory.getCommandlinedataClass()->GetUseBfiInt()) {
        // BFI_INT patching - pass BITALIGN to kernel
        sprintf(buildOptions, "-D PASSWORD_LENGTH=%d -D VECTOR_WIDTH=%d -D BITALIGN=1",
            this->passwordLength, this->VectorWidth);
    } else {
        // No BFI_INT patching.
        sprintf(buildOptions, "-D PASSWORD_LENGTH=%d -D VECTOR_WIDTH=%d",
                this->passwordLength, this->VectorWidth);
    }
    this->OpenCL->buildProgramFromManySourcesConcat(this->getHashFileNames(), buildOptions);

    // If the BFI_INT patching is being used, patch the generated binary.
    if (MultiforcerGlobalClassFactory.getCommandlinedataClass()->GetUseBfiInt()) {
        this->OpenCL->doAMDBFIPatch();
    }

    this->HashProgram = this->OpenCL->getProgram();
    this->HashKernel = clCreateKernel (this->HashProgram, this->getHashKernelName().c_str(), &errorCode);

    if (errorCode != CL_SUCCESS) {
        printf("Error: %s\n", print_cl_errstring(errorCode));
        exit(1);
    }

}
コード例 #20
0
ファイル: ShareMem.c プロジェクト: saprasath/CCPP_PROGRAMS
void *shmServerConstructor(void *arg) {
//Create the key file for shm and sem keyfiles
	deleteFile(SHMKEYPATH);
	deleteFile(SEMKEYPATH);

	createEmptyFile(SHMKEYPATH);
	createEmptyFile(SEMKEYPATH);

//initiator first
	shmServerInitiator();

//Create Clients' Check status
	shmServer.gsThreadID = pthread_create(&shmServer.gsThread, NULL,
			shmServerClientCheck, NULL);
	trace_printf("Thread shmServerClientCheck successfully");

	pthread_join(shmServer.gsThread, NULL);
	trace_printf("Join threads Done");
	shmServerDestructor();
	return (void *) NULL;
}
コード例 #21
0
ファイル: backtrace.c プロジェクト: abak/jato
static void show_registers(gregset_t gregs)
{
	unsigned long eax, ebx, ecx, edx;
	unsigned long esi, edi, ebp, esp;

	eax = gregs[REG_EAX];
	ebx = gregs[REG_EBX];
	ecx = gregs[REG_ECX];
	edx = gregs[REG_EDX];

	esi = gregs[REG_ESI];
	edi = gregs[REG_EDI];
	ebp = gregs[REG_EBP];
	esp = gregs[REG_ESP];

	trace_printf("Registers:\n");
	trace_printf(" eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
	       eax, ebx, ecx, edx);
	trace_printf(" esi: %08lx   edi: %08lx   ebp: %08lx   esp: %08lx\n",
	       esi, edi, ebp, esp);
}
コード例 #22
0
std::vector<std::string> MFNHashTypePlainOpenCL_MD5::getHashFileNames() {
    trace_printf("MFNHashTypePlainOpenCL_MD5::getHashFileNames()\n");
    
    std::vector<std::string> returnHashFilenames;
    std::string hashFilename;
    
#if !RELEASE_KERNEL    
    hashFilename = "./src/MFN_OpenCL_device/MFNHashTypePlainOpenCL_MD5.cl";
    returnHashFilenames.push_back(hashFilename);
#endif
    return returnHashFilenames;
}
コード例 #23
0
ファイル: exec_cmd.c プロジェクト: emk/git
int execv_git_cmd(const char **argv) {
	const char **nargv = prepare_git_cmd(argv);
	trace_argv_printf(nargv, "trace: exec:");

	/* execvp() can only ever return if it fails */
	execvp("git", (char **)nargv);

	trace_printf("trace: exec failed: %s\n", strerror(errno));

	free(nargv);
	return -1;
}
コード例 #24
0
int MFNWorkunitRobust::CreateWorkunits(uint64_t NumberOfPasswords, uint8_t BitsPerUnit, uint8_t PasswordLength) {
    trace_printf("MFNWorkunitRobust::CreateWorkunits(%lu, %u, %u)\n", NumberOfPasswords, BitsPerUnit, PasswordLength);

    uint64_t NumberOfWorkunits = 0;
    
    this->workunitMutexBoost.lock();
    
    this->ClearAllInternalState();

    this->WorkunitBits = BitsPerUnit;
    this->CurrentPasswordLength = PasswordLength;

    this->NumberPasswordsTotal = NumberOfPasswords;
    
    // Calculate how many elements are needed per workunit
    this->ElementsPerWorkunit = pow(2.0, (int)BitsPerUnit);
    
    if (this->DebugOutput) {
        printf("Elements per unit: %llu\n", this->ElementsPerWorkunit);
    }

    // If the number of workunits fits perfectly, no need for an extra "end" unit.
    if ((NumberOfPasswords % this->ElementsPerWorkunit) == 0) {
        NumberOfWorkunits = (NumberOfPasswords / this->ElementsPerWorkunit);
    } else {
        NumberOfWorkunits = (NumberOfPasswords / this->ElementsPerWorkunit) + 1;
    }
    this->NumberOfWorkunitsTotal = NumberOfWorkunits;

    if (this->DebugOutput) {
        printf("Total number of workunits: %llu\n", NumberOfWorkunits);
        
    }
    
    // Create the initial batch of workunits
    this->CreateMorePendingWorkunits(MFN_WORKUNIT_WU_REFILL_SIZE);
    
    // At this point, we should be done with creating the workunits.
    // Do some final cleanup and go.

    this->NumberOfWorkunitsCompleted = 0;
    this->WorkunitClassInitialized = 1;

    // Start the execution timer
    this->WorkunitTimer.start();
    this->LastStateSaveTime = 0;

    this->workunitMutexBoost.unlock();

    this->WriteSaveState(1);

    return 1;
}
コード例 #25
0
ファイル: classloader.c プロジェクト: headius/jato
static inline void trace_push(struct vm_object *loader, const char *class_name)
{
	assert(trace_classloader_level >= 0);

	if (opt_trace_classloader) {
		trace_printf("classloader: %p %*s%s\n", loader,
			     trace_classloader_level, "", class_name);
		trace_flush();
	}

	++trace_classloader_level;
}
コード例 #26
0
ファイル: main.cpp プロジェクト: wshy1121/FileOpr
int main()
{
    trace_start("127.0.0.1", 8889, "/home/share/Log/TraceWorkerDebug.cpp");
    CFTPManager ftpManager;
    trace_printf("NULL");
    ftpManager.login2Server("10.17.128.105:21");
    trace_printf("NULL");
    ftpManager.inputUserName("huangyuan1");
    trace_printf("NULL");
    ftpManager.inputPassWord("7ujMko0admin");
    trace_printf("NULL");
    //ftpManager.Put("/Log/Makefile", "Makefile");

    for (int i=0; i<5; ++i)
    {
        ftpManager.WriteData("/Log/WriteTest.txt", "12345\n", 7);
    }
    trace_printf("NULL");
    ftpManager.quitServer();
    return 0;
}
コード例 #27
0
void MFNHashTypePlainCUDA::copyStartPointsToDevice() {
    trace_printf("MFNHashTypePlainCUDA::copyStartPointsToDevice()\n");
    cudaMemcpy(this->DeviceStartPointAddress,
               this->HostStartPointAddress,
               this->TotalKernelWidth * this->passwordLength,
               cudaMemcpyHostToDevice);

    cudaMemcpy(this->DeviceStartPasswords32Address,
               &this->HostStartPasswords32[0],
               this->TotalKernelWidth * this->passwordLengthWords,
               cudaMemcpyHostToDevice);
}
コード例 #28
0
std::vector<std::string> MFNHashTypePlainOpenCL_MD5::getHashFileNames() {
    trace_printf("MFNHashTypePlainOpenCL_MD5::getHashFileNames()\n");
    
    std::vector<std::string> returnHashFilenames;
    std::string hashFilename;
    
    hashFilename = "./inc/MFN_OpenCL_device/MFN_OpenCL_incrementors.h";
    returnHashFilenames.push_back(hashFilename);
    hashFilename = "./src/MFN_OpenCL_device/MFNHashTypePlainOpenCL_MD5.cl";
    returnHashFilenames.push_back(hashFilename);
    return returnHashFilenames;
}
コード例 #29
0
MFNWorkunitRobust::~MFNWorkunitRobust() {
    trace_printf("MFNWorkunitRobust::~MFNWorkunitRobust()\n");
    // If the workunit is complete, delete the resume file.
    if (this->NumberOfWorkunitsCompleted == this->NumberOfWorkunitsTotal) {
        if (this->UseResumeFile) {
            if (this->DebugOutput) {
                printf("Deleting file %s\n", this->ResumeFilename.c_str());
            }
            unlink(this->ResumeFilename.c_str());
        }
    }
}
コード例 #30
0
ファイル: notes-merge.c プロジェクト: CinsonChen/git
static int merge_changes(struct notes_merge_options *o,
			 struct notes_merge_pair *changes, int *num_changes,
			 struct notes_tree *t)
{
	int i, conflicts = 0;

	trace_printf("\tmerge_changes(num_changes = %i)\n", *num_changes);
	for (i = 0; i < *num_changes; i++) {
		struct notes_merge_pair *p = changes + i;
		trace_printf("\t\t%.7s: %.7s -> %.7s/%.7s\n",
		       sha1_to_hex(p->obj), sha1_to_hex(p->base),
		       sha1_to_hex(p->local), sha1_to_hex(p->remote));

		if (!hashcmp(p->base, p->remote)) {
			/* no remote change; nothing to do */
			trace_printf("\t\t\tskipping (no remote change)\n");
		} else if (!hashcmp(p->local, p->remote)) {
			/* same change in local and remote; nothing to do */
			trace_printf("\t\t\tskipping (local == remote)\n");
		} else if (!hashcmp(p->local, uninitialized) ||
			   !hashcmp(p->local, p->base)) {
			/* no local change; adopt remote change */
			trace_printf("\t\t\tno local change, adopted remote\n");
			if (add_note(t, p->obj, p->remote,
				     combine_notes_overwrite))
				die("BUG: combine_notes_overwrite failed");
		} else {
			/* need file-level merge between local and remote */
			trace_printf("\t\t\tneed content-level merge\n");
			conflicts += merge_one_change(o, p, t);
		}
	}

	return conflicts;
}