Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
prdump.c File Reference
#include "primpl.h"

Go to the source code of this file.

Functions

PRUint32 _PR_DumpPrintf (PRFileDesc *fd, const char *fmt,...)
void _PR_DumpThread (PRFileDesc *fd, PRThread *thread)
static void DumpThreadQueue (PRFileDesc *fd, PRCList *list)
void _PR_DumpThreads (PRFileDesc *fd)
 PR_IMPLEMENT (void)
 PR_SetThreadDumpProc (PRThread *thread, PRThreadDumpProc dump, void *arg)

Variables

PRFileDesc_pr_dumpOut

Function Documentation

PRUint32 _PR_DumpPrintf ( PRFileDesc fd,
const char *  fmt,
  ... 
)

Definition at line 54 of file prdump.c.

{
    char buf[100];
    PRUint32 nb;
    va_list ap;

    va_start(ap, fmt);
    nb = PR_vsnprintf(buf, sizeof(buf), fmt, ap);
    va_end(ap);
    PR_Write(fd, buf, nb);

    return nb;
}

Here is the caller graph for this function:

void _PR_DumpThread ( PRFileDesc fd,
PRThread thread 
)

Definition at line 68 of file prdump.c.

{

#ifndef _PR_GLOBAL_THREADS_ONLY
    _PR_DumpPrintf(fd, "%05d[%08p] pri=%2d flags=0x%02x",
                   thread->id, thread, thread->priority, thread->flags);
    switch (thread->state) {
      case _PR_RUNNABLE:
      case _PR_RUNNING:
        break;
      case _PR_LOCK_WAIT:
        _PR_DumpPrintf(fd, " lock=%p", thread->wait.lock);
        break;
      case _PR_COND_WAIT:
        _PR_DumpPrintf(fd, " condvar=%p sleep=%lldms",
                       thread->wait.cvar, thread->sleep);
        break;
      case _PR_SUSPENDED:
        _PR_DumpPrintf(fd, " suspended");
        break;
    }
    PR_Write(fd, "\n", 1);
#endif

    /* Now call dump routine */
    if (thread->dump) {
       thread->dump(fd, thread, thread->dumpArg);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 112 of file prdump.c.

{
    PRThread *t;
    PRIntn i;

    _PR_DumpPrintf(fd, "Current Thread:\n");
    t = _PR_MD_CURRENT_THREAD();
    _PR_DumpThread(fd, t);

    _PR_DumpPrintf(fd, "Runnable Threads:\n");
    for (i = 0; i < 32; i++) {
        DumpThreadQueue(fd, &_PR_RUNQ(t->cpu)[i]);
    }

    _PR_DumpPrintf(fd, "CondVar timed wait Threads:\n");
    DumpThreadQueue(fd, &_PR_SLEEPQ(t->cpu));

    _PR_DumpPrintf(fd, "CondVar wait Threads:\n");
    DumpThreadQueue(fd, &_PR_PAUSEQ(t->cpu));

    _PR_DumpPrintf(fd, "Suspended Threads:\n");
    DumpThreadQueue(fd, &_PR_SUSPENDQ(t->cpu));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void DumpThreadQueue ( PRFileDesc fd,
PRCList *  list 
) [static]

Definition at line 98 of file prdump.c.

{
#ifndef _PR_GLOBAL_THREADS_ONLY
    PRCList *q;

    q = list->next;
    while (q != list) {
        PRThread *t = _PR_THREAD_PTR(q);
        _PR_DumpThread(fd, t);
        q = q->next;
    }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 136 of file prdump.c.

Here is the call graph for this function:

PR_SetThreadDumpProc ( PRThread thread,
PRThreadDumpProc  dump,
void arg 
)

Definition at line 149 of file prdump.c.

{
    thread->dump = dump;
    thread->dumpArg = arg;
}

Variable Documentation

Definition at line 52 of file prdump.c.