Oracle® Solaris Studio 12.4: Performance Analyzer

Exit Print View

Updated: January 2015
 
 

Using er_label in Scripts

One use of er_label is to support profiling a server program that is being driven by a client as an independent process or processes. In this usage model, you start the server with the collect command to start creating an experiment on the server. Once the server is started and ready to accept requests from a client, you can run a client script that makes requests to drive the server and runs er_label to label the portions of the experiment where the client requests occur.

The following sample client script produces a time label in a test.1.er experiment for each request run against the server. Each of the five labels created marks off the time spent processing the named request.

for REQ in req1 req2 req3 req4 req5
          do

          echo "=========================================================="
          echo " $REQ started at `date`"

          er_label -o test.1.er -n $REQ -t start=@
          run_request $REQ
          er_label -o test.1.er -n $REQ -t stop=@
          done

The following sample script shows an alternative usage that produces a single label named all, which includes all the requests.

for REQ in req1 req2 req3 req4 req5
          do

          echo "=========================================================="
          echo " $REQ started at `date`"

          er_label -o test.1.er -n all -t start=@
          run_request $REQ
          er_label -o test.1.er -n all -t stop
          done

Note that no time specification follows –t stop in the second invocation of er_label, so it defaults to stop=@.

You can create more complex scripts, and run multiple scripts simultaneously on the same node or on different nodes. If the experiment is located in shared directory accessible by all the nodes, the scripts can mark intervals in the same experiment. The labels in each script can be the same or different.