Monday, April 30, 2007

Yokohama-ya

Yokohama-ya (横濱屋) is a Ramen (Chinese Noodle) restaurant chain. They have about 15 restaurants in mainly Tokyo and Kanagawa. In this sense, Yokohama-ya is different from small but good stand-alone Ramen restaurants along Koganei Kaido avenue.

My wife and I had already finished evacuating our fridge today before our trip to our home towns from tomorrow, thus tonight dinner was Ramen, again. :o

Here is my choice.

Chives and Beansprouts Ramen with sliced pork.
I felt it's about 1.5 starts. :(

Sunday, April 29, 2007

Interface Magagine '07/06

I bought '07/06 issue of the Interface Magagine.
http://www.cqpub.co.jp/interface/
http://www.cqpub.co.jp/interface/contents/2007/200706.htm

Yes, it's the magagine that gave me an NEC V850 CPU board. :)

When I read the previous issue in detail last month, I felt it's too elementary because example programs are:
  • Blinking an LED on the board
  • Sending a "Hello, World!" message infinitely
But, there are practical application examples such as a line-tracing car controlled by the V850 board in this month issue, and finally that makes sense for me. Maybe the editors were too busy for preparing the giveaway. :o

BTW, one of the article was about a u-ITRON (TOPPERS) port for the board.
I'm wondering if I should go ahead for another program monitor...
Hey, Furukawa-san, are you reading?
What do you think about? :)

Smetana

Today, we had a dinner at this Russian restaurant, Smetana (Сметана, スメターナ).


Appetizer.



The drink in white is a glass of Kumis (Кумыс) .
http://en.wikipedia.org/wiki/Kumis
http://ru.wikipedia.org/wiki/%D0%9A%D1%83%D0%BC%D1%8B%D1%81



Borsch



The main dish, Kievski escallop.
Also a glass of Nemiroff Honey Pepper Ukrainian Vodka. :)

I like the restaurant, but my wife says she prefers to Sungari in Shinjuku, Tokyo.

Friday, April 27, 2007

14 Weeks


In Japan, a big vacation season is beginning from tomorrow, and my wife had a medical check before the vacation.

Now, thatsdone 3.0 is 14 weeks and 16cm tall without any troubles. :)

Today, the baby seemed to be sleeping and kept still at first, but after a few minutes of the check, woke up and was waving its hands and legs.
Well, I'm not sure if the baby was saying, "Don't wake me up!" :o)

Thursday, April 26, 2007

A Farewell Party

In Japan, usually March and September are farewell party seasons. So, in the beginning of this April, there was a organization restructuring at work and I had several farewell and welcome parties as usual.
But, last week I got a bit shocking news that a colleague of mine would leave our organization by the end of this April. I'm not sure why it's in the end of April not March. Could be because of his new organization's convenience. Anyway, I hope he and his family live in happy harmony there, his wife's home town and also close to his home town. But, what I'm wondering is how the remaining people can fill the role which he did for these two years.

Well, the party was held at Inataya (稲田屋), Shinagawa.
http://www.inataya.co.jp/store/sinagawa/index.html



It's an average class Japanese style pub, and I drank a bit too much Beer and Japanese Sake there. So, I fell over after leaving the pub, and what is worse, I hit my legs hard with something. My legs are still aching. :(
Two my bosses witnessed that. :o

BTW, I didn't know it's "Inata-ya" not "Inada-ya." :o

Monday, April 23, 2007

Linux Kernel Linkage

I have to confess that I didn't know Linux kernel (general?) linkage convention well till the last Sunday. :(

I've been feeling strange we often get unknown function call entries in
kernel stack traces like the below example when we are running Linux on
x86 or x86_64 architecture. Among the stack trace below, entries in red
cannot be found even if you looked into the source code in detail.

