-
Understanding RT by graphics
A lot of people seem not to understand very well what real-time means. They usually tend to think RT has anything to do with performance and the raw throughput. It doesn’t. It’s all about determinism and guarantees.
This post’s title has “by graphics” words. I think the graphics below are worth a thousand words. I obtained them while porting the RT tree to Freescale boards some weeks ago at ProFUSION. Basically I’m running a task that wakes up every 40ms, run a tiny job, send some numbers through the network and sleeps again. The time in the graphics is the difference between the total time (sleep + wake-up + execution) and 40ms.
One important fact: while this is running, I’m running some CPU-intensive jobs in background and the board is receiving a ping flood from another host.
See that when the task is running with real-time priority, it doesn’t matter there’s a hugger job in background or someone is trying to take your board down with a ping flood. It’s always possible to draw a line and say it will never* go beyond that limit. In the other hand, when running with normal priority, the total time varies much more.
PS.: In the graphics above I’m using an oscilloscope made by Arnaldo Carvalho de Melo. Thanks, acme.
* Well, never is a strong word. You better test with several scenarios, workloads, etc before saying that.
-
WebKit
After some time working with the EFL port of WebKit, I’ve been nominated as an official webkit developer. Now I have super powers in the official repository
, but I swear I intend to use it with caution and responsibility. I’ll not forget Uncle Ben’s advice: ”with great power comes great responsibility”.I’m preparing a post to talk about WebKit, EFL, eve (a new web browser based on WebKit + EFL) and how to easily embed a browser in your application. Stay tuned.
-
strace, valgrind and gdb as a strace-like tool
A long time since I do not post some technical thing. Time to share something I learnt during latest months.
My boss at ProFUSION always says there are only 2 debugging tools worth using: strace and valgrind. Indeed, they are very helpful while developing software in C. If you don’t know them, hurry! Google it. Basically what I can do is to summarize their functionality:
- strace traces all system calls a program does. You don’t even need the source code. Suppose a software is misbehaving and you want to know what files it is opening: all you have to do is to intercept calls to your kernel, i.e. trace all open syscalls. You have to do as following:
$ strace -e trace=open ./your-program-to-trace
This will output all the system calls of type open, with their parameters;
- valgrind helps you to debug problems related to memory accesses. It’s a common mistake to free an alloc’d variable and after trying to access its content. Valgrind will tell you exactly where you freed the memory an then you may catch the bug much more easily
However I don’t think gdb is not worth using and I’ll show here it’s so powerful that you can even simulate strace with gdb. Let’s say you want to do the same thing as above with strace. You’ll need to use the ‘catch’ command in gdb:
(gdb) catch syscall open
Done! Your program will stop for every open syscall. But wait, strace does not break, it just prints the syscall and continues exection. Let me continue… One of the features gdb has that I see really few people using is commands. Hey! GDB is not a tool made only for seeing the backtrace when a program reaches a certain line in your source code! You can automate several things, print memory locations, break if a variable assumes a certain value etc. So, if you just want to print something, you can improve our previous example:
(gdb) catch syscall open (gdb) commands 1 > bt > continue > end
Now it will print the backtrace every time an open syscall is issued. If you pay attention to the calling convention of your architecture[1] [2], you could check the parameters to that syscall and print its value or stop if it is something interesting. For example, in x86_64 the following snippet would print the filename being opened:
(gdb) catch syscall open (gdb) commands 1 > silent > x/s $rdi > continue > end
Yes, you could use strace and grep for the file you are interested in. But, where’s the fun
? The thing is that all these debugging tools rely on ptrace syscall, that allows a process to trace another one. So, choose your debugging tool and go fix your code
- strace traces all system calls a program does. You don’t even need the source code. Suppose a software is misbehaving and you want to know what files it is opening: all you have to do is to intercept calls to your kernel, i.e. trace all open syscalls. You have to do as following:
-
Brasil x Holanda
Brasil perdeu. Infelizmente estamos fora da copa.
O Juca Kfouri resumiu praticamente tudo o que eu acho desse jogo. Só pra complementar: o time de laranja era uma equipe de teatro ou de bonecas?
-
Now, officially an EFL developer
Last week I was officially added to EFL developers list. After contributing some patches to eina, edbus, elementary and E17 (especially to connman module), Gustavo Barbieri, who is also my boss at ProFUSION, added me to developers list giving me commit rights on EFL svn.
He said me some weeks ago that the only thing missing to add me as developer was that I’d have to use E as my window manager. Fair enough. If one wants to be a developer of a certain program, it’s better to first be an active user. So, last Friday I wiped out my Gnome and started using E17 as my default window manager. If you don’t know E, you should check its site. It’s a lightweight Desktop Environment designed on top of EFL, the Enlightnement Foundation Libraries.
I don’t think the current theme is that good, but I’m getting used to it. Hopefully, it will be replaced some time soon. Below, my current desktop with an animated wallpaper with a clock:

