--- old/hotspot/make/defs.make Thu Jan 7 14:58:19 2010 +++ new/hotspot/make/defs.make Thu Jan 7 14:58:19 2010 @@ -1,5 +1,5 @@ # -# Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -259,6 +259,7 @@ # Common export list of files EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h --- old/hotspot/make/Makefile Thu Jan 7 14:58:20 2010 +++ new/hotspot/make/Makefile Thu Jan 7 14:58:20 2010 @@ -1,5 +1,5 @@ # -# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -281,10 +281,13 @@ $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar $(install-file) -# Include files (jvmti.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h) +# Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h) $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/% $(install-file) +$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/% + $(install-file) + $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/% $(install-file) --- /dev/null Thu Jan 7 14:58:20 2010 +++ new/hotspot/src/share/vm/code/jvmticmlr.h Thu Jan 7 14:58:20 2010 @@ -0,0 +1,115 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * This header file defines the data structures sent by the VM + * through the JVMTI CompiledMethodLoad callback function via the + * "void * compile_info" parameter. The memory pointed to by the + * compile_info parameter may not be referenced after returning from + * the CompiledMethodLoad callback. These are VM implementation + * specific data structures that may evolve in future releases. A + * JVMTI agent should interpret a non-NULL compile_info as a pointer + * to a region of memory containing a list of records. In a typical + * usage scenario, a JVMTI agent would cast each record to a + * jvmtiCompiledMethodLoadRecordHeader, a struct that represents + * arbitrary information. This struct contains a kind field to indicate + * the kind of information being passed, and a pointer to the next + * record. If the kind field indicates inlining information, then the + * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. + * This record contains an array of PCStackInfo structs, which indicate + * for every pc address what are the methods on the invocation stack. + * The "methods" and "bcis" fields in each PCStackInfo struct specify a + * 1-1 mapping between these inlined methods and their bytecode indices. + * This can be used to derive the proper source lines of the inlined + * methods. + */ + +#ifndef _JVMTI_CMLR_H_ +#define _JVMTI_CMLR_H_ + +enum { + JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, + JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, + + JVMTI_CMLR_MAJOR_VERSION = 0x00000001, + JVMTI_CMLR_MINOR_VERSION = 0x00000000 + + /* + * This comment is for the "JDK import from HotSpot" sanity check: + * version: 1.0.0 + */ +}; + +typedef enum { + JVMTI_CMLR_DUMMY = 1, + JVMTI_CMLR_INLINE_INFO = 2 +} jvmtiCMLRKind; + +/* + * Record that represents arbitrary information passed through JVMTI + * CompiledMethodLoadEvent void pointer. + */ +typedef struct _jvmtiCompiledMethodLoadRecordHeader { + jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ + jint majorinfoversion; /* major and minor info version values. Init'ed */ + jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ + + struct _jvmtiCompiledMethodLoadRecordHeader* next; +} jvmtiCompiledMethodLoadRecordHeader; + +/* + * Record that gives information about the methods on the compile-time + * stack at a specific pc address of a compiled method. Each element in + * the methods array maps to same element in the bcis array. + */ +typedef struct _PCStackInfo { + void* pc; /* the pc address for this compiled method */ + jint numstackframes; /* number of methods on the stack */ + jmethodID* methods; /* array of numstackframes method ids */ + jint* bcis; /* array of numstackframes bytecode indices */ +} PCStackInfo; + +/* + * Record that contains inlining information for each pc address of + * an nmethod. + */ +typedef struct _jvmtiCompiledMethodLoadInlineRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + jint numpcs; /* number of pc descriptors in this nmethod */ + PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ +} jvmtiCompiledMethodLoadInlineRecord; + +/* + * Dummy record used to test that we can pass records with different + * information through the void pointer provided that they can be cast + * to a jvmtiCompiledMethodLoadRecordHeader. + */ + +typedef struct _jvmtiCompiledMethodLoadDummyRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + char message[50]; +} jvmtiCompiledMethodLoadDummyRecord; + +#endif --- old/hotspot/src/share/vm/includeDB_core Thu Jan 7 14:58:20 2010 +++ new/hotspot/src/share/vm/includeDB_core Thu Jan 7 14:58:20 2010 @@ -1,5 +1,5 @@ // -// Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -2500,6 +2500,7 @@ jvmtiExport.hpp handles.hpp jvmtiExport.hpp iterator.hpp jvmtiExport.hpp jvmti.h +jvmtiExport.hpp jvmticmlr.h jvmtiExport.hpp oop.hpp jvmtiExport.hpp oopsHierarchy.hpp --- old/hotspot/src/share/vm/prims/jvmtiExport.cpp Thu Jan 7 14:58:21 2010 +++ new/hotspot/src/share/vm/prims/jvmtiExport.cpp Thu Jan 7 14:58:21 2010 @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -686,11 +686,11 @@ jvmtiAddrLocationMap *_map; const void *_compile_info; public: - JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm) + JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm, void* compile_info_ptr = NULL) : JvmtiMethodEventMark(thread,methodHandle(thread, nm->method())) { _code_data = nm->code_begin(); _code_size = nm->code_size(); - _compile_info = NULL; /* no info for our VM. */ + _compile_info = compile_info_ptr; // Set void pointer of compiledMethodLoad Event. Default value is NULL. JvmtiCodeBlobEvents::build_jvmti_addr_location_map(nm, &_map, &_map_length); } ~JvmtiCompiledMethodLoadEventMark() { @@ -1752,6 +1752,46 @@ } } +// Returns a record containing inlining information for the given nmethod +jvmtiCompiledMethodLoadInlineRecord* create_inline_record(nmethod* nm) { + jint numstackframes = 0; + jvmtiCompiledMethodLoadInlineRecord* record = (jvmtiCompiledMethodLoadInlineRecord*)NEW_RESOURCE_OBJ(jvmtiCompiledMethodLoadInlineRecord); + record->header.kind = JVMTI_CMLR_INLINE_INFO; + record->header.next = NULL; + record->header.majorinfoversion = JVMTI_CMLR_MAJOR_VERSION_1; + record->header.minorinfoversion = JVMTI_CMLR_MINOR_VERSION_0; + record->numpcs = 0; + for(PcDesc* p = nm->scopes_pcs_begin(); p < nm->scopes_pcs_end(); p++) { + if(p->scope_decode_offset() == DebugInformationRecorder::serialized_null) continue; + record->numpcs++; + } + record->pcinfo = (PCStackInfo*)(NEW_RESOURCE_ARRAY(PCStackInfo, record->numpcs)); + int scope = 0; + for(PcDesc* p = nm->scopes_pcs_begin(); p < nm->scopes_pcs_end(); p++) { + if(p->scope_decode_offset() == DebugInformationRecorder::serialized_null) continue; + void* pc_address = (void*)p->real_pc(nm); + assert(pc_address != NULL, "pc_address must be non-null"); + record->pcinfo[scope].pc = pc_address; + numstackframes=0; + for(ScopeDesc* sd = nm->scope_desc_at(p->real_pc(nm));sd != NULL;sd = sd->sender()) { + numstackframes++; + } + assert(numstackframes != 0, "numstackframes must be nonzero."); + record->pcinfo[scope].methods = (jmethodID *)NEW_RESOURCE_ARRAY(jmethodID, numstackframes); + record->pcinfo[scope].bcis = (jint *)NEW_RESOURCE_ARRAY(jint, numstackframes); + record->pcinfo[scope].numstackframes = numstackframes; + int stackframe = 0; + for(ScopeDesc* sd = nm->scope_desc_at(p->real_pc(nm));sd != NULL;sd = sd->sender()) { + // sd->method() can be NULL for stubs but not for nmethods. To be completely robust, include an assert that we should never see a null sd->method() + assert(!sd->method().is_null(), "sd->method() cannot be null."); + record->pcinfo[scope].methods[stackframe] = sd->method()->jmethod_id(); + record->pcinfo[scope].bcis[stackframe] = sd->bci(); + stackframe++; + } + scope++; + } + return record; +} void JvmtiExport::post_compiled_method_load(nmethod *nm) { // If there are pending CompiledMethodUnload events then these are @@ -1780,7 +1820,11 @@ (nm->method() == NULL) ? "NULL" : nm->method()->name()->as_C_string())); ResourceMark rm(thread); - JvmtiCompiledMethodLoadEventMark jem(thread, nm); + + // Add inlining information + jvmtiCompiledMethodLoadInlineRecord* inlinerecord = create_inline_record(nm); + // Pass inlining information through the void pointer + JvmtiCompiledMethodLoadEventMark jem(thread, nm, inlinerecord); JvmtiJavaThreadEventTransition jet(thread); jvmtiEventCompiledMethodLoad callback = env->callbacks()->CompiledMethodLoad; if (callback != NULL) { --- old/jdk/make/common/shared/Sanity.gmk Thu Jan 7 14:58:21 2010 +++ new/jdk/make/common/shared/Sanity.gmk Thu Jan 7 14:58:21 2010 @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1086,6 +1086,7 @@ # Check for existence of misc Hotspot imported files ###################################################### HOTSPOT_INCLUDE_FILE_LIST = jvmti.h +HOTSPOT_INCLUDE_FILE_LIST += jvmticmlr.h #HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h #HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h #HOTSPOT_INCLUDE_FILE_LIST += jmm.h --- old/jdk/make/java/jvm/Makefile Thu Jan 7 14:58:22 2010 +++ new/jdk/make/java/jvm/Makefile Thu Jan 7 14:58:22 2010 @@ -1,5 +1,5 @@ # -# Copyright 1995-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,8 @@ FILES_h = $(INCLUDEDIR)/jni.h \ $(PLATFORM_INCLUDE)/jni_md.h \ - $(INCLUDEDIR)/jvmti.h \ + $(INCLUDEDIR)/jvmti.h \ + $(INCLUDEDIR)/jvmticmlr.h \ $(INCLUDEDIR)/classfile_constants.h $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h --- /dev/null Thu Jan 7 14:58:23 2010 +++ new/jdk/make/mkdemo/jvmti/compiledMethodLoad/Makefile Thu Jan 7 14:58:22 2010 @@ -0,0 +1,41 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = ../../.. +PRODUCT = demo/jvmti +DEMONAME = compiledMethodLoad +include $(BUILDDIR)/common/Defs.gmk + +DEMO_ROOT = $(SHARE_SRC)/demo/jvmti/$(DEMONAME) +DEMO_TOPFILES = ./README.txt +DEMO_DESTDIR = $(DEMODIR)/jvmti/$(DEMONAME) + +DEMO_OBJECTS = agent_util.$(OBJECT_SUFFIX) + +# +# Demo jar building rules. +# +include $(BUILDDIR)/common/Demo.gmk + --- old/jdk/make/mkdemo/jvmti/Makefile Thu Jan 7 14:58:23 2010 +++ new/jdk/make/mkdemo/jvmti/Makefile Thu Jan 7 14:58:23 2010 @@ -1,5 +1,5 @@ # -# Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -33,12 +33,13 @@ # Can be built in any order, the JRE version of hprof and java_crw_demo are # really built in make/java. -# The hprof target here just deliveres the sources and README files. +# The hprof target here just delivers the sources and README files. # The java_crw_demo and agent_util files are copied into each demo that # uses them. SUBDIRS = \ versionCheck \ - gctest \ + compiledMethodLoad \ + gctest \ heapViewer \ heapTracker \ minst \ --- old/jdk/make/mkdemo/jvmti/README.txt Thu Jan 7 14:58:23 2010 +++ new/jdk/make/mkdemo/jvmti/README.txt Thu Jan 7 14:58:23 2010 @@ -1,5 +1,5 @@ # -# Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ Basically you want to mimic the jvmti demo agent "mtrace". -* Create and populate a source directory at src/demo/jvmti - (Try and re-use code in agent_util area like src/demo/jvmti/mtrace) +* Create and populate a source directory at src/share/demo/jvmti + (Try and re-use code in agent_util area like src/share/demo/jvmti/mtrace) (This should include a small README.txt document on what this demo is) * Make sure the appropriate "demo" copyright notice is added to all the @@ -44,7 +44,7 @@ * Create test directory at test/demo/jvmti, create at least one test (Use test/demo/jvmti/mtrace as a template) -* Don't forget to SCCS in all the new files +* Don't forget to check in all the new files * Build and create images (cd make && gnumake && gnumake images) (Do this on Solaris, Linux, and at least one Windows platform) @@ -54,5 +54,5 @@ * Run the tests: cd test/demo/jvmti && runregress . (Do this on Solaris, Linux, and at least one Windows platform) -Contact: jk-svc-group@sun.com for more information or help. +Contact: serviceability-dev@openjdk.java.net for more information or help. --- /dev/null Thu Jan 7 14:58:24 2010 +++ new/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c Thu Jan 7 14:58:24 2010 @@ -0,0 +1,268 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Sun Microsystems nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include "jni.h" +#include "jvmti.h" +#include "jvmticmlr.h" + +#include "agent_util.h" + +/* Global static data */ +static char OUTPUT_FILE[] = "compiledMethodLoad.txt"; +static FILE *fp; +static jvmtiEnv *jvmti; +static jrawMonitorID lock; + +/* print a jvmtiCompiledMethodLoadDummyRecord */ +void +print_dummy_record(jvmtiCompiledMethodLoadDummyRecord* record, + jvmtiEnv* jvmti, FILE* fp) { + + if (record != NULL) { + fprintf(fp, "Dummy record detected containing message: %s\n", + (char *)record->message); + } +} + +/* print the specified stack frames */ +void +print_stack_frames(PCStackInfo* record, jvmtiEnv *jvmti, FILE* fp) { + if (record != NULL && record->methods != NULL) { + int i; + + for (i = 0; i < record->numstackframes; i++) { + jvmtiError err; + char* method_name = NULL; + char* class_name = NULL; + char* method_signature = NULL; + char* class_signature = NULL; + char* generic_ptr_method = NULL; + char* generic_ptr_class = NULL; + jmethodID id; + jclass declaringclassptr; + id = record->methods[i]; + + err = (*jvmti)->GetMethodDeclaringClass(jvmti, id, + &declaringclassptr); + check_jvmti_error(jvmti, err, "get method declaring class"); + + err = (*jvmti)->GetClassSignature(jvmti, declaringclassptr, + &class_signature, &generic_ptr_class); + check_jvmti_error(jvmti, err, "get class signature"); + + err = (*jvmti)->GetMethodName(jvmti, id, &method_name, + &method_signature, &generic_ptr_method); + check_jvmti_error(jvmti, err, "get method name"); + + fprintf(fp, "%s::%s %s %s @%d\n", class_signature, method_name, + method_signature, + generic_ptr_method == NULL ? "" : generic_ptr_method, + record->bcis[i]); + + if (method_name != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)method_name); + check_jvmti_error(jvmti, err, "deallocate method_name"); + } + if (method_signature != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)method_signature); + check_jvmti_error(jvmti, err, "deallocate method_signature"); + } + if (generic_ptr_method != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)generic_ptr_method); + check_jvmti_error(jvmti, err, "deallocate generic_ptr_method"); + } + if (class_name != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)class_name); + check_jvmti_error(jvmti, err, "deallocate class_name"); + } + if (class_signature != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)class_signature); + check_jvmti_error(jvmti, err, "deallocate class_signature"); + } + if (generic_ptr_class != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)generic_ptr_class); + check_jvmti_error(jvmti, err, "deallocate generic_ptr_class"); + } + } + } +} + +/* print a jvmtiCompiledMethodLoadInlineRecord */ +void +print_inline_info_record(jvmtiCompiledMethodLoadInlineRecord* record, + jvmtiEnv *jvmti, FILE* fp) { + + if (record != NULL && record->pcinfo != NULL) { + int numpcs = record->numpcs; + int i; + + for (i = 0; i < numpcs; i++) { + PCStackInfo pcrecord = (record->pcinfo[i]); + fprintf(fp, "PcDescriptor(pc=0x%lx):\n", (jint)(pcrecord.pc)); + print_stack_frames(&pcrecord, jvmti, fp); + } + } +} + +/* decode kind of CompiledMethodLoadRecord and print */ +void +print_records(jvmtiCompiledMethodLoadRecordHeader* list, jvmtiEnv *jvmti, + FILE* fp) +{ + jvmtiCompiledMethodLoadRecordHeader* curr = list; + fprintf(fp, "\nPrinting PC Descriptors\n\n"); + while (curr != NULL) { + switch (curr->kind) { + case JVMTI_CMLR_DUMMY: + print_dummy_record((jvmtiCompiledMethodLoadDummyRecord *)curr, + jvmti, fp); + break; + + case JVMTI_CMLR_INLINE_INFO: + print_inline_info_record( + (jvmtiCompiledMethodLoadInlineRecord *)curr, jvmti, fp); + break; + + default: + fprintf(fp, "Warning: unrecognized record: kind=%d\n", curr->kind); + break; + } + + curr = (jvmtiCompiledMethodLoadRecordHeader *)curr->next; + } +} + +/* Callback for JVMTI_EVENT_COMPILED_METHOD_LOAD */ +void JNICALL +compiled_method_load(jvmtiEnv *jvmti, jmethodID method, jint code_size, + const void* code_addr, jint map_length, const jvmtiAddrLocationMap* map, + const void* compile_info) +{ + jvmtiError err; + char* name = NULL; + char* signature = NULL; + char* generic_ptr = NULL; + jvmtiCompiledMethodLoadRecordHeader* pcs; + + err = (*jvmti)->RawMonitorEnter(jvmti, lock); + check_jvmti_error(jvmti, err, "raw monitor enter"); + + err = (*jvmti)->GetMethodName(jvmti, method, &name, &signature, + &generic_ptr); + check_jvmti_error(jvmti, err, "get method name"); + + fprintf(fp, "\nCompiled method load event\n"); + fprintf(fp, "Method name %s %s %s\n\n", name, signature, + generic_ptr == NULL ? "" : generic_ptr); + pcs = (jvmtiCompiledMethodLoadRecordHeader *)compile_info; + if (pcs != NULL) { + print_records(pcs, jvmti, fp); + } + + if (name != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)name); + check_jvmti_error(jvmti, err, "deallocate name"); + } + if (signature != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)signature); + check_jvmti_error(jvmti, err, "deallocate signature"); + } + if (generic_ptr != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)generic_ptr); + check_jvmti_error(jvmti, err, "deallocate generic_ptr"); + } + + err = (*jvmti)->RawMonitorExit(jvmti, lock); + check_jvmti_error(jvmti, err, "raw monitor exit"); +} + +/* Agent_OnLoad() is called first, we prepare for a COMPILED_METHOD_LOAD + * event here. + */ +JNIEXPORT jint JNICALL +Agent_OnLoad(JavaVM *vm, char *options, void *reserved) +{ + jint rc; + jvmtiError err; + jvmtiCapabilities capabilities; + jvmtiEventCallbacks callbacks; + + fp = fopen(OUTPUT_FILE, "w"); + if (fp == NULL) { + fatal_error("ERROR: %s: Unable to create output file\n", OUTPUT_FILE); + return -1; + } + + /* Get JVMTI environment */ + rc = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION); + if (rc != JNI_OK) { + fatal_error( + "ERROR: Unable to create jvmtiEnv, GetEnv failed, error=%d\n", rc); + return -1; + } + + /* add JVMTI capabilities */ + memset(&capabilities,0, sizeof(capabilities)); + capabilities.can_generate_compiled_method_load_events = 1; + err = (*jvmti)->AddCapabilities(jvmti, &capabilities); + check_jvmti_error(jvmti, err, "add capabilities"); + + /* set JVMTI callbacks for events */ + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.CompiledMethodLoad = &compiled_method_load; + err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(callbacks)); + check_jvmti_error(jvmti, err, "set event callbacks"); + + /* enable JVMTI events */ + err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, + JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL); + check_jvmti_error(jvmti, err, "set event notify"); + + /* create coordination monitor */ + err = (*jvmti)->CreateRawMonitor(jvmti, "agent lock", &lock); + check_jvmti_error(jvmti, err, "create raw monitor"); + + return 0; +} + +/* Agent_OnUnload() is called last */ +JNIEXPORT void JNICALL +Agent_OnUnload(JavaVM *vm) +{ +} --- /dev/null Thu Jan 7 14:58:24 2010 +++ new/jdk/src/share/demo/jvmti/compiledMethodLoad/README.txt Thu Jan 7 14:58:24 2010 @@ -0,0 +1,42 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# - Neither the name of Sun Microsystems nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +compiledMethodLoad + +This agent library traces CompiledMethodLoad events along +with the HotSpot specific compile_info parameter. + +You can use this agent library as follows: + + java -agentlib:compiledMethodLoad ... + +See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. + --- /dev/null Thu Jan 7 14:58:25 2010 +++ new/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt Thu Jan 7 14:58:25 2010 @@ -0,0 +1,148 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# - Neither the name of Sun Microsystems nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +######################################################################## +# +# Sample GNU Makefile for building JVMTI Demo compiledMethodLoad +# +# Example uses: +# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] +# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] +# gnumake JDK= OSNAME=linux [OPT=true] +# gnumake JDK= OSNAME=win32 [OPT=true] +# +######################################################################## + +# Source lists +LIBNAME=compiledMethodLoad +SOURCES=compiledMethodLoad.c ../agent_util/agent_util.c + +# Solaris Sun C Compiler Version 5.5 +ifeq ($(OSNAME), solaris) + # Sun Solaris Compiler options needed + COMMON_FLAGS=-mt -KPIC + # Options that help find errors + COMMON_FLAGS+= -Xa -v -xstrconst -xc99=%none + # Check LIBARCH for any special compiler options + LIBARCH=$(shell uname -p) + ifeq ($(LIBARCH), sparc) + COMMON_FLAGS+=-xarch=v8 -xregs=no%appl + endif + ifeq ($(LIBARCH), sparcv9) + COMMON_FLAGS+=-xarch=v9 -xregs=no%appl + endif + ifeq ($(OPT), true) + CFLAGS=-xO2 $(COMMON_FLAGS) + else + CFLAGS=-g $(COMMON_FLAGS) + endif + # Object files needed to create library + OBJECTS=$(SOURCES:%.c=%.o) + # Library name and options needed to build it + LIBRARY=lib$(LIBNAME).so + LDFLAGS=-z defs -ztext + # Libraries we are dependent on + LIBRARIES= -lc + # Building a shared library + LINK_SHARED=$(LINK.c) -G -o $@ +endif + +# Linux GNU C Compiler +ifeq ($(OSNAME), linux) + # GNU Compiler options needed to build it + COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer + # Options that help find errors + COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses + ifeq ($(OPT), true) + CFLAGS=-O2 $(COMMON_FLAGS) + else + CFLAGS=-g $(COMMON_FLAGS) + endif + # Object files needed to create library + OBJECTS=$(SOURCES:%.c=%.o) + # Library name and options needed to build it + LIBRARY=lib$(LIBNAME).so + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + # Libraries we are dependent on + LIBRARIES=-lc + # Building a shared library + LINK_SHARED=$(LINK.c) -shared -o $@ +endif + +# Windows Microsoft C/C++ Optimizing Compiler Version 12 +ifeq ($(OSNAME), win32) + CC=cl + # Compiler options needed to build it + COMMON_FLAGS=-Gy -DWIN32 + # Options that help find errors + COMMON_FLAGS+=-W0 -WX + ifeq ($(OPT), true) + CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) + else + CFLAGS= -Od -Zi $(COMMON_FLAGS) + endif + # Object files needed to create library + OBJECTS=$(SOURCES:%.c=%.obj) + # Library name and options needed to build it + LIBRARY=$(LIBNAME).dll + LDFLAGS= + # Libraries we are dependent on + LIBRARIES= + # Building a shared library + LINK_SHARED=link -dll -out:$@ +endif + +# Common -I options +CFLAGS += -I. +CFLAGS += -I../agent_util +CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) + +# Default rule +all: $(LIBRARY) + +# Build native library +$(LIBRARY): $(OBJECTS) + $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) + +# Cleanup the built bits +clean: + rm -f $(LIBRARY) $(OBJECTS) + +# Simple tester +test: all + LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version + +# Compilation rule only needed on Windows +ifeq ($(OSNAME), win32) +%.obj: %.c + $(COMPILE.c) $< +endif + --- old/jdk/src/share/demo/jvmti/index.html Thu Jan 7 14:58:25 2010 +++ new/jdk/src/share/demo/jvmti/index.html Thu Jan 7 14:58:25 2010 @@ -100,6 +100,13 @@
  • +compiledMethodLoad +
    +This is a small agent that traces CompiledMethodLoad events along +with the HotSpot specific compile_info parameter. +
  • + +
  • mtrace
    This is a small agent that does method tracing. --- /dev/null Thu Jan 7 14:58:26 2010 +++ new/jdk/src/share/javavm/export/jvmticmlr.h Thu Jan 7 14:58:26 2010 @@ -0,0 +1,115 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * This header file defines the data structures sent by the VM + * through the JVMTI CompiledMethodLoad callback function via the + * "void * compile_info" parameter. The memory pointed to by the + * compile_info parameter may not be referenced after returning from + * the CompiledMethodLoad callback. These are VM implementation + * specific data structures that may evolve in future releases. A + * JVMTI agent should interpret a non-NULL compile_info as a pointer + * to a region of memory containing a list of records. In a typical + * usage scenario, a JVMTI agent would cast each record to a + * jvmtiCompiledMethodLoadRecordHeader, a struct that represents + * arbitrary information. This struct contains a kind field to indicate + * the kind of information being passed, and a pointer to the next + * record. If the kind field indicates inlining information, then the + * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. + * This record contains an array of PCStackInfo structs, which indicate + * for every pc address what are the methods on the invocation stack. + * The "methods" and "bcis" fields in each PCStackInfo struct specify a + * 1-1 mapping between these inlined methods and their bytecode indices. + * This can be used to derive the proper source lines of the inlined + * methods. + */ + +#ifndef _JVMTI_CMLR_H_ +#define _JVMTI_CMLR_H_ + +enum { + JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, + JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, + + JVMTI_CMLR_MAJOR_VERSION = 0x00000001, + JVMTI_CMLR_MINOR_VERSION = 0x00000000 + + /* + * This comment is for the "JDK import from HotSpot" sanity check: + * version: 1.0.0 + */ +}; + +typedef enum { + JVMTI_CMLR_DUMMY = 1, + JVMTI_CMLR_INLINE_INFO = 2 +} jvmtiCMLRKind; + +/* + * Record that represents arbitrary information passed through JVMTI + * CompiledMethodLoadEvent void pointer. + */ +typedef struct _jvmtiCompiledMethodLoadRecordHeader { + jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ + jint majorinfoversion; /* major and minor info version values. Init'ed */ + jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ + + struct _jvmtiCompiledMethodLoadRecordHeader* next; +} jvmtiCompiledMethodLoadRecordHeader; + +/* + * Record that gives information about the methods on the compile-time + * stack at a specific pc address of a compiled method. Each element in + * the methods array maps to same element in the bcis array. + */ +typedef struct _PCStackInfo { + void* pc; /* the pc address for this compiled method */ + jint numstackframes; /* number of methods on the stack */ + jmethodID* methods; /* array of numstackframes method ids */ + jint* bcis; /* array of numstackframes bytecode indices */ +} PCStackInfo; + +/* + * Record that contains inlining information for each pc address of + * an nmethod. + */ +typedef struct _jvmtiCompiledMethodLoadInlineRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + jint numpcs; /* number of pc descriptors in this nmethod */ + PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ +} jvmtiCompiledMethodLoadInlineRecord; + +/* + * Dummy record used to test that we can pass records with different + * information through the void pointer provided that they can be cast + * to a jvmtiCompiledMethodLoadRecordHeader. + */ + +typedef struct _jvmtiCompiledMethodLoadDummyRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + char message[50]; +} jvmtiCompiledMethodLoadDummyRecord; + +#endif --- /dev/null Thu Jan 7 14:58:26 2010 +++ new/jdk/test/demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java Thu Jan 7 14:58:26 2010 @@ -0,0 +1,51 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +/* @test + * @bug 6580131 + * @summary Test jvmti demo compiledMethodLoad + * + * @compile ../DemoRun.java ../Hello.java + * @build CompiledMethodLoadTest + * @run main CompiledMethodLoadTest Hello + */ + +public class CompiledMethodLoadTest { + + public static void main(String args[]) throws Exception { + DemoRun demo; + + /* Run demo that uses JVMTI compiledMethodLoad agent (no options) */ + demo = new DemoRun("compiledMethodLoad", "" /* options to compiledMethodLoad */ ); + demo.runit(args[0]); + + /* Make sure patterns in output look ok */ + if (demo.output_contains("ERROR")) { + throw new RuntimeException("Test failed - ERROR seen in output"); + } + + /* Must be a pass. */ + System.out.println("Test passed - cleanly terminated"); + } +} --- old/jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java Thu Jan 7 14:58:27 2010 +++ new/jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java Thu Jan 7 14:58:26 2010 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ /* Make sure patterns in output look ok */ if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ --- old/jdk/test/demo/jvmti/hprof/CpuTimesDefineClassTest.java Thu Jan 7 14:58:27 2010 +++ new/jdk/test/demo/jvmti/hprof/CpuTimesDefineClassTest.java Thu Jan 7 14:58:27 2010 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ /* Make sure patterns in output look ok */ if (hprof.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ --- old/jdk/test/demo/jvmti/hprof/CpuTimesTest.java Thu Jan 7 14:58:28 2010 +++ new/jdk/test/demo/jvmti/hprof/CpuTimesTest.java Thu Jan 7 14:58:27 2010 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ /* Make sure patterns in output look ok */ if (hprof.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ --- old/jdk/test/demo/jvmti/minst/MinstTest.java Thu Jan 7 14:58:28 2010 +++ new/jdk/test/demo/jvmti/minst/MinstTest.java Thu Jan 7 14:58:28 2010 @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ /* Make sure patterns in output look ok */ if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ --- old/jdk/test/demo/jvmti/mtrace/TraceJFrame.java Thu Jan 7 14:58:29 2010 +++ new/jdk/test/demo/jvmti/mtrace/TraceJFrame.java Thu Jan 7 14:58:28 2010 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ /* Make sure patterns in output look ok */ if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */