Monday Mar 30, 2009

Sestinfo 2009 - Universidade Metodista

Last week the Sestinfo 2009 event happened. It is a set of presentations and mini-courses during the week at Metodista University, SP.

I had the opportunity to talk about OpenSolaris in a presentation on Thursday, and it was a four-hour course on Friday. Both were great. Thank you all for coming and congratulations for those who got a certification voucher!

[Read More]

Thursday Feb 12, 2009

OpenSolaris Zones Clusters VideoBlog

Here's a very interesting video talking about virtual clustering using Solaris Zones by Ellard Roush.

Enjoy It!

For more information on how to set up zones and Glassfish refer to:

[Read More]

Wednesday Feb 11, 2009

DTrace presentation at Campus-Party 2009!

On the last Friday of Campus-Party 2009, Pedro Reis and me (Marcelo Arbore) have performed a presentation together.
He talked about Zones, which is an O.S. abstraction for instantiating systems, allowing multiple applications to run isolated one from each other in the same system.

I showed some concepts and a brief demonstration on DTrace, which is a dynamic tracing framework for OpenSolaris that provides an infrastructure to allow administrators and developers to concisely answer arbitrary questions about the behavior of the operating systems and user programs (from the kernel to high level). The questions are written in a script C-like language called D.

Here you can see a blog post showing a DTrace demonstration:

[Read More]

Basic demonstration of DTrace feature of OpenSolaris

This is a demonstration, for a full material on DTrace please refer to the  Solaris DTrace  guide at:

D is a C-like event-oriented script that uses operational system instrumentation points as its events.
That points of instrumentation are called Probes.
You can list all the probes of your system using '-l' option.

# pfexec dtrace -l
ID      PROVIDER    MODULE                FUNCTION        NAME
1       dtrace                                            BEGIN
2       dtrace                                            END
3       dtrace                                            ERROR
4       python723   PyEval_EvalFrame function-entry
5       python723   dtrace_entry function-entry
71348   fbt         semsys                _info           return
71349   fbt         semsys                semexit         entry
71350   fbt         semsys                semexit         return
71351   syscall                           semsys          entry
71352   syscall                           semsys          return

You can see that I have 71352 places in my system that I can get statistics right now.

Every Probe in the system can be mapped by a 4-layer hierarchy:

provider : subsystem : function : probeName

More information on that can be found on chap 1 of the DTrace Guide:

What is important to understand now is that 'provider' is normally the name of module inside the kernel, 'subsystem' is a kernel subsystem or a user lib, 'function' is the function that we wanna inspect and 'probeName' is what point of that function we wanna get statistics. If I omit any member of this hierarchy the system will understand as '\*'(anything)


The name of the DTrace provider that is publishing this probe. The provider name typically corresponds to the name of the DTrace kernel module that performs the instrumentation to enable the probe. 


If this probe corresponds to a specific program location, the name of the module in which the probe is located. This name is either the name of a kernel module or the name of a user library. 


If this probe corresponds to a specific program location, the name of the program function in which the probe is located. 


The final component of the probe name is a name that gives you some idea of the probe's semantic meaning, such as BEGIN or END.

So, let's say I wanna the entry point of every system call of the system:


The option '-n' is used to run the D script from the shell call, so this command should show the standard output for all syscall probes:

The standard output is to print the id of the CPU, the id of the process, the function name and the probe name:

# pfexec dtrace -n 'syscall:::entry{ }'
 CPU     ID               FUNCTION:NAME
  0      70861               ioctl:entry
  0      70861               ioctl:entry
  0      70999           sysconfig:entry
  0      70999           sysconfig:entry
  1      70767                read:entry
  1      70861               ioctl:entry
  1      70861               ioctl:entry

This can be impressive, but just for a second. In the next moment you will want some way to aggregate this huge amount of information.

To aggregate it by syscall name and count how many times it was called:

# pfexec dtrace -n 'syscall:::entry{ @[probefunc]=count(); }'
  fstat                1
  getpid               1
  mmap                 1
  schedctl             1
  sigpending           1
  stat64               1
  sysconfig            3
  getgid               4
  setcontext           24
  writev               39
  setitimer            47
  p_online             64
  clock_gettime        150
  read                 261
  write                301
  pollsys              335
  lwp_park             379
  ioctl                590

For more information on aggergations, refer to chap 9 of the Dtrace guide:

You can short by execname too:

# pfexec dtrace -n 'syscall:::entry{ @[execname,probefunc]=count();}'
 dtrace               fstat                  1
  dtrace              lwp_park               1
  dtrace              lwp_sigmask            1
  firefox-bin         read                   84
  Xorg                clock_gettime          98
  firefox-bin         ioctl                  132
  firefox-bin         pollsys                151
  rhythmbox           ioctl                  165
  rhythmbox           write                  169
  rhythmbox           lwp_park               230

One can say that so far, the only thing that we discover is that I'm listening to music right now, because rhythmbox is making syscalls like crazy.

So, let's say I wanna really understand what is going on when some process calls the syscall, let's say, ioctl. It wouldn't be perfect if we could just ask the process to say every function it enters?

Let's look at this script:

#!/sbin/dtrace -s

#pragma D option flowindent

self->follow = 1;
self->follow = 0;

Each probe description is an event.

Don't bother yourself with the first two lines. The first one is the interpreter, and the second is just a macro for spacing rightly the standard output.

The first will fire when the system enters in the system call ioctl. The second will fire every time the system changes the working function and the thread have a special thread variable follow. FBT is the function boundary provider, and it maps all the functions in the system. What is under the slashes is a filter, and it is called predicate. The last will fire every time a syscall ioctl returns with the thread variable.

Things are getting clearer now.

The flow gos like that:

The first process that calls ioctl will cause the system to put a thread variable named follow in that specific thread and print the standard output (probe details). The next functions that this thread calls will fire a probe, and the next, and the next, and all will print it details until we reach the return of the syscall. This probe will print itself, unset the thread variable and exit the dtrace program.

Without more delays, let's see the output:

# pfexec dtrace -s flw.d
dtrace: script 'flw.d' matched 60932 probes
 0  -> ioctl
 0    -> getf
 0      -> set_active_fd
 0      <- set_active_fd
 0    <- getf
 0    -> fop_ioctl
 0      -> crgetmapped
 0      <- crgetmapped
 0      -> spec_ioctl
 0        -> cdev_ioctl
 0          -> ddi_get_soft_state
 0          <- ddi_get_soft_state
 0          -> kmem_zalloc
 0            -> kmem_cache_alloc
 0              -> kmem_depot_alloc
 0              <- kmem_depot_alloc
 0              -> kmem_slab_alloc
 0              <- kmem_slab_alloc
 0            <- kmem_cache_alloc
 0          <- kmem_zalloc
 0          -> kmem_free
 0            -> kmem_cache_free
 0            <- kmem_cache_free
 0          <- kmem_free
 0        <- cdev_ioctl
 0      <- spec_ioctl
 0    <- fop_ioctl
 0    -> releasef
 0      -> clear_active_fd
 0      <- clear_active_fd
 0      -> cv_broadcast
 0      <- cv_broadcast
 0    <- releasef
 0  <- ioctl
 0  <= ioctl


Now you can search at for each function and really understand what is happening when ioctl is called.

As we could imagine, ioctl deals with io control, some file descriptor configuration, in the middle we can see some memory allocation and of course, all of that are protected by mutual exclusions locks. All that can be seen in the output.

If you run this scripts some more times it won't be long until you get some result like that:

# pfexec dtrace -s flw.d
dtrace: script 'flw.d' matched 60932 probes
0  -> do_interrupt
 0    -> tlb_service
 0    <- tlb_service
 0    -> uppc_intr_enter
 0      -> uppc_setspl
 0      <- uppc_setspl
 0    <- uppc_intr_enter
 0    -> intr_thread_prolog
 0    <- intr_thread_epilog
 0  <- dispatch_hardint
 0  <- switch_sp_and_call
 0  <- do_interrupt
 0  -> sys_rtt_common
 0  <- sys_rtt_common
 0  -> do_interrupt
 0    -> tlb_service
 0    <- tlb_service
 0    -> uppc_intr_enter
 0      -> uppc_setspl
 0      <- uppc_setspl
 0    <- uppc_intr_enter
 0    -> intr_thread_prolog
 0    <- intr_thread_epilog
 0  <- dispatch_hardint
 0  <- switch_sp_and_call
 0  <- do_interrupt
 0  -> sys_rtt_common
 0  <- sys_rtt_common
 0  -> do_interrupt
 0    -> tlb_service
 0    <- tlb_service
 0    -> uppc_intr_enter
 0      -> uppc_setspl
 0      <- uppc_setspl
 0    <- uppc_intr_enter
 0    -> intr_thread_prolog
 0    <- intr_thread_epilog
 0  <- dispatch_hardint
 0  <- switch_sp_and_call
 0  <- do_interrupt
 0  -> sys_rtt_common
 0  <- sys_rtt_common
 0  -> do_interrupt
 0    -> tlb_service
 0    <- tlb_service
 0    -> uppc_intr_enter
 0      -> uppc_setspl
 0      <- uppc_setspl
 0    <- uppc_intr_enter
 0    -> intr_thread_prolog
 0    <- intr_thread_epilog
 0  <- dispatch_hardint
 0  <- switch_sp_and_call
 0  <- do_interrupt
 0  -> sys_rtt_common
 0  <- sys_rtt_common
 0  -> ioctl
 0    -> getf
 0      -> set_active_fd
 0      <- set_active_fd
 0    <- getf
 0    -> fop_ioctl
 0      -> crgetmapped
 0      <- crgetmapped
 0      -> nm_ioctl
 0        -> fop_ioctl
 0          -> crgetmapped
 0          <- crgetmapped
 0          -> fifo_ioctl
 0            -> fifo_strioctl
 0              -> strioctl
 0                -> job_control_type
 0                <- job_control_type
 0                -> strcopyout
 0                <- strcopyout
 0              <- strioctl
 0            <- fifo_strioctl
 0          <- fifo_ioctl
 0        <- fop_ioctl
 0      <- nm_ioctl
 0    <- fop_ioctl
 0    -> releasef
 0      -> clear_active_fd
 0      <- clear_active_fd
 0      -> cv_broadcast
 0      <- cv_broadcast
 0    <- releasef
 0  <- ioctl
 0  <= ioctl

Probably when ioctl was called, it needed to take some other thread out of the cpu. We can see some calls from the interrupt sequence. TLB is the table that maps virtual memory, and we can see some calls related to stack pointers and that cleary are evidencing context changes.

As we can see, Dtrace is a great way to find bugs, profile, do performance analyses/evaluation. It is also a great way to learn and unsderstand operational systems behavior.

So, Where we can go now?

Community at

Adam Leventhal:

BigAdmin resources:

Sun's How To:

Solaris Internals:

Please post a comment or send me a email if you have any doubts, suggestions or if you find something here that isn't that right. We're a community and your help is very welcome a encouraged. =)  [Read More]

Wednesday Feb 04, 2009

Glassfish over a Zone over OpenSolaris

Hi all!

Today I'll try to show you guys how to create a zone in OpenSolaris and install a glassfish application server on the top of it.

First of all, you need a native installation of Solaris10/OpenSololaris or a virtual machine with one of these installed. Here you can find how to set up a vm with OpenSolaris.

You can refer to the Zones Administration Guide too.

To see the zones on the system:

# zoneadm list -vi
0   global   running   /      native   shared

Let's configure one more called glasszone for us:

zonecfg -z glasszone
glasszone: No such zone configuredUse 'create' to begin configuring a new zone.
zonecfg:glasszone> create
zonecfg:glasszone> set zonepath=/export/home/glasszone
zonecfg:glasszone> set autoboot=true

Zonepath is the place that solaris will create the filesystem for the new zone. If you don't want your zone to start running automatically at the boot time, you can set autoboot=false or just leave it.

Now, let's add a virtual network interface, commit the zone, install it on the system, boot and login( -C option is used in the first time you start the zone to configure the hostname, dns server, root password and some other stuff).

zonecfg:glasszone> add net
zonecfg:glasszone:net> set address=
zonecfg:glasszone:net> set physical=e1000g0
zonecfg:glasszone:net> set defrouter=
zonecfg:glasszone:net> end
zonecfg:glasszone> commit
zonecfg:glasszone> exit
# zoneadm -z glasszone install
# zoneadm -z glasszone boot
# zlogin -C glasszone