crash> bt
PID: 2115 TASK: ffff81007f0ff7d0 CPU: 0 COMMAND: "sendmail"
#0 [ffff810078269950] schedule at ffffffff80260ab2
#1 [ffff810078269a30] schedule_timeout at ffffffff80261416
#2 [ffff810078269a80] do_select at ffffffff80211369
#3 [ffff810078269b70] proc_alloc_inode at ffffffff802f48dc
#4 [ffff810078269b80] alloc_inode at ffffffff80225746
#5 [ffff810078269bb0] inotify_d_instantiate at ffffffff802e6a70
#6 [ffff810078269bd0] d_rehash at ffffffff80240566
#7 [ffff810078269bf0] proc_lookup at ffffffff802277cd
#8 [ffff810078269c20] proc_root_lookup at ffffffff80254ddd
#9 [ffff810078269c40] do_lookup at ffffffff8020cade
#10 [ffff810078269c70] dput at ffffffff8020cff4
#11 [ffff810078269c90] __link_path_walk at ffffffff8020a196
#12 [ffff810078269cf0] vsnprintf at ffffffff80219e0f
#13 [ffff810078269d00] link_path_walk at ffffffff8020e776

#14 [ffff810078269d90] core_sys_select at ffffffff802d8dd8
#15 [ffff810078269e00] __next_cpu at ffffffff8033bf39
#16 [ffff810078269e10] nr_running at ffffffff802861c5
#17 [ffff810078269e30] loadavg_read_proc at ffffffff802f7be7
#18 [ffff810078269e60] lock_kernel at ffffffff802627fb
#19 [ffff810078269e80] de_put at ffffffff802f480b

#20 [ffff810078269f20] sys_select at ffffffff80216185
#21 [ffff810078269f80] system_call at ffffffff8025c00e

Finally, I understood the reason.

Below code chunk is excerpted from 'arch/x86_64/kernel/traps.c' of RHEL5 Update 0 kernel (based on linux-2.6.18). The function 'dump_trace' is the one which prints out stack traces, and note that lines from 269 to 272 say something strange. That means 'dump_trace' cannot determine boundaries of stack frames strictly. Thus, taking a stack area as if it's an array of pointers, the function prints an entry into the stack trace if the value looks like an in-kernel function. :(
242 void dump_trace(struct task_struct *tsk,
struct pt_regs *regs, unsigned long * stack,
243 struct stacktrace_ops *ops, void *data)
244 {
245 const unsigned cpu = smp_processor_id();
246 unsigned long *irqstack_end =
(unsigned long *)cpu_pda(cpu)->irqstackptr;
247 unsigned used = 0;
248
[snip]
259 /*
260 * Print function call entries within a stack. 'cond' is the
261 * "end of stackframe" condition, that the 'stack++'
262 * iteration will eventually trigger.
263 */
264 #define HANDLE_STACK(cond) \
265 do while (cond) { \
266 unsigned long addr = *stack++; \
267 if (kernel_text_address(addr)) { \
268 /* \
269 * If the address is either in the text segment of the \
270 * kernel, or in the region which contains vmalloc'ed \
271 * memory, it *may* be the address of a calling \
272 * routine; if so, print it so that someone tracing \
273 * down the cause of the crash will be able to figure \
274 * out the call path that was taken. \
275 */ \
276 ops->address(data, addr); \
277 } \
278 } while (0)
279
280 /*
281 * Print function call entries in all stacks, starting at the
282 * current stack address. If the stacks consist of nested
283 * exceptions
284 */
285 for (;;) {
286 char *id;
287 unsigned long *estack_end;
288 estack_end = in_exception_stack(cpu, (unsigned long)stack,
289 &used, &id);
290
291 if (estack_end) {
292 if (ops->stack(data, id) <>stack(data, "");
296 /*
297 * We link to the next stack via the
298 * second-to-last pointer (index -2 to end) in the
299 * exception stack:
300 */
301 stack = (unsigned long *) estack_end[-2];
302 continue;
303 }

304 if (irqstack_end) {
[snip]
323 }
324 break;
325 }
The reason comes from the linkage convention of Linux (x86 and x86_64, at least).

In those architectures, callee functions do NOT save any registers except ones which the callees destroy. Even the stack pointer (%sp or %rsp register). Only return addresses are saved automatically by 'call' instructions.

That's why, different from other architectures/operating systems like SPARC/Solaris, it's difficult to track back the caller functions correctly among the stack area in case of Linux/x86(x86_64). :(

Of couse, this must come from performance consideration. But still, it makes trouble shootings difficult, I think. :(

Friday, April 20, 2007

Linux Function Call Catcher

I wrote another stupid device driver, 'allie.'

'allie' uses kprobe which is a built-in feature in RHEL4 or later.
If you want to know call trees of a particular in-kernel function such as 'ip6_xmit()' but don't want to recompile the entire kernel, 'allie' will help you very much.
It's available here under GPL2 as usual. :)

When you want to know function call graphs of a particular in-kernel function, for example, 'mpage_bio_submit', then you can see them by installing 'allie' with insmod parameters like the following:

# insmod allie.ko symbol= mpage_bio_submit count=3

Here are several notes.
  1. Lines in red below are kprobe and allie origin trace entries.
  2. Under Linux(x86 and x86_64) environment, we often see actually unrelated function call entries because of Linux linkage convention as I wrote here. Don't be confused.
  3. count=3 means to show only 3 stack traces because in-kernel functions are usually called very frequently and your /var/log/messages could be full.
  4. kprobe uses 'int3', thus we cannot catch function calls under interrupt disabled state.
The below example is excerpted from a log file included in allie-1.0.tar.gz.
-----
Apr 19 20:06:59 rhel5 syslogd 1.4.1: restart.
[snip]
Apr 19 20:47:14 rhel5 kernel: allie_init: called
Apr 19 20:47:14 rhel5 kernel: allie_init: flags=00000000, action=1, count=3, verbose=0
Apr 19 20:47:14 rhel5 kernel: allie_init: symbol=mpage_bio_submit
Apr 19 20:47:42 rhel5 kernel: [] allie_pre_handler+0x3b/0x61 [allie]
Apr 19 20:47:42 rhel5 kernel: [] kprobe_exceptions_notify+0x187/0x3dc
Apr 19 20:47:42 rhel5 kernel: [] notifier_call_chain+0x19/0x29
Apr 19 20:47:42 rhel5 kernel: [] do_int3+0x39/0x6a
Apr 19 20:47:42 rhel5 kernel: [] int3+0x1e/0x24

Apr 19 20:47:42 rhel5 kernel: [] mpage_bio_submit+0x1/0x1d
Apr 19 20:47:42 rhel5 kernel: [] mpage_readpages+0xec/0xf9
Apr 19 20:47:42 rhel5 kernel: [] get_page_from_freelist+0x96/0x310
Apr 19 20:47:42 rhel5 kernel: [] common_interrupt+0x1a/0x20
Apr 19 20:47:42 rhel5 kernel: [] ext3_readpages+0x0/0x15 [ext3]
Apr 19 20:47:42 rhel5 kernel: [] ext3_readpages+0x0/0x15 [ext3]
Apr 19 20:47:42 rhel5 kernel: [] __do_page_cache_readahead+0x11f/0x1c6
Apr 19 20:47:42 rhel5 kernel: [] ext3_get_block+0x0/0xbd [ext3]
Apr 19 20:47:42 rhel5 kernel: [] blockable_page_cache_readahead+0x46/0x99
Apr 19 20:47:42 rhel5 kernel: [] page_cache_readahead+0xb3/0x178
Apr 19 20:47:42 rhel5 kernel: [] do_generic_mapping_read+0x137/0x468
Apr 19 20:47:42 rhel5 kernel: [] __generic_file_aio_read+0x16f/0x1b6
Apr 19 20:47:42 rhel5 kernel: [] file_read_actor+0x0/0xd1
Apr 19 20:47:43 rhel5 kernel: [] generic_file_aio_read+0x3b/0x42
Apr 19 20:47:43 rhel5 kernel: [] do_sync_read+0xb6/0xf1
Apr 19 20:47:43 rhel5 kernel: [] autoremove_wake_function+0x0/0x2d
Apr 19 20:47:43 rhel5 kernel: [] sched_balance_self+0x1bf/0x208
Apr 19 20:47:43 rhel5 kernel: [] do_sync_read+0x0/0xf1
Apr 19 20:47:43 rhel5 kernel: [] vfs_read+0x9f/0x141
Apr 19 20:47:43 rhel5 kernel: [] kernel_read+0x32/0x43
Apr 19 20:47:43 rhel5 kernel: [] prepare_binprm+0xc7/0xcc
Apr 19 20:47:43 rhel5 kernel: [] do_execve+0xf6/0x1f5
Apr 19 20:47:43 rhel5 kernel: [] sys_execve+0x2a/0x4a
Apr 19 20:47:43 rhel5 kernel: [] syscall_call+0x7/0xb

(Updated slightly on April 29, 2007)

Guts Ramen

Guts Ramen is another Chinese noodle restaurant close to my house.
It's closer to my house than Menya Kotaro, and actually I and my wife go to Guts most frequently among Chinese noodle restaurants along Koganei-Kaido avenue. :)

http://tokyo.gourmet.livedoor.com/restaurant/info/18934.html

They offer very good pork bone based soup Chinese noodles and very soft sliced roast porks, and both my wife and I like them. :)
In addition, Guts is unique for its advertising display and chairs. Especially, chairs look like piggs and kids must like them. :)

Here is tonight dinner. :o


Wraplings, and Chinese noodle with sliced roast pork and sliced green onion.

Wednesday, April 18, 2007

NEC V850 CPU Board Power ON

Well, it's about the V850 CPU board I wrote before.
As I'm not good at soldering, I asked one of my colleagues to assemble separated parts including a USB connector, several external pins and a crystal module.
Today, finally the guy gave me completed board, and it's the Power ON ritual(?) day for the V850 board. It worked without any trouble, and you can see its LED on the upper left corner is lighting.
Thanks, Furukawa-san! :)

Now, I'm considering what I should do next, but I guess I'd write a small monitor program.

BTW, I found an excellent report page about the board. (Japanese only, at this moment)
I'm a pure software guy, and so I cannot compete with him. :o


Interface Magazine, May 2007
CPU : NEC V850 (uPD70F3716GC, 20MHz) Internal Flash ROM 256KB, SRAM 24KB


Monday, April 16, 2007

Another Stupid Device Driver

I wrote another stupid Linux device driver. :o
This time the driver uses netfilter and can catch various conditions of TCP/IP(v4, at this moment) protocol stack. I named it 'holden'. :)
It's available here.

