< prev index next >

src/share/vm/services/diagnosticCommand.cpp

Print this page

        

*** 29,38 **** --- 29,39 ---- #include "services/diagnosticCommand.hpp" #include "services/diagnosticFramework.hpp" #include "services/heapDumper.hpp" #include "services/management.hpp" #include "utilities/macros.hpp" + #include "evtrace/traceEvents.hpp" PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC void DCmdRegistrant::register_dcmds(){ // Registration of the diagnostic commands
*** 54,63 **** --- 55,65 ---- DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false)); #endif // INCLUDE_SERVICES DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<EventTracingMarkerDCmd>(full_export, true, false)); // Enhanced JMX Agent Support // These commands won't be exported via the DiagnosticCommandMBean until an // appropriate permission is created for them uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
*** 422,431 **** --- 424,455 ---- if (dcmd != NULL) { DCmdMark mark(dcmd); return dcmd->_dcmdparser.num_arguments(); } else { return 0; + } + } + + EventTracingMarkerDCmd::EventTracingMarkerDCmd(outputStream* output, bool heap) + : DCmdWithParser(output, heap), + _label("label", "description for the marker", "STRING", true) + { + _dcmdparser.add_dcmd_argument(&_label); + } + + void EventTracingMarkerDCmd::execute(DCmdSource source, TRAPS) { + TraceEvents::write_marker(_label.value()); + } + + int EventTracingMarkerDCmd::num_arguments() { + ResourceMark rm; + EventTracingMarkerDCmd* dcmd = new EventTracingMarkerDCmd(NULL, false); + if (dcmd != NULL) { + DCmdMark mark(dcmd); + return dcmd->_dcmdparser.num_arguments(); + } else { + return 0; } } // Enhanced JMX Agent support
< prev index next >