The address is the ip of your subnet that the zone will use, and 24 is the number of 1's of the bitmask of the subnet mask that you have. More info on this here.

Remember that the interface will be shared, and the glasszone will be visible to the outsiders. This means that the glasszone and the globalzone will need different ip addresses of the net, and your interface will act like a router.

INFO: Zones doesn't support dhcp yet.

In my case, I'm using VirtualBox to virtualize the OpenSolaris system. It created a subnet for the system with the default router and the default dns server .

Physical is the interface that glasszone will share (must be a configured, plumbed, working interface).

You can see the interfaces information through the ifconfig command in the globalzone.

# ifconfig -a
e1000g0: flags=201004843 mtu 1500 index 2 inet netmask ffffff00 broadcast ether 8:0:27:31:8b:21
e1000g0:1: flags=201000843 mtu 1500 index 2 zone glasszone inet netmask ffffff00 broadcast

Now the zone should be up and running:

# zoneadm list -vi
   ID    NAME    STATUS       PATH                BRAND    IP
   0    global    running       /                native    shared
   1    global    running       /export/home/glasszone    ipkg    shared

Login to it. We're going to install the glassfish app. Since a zone is an instance of the OpenSolaris operational system, if the fs is not mounted anywhere, the only way to communicate with it is though the network interface (remember that it is a virtual interface, so if you are communicating between zones, minimum delay is expected).

Basically you need two things: The jdk and the glassfish app.

My tip: Download both at once:

Of course you can install it separately, but you will have to set some environment variables such as JAVA_HOME and the PATH. It isn't so hard, but it isn't so fast too, so I'll keep my advise.

You can download it logged to globalzone and then move it to the glasszone space. You can use wget to download it directly into your zone too.

TIP: Use -console option to install, because you have just a console in the zone.

You may have to set the execution permission for the downloaded file.

chmod +xxx runnable.bin

Now that you have installed it, you should be able to start a sample domain:

# asadmin start-domain domain1

Once it started, you should be able to see it on the hole subnet by typing in your browser:

TIP: Probably you will have add the glasszone entry in the /etc/hosts in the globalzone.

#echo “ glasszone” >> /etc/hosts
#cat /etc/hosts
[…] localhost glasszone

Now you have a "ready to use" web application server enviroment inside a zone inside the OpenSolaris OS.


Please post a comment or send me a email if you have any doubts, suggestions or if you find something here that isn't that right. We're a community and your help is very welcome a encouraged. =)

References and related links:
⁞[Read More]

Thursday Jan 22, 2009

OpenSolaris Course at Campus-Party 2009!

This week, here in São Paulo, is happening one of the most interesting events of the year, the Campus-Party.

The idea is simple:

Come with your computer and stay camping, immerse 24/4 in the computing world for a whole week!

A lot of good talks, mini-events, demos, video games, robots and, of course, open source software.

You can see more about the event in the blog:

The osum community:

The official website:

Yesterday I had the opportunity to give a mini-course on OpenSolaris.

Vitório Sassi, Thiago Gonzaga, Ronaldo Prass and some other guys from SAMPAosug, POAosug and NORosug also showed the guys how to install the operational system, and how to use it with VirtualBox, a virtulization solution from Sun.

Here the slides:

Intro Open Solaris
View more presentations or upload your own. (tags: intro open)

It's all for now!

See ya and stay free!

[Read More]

Saturday Dec 13, 2008

OpenSolaris 2008.11

"OpenSolaris is the state of the art, cutting edge operating system that provides a rich, coherent platform for building and running applications.

OpenSolaris offers free, built-in features that help you build, debug and deploy new applications faster. It's is an operating system (OS), an open source project licensed under CDDL, and a community.

The project's goals are innovation, collaboration, and the extension of OpenSolaris technology." (

They just released the 2008.11 version, with some new cool tools like TimeSlider and much more hardware compatibility.

You can download it here:

You can see a walk-through the installation here:

You can see videos and talks about the release and the new stuff here:

You can get in touch with the community here:

You can see the hardware compatibility list here:

Download it! Try it! Enjoy it!

Technology Week at UNISA

This is a nice event that happens every year at University of Santo Amaro, a well known college here in São Paulo, Brazil.

This year (2008) it happened august 20.

Is not every day that we have the chance to talk to 150 people.

