* [PATCH] export softirq_to_name symbol
@ 2009-05-01 19:30 Jason Baron
2009-05-01 19:50 ` Christoph Hellwig
2009-05-03 8:33 ` Ingo Molnar
0 siblings, 2 replies; 9+ messages in thread
From: Jason Baron @ 2009-05-01 19:30 UTC (permalink / raw)
To: mingo, rostedt; +Cc: linux-kernel, jistone
hi,
In response to a user request:
Export 'softirq_to_name' so that modules using the softirq tracepoints
can resolve the # to a name.
Signed-off-by: Jason Baron <jbaron@redhat.com>
---
kernel/softirq.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/softirq.c b/kernel/softirq.c
index b76064b..1841ab7 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -60,6 +60,7 @@ char *softirq_to_name[NR_SOFTIRQS] = {
"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK",
"TASKLET", "SCHED", "HRTIMER", "RCU"
};
+EXPORT_SYMBOL_GPL(softirq_to_name);
/*
* we cannot loop indefinitely here to avoid userspace starvation,
--
1.6.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 19:30 [PATCH] export softirq_to_name symbol Jason Baron
@ 2009-05-01 19:50 ` Christoph Hellwig
2009-05-01 20:07 ` Josh Stone
2009-05-03 8:33 ` Ingo Molnar
1 sibling, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2009-05-01 19:50 UTC (permalink / raw)
To: Jason Baron; +Cc: mingo, rostedt, linux-kernel, jistone
On Fri, May 01, 2009 at 03:30:22PM -0400, Jason Baron wrote:
>
> hi,
>
> In response to a user request:
>
>
> Export 'softirq_to_name' so that modules using the softirq tracepoints
> can resolve the # to a name.
Please submit it together with the module that uses it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 19:50 ` Christoph Hellwig
@ 2009-05-01 20:07 ` Josh Stone
2009-05-01 20:10 ` Christoph Hellwig
0 siblings, 1 reply; 9+ messages in thread
From: Josh Stone @ 2009-05-01 20:07 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jason Baron, mingo, rostedt, linux-kernel
On 05/01/2009 12:50 PM, Christoph Hellwig wrote:
> On Fri, May 01, 2009 at 03:30:22PM -0400, Jason Baron wrote:
>> hi,
>>
>> In response to a user request:
>>
>>
>> Export 'softirq_to_name' so that modules using the softirq tracepoints
>> can resolve the # to a name.
>
> Please submit it together with the module that uses it.
I'm adding SystemTap support for the format strings in the TRACE_EVENT
macros. The softirq's TP_fast_assign uses softirq_to_name, and so that
array is needed to prepare the softirq's trace string.
So, there's no explicit reference to the symbol in SystemTap -- it's
just indirectly referenced by the tracepoint declaration.
Thanks,
Josh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 20:07 ` Josh Stone
@ 2009-05-01 20:10 ` Christoph Hellwig
2009-05-01 20:17 ` Josh Stone
2009-05-03 18:36 ` Frederic Weisbecker
0 siblings, 2 replies; 9+ messages in thread
From: Christoph Hellwig @ 2009-05-01 20:10 UTC (permalink / raw)
To: Josh Stone; +Cc: Christoph Hellwig, Jason Baron, mingo, rostedt, linux-kernel
On Fri, May 01, 2009 at 01:07:34PM -0700, Josh Stone wrote:
> I'm adding SystemTap support for the format strings in the TRACE_EVENT
> macros. The softirq's TP_fast_assign uses softirq_to_name, and so that
> array is needed to prepare the softirq's trace string.
>
> So, there's no explicit reference to the symbol in SystemTap -- it's
> just indirectly referenced by the tracepoint declaration.
TP_fast_assign should only be called by core code, it's the piece that
copies the trace into the ring buffer. If systemtap copies events into
the ring buffer from modular code something is deeply wrong in it's
design.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 20:10 ` Christoph Hellwig
@ 2009-05-01 20:17 ` Josh Stone
2009-05-01 20:22 ` Christoph Hellwig
2009-05-03 18:36 ` Frederic Weisbecker
1 sibling, 1 reply; 9+ messages in thread
From: Josh Stone @ 2009-05-01 20:17 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jason Baron, mingo, rostedt, linux-kernel
On 05/01/2009 01:10 PM, Christoph Hellwig wrote:
> On Fri, May 01, 2009 at 01:07:34PM -0700, Josh Stone wrote:
>> I'm adding SystemTap support for the format strings in the TRACE_EVENT
>> macros. The softirq's TP_fast_assign uses softirq_to_name, and so that
>> array is needed to prepare the softirq's trace string.
>>
>> So, there's no explicit reference to the symbol in SystemTap -- it's
>> just indirectly referenced by the tracepoint declaration.
>
> TP_fast_assign should only be called by core code, it's the piece that
> copies the trace into the ring buffer. If systemtap copies events into
> the ring buffer from modular code something is deeply wrong in it's
> design.
More precisely, it's the piece of code that copies the trace into an
__entry pointer. In my case, __entry has nothing to do with the ring
buffer.
Josh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 20:17 ` Josh Stone
@ 2009-05-01 20:22 ` Christoph Hellwig
2009-05-01 21:25 ` Josh Stone
0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2009-05-01 20:22 UTC (permalink / raw)
To: Josh Stone; +Cc: Christoph Hellwig, Jason Baron, mingo, rostedt, linux-kernel
On Fri, May 01, 2009 at 01:17:59PM -0700, Josh Stone wrote:
> More precisely, it's the piece of code that copies the trace into an
> __entry pointer. In my case, __entry has nothing to do with the ring
> buffer.
Well, it should be the ring buffer. If you want to do something more
fancy rewrite it in proper C code and submit a patch for discussion to
lkml.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 20:22 ` Christoph Hellwig
@ 2009-05-01 21:25 ` Josh Stone
0 siblings, 0 replies; 9+ messages in thread
From: Josh Stone @ 2009-05-01 21:25 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jason Baron, mingo, rostedt, linux-kernel
On 05/01/2009 01:22 PM, Christoph Hellwig wrote:
> On Fri, May 01, 2009 at 01:17:59PM -0700, Josh Stone wrote:
>> More precisely, it's the piece of code that copies the trace into an
>> __entry pointer. In my case, __entry has nothing to do with the ring
>> buffer.
>
> Well, it should be the ring buffer. If you want to do something more
> fancy rewrite it in proper C code and submit a patch for discussion to
> lkml.
It's not that fancy -- this is basically it:
#define __field(type, item) type item;
#define __array(type, item, len) type item[len];
#define __string(item, src) const char * __str_##item;
#define __assign_str(item, src) __entry->__str_##item = src
#define __get_str(item) __entry->__str_##item
#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
static inline int \
trace_snprintf_##name(char * __buf, size_t __size, proto) { \
struct { tstruct } __value, *__entry = &__value; \
assign; \
return snprintf(__buf, __size, print); \
}
I don't know if anyone would need this besides stap, but I can post it
as a patch if there's interest.
Josh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 19:30 [PATCH] export softirq_to_name symbol Jason Baron
2009-05-01 19:50 ` Christoph Hellwig
@ 2009-05-03 8:33 ` Ingo Molnar
1 sibling, 0 replies; 9+ messages in thread
From: Ingo Molnar @ 2009-05-03 8:33 UTC (permalink / raw)
To: Jason Baron; +Cc: rostedt, linux-kernel, jistone
* Jason Baron <jbaron@redhat.com> wrote:
> hi,
>
> In response to a user request:
>
> Export 'softirq_to_name' so that modules using the softirq
> tracepoints can resolve the # to a name.
>
> Signed-off-by: Jason Baron <jbaron@redhat.com>
> ---
> kernel/softirq.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index b76064b..1841ab7 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -60,6 +60,7 @@ char *softirq_to_name[NR_SOFTIRQS] = {
> "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK",
> "TASKLET", "SCHED", "HRTIMER", "RCU"
> };
> +EXPORT_SYMBOL_GPL(softirq_to_name);
Hm, that very much looks like as if someone was writing kernel
tracing code without the intention to submitting it upstream. Not
having exported that symbol is thus a subtle "dont do that please"
warning sign ;-)
Ingo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] export softirq_to_name symbol
2009-05-01 20:10 ` Christoph Hellwig
2009-05-01 20:17 ` Josh Stone
@ 2009-05-03 18:36 ` Frederic Weisbecker
1 sibling, 0 replies; 9+ messages in thread
From: Frederic Weisbecker @ 2009-05-03 18:36 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Josh Stone, Jason Baron, mingo, rostedt, linux-kernel
On Fri, May 01, 2009 at 04:10:28PM -0400, Christoph Hellwig wrote:
> On Fri, May 01, 2009 at 01:07:34PM -0700, Josh Stone wrote:
> > I'm adding SystemTap support for the format strings in the TRACE_EVENT
> > macros. The softirq's TP_fast_assign uses softirq_to_name, and so that
> > array is needed to prepare the softirq's trace string.
> >
> > So, there's no explicit reference to the symbol in SystemTap -- it's
> > just indirectly referenced by the tracepoint declaration.
>
> TP_fast_assign should only be called by core code, it's the piece that
> copies the trace into the ring buffer. If systemtap copies events into
> the ring buffer from modular code something is deeply wrong in it's
> design.
In itself, the use of TRACE_EVENT from a module is fine, otherwise
Steve wouldn't have written the module support.
For example the mac80211 subsystem can be built as a module, and
if a tracing code is merged for this subsystem, we want it to be
usable whenever it is build as a module or not.
Frederic.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-05-03 18:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-01 19:30 [PATCH] export softirq_to_name symbol Jason Baron
2009-05-01 19:50 ` Christoph Hellwig
2009-05-01 20:07 ` Josh Stone
2009-05-01 20:10 ` Christoph Hellwig
2009-05-01 20:17 ` Josh Stone
2009-05-01 20:22 ` Christoph Hellwig
2009-05-01 21:25 ` Josh Stone
2009-05-03 18:36 ` Frederic Weisbecker
2009-05-03 8:33 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox