Skip to contentSkip to conversation

Documentation for struct threadobj_stat on Alchemy

Xenomai Giulio Moro 2 participants 2 messages Mar 21, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

In Alchemy RT_TASK_INFO has a member struct threadobj_stat which is undocumented (https://xenomai.org//documentation/xenomai-3/html/xeno3prm/structRT__TASK__INFO.html).
Looking at the source of copperplate/threadobj.h (https://xenomai.org//documentation/xenomai-3/html/xeno3prm/threadobj_8h_source.html) , it turns out it has these members:

struct threadobj_stat {
ticks_t xtime;
ticks_t timeout;
uint64_t msw;
uint64_t csw;
uint64_t xsc;
int cpu;
int schedlock;
unsigned int status;
uint32_t pf;
};

I could not find a documentation of what they are and even a straight forward comparison with rt_task_info from Xenomai 2.6 (http://www.xenomai.org/documentation/trunk/html/api/structrt__task__info.html) does not give an idea of what all of these are (e.g.: timeout, xsc, cpu, schedlock).

The migration guide (https://xenomai.org/migrating-from-xenomai-2-x-to-3-x/) only says "other fields which represent runtime statistics are now avail from a core-specific stat field sub-structure."

Thanks,
Giulio

#2 lore raw
Quoted 5 lines · Giulio Moro

In Alchemy RT_TASK_INFO has a member struct threadobj_stat which is undocumented (https://xenomai.org//documentation/xenomai-3/html/xeno3prm/structRT__TASK__INFO.html).
Looking at the source of copperplate/threadobj.h (https://xenomai.org//documentation/xenomai-3/html/xeno3prm/threadobj_8h_source.html) , it turns out it has these members:

struct threadobj_stat {
ticks_t xtime;

Total execution time in primary mode (ns)

Quoted 1 line

ticks_t timeout;

Pending timeout (ns)

Quoted 1 line

uint64_t msw;

Total count of mode switches (primary -> secondary)

Quoted 1 line

uint64_t csw;

Total count of context switches

Quoted 1 line

uint64_t xsc;

Total count of Cobalt system calls.

Quoted 1 line

int cpu;

Current CPU.

Quoted 1 line

int schedlock;

Scheduler lock depth count.

Quoted 1 line

unsigned int status;

Internal status bits (from uapi/kernel/thread.h, state flags)

Quoted 1 line

uint32_t pf;

Number of page faults in primary mode. Debug stuff, should be zero.

Signature · 1 line
Philippe.