Well, I heard Linux TCP/IP stack sometimes sent out TCP segments with both RST and ACK bits are ON, and I wanted to catch such an event. This is why I did this small work.
Anyway, it's just a relaxation before going into RFC 793 deeply.

Wednesday, April 11, 2007

An in-kernel Event Catcher

I updated the stupid device driver for Linux and made it public here.

Now the driver can:
  1. Monitor context switches rate
  2. Monitor CPU consumption rate
and cause a panic, and thus using it with your favorite crash dump utility, you can take good information about your trouble.

Here is a TODO list.
  1. Make it a bit more foolproof.
  2. Add interrupt rate monitoring. (Straight forward)
  3. Add lock contention monitoring, if possible. (I'm not sure.)
  4. Add monitoring features for other performance sensitive quantities. (Any idea?)
  5. Add some more documentation.
Well, it will be a part of the project I mentioned yesterday.

Tuesday, April 10, 2007

SourceForge

On April 6, I applied a small new software project creation for SourceForge.net and I've been waiting if the application was approved or not for several days.

I know it was Friday April 6 and it would be at most Tuesday (in Japan) or so. But, I found there was an approval mail on my SourceForge account which was sent out to me on April 6(!?). :(
Why was not the mail forwarded to me???
But anyway, I'm going to upload the programs I wrote recently like this (or this) and form a small project from this week end. :)

What kind of project?
Well, stay tuned. :o

Monday, April 09, 2007

Debian GNU/Linux 4.0

I didn't know Debian GNU/Linux 4.0 (etch) was released yesterday. Actually, the release was earlier than my expectation. :o

I've worked on a Debian based system for recent 1.5 years, but the project was mothballed, AGAIN! :(

Hey Mr. T, are you reading?
You have to let us make our works be public!
What in the world do you want me to do? :(

12 Weeks



It's 12 weeks and thatsdone 3.0 is about 6cm tall.
Oh well, but accoding to my wife, 6cm does not include its legs.
Today, she got also a 25min video, and I saw the baby is waving its hands and legs for the first time. It's like dancing. :)
I hope this baby can be born without any trouble...

Sunday, April 08, 2007

Bibimbap

Bibimbap is a popular Korean cuisine in also Japan.
It's a favorite dish of my wife, and here is tonight dinner. :o



As the Wikipedia bibimbap page says, basically they use beef not pork and a plenty of vegetables. Tonight, my wife arranged simply that her own way, but anyway I like it and we enjoyed. :)

Saturday, April 07, 2007

The Ultimate Pointing Device


I bought an interesting pointing device for presentations.
That's it!
And, I don't need a laser poiner anymore. :o

BTW, it reminded me of an old Japanese TV anime. If you are in your late 30s or ealy 40s, I believe you can understand why. :)

Sotte Bosse


Today, I went to Diamond City Mu again with my wife to buy a present for my mother.
We were looking for a photo stand so that she can put photos of her grand child due in this November. :) But, it's not the point of today. When I went to Harvest Village, I heard Hanamizuki of Yo Hitoto. But, actually it's not Yo Hitoto herself, but other singer was singing the song in bossa nova arrange.

