Feeds:
Posts
Comments

Oprofile (http://oprofile.sourceforge.net) is an open source tool that profiles various hardware performance information of a system through sampling hardware performance counters.

To use Oprofile to measure the CPI of an application, simply collect the following two events:

CPU_CLK_UNHALTED

“INST_RETIRED”

The ratio of the two would lead to CPI.

1. Streaming benchmark:

a) when it tells you to use the following command to compile RTSP

gcc -I /path/to/curl/curlinst/include -L /path/to/curl/curlinst/lib/ -lcurl rtspclientfinal.c -o rtspclient.o

Put -lcurl at the end instead of in the middle

b) To do patch, use -p0 instead of -p1

c) For the Darwin Server, in file Buildit, the order of the link libraries is wrong: -lbl should be the last one, and -pthread should be the last second one. You don’t need to change all of them, but only the configuration for your machine.

d) When you start the Darwin Server, you get an error messaging saying that the whatever ports are already being used. I guess the server has automatically started. Need to verify that.

e) When running the benchmark, need to change outputdir and codeDir in deploy/run.xml

f) There is no copy_stream.sh

g) The ip address in run.xml needs to be modified

2. Data-serving

a) The cassandra package included in the data-serving tar ball is wrong, you need to download it from cassandra website.

SSH in Ubuntu

Ever since Ubuntu 6.X, /bin/sh is linked to dash instead of bash.

And dash is ugly, evil.

This started to bother me when I was installing hadoop which invoke “ssh localhost” which then invoke dash instead of bash which then does not read ~/.bashrc, hence all environment variables are not loaded.

To solve this, I simply switched back from dash to bash, by running:

sudo dpkg-reconfigure dash

Assume you know how to convert your figure to a pdf file.

1. Use “pdfcrop [pdf_file]” to remove white area in your figure

2. Use “pdftops -eps [cropped_pdf_file]” to generate eps files with fonts correctly embedded, using this command can solve fuzzy font problem.

3. Use  ”cat [eps_file] | ps2eps > [new_filename]” to resolve box bound problem.

One thing I learned this year

Never use Python to develop something that tends to be slow, such as simulation, large data analysis and so on…

It is millions of times slower even compared with Java, not mentioning C/C++.

Actually, Scala might be a good shift for the future.

Just successfully compiled M5 (the old version, not the GEM5) on a Fedora 64-bit machine. Lots of troubles encountered and here are some experience:

1. I tried to use gcc-4.4 to compile it but lots of errors showed up. It seems like you have to compile it using gcc-3.4

2. I got the following 5 files in hand: ( you should be able to download them by googling

cpp-3.4_3.4.6-1ubuntu2_amd64.deb

g++-3.4_3.4.6-1ubuntu2_amd64.deb

gcc-3.4_3.4.6-1ubuntu2_amd64.deb

gcc-3.4-base_3.4.6-1ubuntu2_amd64.deb

libstdc++6-dev_3.4.6-1ubuntu2_amd64.deb

 

3. Unfortunately I am using Fedora which only supports RPM files not deb files. So I use a tool called “alien” (http://kitenet.net/~joey/code/alien/) to convert those files from deb to RPM. After that I am able to install gcc-3.4 on my machine.

4. Change the software link of “g++” to gcc-3.4

5. Rebuild M5. However errors still show up.

Most of them are basically complaining something like: “/usr/bin/ld: skipping incompatible ” blah blah blah.

The problem is that the libraries that it found are not compatible with the compiler.

I started to look at the libraries that the compiler is looking for, located at “/usr/lib/gcc/x86_64-linux-gnu/3.4.6″

Everything looks right. However here are the tricks: all files (libraries and .o files) under the above location are not real files and software links pointing to files under /usr/lib or /lib

On my system for some reason all files under /usr/lib and /lib are 32-bit files. Those 64-bit libraries are located under /lib64 and /usr/lib64

So here is what I did:

1) Under /usr/lib64, create a software link from libstdc++.so to libstdc++.so.6

2) Under /lib64, create a software link from libgcc_s.so to libgcc_s.so.1

3) Under /usr/lib, I replace all the .o files (link header files) by those .o files under /usr/lib64.

4) In the SConstruct file under m5/build/ which is the scons script for building, I added:

env.Append(LINKFLAGS=’-L/usr/lib64 -L/lib64′)

to let the liker looking for libraries in the right position.

 

 

 

 

 

 

Below is the slides of my presentation in PLDI 2011 co-located with FCRC in San Jose.

Paper titled “Caisson: A Hardware Description Language for Secure Information Flow”

Slides – Caisson: A Hardware Description Language for Secure Information Flow

 

 

 

Follow

Get every new post delivered to your Inbox.