LWN: Comments on "A SystemTap update" https://lwn.net/Articles/315022/ This is a special feed containing comments posted to the individual LWN article titled "A SystemTap update". en-us Sat, 04 Oct 2025 11:05:56 +0000 Sat, 04 Oct 2025 11:05:56 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net A SystemTap update https://lwn.net/Articles/317817/ https://lwn.net/Articles/317817/ oak <div class="FormattedComment"> <font class="QuotedText">&gt; Well, this would be the classic illustration of the problems systemtap </font><br> faces. Nothing on the above laundry list is impossible even if the kernel <br> merely controls the traced process and lets userspace poke at it ... that, <br> after all, is how gdb works.<br> <p> As to why to do it in kernel... Doing it from user space is just too slow. <br> Try e.g. get backtraces to mallocs through ptrace and you notice how <br> infeasible this is from user-space (at least through the interface ptrace <br> offers). With the modern desktop apps that use malloc pretty heavily, the <br> programs become unusable slow (in addition to their usability, also their <br> functionality may suffer if they use timeouts for responses etc).<br> <p> </div> Tue, 03 Feb 2009 22:41:56 +0000 A SystemTap update https://lwn.net/Articles/317815/ https://lwn.net/Articles/317815/ oak <div class="FormattedComment"> No idea, but you can get the same information also from /proc/PID/smaps. <br> It's separate for each of the memory mapping the process has i.e. you may <br> need to write a small script to process the data.<br> <p> If the process has stuff that's marked as swapped, but not anymore as <br> dirty, it's completely swapped out. For some reason kernel/SMAPS doesn't <br> think swapped pages to be anymore dirty which loses the distinction <br> between shared dirty and private dirty that SMAPS shows for pages still in <br> RAM.<br> <p> </div> Tue, 03 Feb 2009 22:33:41 +0000 "Client and server" https://lwn.net/Articles/317377/ https://lwn.net/Articles/317377/ saffroy <div class="FormattedComment"> I'm really glad to see that the idea of the "client and server" to debug constrained platforms has caught. Systemtap, even when "only" used for kernel debugging, is way too good to be only for big servers where you can install large debug RPMs. Embedded platform developpers will bless such a tool when it becomes available!<br> </div> Fri, 30 Jan 2009 23:25:05 +0000 A SystemTap update https://lwn.net/Articles/317286/ https://lwn.net/Articles/317286/ mjw <div class="FormattedComment"> <font class="QuotedText">&gt; Actuallly, only the user space tracing aspect of systemtap is dependent on these. You can still do kernel space tracing without them.</font><br> <p> Correct.<br> <p> <font class="QuotedText">&gt; We've spent quite a lot of effort explaining the problems with the utrace/uprobes dependency (especially the issues of having to pull the process symbol table into the kernel and of having the kernel actually execute the compiled code to do the traps).</font><br> <p> Could you post the problems you see?<br> <p> How a tracing tool like systemtap processes and uses the symbol table is kind of orthogonal from utrace and uprobes. utrace and uprobes might make it easier to access them during runtime. But that isn't what Systemtap currently does. If you want a tracer to do these things dynamically at trace event time, or even push the whole thing towards user space in reaction to trace events and hand it off to a user space helper then that is certainly a design choice you can make (unlike tracers, debuggers do this for example since they don't mind suspending the tracee for a longer period). The article does hint at why "offloading" this to a user space helper might not be practical (see the vfs example and the explanation of what might happen if you try to offload something like that to a perl script). But those are tradeoffs you can make independent of the infrastructure you use in the kernel to handle events and trace point insertion.<br> <p> <font class="QuotedText">&gt; There is hope that we might be able to go with a lighter weight infrastructure that simply vectors traps to the user space stap runtime and does all the interpreting in user space.</font><br> <p> Yes, there is nothing inherent in utrace or uprobes about how you handle trace events or how you use and insert vector traps into user space. That is the basic idea behind pushing them upstream, because they are useful apart from systemtap. They should also be useful for other tracers like connecting them to ftrace or lttng. You could even use them for a new debugger interface if you aren't interested in a no-overhead tracer. That is what the froggy project is exploring. It seems time to provide something better than the ptrace interface for debuggers.<br> </div> Fri, 30 Jan 2009 10:31:36 +0000 A SystemTap update https://lwn.net/Articles/317263/ https://lwn.net/Articles/317263/ SEJeff <div class="FormattedComment"> Actually the block_dump feature of modern 2.6 linux kernels will show you which processes are writing to which devices. I wrote a proof of concept script to show them:<br> <p> <a href="http://www.digitalprognosis.com/opensource/scripts/top-disk-users">http://www.digitalprognosis.com/opensource/scripts/top-di...</a><br> <p> The output looks like this:<br> root@desktopmonster:~# ./top-disk-users <br> COMMAND PID NUM ACTION DEVICE<br> banshee-1 23999 8 READ sda9<br> kjournald 2494 131 WRITE sda5<br> kjournald 5182 5 WRITE sda8<br> pdflush 228 15 WRITE sda5<br> pdflush 228 1 WRITE sda8<br> pdflush 228 32 WRITE sda9<br> <p> </div> Fri, 30 Jan 2009 03:15:48 +0000 A SystemTap update https://lwn.net/Articles/317215/ https://lwn.net/Articles/317215/ epb205 <div class="FormattedComment"> Why doesn't ps show which processes are swapped out anymore? Is that somehow a security hole?<br> </div> Thu, 29 Jan 2009 20:07:14 +0000 A SystemTap update https://lwn.net/Articles/317176/ https://lwn.net/Articles/317176/ fuhchee <div class="FormattedComment"> <font class="QuotedText">&gt; Um, just use a search</font><br> <p> I asked because I recall no serious debate about the two specific items ("process symbol tables in the kernel" and "having kernel ... execute code ... to do the traps") you listed. Please humor fellow readers and give some links.<br> <p> <p> <font class="QuotedText">&gt; &gt; User-space symbol tables are made available to the systemtap module</font><br> <font class="QuotedText">&gt; &gt; only if it is required by the script</font><br> <p> <font class="QuotedText">&gt; Only if you buy the premise that the kernel has to be intimately involved </font><br> <font class="QuotedText">&gt; in the trace instead of being a simple conduit for mediating it.</font><br> <p> There are many possible details behind such a summary. If one wants dtrace-level introspection and manipulation, never mind going beyond it, some "intimate involvement" (kernel-side processing?) is necessary. Merely "mediating" (data copying?) is not sufficient, since the choice of data and the nature of the programmed reaction is itself variable.<br> <p> <font class="QuotedText">&gt; [...] that, after all, is how gdb works. [...]</font><br> <p> The work involved in how gdb does its thing is several orders of magnitude heavier.<br> <p> <font class="QuotedText">&gt; The brick wall is that kernel developers don't think this is at all a </font><br> <font class="QuotedText">&gt; compelling argument and apparently systemtap people think it is.</font><br> <p> Individual kernel people don't need to buy into every argument for systemtap to bloom. We have promoted numerous "dual-use" kernel-side technologies that can stand on their own feet. For example, with utrace, if you believe that user-space instrumentation is plausible, you should support utrace and forthcoming ("froggy" or "ubs"-like) layers on top, for dispatching those events to a hypothetical user-space handler.<br> <p> The details deserve more in-depth discussion.<br> <p> </div> Thu, 29 Jan 2009 17:26:55 +0000 A SystemTap update https://lwn.net/Articles/317175/ https://lwn.net/Articles/317175/ knobunc <div class="FormattedComment"> See also iotop.<br> </div> Thu, 29 Jan 2009 17:05:11 +0000 A SystemTap update https://lwn.net/Articles/317172/ https://lwn.net/Articles/317172/ jejb <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; We've spent quite a lot of effort explaining the problems with the</font><br> <font class="QuotedText">&gt;&gt; utrace/uprobes dependency</font><br> &gt;<br> <font class="QuotedText">&gt; Can you provide some links to discussion about these specifics: ?</font><br> <p> Um, just use a search ... if you search lkml for utrace you get the less polite version .. if you search the systemtap lists on the same thing, you get the more polite one.<br> <p> <font class="QuotedText">&gt;&gt; (especially the issues of having to pull the</font><br> <font class="QuotedText">&gt;&gt; process symbol table into the kernel</font><br> &gt;<br> <font class="QuotedText">&gt; User-space symbol tables are made available to the systemtap module</font><br> <font class="QuotedText">&gt; only if it is required by the script - if it performs symbolic</font><br> <font class="QuotedText">&gt; address or backtrace type lookups.</font><br> <p> Only if you buy the premise that the kernel has to be intimately involved in the trace instead of being a simple conduit for mediating it.<br> <p> <font class="QuotedText">&gt;&gt; and of having the kernel actually</font><br> <font class="QuotedText">&gt;&gt; execute the compiled code to do the traps</font><br> &gt;<br> <font class="QuotedText">&gt; Like in dtrace, instrumentation is run within the kernel because</font><br> <font class="QuotedText">&gt; having user-space processes instrument each other is too disruptive.</font><br> <font class="QuotedText">&gt; We're looking for microsecond-level probe effect, not something</font><br> <font class="QuotedText">&gt; involving multiple context switches, indirect address space accesses,</font><br> <font class="QuotedText">&gt; and so on.</font><br> <p> Well, this would be the classic illustration of the problems systemtap faces. Nothing on the above laundry list is impossible even if the kernel merely controls the traced process and lets userspace poke at it ... that, after all, is how gdb works. The brick wall is that kernel developers don't think this is at all a compelling argument and apparently systemtap people think it is.<br> <p> </div> Thu, 29 Jan 2009 16:55:09 +0000 A SystemTap update https://lwn.net/Articles/317166/ https://lwn.net/Articles/317166/ fuhchee <div class="FormattedComment"> <font class="QuotedText">&gt; We've spent quite a lot of effort explaining the problems with the</font><br> <font class="QuotedText">&gt; utrace/uprobes dependency</font><br> <p> Can you provide some links to discussion about these specifics: ?<br> <p> <font class="QuotedText">&gt; (especially the issues of having to pull the </font><br> <font class="QuotedText">&gt; process symbol table into the kernel</font><br> <p> User-space symbol tables are made available to the systemtap module<br> only if it is required by the script - if it performs symbolic<br> address or backtrace type lookups.<br> <p> <font class="QuotedText">&gt; and of having the kernel actually </font><br> <font class="QuotedText">&gt; execute the compiled code to do the traps</font><br> <p> Like in dtrace, instrumentation is run within the kernel because<br> having user-space processes instrument each other is too disruptive.<br> We're looking for microsecond-level probe effect, not something<br> involving multiple context switches, indirect address space accesses,<br> and so on.<br> <p> </div> Thu, 29 Jan 2009 16:36:15 +0000 A SystemTap update https://lwn.net/Articles/317160/ https://lwn.net/Articles/317160/ jejb <div class="FormattedComment"> Actuallly, only the user space tracing aspect of systemtap is dependent on these. You can still do kernel space tracing without them.<br> <p> We've spent quite a lot of effort explaining the problems with the utrace/uprobes dependency (especially the issues of having to pull the process symbol table into the kernel and of having the kernel actually execute the compiled code to do the traps). There is hope that we might be able to go with a lighter weight infrastructure that simply vectors traps to the user space stap runtime and does all the interpreting in user space. It's just we still haven't quite got system tap buy in yet.<br> </div> Thu, 29 Jan 2009 16:15:59 +0000 A SystemTap update https://lwn.net/Articles/317132/ https://lwn.net/Articles/317132/ fuhchee <div class="FormattedComment"> <font class="QuotedText">&gt; [why is] systemtap dependent upon two large</font><br> <font class="QuotedText">&gt; kernel patches (utrace and uprobes)</font><br> <p> For probing user-space, there is apprx. no alternative: one needs a<br> kprobes-like infrastructure.<br> <p> <font class="QuotedText">&gt; which have dim-to-zero prospects of ever being included in Linux?</font><br> <p> While skepticism may be warranted, we are making efforts to make this<br> code more palatable to the gatekeepers.<br> <p> </div> Thu, 29 Jan 2009 13:28:03 +0000 A SystemTap update https://lwn.net/Articles/317125/ https://lwn.net/Articles/317125/ eugeniy <div class="FormattedComment"> Correction: patches are not needed for probing kernel. It looks like for userspace utrace is required. uprobes source, it seems, is included in systemtap.<br> </div> Thu, 29 Jan 2009 12:46:01 +0000 A SystemTap update https://lwn.net/Articles/317114/ https://lwn.net/Articles/317114/ mjw <div class="FormattedComment"> The vfs tapset example in the article works without needing any additional user space hook patches.<br> <p> Also take a look at some of the examples that come with Systemtap. disktop.stp probably does what you want:<br> <a href="http://sourceware.org/systemtap/examples/keyword-index.html#DISK">http://sourceware.org/systemtap/examples/keyword-index.ht...</a><br> </div> Thu, 29 Jan 2009 10:42:36 +0000 A SystemTap update https://lwn.net/Articles/317108/ https://lwn.net/Articles/317108/ mjw <div class="FormattedComment"> As the article states there is no hard dependency, they are just used for deeper user space probing if wanted. And some of the utrace foundations have been going in, with the groundwork now upstream.<br> <p> The last part of the article gives some idea of ways people are working on getting this functionality faster upstream, so they are included with more distributions by default. By splitting it up, providing other users, etc. One recent example is the utrace-&gt;ftrace engine proof of concept: <a href="http://lkml.org/lkml/2009/1/27/294">http://lkml.org/lkml/2009/1/27/294</a><br> <p> If you have any hints and tips for getting these things, or similar user space hooks that Systemtap can use, upstream faster that would be appreciated.<br> </div> Thu, 29 Jan 2009 10:38:34 +0000 A SystemTap update https://lwn.net/Articles/317104/ https://lwn.net/Articles/317104/ ctg <div class="FormattedComment"> Me and a colleague were discussing just last night the thorny problem of how we work out which of many competing processes are using disk access - causing contention on the disk, so that everything queues up, and more and more disk access is caused... not really a lot of tools in linux todo that... (If we knew the worst offenders, then we could focus our effort on making them more efficient - having to put instrumentation in each process is really time consuming).<br> <p> .. so reading this article was timely. Looks like systemtap would enable us to quickly home in on the big disk users..<br> <p> .. the article quite clearly states that to get the best out of systemtap you need these patches, so when Mr Morton himself makes this sort of criticism, then its a bit of a concern.<br> <p> Despite all that, I'm off to look at systemtap in a bit more detail (it's lack of ubiquity has put me off before), but the lack of decent tools for working out what is really going on in a complex system is pretty frustrating (I'm still suffering from the lack of the "W" flag in the output of ps(1) to show which processes are swapped out - I understand why it doesn't show that any more - but when your system goes into swap, it's useful to see which processes are being paged out.. I suspect systemtap might be able to help with this too).<br> </div> Thu, 29 Jan 2009 10:08:19 +0000 A SystemTap update https://lwn.net/Articles/317096/ https://lwn.net/Articles/317096/ eugeniy <div class="FormattedComment"> SystemTap is not dependent on any patches, it works fine with unpatched kernel.<br> </div> Thu, 29 Jan 2009 08:23:13 +0000 A SystemTap update https://lwn.net/Articles/317079/ https://lwn.net/Articles/317079/ akpm <div class="FormattedComment"> um, which genius decided to make systemtap dependent upon two large<br> kernel patches (utrace and uprobes) which have dim-to-zero prospects<br> of ever being included in Linux?<br> <p> </div> Thu, 29 Jan 2009 04:04:30 +0000