Dynamic Tracing Framework for Oracle WebLogic Server on Oracle ...

0 downloads 185 Views 679KB Size Report
like' language for enabling and programming instrumentation points. ... http://www.solarisinternals.com/wiki/index.php/D
An Oracle White Paper September 2010

Dynamic Tracing Framework for Oracle WebLogic Server on Oracle Solaris

Dynamic Tracing Framework for Oracle WebLogic Server on Oracle Solaris

Executive Overview ................................................................................ 4 Introduction ............................................................................................ 4 Observing Applications in Production .................................................... 5 Solaris DTrace.................................................................................... 5 DTrace basics.................................................................................... 5 Observing Java Applications using DTrace ....................................... 6 BTrace - Java byte code instrumentation ........................................... 7 Framework combining BTrace and DTrace ....................................... 7 Dynamic Tracing Framework for Oracle WebLogic Server ....................8 DFrame Architecture .............................................................................. 8 Using DFrame ........................................................................................ 9 Prerequisites ..................................................................................... 9 Installing DFrame............................................................................... 9 Steps to Use DFrame to collect performance / { self->in_http=1; } weblogic*:::method-entry /self->in_http/ { this->cn = copyinstr(arg0); this->mn = copyinstr(arg1); self->ts[this->cn,this->mn]=timestamp; } weblogic*:::method-return /self->in_http/ { this->cn = copyinstr(arg0); this->mn = copyinstr(arg1); } weblogic*:::method-return /self->in_http && self->ts[this->cn,this->mn]/ { @s[this->cn,this->mn]=sum(timestamp - self->ts[this->cn, this->mn]); @c[this->cn,this->mn]=count(); self->ts[this->cn,this->mn]=0; } END { printf("%50s.%-10s printa("%50s.%-10s

%15s %8s\n","CLASS","METHOD","TIME","COUNT"); %@15d %@8d\n",@s,@c);

} SAMPLE OUTPUT.

CLASS.METHOD com.bea.medrec.value.Patient.setPhone com.bea.medrec.value.Address.setCity com.bea.medrec.value.Patient.getSsn com.bea.medrec.value.Patient.setEmail com.bea.medrec.value.Address.getCity com.bea.medrec.value.Address.setState com.bea.medrec.value.Address.getState com.bea.medrec.beans.PatientBean.getDob com.bea.medrec.beans.UserBean.toUser com.bea.medrec.beans.PatientBean.getMiddleName com.bea.medrec.beans.BaseBean.getId com.bea.medrec.beans.PatientBean.getFirstName com.bea.medrec.beans.PatientBean.getLastName com.bea.medrec.value.Address.setStreetName2 com.bea.medrec.value.Address.setStreetName1 com.bea.medrec.value.Address.getStreetName1 com.bea.medrec.value.Patient.getMiddleName com.bea.medrec.actions.SearchResultsAction.processSearch com.bea.medrec.actions.SearchResultsAction.search com.bea.medrec.actions.PhysBaseLookupDispatchAction.execute com.bea.medrec.actions.BaseAction.execute

TIME(ns) 1228 1228 1228 1228 1228 1228 1228 16689994 17364983 205 17699911 17783028 2665 17809213 17980862 8343559 1228 8397772 1228 8423503 1228 8430561 1228 4212356200 205 4261589358 205 4277889374 205 7019780498 3485 7764217 7772288 7814521 7817248 7822853 7845840 7867625

COUNT

2460 2460 2460 2460

Dynamic Tracing Framework for Oracle WebLogic Server on Oracle Solaris

com.bea.medrec.actions.BaseLookupDispatchAction.execute com.bea.medrec.filters.RequestEncodingFilter.doFilter

9904998643 1230 15987611900 4096

Note that the above result was from a 2 minute run with the embedProbes.conf file that contains *medrec*:*

Dynamic Tracing Framework for Oracle WebLogic Server on Oracle Solaris

cf-gen.d

This script takes a name of a class.method as its only input and prints the call flow for that method and the time spent in each of the called methods CF-GEN.D

#pragma #pragma #pragma #pragma #pragma

D D D D D

option option option option option

strsize=204800 dynvarsize=30m switchrate=1000hz aggsize=40m aggrate=100hz

weblogic*:::method-entry { this->cm=strjoin(strjoin(copyinstr(arg0),"."),copyinstr(arg1)); } weblogic*:::method-entry /strstr(this->cm,$$1)!=0/ { self->ts=timestamp; self->cf=strjoin("->", this->cm); self->ats[this->cm]=timestamp; } weblogic*:::method-entry /self->ts && strstr(this->cm,$$1)==0/ { self->cf=strjoin(self->cf,strjoin("\n->",this->cm)); self->ats[this->cm]=timestamp; } weblogic*:::method-return /self->ts/ { this->cm=strjoin(strjoin(copyinstr(arg0),"."),copyinstr(arg1)); } weblogic*:::method-return /self->ts && strstr(this->cm,$$1)==0/ { self->cf=strjoin(self->cf,strjoin("\n", copyinstr(arg1)); self->ts=timestamp; } weblogic*:::method-entry /self->ts/ { this->cm=strjoin(strjoin(copyinstr(arg0),"."),copyinstr(arg1)); self->cf=strjoin(self->cf,strjoin("\n->", this->cm)); self->ats[this->cm]=timestamp; } weblogic*:::method-return /self->ts/ { this->cm=strjoin(strjoin(copyinstr(arg0),"."),copyinstr(arg1)); } weblogic*:::method-return /self->ts/ { self->cf=strjoin(self->cf,strjoin("\n