2011-01-01から1年間の記事一覧

SystemtapでSleep sort

なんか書かねばならぬ気がしたのでやってしまった。 probe begin { foreach(i in argv) system("sleep " . argv[i]) } probe syscall.nanosleep.return { ctsk = task_current(); ptsk = task_parent(ctsk); if (task_execname(ctsk) != "sleep" || task_exe…

fizzbuzzっぽいもの

これだけだと面白くないので、fizzbuzzモードを追加した global fillstr; global candidate; global readpos; %{ #include <linux/string.h> %} function fizzbuzz:string (num:long) { s = "" if (num % 3 == 0) s = "fizz" if (num % 5 == 0) s = s . "buzz" return s } fu</linux/string.h>…

/dev/zeroに対抗して/dev/0を作る

読み出したら zero fillならぬ0 fillをするデバイスを作る。とはいっても、デバイスファイルの登録とか面倒だし、SystemTapでちょっと小細工をする。 出来たのが以下。 global fillstr; global candidate; global readpos; %{ #include <linux/string.h> %} function basenam</linux/string.h>…

SystemTapでfizzbuzz

とりあえず、advent calenderに穴を開けたくないので、何か書こうと思っていろいろ考えてみたが、あまり手をかける余裕もないので、SystemTapでちょっとしたものを書くことにする。

stapgamesをgithubに移したよ

すっかり放置していたstapgamesをgithubに移すことにした。 いろいろ用意を整えて、さあ移行するか!と思ったら、・・・subversionから直接インポートできるのか。(´・ω・`) とりあえず、https://github.com/mhiramat/stapgamesで公開しておきました。ま…