krn.JobThreadGetCallStack

This job returns the call stack of the job currently or last executed on the specified thread. It is the detailed drill-down into a single thread; the lightweight snapshot across all threads is provided by krn.JobThreadGetInfo. The thread identifier is obtained from krn.ThreadEnum or krn.QueueGetStatistic.

1. Input Parameters

Name Type Required Description

Flags

INT

Yes

Currently not supported — pass 0.

ThreadID

INT

Yes

Identifier of the thread

2. Output Parameters

Name Type Dependency Description

CallStack

BASE64

Base64-encoded fixed-length dump (1 MiB) of the thread’s current C++ call stack, innermost frame first. See the structure below.

Count

INT

Control value for paged reading (not the number of frames)

CountExtra

INT

Control value for paged reading

Offset

BIGINT

Byte offset for paged or streamed reading

The values Count, CountExtra and Offset control paged or streamed reading; since the complete stack is already contained in the buffer, they are usually 0.

3. Structure of the CallStack buffer

CallStack is a fixed-length dump (1 MiB) of the thread’s C++ call stack, innermost frame first (index 0 = the function currently executing). Between the frames there are internal 8-byte pointers or sizes that can be ignored. Each frame consists of four strings separated by NUL characters, encoded as UTF-16LE:

Component Description

Function

Name of the function, e.g. CNameSpace::MakeCall, CWFJobWorkerJob::Execute

Source file

Name of the source file, e.g. namespace.cpp, WFJob.cpp

Module

Module including version information in the format Module (version build # bits), e.g. axsvckrn (12.0 799 # 64)

Parameters

Captured arguments in the format name = value; …. On dispatch frames this contains the called job including its input parameters, e.g. szName = std.ProcessPageCountCPMessages; Parameters = $$$QueueName$$$=bat;ConcurrentJobCount=1;Flags=0;

Reading the stack from bottom to top yields the job executed by the thread. The parameter component reveals the exact job being dispatched, its input parameters and any fired server-event codes (e.g. nCode = 5001 for KernelAfterJob).

Example of a stack (thread of the workflow queue executing wfm.WorkerJob):

[0]  CArchivDBFuncPool::FreeDB         adbfunc_impl.cpp    axsvckrn (12.0 799 #64)  pDBFunc = 0x…;
[1]  CArchivDBFuncPool::unsafe_FreeDB  adbfunc_impl.cpp    axsvckrn (12.0 799 #64)  pDBFunc = 0x…;
[2]  CNameSpace::DispatchJob           namespace.cpp       axsvckrn (12.0 799 #64)  szName = wfm.WorkerJob; Parameters = ;
[3]  CNameSpace::wrapped_MakeCall      namespace.cpp       axsvckrn (12.0 799 #64)
[4]  CNameSpace::MakeCall              namespace.cpp       axsvckrn (12.0 799 #64)  szName = WorkerJob;
[5]  CNameSpace::safe_DispatchJob      namespace.cpp       axsvckrn (12.0 799 #64)
[6]  RestoreContextIfNeeded            namespace.cpp       axsvckrn (12.0 799 #64)
[7]  CWFJob::CleanUp                   WFJob.cpp           oxjobwfm (12.0 562 #64)
[8]  CWFJob::Run                       WFJob.cpp           oxjobwfm (12.0 562 #64)
[9]  CWFJob::Run_                      WFJob.cpp           oxjobwfm (12.0 562 #64)
[10] CWFJobWorkerJob::Execute          WFJobWorkerJob.cpp  oxjobwfm (12.0 562 #64)

4. Return Value

(INT): 0 = Job successful, otherwise error code.