[okl4-developer] queries related to trace buffer
Matthew Warton
mwarton at ok-labs.com
Thu Jan 17 12:21:50 EST 2008
Hi Shweta,
On 16/01/2008, at 5:41 PM, shweta kumari wrote:
> Hi,
>
> I checked out the code related to trace buffer and iguana platform.
> Actually I had some doubts which are as follows:-
>
> 1.In pistachio/src/tracebuffer.c the trace buffer area is allocated
> through kmem.alloc.In iguana/trace/src/trace_server.c we have the
> kernel trace buffer allocated by mapping to some kernel area.How
> are these 2 tracebuffers linked.Moreover is there something common
> between these files.
>
The trace buffer is allocated by the kernel from it's heap at boot
time. The physical address of this buffer is then added to the
kernel interface page before the first user task is started. Iguana
tasks can map the physical memory to a virtual address they can
access and hence look at the data in the buffer.
> 2. In pistachio/src/tracebuffer.c when the virtual_interrupt
> function should be called.What is the trigger point for this
> function? Moreover how it can be handled.
The tracebuffer is usually divided into two or more buffers. when
one of these buffers fills up, the kernel generates an interrupt and
switches to using the next free buffer. The user task monitoring the
tracebuffer is supposed to receive this interrupt and clean out the
filled buffer (eg outputing it over network, or extracting data it is
interested in) and then mark the buffer as empty again so that the
kernel can re-use it.
In the current release the kernel will not re-use a full buffer. In
the next release there are plans to make the buffer circular by
default, so that in the event of an error the last few hundred kernel
operations are readily observable. In addition in the next release
the tracebuffer interrupt has been removed as it was the cause of a
few rare bugs in the kernel, so the user task will need to
periodically poll the tracebuffer data structure looking for filled
buffers.
I hope that answers the questions, let us know if you have any more.
Thanks,
Matthew Warton
>
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
More information about the Developer
mailing list