| No initiation | Red | Please do not initiate any interaction with me. |
|---|---|---|
| Prior Permission | Yellow | Please do not initiate unless I have already given you permission to approach me on a yellow badge. |
| Please initiate | Green | I would like to socialise, but I have difficulty initiating. Please initiate with me. |
| Neutral | White (or no badge) | I am able to regulate my own interaction. |
bts command as a way to open the bug mbox in mutt, that makes it really easy to answer the bug.bts -m show $n where $n is the bug number, and I can then answer the bug from mutt.
Last year I shared my Debian related goals for 2010 . I announced that I would not be able to complete them all and indeed I have not, but I have still done more than what I expected. Let s have a look.
Translate my Debian book into English and get it published: NOT DONE
Or rather not yet done. It s still an important project of mine and I will do it this year. When I wrote this last year, I expected to find a publisher that would take care of everything but we failed to find a suitable one so we re going to do it ourselves.
Cleanup the dpkg perl API and create libdpkg-perl: DONE
libdpkg-perl has been introduced with dpkg 1.15.6.
Create dpkg-buildflags: DONE
dpkg-buildflags has been introduced with dpkg 1.15.7. It s not widely used yet and it won t really be until debhelper 7 supports it (see #544844). It would be nice to see progress on this front this year.
Ensure the new source formats continue to gain acceptance: DONE
The adoption rate has been steady, it clearly slowed down since the freeze though. I have implemented quite a few features to satisfy the needs of users, like the possibility to unapply the patches after the build, or the possibility to fail in case of unwanted upstream changes.
Design a generic vcs-buildpackage infrastructure to be integrated in dpkg-dev: NOT DONE
I believe it s something important on the long term but it never made it to my short-term TODO list and it s unlikely to change any time soon.
Continue fixing dpkg bugs faster than they are reported: PARTLY DONE
We have dealt with many bugs over the year, but we still have 20 more bugs than at the start of last year (370 vs 350). We re not doing bad compared to many other Debian teams but we can still benefit from some help. Start here if you re interested.
Enhance our infrastructure to ease interaction between contributors and to have a better view of how each package is maintained: NOT DONE
I am convinced that we need something to have a clearer idea of the commitments made by each contributor. I don t put the same amount of care in maintaining smarty-gettext that I do on dpkg. If we had a database of the stuff that we know we don t do well enough, it s easier to point new contributors towards those.
Anyway, this project is still unlikely to come to the top of my priorities any time soon.
Work on the developers-reference: NOT DONE
We have switched the Maintainer field to debian-policy@lists.debian.org to have more review of the changes suggested through the bug tracking system but that has not changed much on the global situation.
I still hope to become more active on it sometimes this year. Maybe by trying to make it more fun and creating the text for some of the wishlist bugs as blog articles first.
Rewrite in C the last Perl scripts provided by the dpkg binary package: DONE
Dpkg 1.15.8 was the first version working without Perl, I announced it in July.
Integrate the 3-way merge tool for Debian changelogs in dpkg-dev: DONE
dpkg-mergechangelogs is part of dpkg-dev since 1.15.7.
I enjoy it regularly. Unfortunately it doesn t work well for cherry-picks. Would be nice to see this fixed, anyone up to the task? Click here to subscribe to my free newsletter and get my monthly analysis on what s going on in Debian and Ubuntu. Or just follow along via the RSS feed, Identi.ca, Twitter or Facebook.
One comment Liked this article? Click here. My blog is Flattr-enabled.
Tomorrow, at this time, I'll probably be unsuccessfully trying to find a
comfortable position on a seat of the Bilmanbus to Irun. Very early
on Saturday, as soon as we get off the bus, Maria and I will quickly head to
Hondarribia's beach in Cape Higer to symbolically wet our feet in the waters
of the Cantabrian Sea.
We won't have much time to enjoy the cold waters of the ocean, though.
Soon after that, we'll have to take a deep breath, look East, and start
walking if we want to achieve our utmost objective: take a bath in the
beautiful beaches of the Cap de Creus, in the Mediterranean sea. In between,
30 days and 840 kilometres of thick woods, deep valleys, high peaks and cold
waters, all of which shape incredible landscapes.

The Portella de Baiau, during our 2008 trip
For a whole month, we'll be mostly disconnected from everything else that
isn't our knee ache, our blisters, the Sun over our heads or where to get
food. It's the first time I leave on a hiking trip as long and tough as this
one, and I feel both uncertainty and eagerness. We've been so busy during the
last few months that we've been unable to train at all for this, and I'm
probably in the worst physical condition in a decade. It's too late
to take care of that now, so we'll try to take good care of our legs and
spine.
In order to get back home in the Mediterranean, we'll have to
be fast, some days joining two stages and skipping a few that we know are not
that interesting (sections over asphalt, etc.). It's hard to make it in just
one month, but we'll try our best. The plan is going to sleep not long after sunset, getting up at dawn, to be able to walk for a decent time before the heat
starts being a handicap and just resting at midday, when the Sun is
strongest.
Of course, this means that I'm missing, yet again, this year's edition
of DebConf in New York City, which is
really sad because I was looking forward hanging around with
Mako,
Mika,
Biella, micah,
Clint and the rest of the
NYC/
Boston gang, but when
the idea of doing a long trip this summer popped up around January, it was
clear DebConf seemed unlikely this year. I hope all of you have a lot of
fun, and see you in a few weeks!
Reading Scott's recent
announcement
on his move to Google was both surprising and a pleasure. Surprising,
because it'll take time to stop associating his name to Ubuntu, Canonical,
and the nice experiences I had while I worked with them. A pleasure,
because his blog post was full of reminiscences of the very early days of
a project that ended up being way more successful in just a few years than
probably anyone in the Oxford conference could imagine.
Scott, best of luck for this new adventure!
Scott's write-up includes a sentence that made me remember I had been
wanting to write a blog post related to all of this, but was pending Mark
Shuttleworth's permission for posting:
Ok, Mark wasn t really a Nigerian 419 scammer, but some people did discard his e-mail as spam! Scott James RemnantMany know the story of how I ended not being part of the Super-Secret-Debian-Startup Scott mentions. I even wrote about it in a blog post, 3 years ago:
[...] nothing beats the next email which sat for some dramatic 6 months in my messy inbox until I found out in the worst of the possible scenarios. Let's go back to late February, 2004, when I had no job, and I didn't have a clue on what to do with my life.When the usual suspects in the secret Spanish Debian Cabal channel read this blog post, they decided Mark deserved a reply, even if it would hit his inbox more than three and a half years late. :) With great care, we crafted an email that would look genuinely stupid in late 2007, but just arrogant and idiotic in 2004, when Ubuntu was just an African word, and the GNU/Linux distribution landscape was quickly evolving at the time, Gentoo Linux had the posh distribution crown, that Debian had held for quite a few years. I even took enough care to forge theI'm not sure if I totally missed it as it came in, or I skimmed through it and thought WTF?! Dude on crack or I just forgot I need to reply to this email , but I'd swear it was the former. Not long after, no-name-yet.com popped up, the rumours started spreading around Debian channels. Luckily, I got a job at LliureX two months later, where I worked during the following 2 years, but that's another story. I guess it was July or so when Ubuntu was made public, and Mark and his secret team organised a conference (blog entries [1] [2] [3] [4] [5]), just before the Warty release, and I was invited to it, for the same reasons I got that email. During that conference, probably because Mark sent me some email and I applied a filter to get to it, I found the lost email, and felt like digging a hole to hide for a LONG while. I couldn't believe the incredible opportunity I had missed. I went to Mark and said "hey, you're not going to believe this", and he did look quite surprised about someone being such an idiot. I wonder if I should reply to his email today...From: Mark Shuttleworth <mark@hbd.com> Subject: New project to discuss To: Jordi Mallach <jordi@debian.org> Date: Sun, 29 Feb 2004 18:33:51 +0000 [...] I'm hiring a team of debian developers to work full time on a new distribution based on Debian. We're making internationalisation a prime focus, together with Python and regular release management. I've discussed it with a number of Debian leaders and they're all very positive about it. [...]
X-Operating-System and User-Agent headers so
they matched whatever was current in Debian in February 2004, and of
course, top-posting seemed most appropriate.
So Mark woke up that Monday, fired up his email client, and got... this:
As you can imagine, his reaction was immediate:Date: Mon, 1 Mar 2004 09:47:55 +0100 From: Jordi Mallach <jordi@sindominio.net> To: Mark Shuttleworth <mark@hbd.com> Subject: Re: New project to discuss Organization: SinDominio X-Operating-System: Debian GNU/Linux sid (Linux 2.6.3 i686) User-Agent: Mutt/1.5.5.1+cvs20040105i Hi Mark, Thanks for your email. I nearly deleted this e-mail because for some reason I thought it was targetted spam. Your project looks very interesting, almost like a dream come true. However, I feel a bit uneasy about your proposal. Something just doesn't fit. Why would someone start a company to work on /yet another/ Debian derivative? Have you heard about Progeny's sad story? I think it's a great example to show that Debian users don't want Debian-based distros, they want people to work on the "real thing". Besides, I don't think there's much more place for successful commercial distros, with Red Hat and SuSE having well-established niches in the US and Europe. Also, why focus on Debian specifically, Why not, for example, Gentoo, which has a lot of buzz these days, and looks poised to be the next big distribution? To be honest, I think only a few people have the stamina or financial stability to undertake a project like this, so I'd like to know a bit more about you, and details on how you plan to sustain the expenses. Those are the main issues that worry me about your project. Other than that, I would be interested in taking part in it, as I'm currently unemployed and working on something Debian-based would be just too good to miss. You can reach me at +34 123 45 67 89, or if you feel like flying people around Europe, I probably can be in the UK whenever it fits you. Thanks, and hoping to hear from you again, Jordi On Sun, Feb 29, 2004 at 06:33:51PM +0000, Mark Shuttleworth wrote: > Hi Jordi > > We haven't met, but both Jeff Waugh and Martin Michelmayr recommended that > I get in touch with you in connection with a new project that I'm starting. > > I'm hiring a team of debian developers to work full time on a new > distribution based on Debian. We're making internationalisation a prime > focus, together with Python and regular release management. I've discussed > it with a number of Debian leaders and they're all very positive about it. > > Would you be available to discuss it by telephone? I'm in the UK, so we > could probably find a good timezoine easily enough ;-) Let me knof if > you're keen to discuss it, when and what number to call. > > Cheers, > Mark > > -- > Try Debian GNU/Linux. Software freedom for the bold, at www.debian.org > http://www.markshuttleworth.com/
With thanks to all the Spanish Cabal members who were involved!Date: Mon, 22 Oct 2007 11:13:54 +0100 From: Mark Shuttleworth <mark@hbd.com> To: Jordi Mallach <jordi@sindominio.net> Subject: Re: New project to discuss Jordi! I just got this now! Did you recently flush an old mail queue?
Not for the first time, I ve seen the suggestion in the echo chamber that Mono packages should be moved from Debian into the non-free repository, which is not formally part of Debian. The reason, as it so often is, is patents specifically this time, the searing risk posed to Debian and its users that Mono s packaging does not (and technically could not without forking from upstream) provide base class libraries which implement only the content of ECMA-335 4th Edition. As I understand it, this implies three things about the suggestion/demand: firstly, that the individual in question believes that Mono end users are at risk from patent litigation from Microsoft Corp because Mono s implementation of Microsoft.NET beyond the content of ECMA 334/335 infringes on Microsoft patents; secondly, that the Microsoft Community Promise which promises not to assert legal claims over third party implementations of ECMA-335 4th Edition (and ECMA-334 4th Edition which defines the C# language) would render a pure ECMA-only runtime safe if it existed (which it does not); thirdly that without the protection offered by the Microsoft Community Promise, the source code licenses of Mono are irrelevant the patent risk renders the software non-Free.
It appears, unfortunately, that the community of Free Software Advocates don t actually understand what Free Software actually IS. That explains an awful lot, but should surprise nobody. So here s a lesson on what, exactly, is being advocated for.
The Free Software Foundation defines four Software Freedoms these are the minimum criteria required for something to be considered Free Software by the FSF:
experimental on this blog previously, but here s a
more thorough review of this katamari. Terminology: that s how
upstream calls a badged annual rollup release. In other words,
the server, drivers, client libraries, protocols, fonts, and basic applications
are all individually released, and a rollup of all those is released
from time to time, with a version for all of those components. The
term comes from
a series of video games. (Explanations
taken from a message by
Alan Coopersmith.)
Katamaris are released with a
consolidated changelog,
where all components and versions are listed. There s also a git
shortlog available for each component, pointing back to freedesktop s
git web interface for each and every
commit.
I modified the table of versions to get the following table, dropping
the X11R7.5 column, and adding a distribution one, so as to
mention where each component for X11R7.6 can be found. It boils down
mostly to:
experimental, built against
XServer 1.9.experimental while those with
fixes and low-impact changes went to unstable.unstable, they can t really break anything.experimental, others went to
unstable.| Type | Component | Version | Distribution |
|---|---|---|---|
| xserver | 1.9.3 | experimental | |
| app | bdftopcf | 1.0.3 | unstable |
| app | iceauth | 1.0.4 | experimental |
| app | luit | 1.1.0 | experimental |
| app | mkfontdir | 1.0.6 | unstable |
| app | mkfontscale | 1.0.8 | unstable |
| app | sessreg | 1.0.6 | unstable |
| app | setxkbmap | 1.2.0 | experimental |
| app | smproxy | 1.0.4 | experimental |
| app | x11perf | 1.5.2 | experimental |
| app | xauth | 1.0.5 | unstable |
| app | xbacklight | 1.1.2 | will be dropped |
| app | xcmsdb | 1.0.3 | experimental |
| app | xcursorgen | 1.0.4 | experimental |
| app | xdpyinfo | 1.2.0 | experimental |
| app | xdriinfo | 1.0.4 | experimental |
| app | xev | 1.1.0 | experimental |
| app | xgamma | 1.0.4 | experimental |
| app | xhost | 1.0.4 | experimental |
| app | xinput | 1.5.3 | unstable |
| app | xkbcomp | 1.2.0 | experimental |
| app | xkbevd | 1.1.2 | experimental |
| app | xkbutils | 1.0.3 | experimental |
| app | xkill | 1.0.3 | experimental |
| app | xlsatoms | 1.1.0 | unstable |
| app | xlsclients | 1.1.1 | experimental |
| app | xmodmap | 1.0.5 | experimental |
| app | xpr | 1.0.3 | will be dropped |
| app | xprop | 1.2.0 | experimental |
| app | xrandr | 1.3.4 | experimental |
| app | xrdb | 1.0.7 | experimental |
| app | xrefresh | 1.0.4 | experimental |
| app | xset | 1.2.1 | experimental |
| app | xsetroot | 1.1.0 | experimental |
| app | xvinfo | 1.1.1 | experimental |
| app | xwd | 1.0.4 | experimental |
| app | xwininfo | 1.1.1 | experimental |
| app | xwud | 1.0.3 | experimental |
| data | bitmaps | 1.1.1 | unstable |
| data | cursors | 1.0.3 | unstable |
| doc | xorg-docs | 1.6 | unstable |
| doc | xorg-sgml-doctools | 1.6 | unstable |
| driver | xf86-input-acecad | 1.4.0 | experimental |
| driver | xf86-input-aiptek | 1.3.1 | experimental |
| driver | xf86-input-evdev | 2.5.0 | experimental |
| driver | xf86-input-joystick | 1.5.0 | experimental |
| driver | xf86-input-keyboard | 1.5.0 | experimental |
| driver | xf86-input-mouse | 1.6.0 | experimental |
| driver | xf86-input-synaptics | 1.3.0 | experimental |
| driver | xf86-input-vmmouse | 12.6.10 | experimental |
| driver | xf86-input-void | 1.3.1 | experimental |
| driver | xf86-video-apm | 1.2.3 | experimental |
| driver | xf86-video-ark | 0.7.3 | experimental |
| driver | xf86-video-ast | 0.91.10 | dropped |
| driver | xf86-video-ati | 6.13.2 | experimental |
| driver | xf86-video-chips | 1.2.3 | experimental |
| driver | xf86-video-cirrus | 1.3.2 | experimental |
| driver | xf86-video-dummy | 0.3.4 | experimental |
| driver | xf86-video-fbdev | 0.4.2 | experimental |
| driver | xf86-video-geode | 2.11.10 | todo: needs upload |
| driver | xf86-video-glide | 1.1.0 | experimental |
| driver | xf86-video-glint | 1.2.5 | experimental |
| driver | xf86-video-i128 | 1.3.4 | experimental |
| driver | xf86-video-i740 | 1.3.2 | experimental |
| driver | xf86-video-intel | 2.13.0 | experimental |
| driver | xf86-video-mach64 | 6.8.2 | experimental |
| driver | xf86-video-mga | 1.4.13 | experimental |
| driver | xf86-video-neomagic | 1.2.5 | experimental |
| driver | xf86-video-newport | 0.2.3 | todo: needs upload |
| driver | xf86-video-nv | 2.1.18 | will be dropped |
| driver | xf86-video-r128 | 6.8.1 | experimental |
| driver | xf86-video-rendition | 4.2.4 | experimental |
| driver | xf86-video-s3 | 0.6.3 | experimental |
| driver | xf86-video-s3virge | 1.10.4 | experimental |
| driver | xf86-video-savage | 2.3.1 | experimental |
| driver | xf86-video-siliconmotion | 1.7.4 | experimental |
| driver | xf86-video-sis | 0.10.3 | experimental |
| driver | xf86-video-sisusb | 0.9.4 | experimental |
| driver | xf86-video-suncg14 | 1.1.1 | experimental |
| driver | xf86-video-suncg3 | 1.1.1 | experimental |
| driver | xf86-video-suncg6 | 1.1.1 | experimental |
| driver | xf86-video-sunffb | 1.2.1 | experimental |
| driver | xf86-video-sunleo | 1.2.0 | experimental |
| driver | xf86-video-suntcx | 1.1.1 | experimental |
| driver | xf86-video-tdfx | 1.4.3 | experimental |
| driver | xf86-video-tga | 1.2.1 | experimental |
| driver | xf86-video-trident | 1.3.4 | experimental |
| driver | xf86-video-tseng | 1.2.4 | experimental |
| driver | xf86-video-v4l | 0.2.0 | dropped |
| driver | xf86-video-vesa | 2.3.0 | experimental |
| driver | xf86-video-vmware | 11.0.3 | experimental |
| driver | xf86-video-voodoo | 1.2.4 | experimental |
| driver | xf86-video-wsfb | 0.3.0 | dropped |
| driver | xf86-video-xgi | 1.6.0 | dropped |
| driver | xf86-video-xgixp | 1.8.0 | dropped |
| font | fonts skipped | ||
| lib | libAppleWM | 1.4.0 | not for us |
| lib | libFS | 1.0.3 | unstable |
| lib | libICE | 1.0.7 | unstable |
| lib | libSM | 1.2.0 | unstable |
| lib | libWindowsWM | 1.0.1 | not for us |
| lib | libX11 | 1.4.0 | experimental |
| lib | libXScrnSaver | 1.2.1 | unstable |
| lib | libXau | 1.0.6 | unstable |
| lib | libXaw | 1.0.8 | unstable |
| lib | libXcomposite | 0.4.3 | unstable |
| lib | libXcursor | 1.1.11 | unstable |
| lib | libXdamage | 1.1.3 | unstable |
| lib | libXdmcp | 1.1.0 | unstable |
| lib | libXext | 1.2.0 | experimental |
| lib | libXfixes | 4.0.5 | unstable |
| lib | libXfont | 1.4.3 | experimental |
| lib | libXft | 2.2.0 | experimental |
| lib | libXi | 1.4.0 | experimental |
| lib | libXinerama | 1.1.1 | unstable |
| lib | libXmu | 1.1.0 | unstable |
| lib | libXpm | 3.5.9 | unstable |
| lib | libXrandr | 1.3.1 | unstable |
| lib | libXrender | 0.9.6 | unstable |
| lib | libXRes | 1.0.5 | unstable |
| lib | libXt | 1.0.9 | experimental |
| lib | libXtst | 1.2.0 | unstable |
| lib | libXv | 1.0.6 | unstable |
| lib | libXvMC | 1.0.6 | unstable |
| lib | libXxf86dga | 1.1.2 | unstable |
| lib | libXxf86vm | 1.1.1 | unstable |
| lib | libdmx | 1.1.1 | unstable |
| lib | libfontenc | 1.1.0 | unstable |
| lib | libpciaccess | 0.12.0 | unstable |
| lib | libxkbfile | 1.0.7 | unstable |
| lib | libxtrans | 1.2.6 | unstable |
| proto | applewmproto | 1.4.1 | not for us |
| proto | bigreqsproto | 1.1.1 | unstable |
| proto | compositeproto | 0.4.2 | unstable |
| proto | damageproto | 1.2.1 | unstable |
| proto | dmxproto | 2.3 | unstable |
| proto | dri2proto | 2.3 | unstable |
| proto | fixesproto | 4.1.2 | unstable |
| proto | fontsproto | 2.1.1 | unstable |
| proto | glproto | 1.4.12 | unstable |
| proto | inputproto | 2.0.1 | unstable |
| proto | kbproto | 1.0.5 | unstable |
| proto | randrproto | 1.3.2 | unstable |
| proto | recordproto | 1.14.1 | unstable |
| proto | renderproto | 0.11.1 | unstable |
| proto | resourceproto | 1.1.1 | unstable |
| proto | scrnsaverproto | 1.2.1 | unstable |
| proto | videoproto | 2.3.1 | unstable |
| proto | windowswmproto | 1.0.4 | not for us |
| proto | xcmiscproto | 1.2.1 | unstable |
| proto | xextproto | 7.1.2 | unstable |
| proto | xf86bigfontproto | 1.2.0 | unstable |
| proto | xf86dgaproto | 2.1 | unstable |
| proto | xf86driproto | 2.1.0 | unstable |
| proto | xf86vidmodeproto | 2.3 | unstable |
| proto | xineramaproto | 1.2 | unstable |
| proto | x11proto | 7.0.20 | unstable |
| util | makedepend | 1.0.3 | unstable |
| util | macros | 1.11.0 | unstable |
| xcb | pthread-stubs | 0.3 | unstable |
| xcb | libxcb | 1.7 | experimental |
| xcb | proto | 1.6 | unstable |
readdir(), which may lead to I/O on the directory for the same reasonread()/write() on a file, which may lead to I/O on the file if it is not in the page cachemmap()ed area of memory, which may lead to I/O on the underlying file if it is not in the page cachestrace) allowing to track what a program is doing with files and directories, but that doesn t tell you if you re actually hitting the disk or not. There are also various ways to track block I/O (e.g. blktrace) allowing to track actual I/O on the block devices, but it is then hard to back-track what part of which files or directories these I/O relate to. To the best of my knowledge, there are unfortunately no tools to do such tracking easily.
Systemtap, however, allows to access the kernel s internals and to gather almost any kind of information from any place in a running kernel. The downside is that it means you need to know how the kernel works internally to gather the data you need ; that will limit the focus of this post.
I had been playing, in the past, with Taras script, which he used a while ago to track I/O during startup. Unfortunately, it became clear something was missing in the picture, so I had to investigate what s going on in the kernel.
Setting up systemtap
On Debian systems, you need to install the following packages:
stapdev and stapusr groups, if you don t want to run systemtap as root. If, like in my case, you don t have enough space left for all the files in /usr/lib/debug, you can trick dpkg into not unpacking files you don t need:
# echo path-exclude /usr/lib/debug/lib/modules/*/kernel/drivers/* > /etc/dpkg/dpkg.cfg.d/kernel-dbg
The file in /etc/dpkg/dpkg.cfg.d can obviously be named as you like, and you can adjust the path-exclude pattern to what you (don t) want. In the above case, kernel drivers debugging symbols will be ignored. Please note that this feature requires dpkg version 1.15.8 or greater.
Small digression
One of the first problems I had with Taras script is that systemtap would complain that it doesn t know the kernel.function("ext4_get_block") probe. It is due to a very unfortunate misfeature of systemtap, where the kernel.* probes refer to whatever is in the vmlinux image. Modules probes have a separate namespace, namely module("name").*.
So for the ext4_get_block() function, this means you need to set a probe for either kernel.function("ext4_get_block") or module("ext4").function("ext4_get_block"), depending how your kernel was compiled. And you can t even use both in your script, because systemtap will complain about either being an unknown probe
Tracking the right thing
I was very recently pointed to a Red Hat document containing 4 useful systemtap scripts ported from dtrace, which gives me a good occasion to explain the issue at hand with the first of these scripts.
This script attempts to track I/O by following read() and write() system calls. Which is not tracking I/O, it is merely tracking some system calls (Taras script had the same kind of problem with read()/write() induced I/O). You could just do the very same with existing tools like strace, and that wouldn t even require some system privileges.
To demonstrate the script doesn t actually track the use of storage devices as the document claims, consider the following source code:
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
/* Ensure the resulting binary is decently sized */
const char dummy[1024 * 1024] = "a";
int main(int argc, char *argv[])
struct stat st;
char buf[65536];
int i, fd = open(argv[0], O_RDONLY);
for (i = 0; i < 100000; i++)
read(fd, buf, 65536);
lseek(fd, 0, SEEK_SET);
read(fd, buf, 65536);
lseek(fd, 512 * 1024, SEEK_SET);
close(fd);
return 0;
All it does is reading some parts of the executable a lot of times (notice the trick to make the executable size at least 1MB). Not a lot of programs will actually do something as bold as reading the same data again and again (though we could probably be surprised), but this easily points the problem. Here is what the output of the systemtap script looks like for this program (stripping other unrelevant processes):
process read KB tot write KB tot
test 400002 25600001 0 0
Now, do you really believe 25MB have actually been read from the disk? (Note that the read() count seems odd as well, as there should only be around 200000 calls)
Read-ahead, page cache and mmap()
What the kernel actually does is that a read() on a file is going to check the page cache first. If there is nothing corresponding to the read() request in the page cache, then it goes down to the disk, and fills page cache. But as loading only a few bytes or kilobytes from the disk could be wasteful, the kernel also reads a few more blocks ahead, apparently with some heuristic.
But read() and write() aren t the sole way a program may hit the disk. On UNIX systems, a file can be mapped in memory with the mmap() system call, and all accesses in the memory range corresponding to this mapping will be reflected on the file. There are exceptions, depending on how the mapping is established, but let s keep it simple. There is a lot of litterature on the subject if you want to document yourself on mmap().
The way the kernel will read from the file, however, is quite similar to that of read(), and uses page cache and read ahead. The systemtap script debunked above doesn t track these.
I ll skip write accesses, because for now, they haven t been in my scope.
Tracking some I/O with systemtap
What I ve been trying to track so far has been limited to disk reads, which happen to be the only accesses occurring on shared library files. Programs and shared libraries are first being read() from, so that the dynamic linker gets the ELF headers and knows what to load, and then are mmap()ed following PT_LOAD entries in these headers.
As far as my investigation in the Linux kernel code goes, fortunately, both accesses, before they end up actually hitting the disk, go through the __do_page_cache_readahead kernel function (this function was tracked in Taras script). Unfortunately, while it is called with an offset and a number of pages to read for a given file, it turns out the last pages in that number are not necessarily being read from the disk. I don t know for sure, because the latter had an effect on my observations, but some might even already be in the page cache.
Going further down, we reach the VFS layer, which ends up being file-system specific. But fortunately, a bunch of (common) file-systems actually share page mapping code, and commonly use the mpage_readpage and mpage_readpages functions, both calling do_mpage_readpage to do the actual work. And this function seems to be properly called only once for each page not in the page cache already.
If my reading of the kernel source is right, this however is not really where it ends, and do_mpage_readpage doesn t actually hit the disk. It seems to only gather some information (basically, a mapping between storage blocks and memory) that is going to be submitted to the block I/O layer, which itself may do some fancy stuff with it, such as reordering the I/Os depending on other requests it got from other processes, the position of the disk heads, etc.
And when I say do_mpage_readpage doesn t actually hit the disk, I m again simplifying the issue, because it actually might, as there might be a need to read some metadata from the disk to know where some blocks are located. But tracking metadata reads is much harder, and I haven t investigated it.
Anyways, skipping metadata, going further down after do_mpage_readpage is hard because it s difficult to back-track which block I/O is related to which read-ahead, corresponding to what read at what position in which file. do_mpage_readpage already has part of this problem because it is not called with any reference to the corresponding file. But __do_page_cache_readahead is.
So knowing all the above, here is my script, the one I used to get the most recent Firefox startup data you can find in my last posts:
global targetpid;
global file_path;
probe begin
targetpid = target();
probe kernel.function("__do_page_cache_readahead")
if (targetpid == pid())
file_path[tid()] = d_path(&$filp->f_path);
probe kernel.function("do_mpage_readpage")
if (targetpid == pid() && (tid() in file_path))
now = gettimeofday_us();
printf("%d %s %d\n", now, file_path[tid()], $page->index*4096);
probe kernel.function("__do_page_cache_readahead").return
if (targetpid == pid())
delete file_path[tid()];
This script needs to be used with a command given to systemtap, with the -c option, such as in the following command line:
# stap readpage.stp -c firefox
Each line of output represents a page (i.e. 4,096 bytes) being read, and contains a timestamp, the name of the file being read, and the offset in the file. As discussed above, do_mpage_readpage is not really the place the I/O actually occurs, so the timestamps are not entirely accurate, and the actual read order from disk might be slightly different, but it still is a quite reliable view in that the result should be reproducible with the same files even when they re not located on the same blocks on disk, and provided their page cache status is the same when starting the program.
This systemtap script ignores writes, as well as metadata accesses (including but not limited to inodes, dentries, bitmap blocks and indirect blocks). It also doesn t account accesses to files opened with the O_DIRECT flag or similar constructs (raw devices, etc.)
Read-ahead in action
Back to the small example program, my systemtap script records 102 page accesses, that is, 417,792 bytes, much less than the actual binary size on my system (1,055,747 bytes). We are still far from the 25MB figure from the other systemtap script. But we are also far from the 128KiB the program actively reads (64KiB twice, leaving a hole between the two blocks).
At this point, it is important to note that the ELF headers and program code all fit within a single page (4 KiB), and following the 1MiB section corresponding to the dummy variable, there are only 5,219 bytes of other ELF sections, including the .dynamic section. So even counting everything the dynamic linker needs to read, and the program code itself, we re still far from what my systemtap script records.
Grouping consecutive blocks with consecutive timestamps, here is what can be observed:
| Offset | Length |
|---|---|
| 0 | 16,384 |
| 983,040 | 73,728 |
| 16,384 | 262,144 |
| 524,288 | 65,536 |
read()s ; if you want to reproduce at home, I suggest you also use my page cache flush helper)
As earlier investigations showed, the first accesses by the dynamic loader are to read the ELF headers and .dynamic section. As mentioned above, these are really small. Yet, the kernel actually reads much more: 16KiB at the beginning of the file when reading the ELF headers, and 72KiB at the end when reading the .dynamic section. Subsequent accesses from the dynamic loader are obviously already covered by these accesses.
Next accesses are those due to the program itself. The program actively reads 64KiB at the beginning of the file, then 64KiB starting at offset 524,288. For the first read, the kernel already had 16KiB in the page cache, so it didn t read them again, but instead of reading the remainder, it reads 256KiB. For the second read, however, it only reads the requested 64KiB.
As you can see, this is far from being something like you wanted n KiB, I ll read that fixed amount now .
Further testing with different read patterns (e.g. changing the hole size, read size, or reading from the dummy variable directly instead of read()ing the binary) is left as an exercise to the reader.
After previous series of posts about Gammu usage in proprietary software, finding culprit and getting the sources I got number of questions and suggestions. So what are the suggestions?
Lesson I've learned is that even though the website seems to be dead, the project itself does not have to be. This is what I thought about http://gpl-violations.org/ and I was proven wrong and these guys are now looking at my case.
Another option is Software Freedom Law Center - http://www.softwarefreedom.org/. I've contacted them from the very beginning (about year ago) and got some useful hints, though now my contact seems to be gone (or simply too busy).
FSF also provides information how to proceed in case of license violation.
Maybe these hints will be also useful for somebody else and I hope they will help me as well.
Filed under: English Gammu Gpl 0 comments Flattr this!
After finding that Sonim's software uses GPL licensed Gammu, the obvious step was to ask them for sources of the software. They quickly transferred their responsibility to company which made software for them - A&W (Anwsoft).
It took some iterations to explain them that I'm pretty sure that their software is based on Gammu and finally they gave up pointing to some external contributor for being guilty of this:
Due to the product was developed years ago, and the source code was bought from a SOHO programmer on the first beginning, so we didn t notice it included some open source code inside.The good thing in the same thing was that they were willing to cooperate:
We are willing to cooperate with you to follow GPL License and provide corresponding sources.As it turned out in upcoming communication, they didn't have (and still don't have) idea what GPL license contains and what they should publish. But that's story for the next post.
Filed under: English Gammu Gpl 0 comments Flattr this!
WordPress has many alternate built-in feeds: per category, per tag, per author, per search-keyword. But in some cases, you want feeds built with some more advanced logic. Let s look at the available options.
WordPress advanced built-in feeds
You can create feeds for unions or intersections of tags, you just have to use a URL like /tag/foo,bar/feed/ (all articles tagged with foo or bar) or /tag/foo+bar/feed/ (all articles tagged with foo and bar).
You can also have feeds excluding a category, although that requires you to know the category identifier (and hardcode it in the URL like this: /?feed=rss2&cat=-123 where 123 is the category id that you want to exclude).
But there s no simple way to have a feed that excludes articles with a given tag. The best solution found involves creating a custom feed. I ll show you a variation of this below.
Creating a custom feed
<?php include('wp-includes/feed-rss2.php'); ?>
/feed/myfeed/ (or /?feed=myfeed). It s a complete feed like the main one.<?php global $wp_query; $tag = get_term_by("slug", "foo", "post_tag"); $args = array_merge( $wp_query->query, array('tag__not_in' => array($tag->term_id)) ); query_posts($args); include('wp-includes/feed-rss2.php'); ?>
<?php global $wp_query; $excluded = array(); $args_excluded = array( 'numberposts' => -1, 'meta_key' => 'no_syndication', 'meta_value' => 1, 'post_type' => 'post', 'post_status' => 'published' ); foreach (get_posts($args_excluded) as $item) $excluded[] = $item->ID; $args = array_merge( $wp_query->query, array('post__not_in' => $excluded) ); query_posts($args); include('wp-includes/feed-rss2.php'); ?>
<?php function myfeed_add_footer($content) return $content . "<hr/>My footer here"; add_filter('the_content_feed', 'myfeed_add_footer'); include('wp-includes/feed-rss2.php'); ?>
One comment Liked this article? Click here. My blog is Flattr-enabled.
json module in python,
this requires the client to buffer all the data in memory for decoding, as the
JSON result would be something like this:
[
info for package 1 ,
info for package 2 ,
...dozens of megabytes...
info for package 30000 ,
...
]
However, it would be reasonable to engineer things so that the client can
process packages one at a time, as they are produced. This can dramatically
reduce client memory usage, as well as remove a large latency between the
start of the request and the start of processing.
One trivial idea would be to just send JSON objects one after the other, and
sort of call load multiple
times.
It doesn't work:
import json
from cStringIO import StringIO
a = StringIO()
json.dump( 1:3 , a)
json.dump( 2:4 , a)
a.reset()
print a.getvalue()
print json.load(a)
gives:
$ python z1.py
"1": 3 "2": 4
Traceback (most recent call last):
File "z1.py", line 8, in <module>
print json.load(a)
File "/usr/lib/python2.6/json/__init__.py", line 267, in load
parse_constant=parse_constant, **kw)
File "/usr/lib/python2.6/json/__init__.py", line 307, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.6/json/decoder.py", line 322, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 8 - line 1 column 16 (char 8 - 16)
And the json module documentation
does not provide any way of telling the "stream" decoder to just stop parsing
after the first valid object.
An alternative can be to use chunked transfer
encoding and transfer
each JSON object in a separate HTTP chunk. It would add the overhead of a
little HTTP header per JSON object, which could be significant when generating
lots of small JSON objects, but it would be an implementation that strictly
follows HTTP and JSON standards to the letter in a clean way.
Except:
we built a streaming JSON app as a part of our platform. However, we
didn't stream a single JSON object as that was a bit cumbersome. When
having syntax like:
[
<json-obj1>,
<json-obj2>,
....
<json-objN>
]
The reader has some problems. Should it read the whole stream to find
the closing bracket ] even if the stream would me tens of megabytes?
Should it try to split on , and parse single objects? What if the
objects contain , so should there be some regexp magic?
We ended up streaming separate JSON objects separated by newlines
(\n). This way the reader can read until hitting \n or end of stream
and then split the result on newlines. The new stream looked like
this:
<json-obj1>\n
<json-obj2>\n
...
<json-objN>\n
This way we could efficiently stream hundreds of thousands of JSON
objects from server to client without reserving a load of memory. For
the WSGI part how to do this, the best would probably to do a
generator that would yield a single JSON object with the newline (we
didn't use WSGI back then). Reading can be done using any reader
capable of handling streams. We used pycurl for reading, but I can't
really recommend it as it is way too complicated for a simple task
like this :p
Hopefully this helps!
This means that if the client has no access to a JSON reader that supports a
stream of concatenated toplevel objects, they can still trivially code it on
top of any JSON library. This means that working clients can be written based
just on Squeeze's python standard library. That's what I'm going to do; I'll
probably implement it as a separate 'jsons' output format for DDE, because
producing a JSON response with multiple toplevel obejcts somehow breaks the
JSON standard.
Thanks to all who provided this excellent information!
the release team has started
to usertag [0] the remaining RC bugs yeah, another step towards the
release!
Dear Lazyweb,
Today I bought me a Canon IXUS 130 and was quite disappointed to see that it couldn t properly connect to my Debian/Sid machine via USB. Apparenty the camera is not recognized as a USB Mass Storage Device but utilizes PTP. I upgraded to libgphoto2 (2.4.10.1-3) from experimental and added a proper udev rule with vendor- and product-id but it did not help. Is there anything more I can try?
Update: Accessing the camera actually works, even with ligbphoto2 (2.4.6) from unstable. I can access the camera with gphoto2 and download pictures (but not with KDE s filemanager). My problem was that I had rhythmbox running and the camera was automatically mounted by it as a media device. When KDE s filemanager or gphoto2 tried to access the camera I got an error like: ( Could not lock the device ): Camera is already in use., which is probably also a bug. Closing rhythmbox solved the issue and I was able to download images with gphoto2.
After several months of leisurely development
(I've read through everything on the Internet several times,
and notified everyone who was wrong),
I have finally gotten obnam, my backup application,
into a state where it successfully backs up my laptop's hard disk
to a USB disk.
I therefore declare it to be perfe... no, wait, I don't.
It's slow. It's probably buggy in ways that will make you want to
abandon computers forever. It's also slow. And buggy. Did
I mention it is slow, making backups at only a few megabytes per
second?
Disclaimers aside, I am happy to have gotten obnam to this stage.
It's not nearly ready, but it's getting along nicely.
If you've been curious about obnam ever since I first mentioned it
in 2007, now might be a good time to try it out. I would be very
interested in hearing any feedback.
Obnam is implemented using copy-on-write B-trees, and I've
also released my B-tree implementation.
See the NEWS file in each source tree for information for what's
changed since the previous release.
Links:
I have made Debian packages of obnam, btree, and some of my other
stuff that they need, for all, amd64, and i386 architectures.
The repository is at http://code.liw.fi/debian/,
so add this to your sources.list if you want to use that:
deb http://code.liw.fi/debian squeeze main
Note, however, that I do not guarantee that this repository will be
in any useful state at any given time. I use it, and rely on it, and
will fix things when they bother me, but that's all the guarantee I
give. (Do you get the impression I've read too many contracts?)
Once obnam is ready, and Debian squeeze is released, I'll upload
it to Debian, and then you'll get it for any architecture Debian
runs one. If anyone wants to help me maintain the packages for
Debian, please e-mail me.
If, on the other hand, you'd like to help make obnam faster, or
better, the bug tracker has some pointers. Right now speed is
perhaps the biggest problem. The B-tree library needs optimizing,
as does obnam itself. And the LRU cache I use.
The worst missing feature is encryption support.
I do my backups to a local hard disk, which is full-disk encrypted,
which is why I haven't cared about implementing encryption yet.
Also, I need to design a good way to manage keys, etc. Help with
that would be quite welcome.
Next.