Yes, it's possible to share vka, allocman etc (if they are in the same address space
you can make them global and use them - although beware, these libraries are not thread
safe). Between processes you can set up new allocators, I recommend you take a look at the
sel4bench project  which passes the timer to each new benchmark process.
However, it depends on what you want. If you just want to be able to read the time and get
timeouts, you don't want to share the timer itself (its a device) but expose a timer
service either through a library, or RPC if it is between processes. I'll note this
down as an example we should build into future tutorials, but you can start by using the
timer manager .
From: Amit Goyal <amitgoyal(a)cse.iitb.ac.in>
Sent: Wednesday, 11 July 2018 12:31 AM
To: Lyons, Anna (Data61, Kensington NSW)
Cc: devel(a)sel4.systems; chrisdenneberg7(a)gmail.com
Subject: Re: [seL4] seL4 - getting the execution time of different threads
Thanks for your reply. I was going through this email chain. I
understand the 3 techniques that you told. I was wondering about this
particular question of Chris: "In the initial thread I can use the timer
as it is shown in the tutorial about timers since I do have the
bootinfo, vka, allocman and so on. Is it possible to share the timer or
create new ones in the other threads?"
Can you please suggest is it possible to share or create a new timer in
the other thread? Creating a timer in the other thread will require vka,
allocman etc. This boils down to, if it is possible to share vka,
allocman etc. with the other thread or create new ones in the other
thread. If yes, how can we do that?
Thanks and Regards,
On 2018-07-10 06:55, Anna.Lyons(a)data61.csiro.au wrote:
It depends on your use case. If you are looking to monitor the
execution times of threads for debugging and/or benchmarking
you can use our kernel benchmarking support, detailed here .
Otherwise, you could consider using the mcs branch of the kernel,
which allows you to obtain the execution time of a thread via the
seL4_SchedContext_Consumed invocation .
If you need to use the master branch of the kernel, then you would
need to intercept the scheduler on thread switch, by running a high
priority thread which enables other threads.
From: Devel <devel-bounces(a)sel4.systems> on behalf of Mr. Peace
Sent: Monday, 9 July 2018 3:34 AM
Subject: [seL4] seL4 - getting the execution time of different
I was wondering how you do get the execution time in seL4 if you are
using multiple threads.
In the initial thread I can use the timer as it is shown in the
tutorial about timers since I do have the bootinfo, vka, allocman and
But how do I use the timer to measure the execution time of the other
threads without stopping their execution to "pull" the time from the
initial thread? Is it possible to share the timer or create new ones
in the other threads? Or is there another way to measure the
Some background information:
The threads have different VSpace's and CSpace's.
Used tutorials: seL4-tutorial 4, seL4-tutorial timer.
The other threads do not have a bootinfo in their environment.
Devel mailing list