lkml.org 
[lkml]   [2008]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][Patch 2/2] markers: example of irq regular kernel markers
Hi Motohiro,

KOSAKI Motohiro wrote:
>>> By doing so, we could leave a gcc format string check by passing the
>>> format string to __mark_check_format(). We could extract the field names
>>> from the prototype, so there is no need to duplicate field information
>>> in the format string.
>> I thought that someone complained against those format strings in
>> kernel code. Thus I removed it from DEFINE_TRACE.
>>
>> even though, I think you can do that by adding below string table
>> to LTTng module.
>>
>> const char *lookup_table[MAX_MARKERS][2] = {
>> {"irq_entry", "%d %d"}, // or "(int irq_id, int kernel_mode)", "%d %d"
>> ...
>> };
>
> if move string to out of kernel core, compiler may kill some variable.
> thus, we will get incomplete tracing result.

I think you might worry about the lookup_table variable will be removed
by compiler if the variable is not referred from nowhere, right?

Here what I said is, if LTTng needs printf-style format, LTTng can "have"
a lookup table in its module. In that case, since LTTng must have (at
least one) functions which refers the lookup table, it is not optimized out.

Of course, LTTng maintainers have to put their eyes on changes of markers
and related variables/structures, and change the lookup table if they need.
(If they have a good c-style parameter parser, the maintenance cost
can be reduced...)

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



\
 
 \ /
  Last update: 2008-06-22 06:05    [from the cache]
©2003-2011 Jasper Spaans