hotspot/src/share/vm/services/attachListener.cpp
changeset 24424 2658d7834c6e
parent 22758 c6b6abb73544
child 24833 c55a7c2888f6
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   282       return JNI_ERR;
   282       return JNI_ERR;
   283     }
   283     }
   284   }
   284   }
   285 
   285 
   286   if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
   286   if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
   287     FormatBuffer<80> err_msg("");
   287     FormatBuffer<80> err_msg("%s", "");
   288     if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) {
   288     if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) {
   289       out->print_cr(err_msg.buffer());
   289       out->print_cr("%s", err_msg.buffer());
   290       return JNI_ERR;
   290       return JNI_ERR;
   291     }
   291     }
   292   } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
   292   } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
   293     FormatBuffer<80> err_msg("");
   293     FormatBuffer<80> err_msg("%s", "");
   294     if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) {
   294     if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) {
   295       out->print_cr(err_msg.buffer());
   295       out->print_cr("%s", err_msg.buffer());
   296       return JNI_ERR;
   296       return JNI_ERR;
   297     }
   297     }
   298   }
   298   }
   299   bool res = CommandLineFlags::uintxAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND);
   299   bool res = CommandLineFlags::uintxAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND);
   300   if (! res) {
   300   if (! res) {
   379     return JNI_ERR;
   379     return JNI_ERR;
   380   }
   380   }
   381   Flag* f = Flag::find_flag((char*)name, strlen(name));
   381   Flag* f = Flag::find_flag((char*)name, strlen(name));
   382   if (f) {
   382   if (f) {
   383     f->print_as_flag(out);
   383     f->print_as_flag(out);
   384     out->print_cr("");
   384     out->cr();
   385   } else {
   385   } else {
   386     out->print_cr("no such flag '%s'", name);
   386     out->print_cr("no such flag '%s'", name);
   387   }
   387   }
   388   return JNI_OK;
   388   return JNI_OK;
   389 }
   389 }