Enlightenment
-
Linux Collaboration Summit 2010
And this was the Linux Collaboration Summit 2010:
Linux Collaboration Summit 2010 from Kenny Moy on Vimeo.
I’m appearing on this video exactly at 2:00
. After it shows Google giving Nexus One phones to everybody. Really nice. -
Embedded Linux Conference 2010
So, today was the last day of the Embedded Linux Conference. Now, I’ll be here in USA for the Linux Collaboration Summit. It was really cool and it was amazing to meet people you are only used to chat, exchange some emails or that you heard about. Just to name some: Steven Rostedt, Greg Kroah-Hartman, Frank Rowand, Mike Anderson, Andrew Morton, Jon Corbet and others. I was really impressed too seeing Rostedt programming or Greg answering emails. What a great guys
And yesterday I presented my work, talking about the optimization of the Linux scheduler for soft real-time when running on multi-core architectures. I must admit I was a bit nervous, but it seems that people liked it. Following some pictures:





-
Banco do Brasil + Linux 64 bits
Faz 1 mês mais ou menos que liguei no Banco do Brasil reclamando que a “solução de segurança” do site deles não estava funcionando no meu Linux 64 bits. Sem grandes surpresas, depois de me perguntarem se eu tinha a VM java da sun instalada, versão, etc, eles me passaram para o suporte de segundo nível. Pediram o meu telefone, dizendo que entrariam em contato (isso foi no sábado).
Logo na segunda-feira de manhã me ligaram e após mais um tempo conversando, ele disse: “o problema é que a nossa solução de segurança não é homologada para a jre 1.6. Acontece que em algumas plataformas ela funciona, mas não é garantido. A gente sabe que em Linux 32 bits funciona, mas a jre 1.5 é que é oficialmente homologada”. Então eu tinha duas opções: ou instalar a versão 1.5 ou rodar um browser 32 bits. Felizmente no meu sistema, archlinux, já tem um pacote firefox32 que faz tudo o que preciso e foi o a solução que adotei. Até hoje.
Hoje quando fiz meu usual “sudo pacman -Syu” para instalar atualizações de todos os pacotes, vi que tinha uma atualização da jre para ser feita: jre-6u18-2. Aí pensei… quem sabe nessa versão mudou alguma coisa que fez funcionar o applet do BB? Sem muitas esperanças, abri o site no chromium e para minha surpresa, funcionou! Abri no Firefox, e funcionou também. Pra tirar a dúvida, fiz o downgrade para a versão anterior do java, jre-6u17-1. Abri novamente e continuou funcionando. Logo, não foi causada pela atualização da VM, mas sim por alguma mudança que o pessoal do Banco do Brasil fez. Não sei se eles chegaram a homologar a versão 1.6 da JVM (o que já estaria mais do que na hora), só sei que agora funciona com Linux 64 bits.
Felizmente agora posso acessar a minha conta no Banco do Brasil sem precisar do browser 32 bits. Já estou removendo-o. Deixe seu comentário pra eu saber se funcionou pra você também (inclusive aqueles que usam FreeBSDs e outros unixes).
-
Amazing kernel related blog
Today while reading “posts” on Buzz and digging in my RSS reader, I found this blog: http://smackerelofopinion.blogspot.com/ made by an ubuntu engineer. How many amazing posts there are on this blog. Particularly interesting is the one about ACPI Debugging and the other about perf, the tool I posted about some days ago (although it covers just a tiny amount of things this tool is capable of).
When I have some spare time I’ll try to use that first post to debug the ACPI on my buggy asus laptop, where temperature goes sometimes as high as 90 °C. Last year I tried to adjust the hysteresis curve of the fan control in order to have a cooler laptop but had no success on it.
PS.: I wished a day had 48h to be able to read all the cool stuff out there
-
Pescaria 2010
Final de semana pra relaxar com a família. Seguindo a sugestão de Ataíde e Alexandre, fomos pescar. Que pena que o meu peixe de 12kg acabou escapando. Algumas fotos:
Mais fotos em: http://picasaweb.google.com.br/lucas.de.marchi/Pescaria?feat=directlink



