* SystemTap on 2.6.23-rc8-mm2
@ 2007-10-04 16:21 Mike Mason
2007-10-04 18:34 ` David Smith
0 siblings, 1 reply; 8+ messages in thread
From: Mike Mason @ 2007-10-04 16:21 UTC (permalink / raw)
To: systemtap
Just a heads up... I had to patch buildrun.cxx to get scripts to build on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed to KBUILD_CPPFLAGS). I've attached the patch below. I don't know when or if this change will go into Linus' kernel. I'm also not sure of the best way to ensure the correct CFLAGS are used in build_run.cxx (maybe check s.kernel_release?).
Mike
--- buildrun.cxx.orig 2007-09-30 11:12:16.000000000 -0700
+++ buildrun.cxx.new 2007-10-02 08:44:00.000000000 -0700
@@ -42,7 +42,7 @@
// Clever hacks copied from vmware modules
o << "stap_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo \"$(1)\"; else echo \"$(2)\"; fi)" << endl;
- o << "stap_check_build = $(shell " << "set -x; " << " if $(CC) $(CPPFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
+ o << "stap_check_build = $(shell " << "set -x; " << " if $(CC) $(KBUILD_CPPFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(KBUILD_CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
o << "SYSTEMTAP_RUNTIME = \"" << s.runtime_path << "\"" << endl;
@@ -59,26 +59,26 @@
o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-ktime-get-real.c, -DSTAPCONF_KTIME_GET_REAL,)" << endl;
for (unsigned i=0; i<s.macros.size(); i++)
- o << "CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;
+ o << "KBUILD_CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;
if (s.verbose > 2)
- o << "CFLAGS += -ftime-report -Q" << endl;
+ o << "KBUILD_CFLAGS += -ftime-report -Q" << endl;
// XXX: unfortunately, -save-temps can't work since linux kbuild cwd
// is not writeable.
//
// if (s.keep_tmpdir)
- // o << "CFLAGS += -fverbose-asm -save-temps" << endl;
+ // o << "KBUILD_CFLAGS += -fverbose-asm -save-temps" << endl;
- o << "CFLAGS += -freorder-blocks" << endl; // improve on -Os
+ o << "KBUILD_CFLAGS += -freorder-blocks" << endl; // improve on -Os
- // o << "CFLAGS += -fno-unit-at-a-time" << endl;
+ // o << "KBUILD_CFLAGS += -fno-unit-at-a-time" << endl;
// Assumes linux 2.6 kbuild
- o << "CFLAGS += -Wno-unused -Werror" << endl;
- o << "CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
+ o << "KBUILD_CFLAGS += -Wno-unused -Werror" << endl;
+ o << "KBUILD_CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
// XXX: this may help ppc toc overflow
- // o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl;
+ // o << "KBUILD_CFLAGS := $(subst -Os,-O2,$(KBUILD_CFLAGS)) -fminimal-toc" << endl;
o << "obj-m := " << s.module_name << ".o" << endl;
o.close ();
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 16:21 SystemTap on 2.6.23-rc8-mm2 Mike Mason
@ 2007-10-04 18:34 ` David Smith
2007-10-04 20:07 ` David Smith
0 siblings, 1 reply; 8+ messages in thread
From: David Smith @ 2007-10-04 18:34 UTC (permalink / raw)
To: Mike Mason; +Cc: systemtap
[-- Attachment #1: Type: text/plain, Size: 929 bytes --]
Mike Mason wrote:
> Just a heads up... I had to patch buildrun.cxx to get scripts to build
> on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed to
> KBUILD_CPPFLAGS). I've attached the patch below. I don't know when or
> if this change will go into Linus' kernel. I'm also not sure of the
> best way to ensure the correct CFLAGS are used in build_run.cxx (maybe
> check s.kernel_release?).
I've seen this also (and in fact I meant to check something in but got
distracted by my other marker work). I believe my solution will be
backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
wanted to test f7 and RHEL5 to make sure I didn't break anything.
Basically I moved all our flag settings to EXTRA_CFLAGS (which is used
by both kernels). See the attached patch for details.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2560 bytes --]
Index: buildrun.cxx
===================================================================
RCS file: /cvs/systemtap/src/buildrun.cxx,v
retrieving revision 1.43
diff -u -p -r1.43 buildrun.cxx
--- buildrun.cxx 24 Sep 2007 19:35:48 -0000 1.43
+++ buildrun.cxx 4 Oct 2007 18:29:37 -0000
@@ -42,7 +42,7 @@ compile_pass (systemtap_session& s)
// Clever hacks copied from vmware modules
o << "stap_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo \"$(1)\"; else echo \"$(2)\"; fi)" << endl;
- o << "stap_check_build = $(shell " << "set -x; " << " if $(CC) $(CPPFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
+ o << "stap_check_build = $(shell " << "set -x; " << " if $(CC) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
o << "SYSTEMTAP_RUNTIME = \"" << s.runtime_path << "\"" << endl;
@@ -59,10 +59,10 @@ compile_pass (systemtap_session& s)
o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-ktime-get-real.c, -DSTAPCONF_KTIME_GET_REAL,)" << endl;
for (unsigned i=0; i<s.macros.size(); i++)
- o << "CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;
+ o << "EXTRA_CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;
if (s.verbose > 2)
- o << "CFLAGS += -ftime-report -Q" << endl;
+ o << "EXTRA_CFLAGS += -ftime-report -Q" << endl;
// XXX: unfortunately, -save-temps can't work since linux kbuild cwd
// is not writeable.
@@ -70,13 +70,13 @@ compile_pass (systemtap_session& s)
// if (s.keep_tmpdir)
// o << "CFLAGS += -fverbose-asm -save-temps" << endl;
- o << "CFLAGS += -freorder-blocks" << endl; // improve on -Os
+ o << "EXTRA_CFLAGS += -freorder-blocks" << endl; // improve on -Os
// o << "CFLAGS += -fno-unit-at-a-time" << endl;
// Assumes linux 2.6 kbuild
- o << "CFLAGS += -Wno-unused -Werror" << endl;
- o << "CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
+ o << "EXTRA_CFLAGS += -Wno-unused -Werror" << endl;
+ o << "EXTRA_CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
// XXX: this may help ppc toc overflow
// o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl;
o << "obj-m := " << s.module_name << ".o" << endl;
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 18:34 ` David Smith
@ 2007-10-04 20:07 ` David Smith
2007-10-04 20:29 ` Andy Gospodarek
0 siblings, 1 reply; 8+ messages in thread
From: David Smith @ 2007-10-04 20:07 UTC (permalink / raw)
To: Mike Mason; +Cc: systemtap
David Smith wrote:
> Mike Mason wrote:
>> Just a heads up... I had to patch buildrun.cxx to get scripts to build
>> on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed
>> to KBUILD_CPPFLAGS). I've attached the patch below. I don't know
>> when or if this change will go into Linus' kernel. I'm also not sure
>> of the best way to ensure the correct CFLAGS are used in build_run.cxx
>> (maybe check s.kernel_release?).
>
> I've seen this also (and in fact I meant to check something in but got
> distracted by my other marker work). I believe my solution will be
> backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
> wanted to test f7 and RHEL5 to make sure I didn't break anything.
I tested this on RHEL4, RHEL5, and f7. It seemed to work correctly
everywhere so I've checked my changes.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 20:07 ` David Smith
@ 2007-10-04 20:29 ` Andy Gospodarek
2007-10-04 21:11 ` Martin Hunt
2007-10-04 21:22 ` Mike Mason
0 siblings, 2 replies; 8+ messages in thread
From: Andy Gospodarek @ 2007-10-04 20:29 UTC (permalink / raw)
To: David Smith; +Cc: Mike Mason, systemtap
On Thu, Oct 04, 2007 at 03:07:00PM -0500, David Smith wrote:
> David Smith wrote:
> >Mike Mason wrote:
> >>Just a heads up... I had to patch buildrun.cxx to get scripts to build
> >>on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed
> >>to KBUILD_CPPFLAGS). I've attached the patch below. I don't know
> >>when or if this change will go into Linus' kernel. I'm also not sure
> >>of the best way to ensure the correct CFLAGS are used in build_run.cxx
> >>(maybe check s.kernel_release?).
> >
> >I've seen this also (and in fact I meant to check something in but got
> >distracted by my other marker work). I believe my solution will be
> >backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
> >wanted to test f7 and RHEL5 to make sure I didn't break anything.
>
> I tested this on RHEL4, RHEL5, and f7. It seemed to work correctly
> everywhere so I've checked my changes.
>
Interestingly I just pulled the latest sources and tried against Dave
Miller's net-2.6.24 tree and I'm getting the following errors:
WARNING: ignored message of type 5
For my printfs. Here's a log:
# /usr/local/bin/stap -vv dma_alloc_coherent.stp
SystemTap translator/driver (version 0.6/0.129 built 2007-10-04)
Copyright (C) 2005-2007 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapWK9BBS"
Searched '/usr/local/share/systemtap/tapset/x86_64/*.stp', found 1
Searched '/usr/local/share/systemtap/tapset/*.stp', found 36
Pass 1: parsed user script and 37 library script(s) in
190usr/0sys/206real ms.
probe dma_alloc_coherent@arch/x86_64/kernel/pci-dma.c:74 kernel
section=.text pc=0xffffffff8021230e
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0
global(s) in 200usr/70sys/265real ms.
Pass 3: using cached
/root/.systemtap/cache/37/stap_3785b7bedca3b118c37dcdc110ec39d6_550.c
Pass 4: using cached
/root/.systemtap/cache/37/stap_3785b7bedca3b118c37dcdc110ec39d6_550.ko
Pass 5: starting run.
Running /usr/local/bin/staprun -v -d 6449
/tmp/stapWK9BBS/stap_3785b7bedca3b118c37dcdc110ec39d6_550.ko
WARNING: ignored message of type 5
stapio:cleanup_and_exit:216 CLEANUP AND EXIT closed=0
stapio:cleanup_and_exit:229 closing control channel
Pass 5: run completed in 30usr/50sys/12659real ms.
Running rm -rf /tmp/stapWK9BBS
[root@core2 stap]# cat dma_alloc_coherent.stp
probe kernel.function("dma_alloc_coherent")
{
printf("dma_alloc_coherent: size = 0x%x\n",$size);
}
The message:
WARNING: ignored message of type 5
only comes out when I force a call to dma_alloc_coherent (one can do
this by modprobing most any network driver).
Any thoughts? I dug through the code and I see where the error is
coming from (mainloop.c), but I'm not familiar enough with the stap
interface to know what's happening.
Thanks,
-andy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 20:29 ` Andy Gospodarek
@ 2007-10-04 21:11 ` Martin Hunt
2007-10-04 21:15 ` Andy Gospodarek
2007-10-04 21:22 ` Mike Mason
1 sibling, 1 reply; 8+ messages in thread
From: Martin Hunt @ 2007-10-04 21:11 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: David Smith, Mike Mason, systemtap
On Thu, 2007-10-04 at 16:29 -0400, Andy Gospodarek wrote:
> On Thu, Oct 04, 2007 at 03:07:00PM -0500, David Smith wrote:
> > David Smith wrote:
> > >Mike Mason wrote:
> > >>Just a heads up... I had to patch buildrun.cxx to get scripts to build
> > >>on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed
> > >>to KBUILD_CPPFLAGS). I've attached the patch below. I don't know
> > >>when or if this change will go into Linus' kernel. I'm also not sure
> > >>of the best way to ensure the correct CFLAGS are used in build_run.cxx
> > >>(maybe check s.kernel_release?).
> > >
> > >I've seen this also (and in fact I meant to check something in but got
> > >distracted by my other marker work). I believe my solution will be
> > >backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
> > >wanted to test f7 and RHEL5 to make sure I didn't break anything.
> >
> > I tested this on RHEL4, RHEL5, and f7. It seemed to work correctly
> > everywhere so I've checked my changes.
> >
>
> Interestingly I just pulled the latest sources and tried against Dave
> Miller's net-2.6.24 tree and I'm getting the following errors:
>
> WARNING: ignored message of type 5
You're the second person today to remind me that warning is still in
there. I am working on a fix. It only happens when a module is loaded
when a systemtap script is running.
Martin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 21:11 ` Martin Hunt
@ 2007-10-04 21:15 ` Andy Gospodarek
2007-10-04 21:35 ` Andy Gospodarek
0 siblings, 1 reply; 8+ messages in thread
From: Andy Gospodarek @ 2007-10-04 21:15 UTC (permalink / raw)
To: Martin Hunt; +Cc: Andy Gospodarek, David Smith, Mike Mason, systemtap
On Thu, Oct 04, 2007 at 05:10:51PM -0400, Martin Hunt wrote:
> On Thu, 2007-10-04 at 16:29 -0400, Andy Gospodarek wrote:
> > On Thu, Oct 04, 2007 at 03:07:00PM -0500, David Smith wrote:
> > > David Smith wrote:
> > > >Mike Mason wrote:
> > > >>Just a heads up... I had to patch buildrun.cxx to get scripts to build
> > > >>on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed
> > > >>to KBUILD_CPPFLAGS). I've attached the patch below. I don't know
> > > >>when or if this change will go into Linus' kernel. I'm also not sure
> > > >>of the best way to ensure the correct CFLAGS are used in build_run.cxx
> > > >>(maybe check s.kernel_release?).
> > > >
> > > >I've seen this also (and in fact I meant to check something in but got
> > > >distracted by my other marker work). I believe my solution will be
> > > >backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
> > > >wanted to test f7 and RHEL5 to make sure I didn't break anything.
> > >
> > > I tested this on RHEL4, RHEL5, and f7. It seemed to work correctly
> > > everywhere so I've checked my changes.
> > >
> >
> > Interestingly I just pulled the latest sources and tried against Dave
> > Miller's net-2.6.24 tree and I'm getting the following errors:
> >
> > WARNING: ignored message of type 5
>
> You're the second person today to remind me that warning is still in
> there. I am working on a fix. It only happens when a module is loaded
> when a systemtap script is running.
>
> Martin
>
>
Aside from the warning it doesn't actually print my message, so the
probe isn't too helpful. ;-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 20:29 ` Andy Gospodarek
2007-10-04 21:11 ` Martin Hunt
@ 2007-10-04 21:22 ` Mike Mason
1 sibling, 0 replies; 8+ messages in thread
From: Mike Mason @ 2007-10-04 21:22 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: David Smith, systemtap
Andy Gospodarek wrote:
> On Thu, Oct 04, 2007 at 03:07:00PM -0500, David Smith wrote:
>> David Smith wrote:
>>> Mike Mason wrote:
>>>> Just a heads up... I had to patch buildrun.cxx to get scripts to build
>>>> on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed
>>>> to KBUILD_CPPFLAGS). I've attached the patch below. I don't know
>>>> when or if this change will go into Linus' kernel. I'm also not sure
>>>> of the best way to ensure the correct CFLAGS are used in build_run.cxx
>>>> (maybe check s.kernel_release?).
>>> I've seen this also (and in fact I meant to check something in but got
>>> distracted by my other marker work). I believe my solution will be
>>> backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
>>> wanted to test f7 and RHEL5 to make sure I didn't break anything.
>> I tested this on RHEL4, RHEL5, and f7. It seemed to work correctly
>> everywhere so I've checked my changes.
>>
>
> Interestingly I just pulled the latest sources and tried against Dave
> Miller's net-2.6.24 tree and I'm getting the following errors:
>
> WARNING: ignored message of type 5
I see this message whenever I'm running a script and another module gets loaded. I don't think it's related to the specific script or kernel tree you're running. The staprun main loop is receiving a STP_MODULE message on the control channel and doesn't know what to do with it. I don't enough about the code to know why.
Mike
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: SystemTap on 2.6.23-rc8-mm2
2007-10-04 21:15 ` Andy Gospodarek
@ 2007-10-04 21:35 ` Andy Gospodarek
0 siblings, 0 replies; 8+ messages in thread
From: Andy Gospodarek @ 2007-10-04 21:35 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: Martin Hunt, David Smith, Mike Mason, systemtap
On Thu, Oct 04, 2007 at 05:15:39PM -0400, Andy Gospodarek wrote:
> On Thu, Oct 04, 2007 at 05:10:51PM -0400, Martin Hunt wrote:
> > On Thu, 2007-10-04 at 16:29 -0400, Andy Gospodarek wrote:
> > > On Thu, Oct 04, 2007 at 03:07:00PM -0500, David Smith wrote:
> > > > David Smith wrote:
> > > > >Mike Mason wrote:
> > > > >>Just a heads up... I had to patch buildrun.cxx to get scripts to build
> > > > >>on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed
> > > > >>to KBUILD_CPPFLAGS). I've attached the patch below. I don't know
> > > > >>when or if this change will go into Linus' kernel. I'm also not sure
> > > > >>of the best way to ensure the correct CFLAGS are used in build_run.cxx
> > > > >>(maybe check s.kernel_release?).
> > > > >
> > > > >I've seen this also (and in fact I meant to check something in but got
> > > > >distracted by my other marker work). I believe my solution will be
> > > > >backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
> > > > >wanted to test f7 and RHEL5 to make sure I didn't break anything.
> > > >
> > > > I tested this on RHEL4, RHEL5, and f7. It seemed to work correctly
> > > > everywhere so I've checked my changes.
> > > >
> > >
> > > Interestingly I just pulled the latest sources and tried against Dave
> > > Miller's net-2.6.24 tree and I'm getting the following errors:
> > >
> > > WARNING: ignored message of type 5
> >
> > You're the second person today to remind me that warning is still in
> > there. I am working on a fix. It only happens when a module is loaded
> > when a systemtap script is running.
> >
> > Martin
> >
> >
>
> Aside from the warning it doesn't actually print my message, so the
> probe isn't too helpful. ;-)
OK, nevermind. I was looking at the wrong driver -- when I used one
that actually calls the function I'm probing it works. Sorry for the
noise....
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-10-04 21:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-04 16:21 SystemTap on 2.6.23-rc8-mm2 Mike Mason
2007-10-04 18:34 ` David Smith
2007-10-04 20:07 ` David Smith
2007-10-04 20:29 ` Andy Gospodarek
2007-10-04 21:11 ` Martin Hunt
2007-10-04 21:15 ` Andy Gospodarek
2007-10-04 21:35 ` Andy Gospodarek
2007-10-04 21:22 ` Mike Mason
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).