After hanging around the shopping center including HMV, we found it's Sotte Bosse (http://www.sottebosse.com/). At this moment, they have 2 CDs and all the songs are cover versions of popular Japanese pop songs. I think it's a healing arrange of the original songs in a sense. And so, I bought "innocent view" above. :)

Friday, April 06, 2007

RFC4824

I found there was one April Fool RFC this year after 5 days delay. :)

http://www.ietf.org/rfc/rfc4824.txt

It's a new encapsulation of IP protocol on top of a very traditional link layer. :)
Here is an excerpt from the clause 3.5 of the RFC.

|3.5. Protocol Limitations
|
| Due to the physical characteristics of the transfer channel, bit
| error rates are expected to be in the range of 1e-3 (boy scout) to
| 1e-4 (professional sailor), and also depend a number of physical
| factors. Poor visibility due to weather conditions or lack of
| illumination (e.g., night time) can drastically increase the error
| rate.

Oh, well. I believe some African people can provide us extremely good quality transmission. Perhaps, error rate 1e-6 and extremely long distance? :o)

| IP-SFS provides no means to handle frame reordering or dual
| (multiple) frame reception. Thus, the protocol is not suitable in
| environments where interfaces are moving fast and/or when the path of
| light is long.

In Japan, about 1800 years ago, there was a genius who can listen to 7 people simultaneously, and so probably he can be a multiplexor among people using IP over SFS. :)

Thursday, April 05, 2007

A Stupid Device Driver

I wrote a stupid Linux device driver for trouble shooting. :o
It's available here.

An excerpt from README.txt
---
This small module, rye.ko, tries to catch a specific in-kernel event.

