Path: blob/master/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp
41149 views
/*1* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_JFR_DCMD_JFRDCMDS_HPP25#define SHARE_JFR_DCMD_JFRDCMDS_HPP2627#include "services/diagnosticCommand.hpp"2829class JfrDumpFlightRecordingDCmd : public DCmdWithParser {30protected:31DCmdArgument<char*> _name;32DCmdArgument<char*> _filename;33DCmdArgument<NanoTimeArgument> _maxage;34DCmdArgument<MemorySizeArgument> _maxsize;35DCmdArgument<char*> _begin;36DCmdArgument<char*> _end;37DCmdArgument<bool> _path_to_gc_roots;3839public:40JfrDumpFlightRecordingDCmd(outputStream* output, bool heap);41static const char* name() {42return "JFR.dump";43}44static const char* description() {45return "Copies contents of a JFR recording to file. Either the name or the recording id must be specified.";46}47static const char* impact() {48return "Low";49}50static const JavaPermission permission() {51JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};52return p;53}54static int num_arguments();55virtual void execute(DCmdSource source, TRAPS);56};5758class JfrCheckFlightRecordingDCmd : public DCmdWithParser {59protected:60DCmdArgument<char*> _name;61DCmdArgument<bool> _verbose;6263public:64JfrCheckFlightRecordingDCmd(outputStream* output, bool heap);65static const char* name() {66return "JFR.check";67}68static const char* description() {69return "Checks running JFR recording(s)";70}71static const char* impact() {72return "Low";73}74static const JavaPermission permission() {75JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};76return p;77}78static int num_arguments();79virtual void execute(DCmdSource source, TRAPS);80};8182class JfrStartFlightRecordingDCmd : public DCmdWithParser {83protected:84DCmdArgument<char*> _name;85DCmdArgument<StringArrayArgument*> _settings;86DCmdArgument<NanoTimeArgument> _delay;87DCmdArgument<NanoTimeArgument> _duration;88DCmdArgument<bool> _disk;89DCmdArgument<char*> _filename;90DCmdArgument<NanoTimeArgument> _maxage;91DCmdArgument<MemorySizeArgument> _maxsize;92DCmdArgument<NanoTimeArgument> _flush_interval;93DCmdArgument<bool> _dump_on_exit;94DCmdArgument<bool> _path_to_gc_roots;9596public:97JfrStartFlightRecordingDCmd(outputStream* output, bool heap);98static const char* name() {99return "JFR.start";100}101static const char* description() {102return "Starts a new JFR recording";103}104static const char* impact() {105return "Medium: Depending on the settings for a recording, the impact can range from low to high.";106}107static const JavaPermission permission() {108JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};109return p;110}111static int num_arguments();112virtual void execute(DCmdSource source, TRAPS);113};114115class JfrStopFlightRecordingDCmd : public DCmdWithParser {116protected:117DCmdArgument<char*> _name;118DCmdArgument<char*> _filename;119120public:121JfrStopFlightRecordingDCmd(outputStream* output, bool heap);122static const char* name() {123return "JFR.stop";124}125static const char* description() {126return "Stops a JFR recording";127}128static const char* impact() {129return "Low";130}131static const JavaPermission permission() {132JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};133return p;134}135static int num_arguments();136virtual void execute(DCmdSource source, TRAPS);137};138139class JfrRuntimeOptions;140141class JfrConfigureFlightRecorderDCmd : public DCmdWithParser {142friend class JfrOptionSet;143protected:144DCmdArgument<char*> _repository_path;145DCmdArgument<char*> _dump_path;146DCmdArgument<jlong> _stack_depth;147DCmdArgument<jlong> _global_buffer_count;148DCmdArgument<MemorySizeArgument> _global_buffer_size;149DCmdArgument<MemorySizeArgument> _thread_buffer_size;150DCmdArgument<MemorySizeArgument> _memory_size;151DCmdArgument<MemorySizeArgument> _max_chunk_size;152DCmdArgument<bool> _sample_threads;153bool _verbose;154155public:156JfrConfigureFlightRecorderDCmd(outputStream* output, bool heap);157void set_verbose(bool verbose) {158_verbose = verbose;159}160static const char* name() {161return "JFR.configure";162}163static const char* description() {164return "Configure JFR";165}166static const char* impact() {167return "Low";168}169static const JavaPermission permission() {170JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};171return p;172}173static int num_arguments();174virtual void execute(DCmdSource source, TRAPS);175};176177bool register_jfr_dcmds();178179#endif // SHARE_JFR_DCMD_JFRDCMDS_HPP180181182