You can apply the usual instructions with GlassFish or you can use the administrative console, which is the officially supported way to do it. Go to http://localhost:4848/, navigate to JVM Options and enter the -agentpath:... option before saving.
Alternatively, you can manually edit the configuration file that stores these entries at<Glassfish home>/domains/domainXXX/domain.xml. You need only add an entry with the -agentpath:... value under /domain/configs/java-config/jvm-options.
For GlassFish version 3, you also need to modify <glassfishHome>/glassfish/osgi/felix/conf/config.properties to include the com.itko.* packages in
the boot delegation list as follows:
# There is no need to use bootdelegation except for the following issues:
# 1. EclipseLink
# 4. NetBeans profiler packages exist in parent class loader (see issue #8612)
# 5. BTrace exists in bootclasspath.
com.sun.btrace, com.sun.btrace.*, \
org.netbeans.lib.profiler, org.netbeans.lib.profiler.*, com.itko.*