[okl4-developer] What does the "STRING_major" mean?
Josh Matthews
jmatthews at ok-labs.com
Thu Apr 23 01:24:20 EST 2009
Hi Cheng,
On Tue, April 21, 2009 10:44 pm, Guanghui, Cheng wrote:
> On Wednesday 22 April 2009 02:07:36 am Josh Matthews wrote:
>> On Mon, April 20, 2009 10:44 pm, Guanghui, Cheng wrote:
>> > In the pistachio/include/traceids.h/traceids.h file, there is a enum :
>> > enum trace_major_ids {
>> > EVENT_major = 0,
>> > STRING_major = 1,
>> > INTERRUPT_major = 2,
>> >
>> > SYSCALL_IPC_major = 3,
>> > ... ...
>> > }
>> >
>> > I want to know what the STRING means? STRING_IPC or whatever.
>>
>> This functionality is all related to the tracebuffers feature. Each
>> kernel
>> event is assigned a unique trace identifier in enum trace_ids.
>> Additionally, each kernel event is assigned to a group in enum
>> trace_major_ids (as you copied above).
>>
>> Calls to tb_log_trace, passing the major (group) identifier and the
>> event
>> identifier (and potentially other data), are made by the kernel on the
>> occurrence of each event (in debug and tracebuffer builds of the kernel
>> only).
>>
>> The major identifier is useful as it allows you to mask out all events
>> of
>> particular groups that you are not interested in and focus only on those
>> groups that you are (see field log_mask in trace_buffer_t, in file
>> pistachio/include/tracebuffer.h, and see how macro TBUF_RECORD will only
>> log the event if the bit corresponding to the major number of the event
>> is
>> active in the log mask).
> Thanks for your reply.
> In the list there are several kinds of trace IDs like this: event,
> string, interrupt, system call. I don't know what the string means.
A string event is just a general event that has no other semantics beyond
some user-defined data that is passed when logging the event.
Check out dump_buffer() in pistachio/kdb/src/tracebuffer.cc - you can see
how a string event just has its data array printed as a string.
You can use it to log some information about an event in the kernel that
doesn't fit into any existing defined event or category.
Best regards,
Josh
More information about the Developer
mailing list