by Lucas De Marchi
RSS icon Home icon
  • Stripping perf out from kernel source

    You may have heard about perf, a tool made by Linux kernel developers to help debugging, benchmarking and profiling.

    The problem is you have to download the whole kernel source in order to compile perf. If you are not used to follow kernel developping, most likely you will not have its source. But it’s still possible to compile perf.

    As I’m helping to maintain perf package in Archlinux, I made the following script to strip perf from a given kernel version:

    #!/bin/bash
     
    function usage() {
    	cat - <<EOF
    USAGE:
    	make-perf-util.sh git-tag-version
     
    EOF
    }
     
    function die() {
    	echo -e "ERROR\n\tSee usage\n"
    	usage
    	exit 1
    }
     
    VERSION=$1
    BASENAME=perf-util
    NAME=$BASENAME-$VERSION
    PKGNAME=$NAME.tar.bz2
     
    if [ $# -ne 1 ]; then
    	die
    fi
     
    git checkout $VERSION || die
    [ -a $NAME ] && rm -rf $NAME
     
    cd tools/perf && make clean
    cd -
     
    rsync -Ra tools lib include/linux arch/x86/include/asm include/asm-generic \
              --link-dest=. $NAME
    tar -cjf $PKGNAME $NAME
    rm -rf $NAME
     
    echo "created $PKGNAME"

    This script works fine with latest 2.6.33 kernel. Regularly I’m uploading to this site the stripped version of perf. The latest one, you find here.

  • Mais um infeliz cliente da Telefônica

    É impressionante como a Telefônica pode ser uma operadora tão ruim. Não bastasse ser ruim e cara, você fica preso a ela por diversos motivos. Explico: tentando diminuir os gastos da linha telefônica, hoje liguei lá para contratar uma segunda linha telefônica, mas do tipo Linha Lazer. A intenção era começar a usar essa segunda linha só para o speedy e depois migrar (usando a portabilidade numérica) a outra linha para uma operadora melhor (e mais barata, muito mais barata).

    A diferença de assinatura entre a Linha Clássica, que temos agora, contra a Linha Lazer: R$ 40,35 contra R$ 14,90. E todos os outros serviços (em ambas) são mais caros do que no Livre.

    Depois de passar todos os documentos pedidos, repetir e repetir mais uma vez, a atendente tentou empurrar a Linha Clássica pra mim. Expliquei que queria a Linha Lazer, e não a Clássica. Sabendo que a gente já tinha uma outra linha (ela tinha perguntado antes), disse que a Linha Lazer não estava disponível para a minha região. Mentira! Aposto que se não tivéssemos nenhuma linha não teríamos problema em contratá-la.

    Graças à magnífica privatização do setor de telefonia no Brasil, ela é a única provedora de internet banda (quase) larga por aqui. Não fosse isso, eu já teria cancelado minha linha. Sendo isso, penso seriamente em cancelá-la de qualquer jeito e ficar sem internet mesmo, pelo menos por um tempo.

    Alguém tem sugestão?

    PS.: Não é que descobri que tem gente na mesma situação que eu?

  • Coming back, with git tips

    So, it has been some months I last wrote on my blog. Not because I don’t have things to write, but because sometimes I’m too lazy do empty my “queue of things to write about”. Nothing better than start with one thing at a time.

    Since january I’m working at ProFUSION. As before when I was mainly developing for Linux kernel and finishing my thesis (@ USP / Polimi), I’m using git a lot. Even in projects in which upstream is using a centralized approach like subversion, I simply can’t live without a local tree and thus, git. So here I’ll post somethings I’ve been using:

    Read the rest of this entry »

  • Parallelizing

    Sometimes we discover that we don’t have to parallelize only the software. We must also parallelize the way it is written.

    Thus, one of the last days of my graduation in Computer Engineering:

    One day of hard work

    One day of hard work

    Almost finished!

  • Welcome Windows 7

    Welcome from a Linux user…

  • Python, bpython and my university’s email

    Almost a year ago I posted in my past blog (in portuguese, automated translation) a tutorial on how to use greasemonkey to workaround the ugly interface of my university’s webmail. More specifically, in Firefox it looses the ability to select all emails. I took that just for an example… the real goal was to delete all emails since I access them through Gmail and periodically I get the email:  “your mailbox is full…”. So, how could I delete them without having to download them all? Simple: connect through POP3 and issue the “dele” command. I could do that even with plain telnet, but I decided to come back to python, since it was awhile I didn’t use it.

    In the same week I saw two interesting posts in my RSS reader:

    • the first came from BR-Linux, and it’s about bpython, a better CLI to python. It’s amazing!! You can get a lot of IDE-like functionalities in your command line. You can view a short video made by its author.
    • The second is about pydev and came from “Linux Today”. With PyDev you can use Eclipse to edit your python code and get all functionalities you may out of an IDE. I still didn’t use it (and I think I’ll continue with vim) but it’s an interesting post to read as it talks about IDE vs vim/eclipse/other_text_editors.

    And now, the really-stupid-delete-all-mail-from-poli.py:

    #!/usr/bin/python
     
    import getpass, poplib
     
    strServer = 'pop3.poli.usp.br'
    user = raw_input('user: ')
    server = poplib.POP3(strServer)
    server.user(user)
    server.pass_(getpass.getpass())
    numMsg = len(server.list()[1])
    while True:
        resp = raw_input('%d messages in Inbox. Delete all? (yes/no) ' % numMsg)
        if resp == 'yes':
            for i in range(1,numMsg+1):
                server.dele(i)
            break
        elif resp == 'no':
            break
        else:
            print 'Answer yes or no\n'
     
    server.quit()

    It will ask the user and password to connect to pop3.poli.usp.br, show the current number of messages and ask for confirmation.

  • Trissa – update status

    Just to let you all know some updates to Trissa: currently it’s in a hold state, waiting for next stable Ogre release, which is version 1.7. So until they release this version I’ll hold Trissa in a beta status, although it’s working great right now and all fixes for 1.0 are in place.

    The biggest problem with current version of Ogre is that it doesn’t have proper support for multi-threaded games, or better, only one thread is able to make calls to Ogre functions which change the rendering states. In the design of Trissa this is not currently possible as both core’s and player’s code may change the rendering.

    Also, I’d like to clarify a thing about the name: in contrary to what I said, “trissa” does not mean “tic-tac-toe” in italian. The right name in italian is “tris” as a friend of mine told me some months ago. However I decided to keep the name, because I liked it, it’s now properly indexed by Google and the game is not the original tic-tac-toe.

  • TinyOS

    As I did with previous projects I had at my university, I’d like to share another one: it’s a project using TinyOS. It’s mainly intended for education purposes, so if you are trying to learn TinyOS, it’s a good example to look at.

    What does it do?

    It’s a platform to monitor temperature and humidity of various rooms in a house. All sensors must collect data every X seconds and send them to sink, a predefined node. Sink can also change the value X and sensors may not reach sink in a single hop, so nodes have to use their own routing protocol to send forward data from other nodes to sink.

    If you are interested in this project, send me an email and so I could help you to understand it. I think it’s a good exercise to look at source code and discover which routing protocol I was talking about (before reading the README file).

    As I think I won’t modify this code anymore, rather than put it in my git repository I made a .tar.bz2 which is available here: House Monitor source code.

  • Testando o google translate com o último post

    Escrevi o último post em italiano e queria testar o Google Translate. Aqui está o link do último post traduzido para o Português.

    Não digo que foi ruim para um tradutor automático. Em geral creio que dê para entender, mas algumas partes foram bem divertentes. Um exemplo é a frase “Eu e meu amigo fomos para Mateus Pomatt”, tradução de “Io e il mio amico Matteo  siamo andati a Val Formazza”. Perdeu-se todo o sentido, que seria: Eu e meu amigo Matteo fomos a Val Formazza.

    De qualquer forma achei legal poder manter a forma do site só traduzindo-o com o Google Translate. Antes quando precisava de uma tradução eu copiava e colava o trecho que queria traduzir.

  • Val Formazza!

    E’ da un po’ di tempo che non scrivo niente sul blog, ma è perché era un po’ preso con le cose dell’università. Spero poter aggiornarlo più spesso ora.

    Questo post è sulla passeggiata che ho fatto un mese fa. Io e il mio amico Matteo  siamo andati a Val Formazza. E’ stato davvero spettacolare. Non posso immaginare una persona ritornare dall’Italia senza essere andato al meno una volta in montagna. È ancora più difficile da capire che tanti italiani non siano mai andati. Me lo raccomando a tutti!

    Vi lascio qualche foto.

    Prima foto a Val Formazza

    Prima foto a Val Formazza

    Spettacolare!

    Spettacolare!

    La marmotta, che pochi sono riusciti a vedere così vicina

    La marmotta, che pochi sono riusciti a vedere così vicina

    Io e Matteo

    Io e Matteo

    Camminando sopra un ghiacciaio

    Camminando sopra un ghiacciaio

    La discesa

    La discesa

    Sono tante foto belle. È difficile da scegliere quale mettere qui. Allora vi lascio anche il link dell’album se voleste guardare altre: Montagna.

    L’ultima foto che vorrei lasciare qui è della famiglia di Matteo. Vorrei anche ringraziare loro per avermi accolti così bene. Peccato che mancano un suo fratello e la sua sorella.

    Matteos family

    Matteo's family

    Una frase che sentivo spesso in Italia era “beati i brasiliani per avere le foreste, le spiagie, ecc…”. Io però vi dico: beati gli italiani per avere, tra altre cose, le montagne bellissime!