Posts

FEATURES installsources not working on MIPS?

Update 2010-07-09: the patch received upstream attention. The maintainer said it's better to send to rpm-devel@rpm5.org directly. Update: just reported to upstream http://rpm5.org/cvs/tktview?tn=61 I resumed my quest to xulrunner linking problem on Loongson: http://old.nabble.com/R_MIPS_TLS_GD-reloc-overflow-when-linking-%3E%3Dxulrunner-1.9.1.5-td26755056.html But I found that "installsources" FEATURE is not working on Loongson. I investigated it and found that it is because debug.sources file produced by debugedit is empty. Then I found that in turn was because debug related sections in MIPS elf file is not of type SHT_PROGBITS, but SHT_MIPS_DWARF. [32] .debug_aranges MIPS_DWARF 00000000 0845c4 0002c0 00 0 0 1 [33] .debug_pubnames MIPS_DWARF 00000000 084884 001a2a 00 0 0 1 [34] .debug_info MIPS_DWARF 00000000 0862ae 015221 00 0 0 1 [35] .debug_abbrev MIPS_DWARF 00000000 09b4cf 002c9a 00 0 0 1 [36] .debug

Show real swap usage for each individual process

Image
Update: the kernel patch is already in 2.6.34-rcN. Currently, in top, the SWAP column only shows the difference between VIRT and RES: case P_SWP: MKCOL(scale_num(PAGES_TO_KB(p->size - p->resident), w, s)); So currently the value is of no use. As a matter of fact, a recent enough kernel has provided the information which is needed to calculate the swap usage for each process. It is in /proc/$PID/smaps. But using smaps may affect top's performance because you have to calculate the sum yourself. But with this patch https://patchwork.kernel.org/patch/56929/ , the kernel will keep track of each process's swap usage for you. This patch (maybe not exactly in the same shape) is already in mmotm tree ( http://userweb.kernel.org/~akpm/mmotm/ ) 2.6.34-rcN. However, checking the /proc/$PID/status file directly may not be a thing which people would like to do. So I decided to make a patch for ps and top. Now it seems to be working. This is the vanilla ps: $ ps -o m_swap,comm

Generate coredumps automatically in specified directory

If you are into investigating coredumps, or you are just curious about how many processes have coredumped, then this is for you: 1. add the following line to /etc/security/limits.conf * - core unlimited 2. add the following line to /etc/sysctl.conf kernel.core_pattern = /corefiles/core.%e.%p %e is the executable filename, %p is pid. Please check the "Naming of core dump files" section of man 5 core for more information on this. 3. run "sysctl -p", then logout and login. Or just reboot. This is what I have on my Yeeloong: $ ls /corefiles/ core.genstrings.11832 core.nscd.10278 core.nscd.12821 core.nscd.13617 core.nscd.23172 core.nscd.29367 core.nscd.6428 core.genstrings.18210 core.nscd.10281 core.nscd.13061 core.nscd.13620 core.nscd.23175 core.nscd.29368 core.nscd.6431 core.main.19478 core.nscd.10284 core.nscd.13064 core.nscd.19028 core.nscd.24042 core.nscd.29369 core.main.19702 core.nsc

Gentoo Penguins

One of my friends has been to Antarctica. She has taken some photos of Gentoo Penguin. Enjoy! (and sorry the blog is in Chinese. :P) http://blog.sina.com.cn/s/blog_657eb8a70100h34p.html

Germany Training confirmed

Anyone in Nuremberg? ;) Activity : Linux Kernel Internals and Crash Dump Analysis Activity Code : Linux-IHC-001 Type : Internally Held Classroom From : 01/26/2010 To : 01/28/2010 Facility: EMEA - Nuernberg, DEU

silent splash progress bar does not progress

I got a laptop from my employer (Novell) nearly 3 months ago. I installed both Gentoo and SLED in it. I didn't setup fbsplash on it when I installed Gentoo. I tried it today. However, I found the progress bar in silent mode did not progress. It stayed at "Initializing kernel", 0%. Finally, I found the reason was that I didn't have "/lib/rc/plugins" directory and as a consequence splashutils openrc plugin splash.so can't be installed into this directory. And that's why the progress bar does not progress. I think maybe it is a bug in openrc. But I am not sure and I can't investigate it further today, it is already 3 pm. :( So I just left a note here. :)

Update on building mips64el cross toolchain

1. git clone git://www.gentoo-cn.org/var/git/loongson.git 2. Don't include loongson overlay's directory directly in your PORTDIR_OVERLAY. But in your own overlay, like /usr/local/portage, create symlinks pointing to sys-devel/ and sys-libs/glibc in loongson overlay. This is because you may not want to install packages from loongson overlay in your host machine. Also you need to make sure your own overlay is the first overlay containing binutils/gcc/glibc in your PORTDIR_OVERLAYS list. You may check the value of this list using command: portageq envvar PORTDIR_OVERLAY 3. Then, just run crossdev -t mips64el-unknown-linux-gnu. This command installed the following components on my host machine: linux-headers-2.6.27-r2 from portage. binutils-2.19.1-r1 from loongson overlay. gcc-4.4.2 from portage. The gcc in loongson overlay currently is just a symlink to portage gcc. glibc-2.9_p2009042 from loongson overlay. However if you build the toolchain now, glibc-2.10.1 will be installed ins

