本文整理汇总了C++中TRACE3函数的典型用法代码示例。如果您正苦于以下问题:C++ TRACE3函数的具体用法?C++ TRACE3怎么用?C++ TRACE3使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TRACE3函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cache_open
component_t *
cache_open (
bundle_t *bundlePtr,
const char *name
) {
XML_Parser parser;
component_t *componentPtr = NULL;
char *path = NULL;
char buffer [256];
xc_result_t result = XC_ERR_INVAL;
int fd;
TRACE3 (("called with bundlePtr=%p", bundlePtr));
assert (bundlePtr != NULL);
path = malloc (PATH_MAX);
if (path != NULL) {
sprintf (path, "%s/" CACHE_FOLDER "/" XC_HOST "/%s.xml", bundlePtr->path, name);
fd = open (path, O_RDONLY);
if (fd >= 0) {
parser = XML_ParserCreate (NULL);
if (parser != NULL) {
componentPtr = component_new (bundlePtr);
if (componentPtr != NULL) {
sprintf (path, "%s/" CODE_FOLDER "/" XC_HOST "/%s", bundlePtr->path, name);
componentPtr->path = path;
path = NULL;
XML_SetUserData (parser, componentPtr);
XML_SetElementHandler (parser, handle_cache_start_tag, NULL);
for (;;) {
int n = read (fd, buffer, sizeof (buffer));
if (n < 0) break;
if (!XML_Parse (parser, buffer, n, n==0)) break;
if (n==0) {
TRACE4 (("%s: loaded meta-data from cache!", componentPtr->name));
result = XC_OK;
break;
}
}
}
XML_ParserFree (parser);
}
close (fd);
}
else {
TRACE2 (("%s: failed to open", path));
}
}
if (result != XC_OK) {
if (componentPtr != NULL) {
component_free (componentPtr);
componentPtr = NULL;
}
free (path);
}
TRACE3 (("exiting with result=%p", componentPtr));
return componentPtr;
}
示例2: query_unlink_import
xc_result_t
query_unlink_import (
xc_handle_t queryHandle,
import_t *importPtr
) {
query_t *queryPtr;
xc_result_t result;
TRACE3 (("called with queryHandle=%u, importPtr=%p"));
assert (queryHandle != XC_INVALID_HANDLE);
assert (importPtr != NULL);
pthread_mutex_lock (&lock);
queryPtr = (query_t *) handle_dir_get (queryHandles, queryHandle);
if (queryPtr != NULL) {
if (queryPtr->firstImportPtr == importPtr) {
queryPtr->firstImportPtr = import_get_next (importPtr);
}
if (queryPtr->lastImportPtr == importPtr) {
queryPtr->lastImportPtr = NULL;
}
}
else {
TRACE1 (("invalid query handle %u", queryHandle));
result = XC_ERR_NOENT;
}
pthread_mutex_unlock (&lock);
TRACE3 (("exiting with result=%d", result));
return result;
}
示例3: cache_write_port
void
cache_write_port (
FILE *cacheFile,
port_t *portPtr
) {
TRACE3 (("called with cacheFile=%p, portPtr=%p", cacheFile, portPtr));
assert (cacheFile != NULL);
assert (portPtr != NULL);
fprintf (cacheFile,
"<port name='%s' interface='%s' vmajor='%u' vminor='%u' size='%u' "
"port='%s' flags='%u' component='%s'></port>",
(portPtr->name != NULL) ? portPtr->name : "",
(portPtr->interfaceSpec.name != NULL) ? portPtr->interfaceSpec.name : "",
portPtr->interfaceSpec.vmajor,
portPtr->interfaceSpec.vminor,
portPtr->interfaceSize,
(portPtr->port != NULL) ? portPtr->port : "",
portPtr->flags,
(portPtr->componentName != NULL) ? portPtr->componentName : ""
);
TRACE3 (("exiting"));
}
示例4: query_next
xc_result_t
query_next (
query_t *queryPtr,
xc_handle_t *importHandlePtr
) {
import_t *importPtr;
xc_result_t result;
TRACE3 (("called with queryPtr=%p, importHandlePtr=%p", queryPtr, importHandlePtr));
assert (queryPtr != NULL);
pthread_mutex_lock (&lock);
importPtr = queryPtr->importPtr;
if (importPtr != NULL) {
TRACE4 (("%u is the next import for query %u", importPtr->importHandle, queryPtr->queryHandle));
if (importHandlePtr != NULL) {
*importHandlePtr = importPtr->importHandle;
}
queryPtr->importPtr = import_get_next (importPtr);
result = XC_OK;
}
else {
TRACE2 (("no more imports for query %u", queryPtr->queryHandle));
result = XC_ERR_NOENT;
}
pthread_mutex_unlock (&lock);
TRACE3 (("exiting with result=%d", result));
return result;
}
示例5: query_add_import
xc_result_t
query_add_import (
query_t *queryPtr,
import_t *importPtr
) {
xc_result_t result;
TRACE3 (("called with queryPtr=%p, importPtr=%p", queryPtr, importPtr));
assert (queryPtr != NULL);
assert (importPtr != NULL);
/* Either link this import to the query if this is the first
* one, otherwise to the previously created import. */
if (queryPtr->lastImportPtr == NULL) {
assert (queryPtr->firstImportPtr == NULL);
TRACE4 (("adding first import to query %u", queryPtr->queryHandle));
queryPtr->firstImportPtr = importPtr;
queryPtr->lastImportPtr = importPtr;
}
else {
/* TODO check if server component is already imported by this client
* in which case, the import would be added to the front. */
TRACE4 (("adding one more import to query %u", queryPtr->queryHandle));
import_set_next (queryPtr->lastImportPtr, importPtr);
queryPtr->lastImportPtr = importPtr;
}
/* Add import to client component */
component_add_import (queryPtr->componentPtr, importPtr);
result = XC_OK;
TRACE3 (("exiting with result=%d", result));
return result;
}
示例6: query_free
void
query_free (
query_t *queryPtr
) {
TRACE3 (("called with queryPtr=%p", queryPtr));
assert (queryPtr != NULL);
/* Free imports that were not xCOM_Import'ed. */
if (queryPtr->firstImportPtr != NULL) {
TRACE4 (("freeing unused imports"));
import_free_unused (queryPtr->firstImportPtr);
}
/* Free query handle. */
if (queryPtr->queryHandle != XC_INVALID_HANDLE) {
handle_dir_remove (queryHandles, queryPtr->queryHandle);
}
free (queryPtr->queriedPort);
free (queryPtr->queriedComponent);
free ((void *) queryPtr->queriedInterface.name);
free (queryPtr->clientPortName);
if (queryPtr->componentPtr != NULL) {
component_unref (queryPtr->componentPtr);
}
free (queryPtr);
TRACE3 (("exiting"));
}
示例7: query_init
xc_result_t
query_init (
void
) {
xc_result_t result;
TRACE3 (("called"));
assert (queryHandles == NULL);
queryHandles = handle_dir_new ();
if (queryHandles != NULL) {
pthread_mutexattr_t attr;
pthread_mutexattr_init (&attr);
pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init (&lock, &attr);
result = XC_OK;
}
else {
TRACE1 (("Out of memory!"));
result = XC_ERR_NOMEM;
}
TRACE3 (("exiting with result=%d", result));
return result;
}
示例8: query_get_candidates
xc_result_t
query_get_candidates (
query_t *queryPtr,
unsigned int *matchCountPtr
) {
struct ProvidedPortsList *listPtr;
port_t *providerPtr;
import_t *importPtr;
unsigned int count = 0;
xc_result_t result = XC_OK;
TRACE3 (("called"));
assert (queryPtr != NULL);
/* Get all the providers of the queried interface. */
listPtr = provided_ports_ref (queryPtr->queriedInterface.name);
if (listPtr != NULL) {
/* Check matching providers and add them as candidates. */
providerPtr = (port_t *) XC_CLIST_HEAD (&listPtr->ports);
while (!XC_CLIST_END (&listPtr->ports, providerPtr)) {
if (query_match_provider (queryPtr, providerPtr)) {
importPtr = import_new (
queryPtr->queryHandle,
queryPtr->componentHandle,
queryPtr->clientPortName,
providerPtr
);
if (importPtr != NULL) {
result = query_add_import (queryPtr, importPtr);
if (result == XC_OK) {
count ++;
}
else {
TRACE1 (("failed to add import to query %u (%d)", queryPtr->queryHandle, result));
import_free (importPtr);
break;
}
}
else {
result = XC_ERR_NOMEM;
break;
}
}
providerPtr = XC_CLIST_NEXT (providerPtr);
}
provided_ports_unref (listPtr);
}
if (result == XC_OK) {
TRACE4 (("%u providers of '%s' found!", count, queryPtr->queriedInterface.name));
queryPtr->importPtr = queryPtr->firstImportPtr;
assert ((count == 0) || (queryPtr->importPtr != NULL));
if (matchCountPtr != NULL) {
*matchCountPtr = count;
}
}
TRACE3 (("exiting with result=%d", result));
return result;
}
示例9: riceFBGetFrameBufferInfo
void riceFBGetFrameBufferInfo(void *p)
{
FrameBufferInfo * pinfo = (FrameBufferInfo *)p;
memset(pinfo,0,sizeof(FrameBufferInfo)*6);
//if( g_ZI.dwAddr == 0 )
//{
// memset(pinfo,0,sizeof(FrameBufferInfo)*6);
//}
//else
{
for (int i=0; i<5; i++ )
{
if( status.gDlistCount-g_RecentCIInfo[i].lastUsedFrame > 30 || g_RecentCIInfo[i].lastUsedFrame == 0 )
{
//memset(&pinfo[i],0,sizeof(FrameBufferInfo));
}
else
{
pinfo[i].addr = g_RecentCIInfo[i].dwAddr;
pinfo[i].size = 2;
pinfo[i].width = g_RecentCIInfo[i].dwWidth;
pinfo[i].height = g_RecentCIInfo[i].dwHeight;
TXTRBUF_DETAIL_DUMP(TRACE3("Protect 0x%08X (%d,%d)", g_RecentCIInfo[i].dwAddr, g_RecentCIInfo[i].dwWidth, g_RecentCIInfo[i].dwHeight));
pinfo[5].width = g_RecentCIInfo[i].dwWidth;
pinfo[5].height = g_RecentCIInfo[i].dwHeight;
}
}
pinfo[5].addr = g_ZI.dwAddr;
//pinfo->size = g_RecentCIInfo[5].dwSize;
pinfo[5].size = 2;
TXTRBUF_DETAIL_DUMP(TRACE3("Protect 0x%08X (%d,%d)", pinfo[5].addr, pinfo[5].width, pinfo[5].height));
}
}
示例10: cache_create
xc_result_t
cache_create (
component_t *componentPtr,
const char *name
) {
FILE *cacheFile;
char path[PATH_MAX];
xc_result_t result = XC_ERR_INVAL;
int r;
TRACE3 (("called with componentPtr=%p, name='%s'", componentPtr, name));
assert (componentPtr != NULL);
assert (name != NULL);
sprintf (path, "%s/" CACHE_FOLDER "/", componentPtr->bundlePtr->path);
r = mkdir_p (path, 0755);
if (r == 0) {
strcat (path, XC_HOST "/");
r = mkdir_p (path, 0755);
if (r == 0) {
strcat (path, name);
strcat (path, ".xml");
cacheFile = fopen (path, "w");
if (cacheFile != NULL) {
/* Write component meta-data */
fprintf (cacheFile,
"<xml>"
"<component name='%s' descr='%s' vmajor='%u' vminor='%u' ports='%u'>",
(componentPtr->name != NULL) ? componentPtr->name : "",
(componentPtr->descr != NULL) ? componentPtr->descr : "",
componentPtr->vmajor,
componentPtr->vminor,
componentPtr->portsCount
);
/* Write ports meta-data */
cache_write_ports (cacheFile, componentPtr);
/* Write footer. */
fprintf (cacheFile,
"</component>"
"</xml>"
);
fclose (cacheFile);
result = XC_OK;
}
else {
TRACE1 (("%s: failed to open for writing!", path));
}
}
}
TRACE3 (("exiting with result=%d", result));
return result;
}
示例11: PLListShrink
PPLLIST PLListShrink(PPLLIST pList)
{
#ifdef ALTERNATE_MEM_MANAGMENT
PPLLIST rc; // 20091202 AB reallocating does not work !!!!!!!
TRACE3("pList addr=0x%X, cbTot=%d, count=%d", pList, pList->cbTot, pList->count);
rc = pList ? realloc(pList, pList->cbTot) : NULL;
TRACE3("pList addr=0x%X, cbTot=%d, count=%d", pList, pList->cbTot, pList->count);
return rc;
#endif // ALTERNATE_MEM_MANAGMENT
return pList;
}
示例12: query_destroy
void
query_destroy (
void
) {
TRACE3 (("called"));
if (queryHandles != NULL) {
handle_dir_destroy (queryHandles);
queryHandles = NULL;
pthread_mutex_destroy (&lock);
}
TRACE3 (("exiting"));
}
示例13: gpgme_error_to_errno
static int
gpgme_error_to_errno (gpgme_error_t err)
{
int res = gpg_err_code_to_errno (err);
if (!err)
{
switch (gpg_err_code (err))
{
case GPG_ERR_EOF:
res = 0;
break;
case GPG_ERR_INV_VALUE:
res = EINVAL;
break;
case GPG_ERR_NOT_SUPPORTED:
res = ENOSYS;
break;
default:
/* FIXME: Yeah, well. */
res = EINVAL;
break;
}
}
TRACE3 (DEBUG_DATA, "gpgme:gpgme_error_to_errno", 0,
"mapping %s <%s> to: %s", gpgme_strerror (err),
gpgme_strsource (err), strerror (res));
errno = res;
return res ? -1 : 0;
}
示例14: context_EnableClient
/**
* \fn context_EnableClient / context_DisableClient
* \brief Enable a specific client activation
*
* Called by the driver main when needed to enble/disable a specific event handling.
* The Enable function also schedules the driver-task if the specified client is pending.
*
* \note
* \param hContext - The module handle
* \param uClientId - The client's index
* \return void
* \sa context_DriverTask
*/
void context_EnableClient (TI_HANDLE hContext, TI_UINT32 uClientId)
{
TContext *pContext = (TContext *)hContext;
#ifdef TI_DBG
if (pContext->aClientEnabled[uClientId])
{
TRACE0(pContext->hReport, REPORT_SEVERITY_ERROR , "context_EnableClient() Client already enabled!!\n");
return;
}
TRACE3(pContext->hReport, REPORT_SEVERITY_INFORMATION , "context_EnableClient(): Client=, ID=%d, enabled=%d, pending=%d\n", uClientId, pContext->aClientEnabled[uClientId], pContext->aClientPending[uClientId]);
#endif /* TI_DBG */
/* Enable client */
pContext->aClientEnabled[uClientId] = TI_TRUE;
/* If client is pending, schedule driver task */
if (pContext->aClientPending[uClientId])
{
/*
* If configured to switch context, request driver task scheduling.
* Else (context switch not required) call the driver task directly.
*/
if (pContext->bContextSwitchRequired)
{
os_RequestSchedule (pContext->hOs);
}
else
{
context_DriverTask (hContext);
}
}
}
示例15: context_RequestSchedule
/**
* \fn context_RequestSchedule
* \brief Handle client's switch to driver's context.
*
* This function is called by a client from external context event.
* It sets the client's Pending flag and requests the driver's task scheduling.
* Thus, the client's callback will be called afterwards from the driver context.
*
* \note
* \param hContext - The module handle
* \param uClientId - The client's index
* \return void
* \sa context_DriverTask
*/
void context_RequestSchedule (TI_HANDLE hContext, TI_UINT32 uClientId)
{
TContext *pContext = (TContext *)hContext;
#ifdef TI_DBG
pContext->aRequestCount[uClientId]++;
TRACE3(pContext->hReport, REPORT_SEVERITY_INFORMATION , "context_RequestSchedule(): Client=, ID=%d, enabled=%d, pending=%d\n", uClientId, pContext->aClientEnabled[uClientId], pContext->aClientPending[uClientId]);
#endif /* TI_DBG */
/* Set client's Pending flag */
pContext->aClientPending[uClientId] = TI_TRUE;
/*
* If configured to switch context, request driver task scheduling.
* Else (context switch not required) call the driver task directly.
*/
if (pContext->bContextSwitchRequired)
{
os_RequestSchedule (pContext->hOs);
}
else
{
context_DriverTask (hContext);
}
}