At this moment the only supported event is a phenomenon called CSS
(Context Switch Storm) [1, 2, 3].
rye.ko creates a kernel thread on insertion, and the thread monitors
accumulated number of context switches periodically and tests if context
switches rate (per second) gets higher than a threshold given on the
insertion time periodically.
If the rate exceeded the given threshold, it calls panic(). Thus,
using rye.ko with your favorite crash dump utility such as kdump,
you can take good information for your investigation.
---
I hope trouble shooting guys would enjoy with this module. :o

Guin Saga 113

The Unknown Underworld
ISBN978-4-15-030884-1

113!

At this moment, almost bimonthly pace. :)

11 Weeks



11 weeks and 30grams.
Well, routine helth checkup is next Monday, but my wife consulted a doctor.
thatsdone 3.0 seemd to be waving its hands. :)

Wednesday, April 04, 2007

Syuri-Ten

Syuri-Ten (首里天) is an Okinawa style dining restaurant in Ebisu, Tokyo.

Gourmet Guide : http://r.gnavi.co.jp/a491600/
Syuri-Ten Home Page : http://www.realize-ryukyu.com/suiten/index.html

As I don't like noisy places, I like the atmosphere of Syuri-ten. :)
One more interesting thing about the restaurant is that there are many foreign guests there because it's in Ebisu.


Thanks Sam!

Oops, Xen Summit, Spring 2007

Xen Technical Summit, Spring 2007

https://www.regonline.com/EventInfo.asp?EventId=124479

OOps, it's too late.
I really wanted to be there. :(

Sunday, April 01, 2007

Interface Magagine 2007/05

Today, I bought the Interface Managine, issue 2007/05.

http://www.cqpub.co.jp/interface/
http://www.cqpub.co.jp/interface/contents/2007/200705.htm

What is interesting is, this issue's giveaway is NEC V850 CPU board. :o

Everly

I saw an interesting quartet in Koganei Park.



Its name is Everly, and their official home page is here.

They look like just a classic quartet in the above photo, but their uniqueness is that they play both classic and popular music. I mean they play also popular instruments such as guitars and sing songs not only classical instruments. As it was an open air concert, I'm not so sure their tune is very good or not. But, they have good atmosphere and make their audience have fun. So, I want to see their pops concert. :)

BTW, my wife found that two violin players look almost the same. In the closing talk their open air performance, it turned out that actually they were brothers.

Hyakkan

Hyakkan (百干) is a good Japanese style dining restaurant.
There seems to be three branches in Tokyo, and today we had a dinner at Hyakkan Kokubunji.

Their catch phrase is 'aburyanse (あぶりゃんせ)' in Japanese as you can see their homepage. It's a bit difficult to explain what あぶりゃんせ means in English because we Japanese love fishes very much and there are several differences in cooking method of fishes between western world and Japan, but anyway, roughly speaking that means something like "Let's broil (a delicious fish and enjoy it) ."

Today, my wife had a broiled Atka mackerel (Hokke, ほっけ in Japanese) and I had a boiled sea bream. (On the menu, it's Medai(目鯛) but I'm not sure its English name exactly.) Very good. :)



The right one above is my wife's dessert, a citron sherbet. :)

Koganei Park and Cherry Blossoms

In Japan, April is the season of Cherry Blossoms. We really love the flower. :)

There is Koganei Kouen (Koganei park, 小金井公園) about 15 minutes walk from my room, and it's well known for its Cherry Blossom in Tokyo.
I and my wife went there for the first time since we moved here, Kodaira city. I guess today was the best day this year for enjoying at Koganei Park.
Here are several pictures I took there.



As you can see above, thousand of people are enjoying their parties seeing beautiful cherry blossoms. :) I heard that it's banned drinking in a public place such as a park in the USA. How poor people they are... :o



BTW, there are terrible traffic jams around Koganei Park especially along Itsukaichi-Kaido avenue (五日市街道) in this season. Today, of course there are. :o
As for us, we walked to Koganei Park, so no problem except backache. :o