Setting CFLAGS on a per-package basis

Update: as reported by Fai Wong, -O1 is actually fine. Obviously, it must be some flag(s) which is(are) enabled at -O2 but not at -O1 caused this problem. However, it is not a priority ATM. Anyone who is interested in it is welcome to investigate it further. As I have mentioned earlier , sqlite compiled with -O2 may cause xulrunner to segfault in N32 userland on Loongson. Well, I almost forget it. So to remove the -O2 from CFLAGS once and for all, I adopted the technique described here . zhangle@2f env $ pwd /etc/portage/env zhangle@2f env $ find . ./dev-db ./dev-db/sqlite ./O2-removal zhangle@2f env $ cat O2-removal pre_pkg_setup() { elog "bashrc is removing \"-O2\" from CFLAGS for $PN" CFLAGS="${CFLAGS/-O2/}" } zhangle@2f env $ ls -l dev-db/sqlite lrwxrwxrwx 1 zhangle zhangle 13 2009-08-01 16:10 dev-db/sqlite -> ../O2-removal

About the kernel of Loongson 2F machine

I just found that, it is actually very easy to trigger the problem that the -mfix-ls2f-kernel as option could fix. Like just emerging glibc could hang the system. So if you are using linux-loongson/2.6.30/stable branch from this git tree http://dev.lemote.com/git?p=rt4ls.git;a=summary, you maybe want to line 129 of arch/mips/Makefile: $(call cc-option,-march=loongson2f,-march=r4600) $(call cc-optoin,-mtune=loongson2f) to $(call cc-option,-march=loongson2f,-march=r4600) $(call as-option,-Wa$(comma)-mfix-ls2f-kernel,) Actually, $(call cc-optoin,-mtune=loongson2f) here is not required. BTW, glibc-2.10.1 is ready in my overlay. This version could solve the gdb issue: Error while reading shared library symbols: find_new_threads_callback: cannot get thread info: generic error find_new_threads_callback: cannot get thread info: generic error This happened previously when debugging multithread applications.

More on Yeeloong status

I have not blogged here for some time. But that does not necessarily mean I am slacking, ;). Instead I have been doing things. I should've blogged more. http://www.gentoo-cn.org/gitweb/?p=loongson.git;a=shortlog Redhatter posted two blogs related to Yeeloong's status. I guess I should say something too. First of all, I recommend this mailing list http://groups.google.com/group/loongson-dev to those who want to know the latest news about Loongson. If you want to try Gentoo on Yeeloong, you can take this http://www.gentoo-cn.org/~zhangle/loongson_mips3_n32_mplt_20081231.tar.bz2 The file's sha256sum is c94bcd45e58e5f4b8314942a6b3110a2316fd74adb009c8269d1e8e2077d7c72. Please note the userland is N32 ABI, meaning there may be more problems than in O32. But I should've already solved many of them for you. I have been working on Fuloong 2E/2F and Yeeloong's support, particularly N32 ABI system. Firefox is just one example. I have 3 Loongson machines, all donated by lemot

MIPS N32 firefox 3.5 beta4

Image
It is working too. The xulrunner's ebuild is already in loongson overlay . For the mozilla-firefox ebuild, just use the one from mozilla overlay. If you experienced segfault, try to re-emerge sqlite with no optimization. Using the bundled sqlite surely is not an optimal solution, ;) One more thing: Xorg's siliconmotion driver is now working on yeeloong notebook : http://bugs.freedesktop.org/show_bug.cgi?id=21528

MIPS N32 firefox in acid3 test

Image
My quest for MIPS N32 firefox could finally come to an end, since I just got it scores the same as X86 firefox . Remember I said it would encounter bus error on a few websites in my last related post . But I didn't plan to look into this issue before dealing with cache aliasing problem. However, since Rayson Ho helped me to locate the exact cause of this issue, I decided to finish it first. The problem is caused by unaligned access of ldc1/sdc1 instruction. These two instructions' operand must be 8 bytes aligned. But when crashing, the operand is only 4 bytes aligned. After some discussion and experimenting, I found a workaround for sina.com.cn crashing problem. Yeah, a padding pointer sounds scary and fragile, but it did work. Before posting any comment to this, please make sure you have read all the emails in that thread. Then Fai Wong reported to me that it still crash in acid3 test . So I took another look. This time the problem happened in a different location, and it i

Ftrace is working now on my loongson box

http://www.linux-mips.org/archives/linux-mips/2009-04/msg00112.html So I confirmed that this MIPS ftrace support is really working. Thanks to Wu Zhangjin (吴章金). However, I have no interest in finding out what kind of difference between my loongson2f patch and wu's caused wu's ftrace patch does not work on top of my loongson 2f patch. What I would like to see now is to get loongson2f patch merged into mainline . Plus, I wish I could make loongson linux to be able to use 4k page(Now, loongson could only use 16k page in order to avoid d-cache aliasing). I have already started working on it now. Even if it turns out that I can't, I could tell others what I have done in order to achieve this goal. And by that time, I would've got a much deeper understanding of Linux's memory management subsystem.