Ktap almost gets into 3.13
Ktap was reasonably well received from the outset, with a number of developers welcoming this functionality. The work was presented at LinuxCon Japan, and the 0.2 release followed at the end of July. After that, things quieted down for a bit until mid-October, when Greg Kroah-Hartman announced (on Google+) that ktap had been merged into the staging tree for the 3.13 release. This release, which already looked to be a relatively feature-heavy development cycle, appeared to be set to acquire a dynamic tracing framework as well.
It subsequently became clear, though, that some developers hadn't seen Greg's post and weren't happy. On October 24, Ingo Molnar sent a protest over the imminent merging of ktap. He added a "Nacked-by" for good measure; Steven Rostedt then followed up with a NACK of his own. After a Kernel Summit conversation with Ingo, Greg reverted the changes, removing ktap from the staging tree and, thus, from the queue for the 3.13 kernel. Those who have been waiting for this kind of dynamic tracing functionality in the Linux kernel will have to wait a bit longer.
What happened, and what's next
At a first glance, this incident could be mistaken as an example of a newcomer being rejected by the incumbent developers of the existing tracing functionality. One need not look much further, though, to see that a rather different explanation applies. The rejection of ktap, which looks highly likely to be a temporary affair, is more a story about the right and wrong ways to get new functionality into the kernel.
The first and foremost mistake is that the patches were never actually posted to the linux-kernel mailing list for review. Ktap developer Jovi Zhangwei has posted his release announcements there, and the code has always been available in a public git repository. But getting review for code in a repository is never easy; that certainly proved to be true in this case. While some developers knew about ktap and what it could do, few had actually looked at the implementation.
As Ingo pointed out in his objection, the form of the code in the staging tree (a single changeset adding 16,000 lines of code) did not make the review process any easier. Neither did the lack of documentation about the design of ktap.
The biggest complaint, though, was about the lack of integration with the kernel's existing tracing functionality. Ingo pointed out a couple of areas where that kind of integration might be useful:
- The kernel currently has a simple interpreter used to implement
filter conditions on tracepoints. The Lua bytecode interpreter offers
a rather richer execution environment; it could perhaps be put to work
implementing a more comprehensive conditional evaluation mechanism for
tracepoints.
- Rather than requiring a new set of commands, ktap scripts could be
made part of the perf
probe command, tying them more firmly into the existing system.
Ingo's goal is clearly to have a single set of comprehensive tracing
functionality that can all be exercised without having to know about
the separate subsystems that implement it.
- Ingo also requested the ability to extract ktap scripts from the kernel and turn them back into their source form. That, he said, would improve security by making it possible to examine any scripts running within the kernel.
In summary, Ingo said, the code looks like it could be useful and make the kernel's instrumentation better:
So it appears that ktap should be able to get in eventually, but first
Jovi has some work cut out for him to get this code into proper shape
for merging. The good news is that he seems
prepared to do that work. The hope is to have a reworked version of
ktap reviewed and ready for the 3.14 development cycle; at that point, it
should be able to go directly into the core kernel without a stay in the
staging tree. This delay is likely to be frustrating for everybody
involved, but the end result will almost certainly be an improved,
in-kernel scripting facility for dynamic tracing.
Index entries for this article | |
---|---|
Kernel | Development tools/Kernel tracing |
Kernel | Tracing |
Posted Nov 7, 2013 6:49 UTC (Thu)
by karim (subscriber, #114)
[Link] (7 responses)
Posted Nov 7, 2013 13:14 UTC (Thu)
by deater (subscriber, #11746)
[Link] (1 responses)
As long as Ingo maintains perf it's unlikely that any other profiling tool will get into the kernel unless it's through perf_event, even if it doesn't make sense.
It's why things like AMD Lightweight Profiling never made it into the kernel
And it's why things like ftrace tracing are part of perf, complicating the interface, which has led to recent bugs where a normal user can lock the kernel using the perf interface.
Posted Nov 7, 2013 14:24 UTC (Thu)
by karim (subscriber, #114)
[Link]
At this stage many of those that have tried are staying away. Personally I've given up on Linux ever providing meaningful online diagnostic to rival any of the other OSes out there. There's just too much kernel politics in the way. This recent idea that all new performance/monitoring stuff has to go through perf craziness is just one more on the list.
FWIW I think ftrace's user interface is kickass. It's not perfect and there are other ways of doing things, but ftrace certainly shows that it was architectured based on deep, real-life experience with tracing lots of data. Smarts just aren't enough.
Posted Nov 7, 2013 13:53 UTC (Thu)
by lambda (subscriber, #40735)
[Link] (4 responses)
I'm curious, what do you find wrong with perf? I've been looking for a good tracing framework recently, and figured that since perf is in mainline I should probably learn that, but I'm wondering if there are better choices out there.
It's bit frustrating that on Linux there are so many, all of which are either incomplete or out of tree; on Solaris, FreeBSD, or Mac OS X, the answer is just "dtrace", while I'm never quite sure which tracing framework to learn on Linux.
Posted Nov 7, 2013 14:41 UTC (Thu)
by karim (subscriber, #114)
[Link] (1 responses)
Posted Nov 7, 2013 16:31 UTC (Thu)
by deater (subscriber, #11746)
[Link]
Posted Nov 12, 2013 3:58 UTC (Tue)
by bgregg (guest, #46639)
[Link] (1 responses)
pref can do a lot, but there are some things where the performance hit can make me hesitate. For example, timing a busy kernel function, where I'm interested in examining its distribution, to identify outliers or multiple modes. perf has an enable/trace/dump/post-process cycle to get to the answer I want. ktap (and DTrace and SystemTap) can execute arbitrary programs in kernel context, where it can filter and summarize using per-CPU buffers (eg, via kp_percpu_data()), and then emit an answer without making a trip to user-level to post-process data. It can also (more easily) let me build real time tools.
Posted Nov 13, 2013 20:35 UTC (Wed)
by karim (subscriber, #114)
[Link]
Yes, it's been a pleasure watching the videos of some of those talks and I'm glad to see your "System Performance" title is finally out, I've been waiting for it for a while. Time to order a copy.
FWIW, I'm not saying perf is useless. Just that it doesn't do what I need. Then again, as I said, I'm not the typical user: I wrote LTT in the late '90s and maintained it for a few years. That doesn't necessarily make my opinion worth more than what others have to say, but I do have a fairly good handle on what such tools can be capable of and we're certainly not where we should be and my expectations, based on historical record, are fairly low.
Posted Nov 7, 2013 14:01 UTC (Thu)
by meuh (guest, #22042)
[Link] (4 responses)
I'm also concerned about the licensing. The homepage states "License GPL v2" so does the README, "ktap is licensed under GPL v2". But ktap source code is a derivative of Lua code, which is covered by a MIT license
Ktap almost gets into 3.13
Ktap almost gets into 3.13
> that I'll use it.
Ktap almost gets into 3.13
Ktap almost gets into 3.13
Ktap almost gets into 3.13
Ktap almost gets into 3.13
Ktap almost gets into 3.13
Ktap almost gets into 3.13
License ?
* This file is part of ktap by Jovi Zhangwei.
*
* Copyright (C) 2012-2013 Jovi Zhangwei <jovi.zhangwei@gmail.com>.
*
* Copyright (C) 1994-2013 Lua.org, PUC-Rio.
* - The part of code in this file is copied from lua initially.
* - lua's MIT license is compatible with GPL.
*
* ktap is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
The Lua origin of code portion was noted by user engla in comment Loops to article Ktap — yet another kernel tracer.
Posted Nov 7, 2013 15:05 UTC (Thu)
by rahulsundaram (subscriber, #21946)
[Link] (3 responses)
Posted Nov 7, 2013 16:12 UTC (Thu)
by meuh (guest, #22042)
[Link] (2 responses)
I've understand that MIT and GPLv2 are compatible licenses,
Posted Nov 7, 2013 16:16 UTC (Thu)
by rahulsundaram (subscriber, #21946)
[Link] (1 responses)
Posted Nov 15, 2013 20:18 UTC (Fri)
by Wol (subscriber, #4433)
[Link]
But you can mix MIT and GPL and the result can only be distributed under the GPL. If, however, the recipient strips out the GPL code, they can redistribute the MIT-licenced stuff under the MIT licence.
When you mix code under different licences, you can't change any of the licences, and you have to comply with all of them. The magic of the GPL lies in the fact that it is explicitly incompatible with any licence that restricts it. In order to be compatible with the GPL, any other licence must let you do everything the GPL lets you do. So, in complying with the GPL, you comply with all the compatible licences as a matter of course.
Cheers,
Posted Nov 7, 2013 14:09 UTC (Thu)
by meuh (guest, #22042)
[Link]
Posted Nov 7, 2013 14:15 UTC (Thu)
by meuh (guest, #22042)
[Link]
License ?
License ?
but does MIT license allows one to re-license code under a different one, even compatible ?
License ?
License ?
Wol
The brief presence of ktap in staging and linux-next git tree give a chance for some developers to review the code.Review
I had myself a look to it and send some comments/patches on the list ktap@freelists.org (but had to subscribe in order to submit mail).
Ktap 0.3 was released in the end of October, see announcement on LWN.net, somewhere in Kernel development page of LWN.net Weekly Edition for October 31, 2013 ;).
ktap 0.3