public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* getting tracepoints with 2.6.30-rc2 kernel
@ 2009-04-17  2:50 William Cohen
  2009-04-17  6:55 ` Josh Stone
  0 siblings, 1 reply; 3+ messages in thread
From: William Cohen @ 2009-04-17  2:50 UTC (permalink / raw)
  To: SystemTAP

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

The have been some changes in the layout of the trace include directory with the
2.6.30-rc2 kernel. There is now a subdirectory trace/events with the trace
points also need to filter out the ftrace.h include file. The attached patch
allows following to list out the tracepoints in the 2.6.30-rc2 kernel:

stap  -L  'kernel.trace("*")'|sort

Without the patch systemtap can not find the tracepoints. Any comments on this
would be appreciated. I would like to make sure that this is reasonable before
checking in.


-Will

[-- Attachment #2: trace_2630.diff --]
[-- Type: text/plain, Size: 1492 bytes --]

diff --git a/buildrun.cxx b/buildrun.cxx
index 82ac9d4..6abb783 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -398,22 +398,32 @@ make_tracequery(systemtap_session& s, string& name, const vector<string>& extra_
 
   // dynamically pull in all tracepoint headers from include/trace/
   glob_t trace_glob;
-  string globs[2] = { "/include/trace/*.h", "/source/include/trace/*.h" };
-  for (unsigned z=0; z<2; z++)
+  string globs[] = { "/include/trace/*.h",
+		      "/source/include/trace/*.h",
+		      "/include/trace/events/*.h",
+		      "/source/include/trace/events/*.h",
+		      ""
+  };
+  for (unsigned z=0; globs[z] != ""; z++)
     {
       string glob_str(s.kernel_build_tree + globs[z]);
       glob(glob_str.c_str(), 0, NULL, &trace_glob);
       for (unsigned i = 0; i < trace_glob.gl_pathc; ++i)
         {
           string header(basename(trace_glob.gl_pathv[i]));
+	  string include_file(trace_glob.gl_pathv[i]);
+	  size_t header_pos = include_file.rfind("trace/");
+	  include_file =  include_file.substr(header_pos);
 
           // filter out a few known "internal-only" headers
           if (header == "trace_events.h")
             continue;
+          if (header == "ftrace.h")
+            continue;
           if (header.find("_event_types.h") != string::npos)
             continue;
 
-          osrc << "#include <trace/" << header << ">" << endl;
+          osrc << "#include <" << include_file << ">" << endl;
         }
       globfree(&trace_glob);
     }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getting tracepoints with 2.6.30-rc2 kernel
  2009-04-17  2:50 getting tracepoints with 2.6.30-rc2 kernel William Cohen
@ 2009-04-17  6:55 ` Josh Stone
  2009-04-17 12:19   ` William Cohen
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Stone @ 2009-04-17  6:55 UTC (permalink / raw)
  To: William Cohen; +Cc: SystemTAP

William Cohen wrote:
> The have been some changes in the layout of the trace include directory with the
> 2.6.30-rc2 kernel. There is now a subdirectory trace/events with the trace
> points also need to filter out the ftrace.h include file. The attached patch
> allows following to list out the tracepoints in the 2.6.30-rc2 kernel:
> 
> stap  -L  'kernel.trace("*")'|sort
> 
> Without the patch systemtap can not find the tracepoints. Any comments on this
> would be appreciated. I would like to make sure that this is reasonable before
> checking in.

It is completely reasonable, to the point that I already committed a
very similar change before you sent this.  Sorry to overlap efforts...

Josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getting tracepoints with 2.6.30-rc2 kernel
  2009-04-17  6:55 ` Josh Stone
@ 2009-04-17 12:19   ` William Cohen
  0 siblings, 0 replies; 3+ messages in thread
From: William Cohen @ 2009-04-17 12:19 UTC (permalink / raw)
  To: Josh Stone; +Cc: SystemTAP

Josh Stone wrote:
> William Cohen wrote:
>> The have been some changes in the layout of the trace include directory with the
>> 2.6.30-rc2 kernel. There is now a subdirectory trace/events with the trace
>> points also need to filter out the ftrace.h include file. The attached patch
>> allows following to list out the tracepoints in the 2.6.30-rc2 kernel:
>>
>> stap  -L  'kernel.trace("*")'|sort
>>
>> Without the patch systemtap can not find the tracepoints. Any comments on this
>> would be appreciated. I would like to make sure that this is reasonable before
>> checking in.
> 
> It is completely reasonable, to the point that I already committed a
> very similar change before you sent this.  Sorry to overlap efforts...
> 
> Josh

No problem, Josh.

I should have mentioned something about it earlier on IRC.The important thing is
that SystemTap is working with the 2.6.30-rc2-tip kernel.

-Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-17 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-17  2:50 getting tracepoints with 2.6.30-rc2 kernel William Cohen
2009-04-17  6:55 ` Josh Stone
2009-04-17 12:19   ` William Cohen

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).