本文整理汇总了C++中TRACEF函数的典型用法代码示例。如果您正苦于以下问题:C++ TRACEF函数的具体用法?C++ TRACEF怎么用?C++ TRACEF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TRACEF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_boot
static int do_boot(void *arg) {
thread_sleep(250);
/* sniff it to see if it's a bootimage or a raw image */
bootimage_t *bi;
if (bootimage_open(lkb_iobuffer, lkb_iobuffer_size, &bi) >= 0) {
void *ptr;
size_t len;
/* it's a bootimage */
TRACEF("detected bootimage\n");
/* find the lk image */
if (bootimage_get_file_section(bi, TYPE_LK, &ptr, &len) >= 0) {
TRACEF("found lk section at %p\n", ptr);
arch_chain_load(ptr, 5, 6, 7, 8);
}
} else {
/* raw image, just chain load it directly */
TRACEF("raw image, chainloading\n");
arch_chain_load(lkb_iobuffer, 1, 2, 3, 4);
}
return 0;
}
示例2: TRACEF
void SSD_Ddm::Reply_With_Status(Message *p_message, STATUS status)
{
TRACEF(TRACE_L5, ("\nReply_With_Status: req_code = %X, status = %X",
p_message->reqCode, status));
// Set the status of the reply.
p_message->DetailedStatusCode = status;
// Get pointer to block storage request payload.
BSA_RW_PAYLOAD *p_BSA = (BSA_RW_PAYLOAD *)p_message->GetPPayload();
// Clear the reply payload.
BSA_REPLY_PAYLOAD reply_payload;
memset(&reply_payload, 0, sizeof(BSA_REPLY_PAYLOAD));
// Set zero transfer byte count in reply.
reply_payload.TransferCount = 0;
// Save logical block address in context for reply.
reply_payload.LogicalBlockAddress = p_BSA->LogicalBlockAddress;
// Add the payload to the reply message.
p_message->AddReplyPayload(&reply_payload, sizeof(BSA_REPLY_PAYLOAD));
// Reply to caller
Reply(p_message);
Decrement_Requests_Outstanding();
TRACEF(TRACE_L5, ("\nReply_With_Status: Return from reply, requests outstanding = %d",
m_num_requests_outstanding));
} // SSD_Ddm::Reply_With_Status
示例3: chargen_server
static int chargen_server(void *arg)
{
status_t err;
tcp_socket_t *listen_socket;
err = tcp_open_listen(&listen_socket, 19);
if (err < 0) {
TRACEF("error opening chargen listen socket\n");
return -1;
}
for (;;) {
tcp_socket_t *accept_socket;
err = tcp_accept(listen_socket, &accept_socket);
TRACEF("tcp_accept returns returns %d, handle %p\n", err, accept_socket);
if (err < 0) {
TRACEF("error accepting socket, retrying\n");
continue;
}
TRACEF("starting chargen worker\n");
thread_detach_and_resume(thread_create("chargen_worker", &chargen_worker, accept_socket, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
}
}
示例4: CT_ASSERT
void FF_Controller::Mark_Unit_Not_Busy(Flash_Address flash_address)
{
// Check to see if the unit_index is busy.
// For the HBC, only one device can be accessed at one time.
U32 unit_index = flash_address.Unit_Index();
CT_ASSERT(unit_index < Flash_Address::Num_Units(), FF_Controller::Mark_Unit_Not_Busy);
CT_ASSERT(FF_Controller::m_p_controller_context[unit_index],
FF_Controller::Mark_Unit_Not_Busy);
// Set callback context for this unit_index to null because it is
// no longer busy.
m_p_controller_context[unit_index] = 0;
if (m_can_units_overlap)
{
// See if another context is waiting for this unit_index.
if (!LIST_IS_EMPTY(&m_context_list_wait_unit[unit_index]))
{
m_p_flash->m_stats.Dec_Num_Waits_Unit(unit_index);
FF_Controller_Context *p_controller_context;
p_controller_context = (FF_Controller_Context *)LIST_REMOVE_HEAD(
&m_context_list_wait_unit[unit_index]);
TRACEF(TRACE_L5,
(EOL "Mark_Unit_Not_Busy Making context ready for unit_index = %d",
p_controller_context->m_flash_address.Unit_Index()));
// Queue context back on ready list for execution.
p_controller_context->Make_Ready();
}
} // m_can_units_overlap
else
{
// See if another context is waiting for any unit.
U32 num_units = Flash_Address::Num_Units();
for (U32 any_unit_index = 0; any_unit_index < num_units; any_unit_index++)
{
if (!LIST_IS_EMPTY(&m_context_list_wait_unit[any_unit_index]))
{
m_p_flash->m_stats.Dec_Num_Waits_Unit(any_unit_index);
FF_Controller_Context *p_controller_context;
p_controller_context = (FF_Controller_Context *)LIST_REMOVE_HEAD(
&m_context_list_wait_unit[any_unit_index]);
TRACEF(TRACE_L5,
(EOL "Mark_Unit_Not_Busy Making context ready for unit_index = %d",
p_controller_context->m_flash_address.Unit_Index()));
// Queue context back on ready list for execution.
p_controller_context->Make_Ready();
return;
}
}
} // NOT m_can_units_overlap
} // FF_Controller::Mark_Unit_Not_Busy
示例5: usbtest_entry
static void usbtest_entry(const struct app_descriptor *app, void *args)
{
LTRACE_ENTRY;
TRACEF("starting usb stack\n");
usb_start();
// XXX get callback from stack
thread_sleep(2000);
TRACEF("queuing transfers\n");
queue_rx_transfer();
queue_tx_transfer();
while (event_wait(&testevent) == NO_ERROR) {
if (!rxqueued) {
/* dump the state of the transfer */
LTRACEF("rx transfer completed\n");
usbc_dump_transfer(&rx);
hexdump8(rx.buf, MIN(128, rx.bufpos));
queue_rx_transfer();
}
if (!txqueued) {
/* dump the state of the transfer */
LTRACEF("tx transfer completed\n");
usbc_dump_transfer(&tx);
queue_tx_transfer();
}
}
LTRACE_EXIT;
}
示例6: START_TEST
}END_TEST
START_TEST( test_PopFromCharRingBuffer)
{
int nRc = -1;
size_t nItemsLeft = 999;
size_t nPopBufferSize = 14;
size_t nItemsRead = 0;
char szBuffer1[] = "LiveMem1";
char szBuffer2[] = "LiveMem2";
char szPopBuffer[14] = "";
struct RingBuffer *pStruct = InitCharRingBuffer();
TRACEF(7,(" test_PopFromCharRingBuffer()\n"));
if (pStruct != NULL) {
nItemsLeft = PushToCharRingBuffer(pStruct, szBuffer1, strlen(
szBuffer1));
DumpCharRingBufferInfo(pStruct);
nItemsLeft = PushToCharRingBuffer(pStruct, szBuffer2, strlen(
szBuffer2));
DumpCharRingBufferInfo(pStruct);
TRACEF(7,(" Items read: %Zi writen: '%s' read: '%s'\n", nItemsRead, szBuffer1, szPopBuffer ));
nItemsRead = PopFromCharRingBuffer(pStruct, szPopBuffer, 8);
DumpCharRingBufferInfo(pStruct);
szPopBuffer[nItemsRead];
}
TRACEF(7,(" Items read: %Zi writen: '%s' read: '%s'\n", nItemsRead, szBuffer1, szPopBuffer ));
fail_unless(strcmp(szBuffer1, szPopBuffer) == 0, "PopFromCharRingBuffer() not all data read.");
nRc = DestroyRingBuffer(pStruct);
}END_TEST
示例7: TRACE_ENTRY
void DriveMonitorIsm::DM_Create_Bsa_Device(void *p,
DM_DEVICE_STATE *pDMState,
pDMCallback_t Callback)
{
DM_CR_CONTEXT *pCC = new DM_CR_CONTEXT;
STATUS status;
TRACE_ENTRY(DM_Create_Bsa_Device);
pCC->p = p;
pCC->pDMState = pDMState;
pCC->Callback = Callback;
pCC->flags = 0;
if (DM_Find_Bsa_Device(pDMState))
{
TRACEF(TRACE_L3, ("\n\rDM: Bsa Vdn %d found", pDMState->pPD->vdnDdm));
// found a pre-configured device for this device, call end
DM_Create_Bsa_End(pCC, 0);
return;
}
TRACEF(TRACE_L3, ("\n\rDM: Bsa Create Started"));
// create a virtual device
status = DM_Create_InsertBSACfg(pCC, OK);
} // DM_Create_Bsa_Device
示例8: StoreStorageData
int StoreStorageData(FILE *LogFileHandle,
struct StorageInformationStructure *pInfoStruct) {
int nStatus = 0;
TRACEF(7,(" StoreStorageData(%p,%p)\n", LogFileHandle, pInfoStruct));
int nStorageIndex = 0;
for (nStorageIndex = 0; nStorageIndex
< pInfoStruct->nNumberOfDisksSupported; nStorageIndex++) {
struct StorageStatistics *pStruct = pInfoStruct->arStorageStatisticsPointerArray[nStorageIndex];
TRACEF(7,(" StorageStatistics[%d] %p\n", nStorageIndex, pStruct));
fprintf(LogFileHandle, " <cpu Name=\"dsk%d\">", nStorageIndex);
fprintf(LogFileHandle, " <nrd>%lu</nrd>", pStruct->nrd);
fprintf(LogFileHandle, " <nwr>%lu</nwr>", pStruct->nwr);
fprintf(LogFileHandle, " <rd>%lu</rd>", pStruct->rd);
fprintf(LogFileHandle, " <wr>%lu</wr>", pStruct->wr);
//fprintf(LogFileHandle, " <wcnt>%lu</wcnt>", pStruct->wcnt);
//fprintf(LogFileHandle, " <rcnt>%lu</rcnt>", pStruct->rcnt);
fprintf(LogFileHandle, " <wtime>%lu</wtime>", pStruct->wtime);
fprintf(LogFileHandle, " <rtime>%lu</rtime>", pStruct->rtime);
fprintf(LogFileHandle, " <ioinprogress>%lu</ioinprogress>", pStruct->ioinprogress);
fprintf(LogFileHandle, " <iotime>%lu</iotime>", pStruct->iotime);
fprintf(LogFileHandle, " <weightediotime>%lu</weightediotime>", pStruct->weightediotime);
fprintf(LogFileHandle, " </cpu>\n");
} // next nStorageIndex.
return (nStatus);
} // end StoreStorageData.
示例9: encode_int
static int encode_int(struct microjs_sdt * microjs, int32_t x)
{
#if MICROJS_OPTIMIZATION_ENABLED
microjs->spc = microjs->pc; /* save code pointer */
#endif
TRACEF("%04x\t", microjs->pc);
if (x >= 0) {
if (x < 32768) {
if (x < 128) {
if (x < 8) {
TRACEF("I4 %d\n", x);
microjs->code[microjs->pc++] = OPC_I4 + x;
} else {
TRACEF("I8 %d\n", x);
microjs->code[microjs->pc++] = OPC_I8;
microjs->code[microjs->pc++] = x;
}
} else {
TRACEF("I16 %d\n", x);
microjs->code[microjs->pc++] = OPC_I16;
microjs->code[microjs->pc++] = x;
microjs->code[microjs->pc++] = x >> 8;
}
} else {
TRACEF("I32 %d\n", x);
microjs->code[microjs->pc++] = OPC_I32;
microjs->code[microjs->pc++] = x;
microjs->code[microjs->pc++] = x >> 8;
microjs->code[microjs->pc++] = x >> 16;
microjs->code[microjs->pc++] = x >> 24;
}
} else {
示例10: rvmOpenDynamicLib
DynamicLib* rvmOpenDynamicLib(Env* env, const char* file, char** errorMsg) {
*errorMsg = NULL;
DynamicLib* dlib = NULL;
void* handle = dlopen(file, RTLD_LOCAL | RTLD_LAZY);
if (!handle) {
*errorMsg = dlerror();
TRACEF("Failed to load dynamic library '%s': %s", file, *errorMsg);
return NULL;
}
if (file) {
TRACEF("Opening dynamic library '%s'", file);
}
dlib = rvmAllocateMemoryAtomicUncollectable(env, sizeof(DynamicLib));
if (!dlib) {
dlclose(handle);
return NULL;
}
dlib->handle = handle;
if (file) {
strncpy(dlib->path, file, sizeof(dlib->path) - 1);
} else {
strncpy(dlib->path, env->vm->options->imagePath, sizeof(dlib->path) - 1);
}
return dlib;
}
示例11: smc91c96_init
void smc91c96_init(void)
{
int i;
TRACE;
// try to detect it
if ((*SMC_REG16(SMC_BSR) & 0xff00) != 0x3300) {
TRACEF("didn't see smc91c96 chip at 0x%x\n",
(unsigned int)smc91c96_base);
}
// read revision
smc_bank(3);
TRACEF("detected, revision 0x%x\n", *SMC_REG16(SMC_REV));
// read in the mac address
smc_bank(1);
for (i = 0; i < 6; i++) {
mac_addr[i] = *SMC_REG8(SMC_IAR0 + i);
}
TRACEF("mac address %02x:%02x:%02x:%02x:%02x:%02x\n",
mac_addr[0], mac_addr[1], mac_addr[2],
mac_addr[3], mac_addr[4], mac_addr[5]);
smc_bank(0);
}
示例12: TRACEF
int FF_Controller::Is_Unit_Busy(
FF_Controller_Context *p_controller_context)
{
// Check to see if the unit_index is busy.
// For the HBC, only one device can be accessed at one time.
U32 unit_index = p_controller_context->m_flash_address.Unit_Index();
if (m_can_units_overlap)
{
// Check this unit to see if it's busy.
if (m_p_controller_context[unit_index] != 0)
{
TRACEF(TRACE_L5,
(EOL "Unit is busy, unit_index = %d", p_controller_context->m_flash_address.Unit_Index()));
// It is busy, so the context must wait.
m_p_flash->m_stats.Inc_Num_Waits_Unit(unit_index);
// Put this context on the wait list for the unit_index.
LIST_INSERT_TAIL(&m_context_list_wait_unit[unit_index],
&p_controller_context->m_list);
return 1;
} // unit_index is busy
}
else
{
// Check to see if any unit is busy.
U32 num_units = Flash_Address::Num_Units();
for (U32 any_unit_index = 0; any_unit_index < num_units; any_unit_index++)
{
if (m_p_controller_context[any_unit_index] != 0)
{
TRACEF(TRACE_L5,
(EOL "Unit is busy, any_unit_index = %d", p_controller_context->m_flash_address.Unit_Index()));
// A unit is busy, so the context must wait.
m_p_flash->m_stats.Inc_Num_Waits_Unit(unit_index);
// Put this context on the wait list for the unit_index.
LIST_INSERT_TAIL(&m_context_list_wait_unit[unit_index],
&p_controller_context->m_list);
return 1;
} // unit_index is busy
}
// Continue if no unit is busy.
}
// Unit is not busy.
// Save the pointer to the callback context that will be run
// when the command finished.
// The caller will start the command.
m_p_controller_context[unit_index] = p_controller_context;
return 0;
} // Is_Unit_Busy
示例13: stm32_flash_bdev_erase
static ssize_t stm32_flash_bdev_erase(struct bdev *bdev, off_t offset, size_t len)
{
LTRACEF("dev %p, offset 0x%llx, len 0x%zx\n", bdev, offset, len);
ssize_t total_erased = 0;
HAL_FLASH_Unlock();
while (len > 0) {
uint32_t sector = 0;
off_t sector_offset = 0;
off_t next_offset = 0;
if (offset_to_sector(offset, §or, §or_offset, &next_offset) < 0)
return ERR_INVALID_ARGS;
FLASH_EraseInitTypeDef erase;
erase.TypeErase = FLASH_TYPEERASE_SECTORS;
erase.Sector = sector;
erase.NbSectors = 1;
erase.VoltageRange = FLASH_VOLTAGE_RANGE_3; // XXX
LTRACEF("erase params: sector %u, num_sectors %u, next_offset 0x%llx\n", erase.Sector, erase.NbSectors, next_offset);
if (1) {
uint32_t sector_error;
HAL_StatusTypeDef err = HAL_FLASHEx_Erase(&erase, §or_error);
if (err != HAL_OK) {
TRACEF("error starting erase operation, sector error %u\n", sector_error);
total_erased = ERR_IO;
break;
}
err = FLASH_WaitForLastOperation(HAL_MAX_DELAY);
if (err != HAL_OK) {
TRACEF("error waiting for erase operation to end, hal error %u\n", HAL_FLASH_GetError());
total_erased = ERR_IO;
break;
}
// invalidate the cache on this region
arch_invalidate_cache_range(FLASHAXI_BASE + sector_offset, next_offset - sector_offset);
}
// move to the next erase boundary
total_erased += next_offset - sector_offset;
off_t erased_bytes = next_offset - offset;
if (erased_bytes >= len)
break;
len -= erased_bytes;
offset = next_offset;
}
HAL_FLASH_Lock();
return total_erased;
}
示例14: print_stubs
void print_stubs(vita_elf_stub_t *stubs, int num_stubs)
{
int i;
for (i = 0; i < num_stubs; i++) {
TRACEF(VERBOSE, " 0x%06x (%s):\n", stubs[i].addr, stubs[i].symbol ? stubs[i].symbol->name : "unreferenced stub");
TRACEF(VERBOSE, " Library: %u (%s)\n", stubs[i].library_nid, stubs[i].library ? stubs[i].library->name : "not found");
TRACEF(VERBOSE, " Module : %u (%s)\n", stubs[i].module_nid, stubs[i].module ? stubs[i].module->name : "not found");
TRACEF(VERBOSE, " NID : %u (%s)\n", stubs[i].target_nid, stubs[i].target ? stubs[i].target->name : "not found");
}
}
示例15: TRACEF
//************************************************************************
// RaidDdmCommandCompletionReply
// This method is called whenever we receive a status for any cmd we
// submitted to the Raid DDM.
// We check if the cmd completed successfully or not. If cmd completed
// successfully, then we report the status of the cmd to the Cmd Sender
// for the RMSTR cmd. Also we need to check if any events need to be
// generated for the cmd completion e.g change priority etc
//
//************************************************************************
void DdmRAIDMstr
::RaidDdmCommandCompletionReply(
STATUS completionCode,
void *pStatusData,
void *pCmdData,
void *_pRmstrCmdContext)
{
CONTEXT *pRmstrCmdContext = (CONTEXT *)_pRmstrCmdContext;
RaidRequest *pRaidRequest = (RaidRequest *)pCmdData;
TRACEF(TRACE_L2,("\tRaidDdmCmdCompletionReply: Enter\n"));
switch(completionCode){
case RMSTR_SUCCESS:
break;
default:
// Resolve:
// Log that the cmd failed to start
TRACEF(TRACE_L1, ("\tRaidDdmCmdCompletionReply: ERROR CODE = 0x%x\n", completionCode));
m_pCmdServer->csrvReportCmdStatus(
pRmstrCmdContext->cmdHandle, // handle
completionCode, // completion code
NULL, // result Data
(void *)pRmstrCmdContext->pData);// Orig cmd info
delete pRmstrCmdContext;
return;
}
if (pRmstrCmdContext->cmdHandle) {
// Report the status to cmdSender, that cmd
// was submitted
// Event will be reported when the RAID DDM reports back
TRACEF(TRACE_L2,("\tRaidDdmCmdCompletionReply: Reporting status back to cmd sender\n"));
m_pCmdServer->csrvReportCmdStatus(
pRmstrCmdContext->cmdHandle, // handle
RMSTR_SUCCESS, // completion code
NULL, // result Data
(void *)pRmstrCmdContext->pData);// Orig cmd info
// check if we need to generate any special events
// e.g for change priority
CheckForEventsToBeGeneratedOnCmdCompletion(
pRmstrCmdContext);
StopCommandProcessing(
true,
pRmstrCmdContext->cmdHandle);
} else {
assert(pRmstrCmdContext->cmdHandle != NULL);
}
if (pRmstrCmdContext) {
delete pRmstrCmdContext;
pRmstrCmdContext = NULL;
}
}