We talked a little bit about Sun as a company, then we discussed the Sun Academic Initiative (SAI) and finished showing the kinds of certification that Sun offers.

Here the slides:

Friday Nov 14, 2008

CONISLI 2008 - Congresso Internacional do Software Livre 2008

In english, CONISLI means International Free Software Congress (free meaning freedom, because in portuguese we don't use the word free for something that have no cost).

The event was on the weekend of october 18th and 19th, 2008. It was great, nice talks, a lot of interested and interesting people. As Tom said in his blog: “The CONISLI 2008 (International Congress of Free Software) is an event of technical content and instructive, with a focus on software development, infrastructure and security, strengthening the Community of Free Software.

It happened at FIAP ( Faculdade de Informática e Administração Paulista) , and giving talks from Sun was me (Marcelo Arbore), Tom Mix Petreca and Maurício Leal. Maurício talked about MySQL database system, Tom introduced OpenSolaris, and I talked about Solaris Dtrace, Resource Manager and Zones.

You can find more info here:

Here the slides I shared with Tom:

Tuesday Nov 11, 2008

It is all about the gifts

The same strategy that tamers use with dogs and speakers use to claim audience attention worked on me this morning. I was reading a blog entry called “Open Source Hardware - or - OpenSPARC as a platform for instruction" at Gery Serda's blog. It is a very interesting entry, he talks about OpenSPARC T1 and OpenSPARC T2 architectures, and the benefits for academic institutions to have now open source hardware too available.

Near to the finish he gives a link to OpenSPARC Internals e-book download, edited by David Weaver. It was the gift I was talking about.

Ok, I admit, I have an unusual love for e-books.

Books are one of the bests ideas ever. Pick a subject, choose some good authors, read cover to cover and you are now one of the specialists on the subject.  I see e-books as something that helps the democratization of knowledge.

Here are the highlights of the book:

  • How to customize and use OpenSPARC

  • How to start using OpenSPARC code

  • How to make basic changes including

    • configuring number of cores or threads

    • paring to a smaller size

    • fitting on an FPGA

    • adding extensions

  • How to set up

    • simulation environment

    • emulation environment

  • How to verify an OpenSPARC design

Here some professors quotes:

"The coverage is extremely broad and deep, from the basics of the OpenSPARC architecture, the rationale for throughput optimized microprocessor design, and the microarchitecture of the T1 and T2 implementations to a roadmap for using the T1 and T2 design database and design verification suites."
Kunle Olukotun, Stanford University
Professor, Electrical Engineering & Computer Science
Director, Pervasive Parallelism Lab

Sunday Nov 09, 2008

What is Open-Source University Meet-Up?

The Open-Source University Meet-Up (OSUM) is an academic developer organization that educates its members about open source technologies in a fun and engaging way.

In OSUM, you create an avatar, containing a little bit about you, your preferences and some of your work too. You can bind your blog, videos, photos, RSS feeds and more.

You can also create, or join communities that represents a technology, a university or just a group of developers. Through this is possible to collaborate online in forums and community groups with other students and academic developers and share your technical interests.

Beyond expanding your educational training and social interaction, OSUM gives you and your community the opportunity to expose your work, interests and curriculum in a worldwide university portal that has students, professors and developers from the biggest and most important academics institutions around the globe.

Sun is one of the major contributors of open source code to the community and this is another initiative visioning facilitates the access to this material and the growth of this community. The Glassfish and the JVM are examples of open source software that Sun has donated, but all open source software are included and encouraged on OSUM.

So, what's next?

Go to , sign in and give a hello at .

After that, you can start exploring your new possibilities.

You can find more info:

Wednesday Oct 29, 2008

Software Freedom Day 2008

"In a time when our lives are increasingly dependent on technologies, it is important we take the time to consider the impact of technology on our lives, and the importance of ensuring technology isn't used to limit us, but rather to take us further along a path of opportunity, innovation and freedom for all people."

"Software Freedom Day(SFD) is an event with hundreds of teams from all around the world running local events to help their communities understand Software Freedom."

There was more than 500 events around the globe and more than 50 just in Brazil!

Me and my coworker Tom Mix Petreca planned 2 SFD events. One for my University and one for his.

 His event took place at Faculdade de Engenharia Industrial (FEI), in the beautiful afternoon of september 20th, 2008.

The presenters were Tom Petreca, Marcelo Arbore and Bruno Souza, known as JavaMan.


Bruno gave us a wonderful introduction in what is open source, why It affects us and how to bring money from It. Tom talked about software freedom and I discussed about OpenSolaris, an open source operational system.

My event was at Polytechnic School of University of São Paulo (Poili-USP), september 24th, 2008. The presentations started at 9 hours of a wednesday shining morning.

The presenters were Tom Petreca, João Samara and Marcelo Arbore.

Tom and João talked about open source and I gave presentation covering Open Solaris project. I also talked about Dtrace, Resource Manager and Zones, witch are technologies from Solaris operational system.

OpenSolaris Dtrace SRM Zones
View SlideShare presentation or Upload your own.

Thanks for everyone that came, thanks Bruno and João for such good talks, thanks Prof. Pedro Correa, from PCS, who helped me with organization issues and everyone that helped It possible.

Be free!

Monday Oct 27, 2008

Computer Architecture: A Quantative Approach - Fourth Edition

For those of you who doesn't know this great piece of lecture written mainly by John L. Hennessy and David A. Patterson, It is a bible for computer architectors and hardware designers. Marc Tremblay, Fellow and VP, Chief Architecture from Sun Microsystems stated "Computer Architecture builds on fundamentals that yielded the RISC revolution, including the enablers for the CISC translations. Now, in this new edition, it clearly explains and gives insight into the latest microarchitectures techniques needed for the new generation of multithreaded multicore processors".

The fourth edition of the book is divided into six chapters and three printed appendices, and more nine appendices on CD.

The chapters are Fundamentals of Computer Design; Instruction-Level Parallelism and Its Exploitation; Limits on Instruction-Level Parallelism; Multiprocessors and Thread-Level parallelism; Memory Hierarchy Design; Storage Systems.

It's good to read a good book. =) 

Chapter Four is specially interesting because It's about multiprocessors and thread-Level parallelism and It uses Sun T1 microprocessor as example.

I made some slides of the sections of chapter 4, one per section.

I'm posting It here, and you can download It through SlideShare. It's a work in process of course, but It's a good start.

I Workshop on OpenSPARC Architecture at USP, Brazil.

A three-day workshop ocurred on march 2008 ( 24th, 25th and 26th) at São Paulo, having openSPARC specification and FPGA implementation as main subjects. The workshop happened from 24th through 26th March and was hosted by the Grupo de Sistemas Pervasivos e de Alto Desempenho (Pervasive systems and high performance group - PAD) of the Laboratory of Integrated Systems (LSI) of the Polytechnic School of the University of São Paulo (EPUSP). This was the first of many events related to the openSPARC center of excellence program at USP.

The introduction had the special participation of Carlos Thomaz and Eduardo Lima from Sun and Prof. Sergio Kofuji, coordinator of the PAD group. In the first day morning, the presentations introduced the principles and concepts of the openSPARC community and Sun’s Throughput Initiative. It showed the history, aspects and design decisions of the architecture. In the afternoon T1 and T2 particular issues were defined. The next day was very interesting, with nice presentations and a practical laboratory over the FPGA modeling theme. In the last day, we talked mainly about multicore specific aspects. You can see the full schedule PAD group webpage.

Prof. Sergio Kofuji gave me the opportunity to perform a presentation about the CMT and CoolThreads technology in the first day. The speakers were Sergio Kofuji, Jussara Kofuji, Fernando Muzzi, Edson Horta, German Santos, Stelvio Barbosan, Antonio Amorim, Eduardo Lima, Carlos Thomaz and Marcelo Arbore.

As you can see, this was a great meeting that gave outstanding information about the technologies that is leading the next generation of hardware multicores. Polytechnic School have a great role in history of brazilian computers hardware development, proudly having produced the first Brazilian computer inside its campus, called Patinho Feio, in 1972. SUN is a company that was born at the StanfordUniversity. There is no doubt that these two giants in hardware development working together can result nothing less than amazing projects.


Hi, my name is Marcelo Arbore, I study electrical engineering at University of Sao Paulo, Brazil, and I work for Sun Microsystems. I also like to surf, I love the sea and I will live in California some day.


« July 2016