1 /* |
1 /* |
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 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. |
23 */ |
23 */ |
24 |
24 |
25 #ifndef SHARE_VM_SERVICES_NMT_DCMD_HPP |
25 #ifndef SHARE_VM_SERVICES_NMT_DCMD_HPP |
26 #define SHARE_VM_SERVICES_NMT_DCMD_HPP |
26 #define SHARE_VM_SERVICES_NMT_DCMD_HPP |
27 |
27 |
|
28 #if INCLUDE_NMT |
|
29 |
28 #include "services/diagnosticArgument.hpp" |
30 #include "services/diagnosticArgument.hpp" |
29 #include "services/diagnosticFramework.hpp" |
31 #include "services/diagnosticFramework.hpp" |
|
32 #include "services/memBaseline.hpp" |
|
33 #include "services/mallocTracker.hpp" |
30 |
34 |
31 /** |
35 /** |
32 * Native memory tracking DCmd implementation |
36 * Native memory tracking DCmd implementation |
33 */ |
37 */ |
34 class NMTDCmd: public DCmdWithParser { |
38 class NMTDCmd: public DCmdWithParser { |
37 DCmdArgument<bool> _detail; |
41 DCmdArgument<bool> _detail; |
38 DCmdArgument<bool> _baseline; |
42 DCmdArgument<bool> _baseline; |
39 DCmdArgument<bool> _summary_diff; |
43 DCmdArgument<bool> _summary_diff; |
40 DCmdArgument<bool> _detail_diff; |
44 DCmdArgument<bool> _detail_diff; |
41 DCmdArgument<bool> _shutdown; |
45 DCmdArgument<bool> _shutdown; |
42 DCmdArgument<bool> _auto_shutdown; |
46 DCmdArgument<bool> _statistics; |
43 #ifndef PRODUCT |
|
44 DCmdArgument<bool> _debug; |
|
45 #endif |
|
46 DCmdArgument<char*> _scale; |
47 DCmdArgument<char*> _scale; |
47 |
48 |
48 public: |
49 public: |
49 NMTDCmd(outputStream* output, bool heap); |
50 NMTDCmd(outputStream* output, bool heap); |
50 static const char* name() { return "VM.native_memory"; } |
51 static const char* name() { return "VM.native_memory"; } |
59 "monitor", NULL}; |
60 "monitor", NULL}; |
60 return p; |
61 return p; |
61 } |
62 } |
62 static int num_arguments(); |
63 static int num_arguments(); |
63 virtual void execute(DCmdSource source, TRAPS); |
64 virtual void execute(DCmdSource source, TRAPS); |
|
65 |
|
66 private: |
|
67 void report(bool summaryOnly, size_t scale); |
|
68 void report_diff(bool summaryOnly, size_t scale); |
|
69 |
|
70 size_t get_scale(const char* scale) const; |
|
71 |
|
72 // check if NMT running at detail tracking level |
|
73 bool check_detail_tracking_level(outputStream* out); |
64 }; |
74 }; |
65 |
75 |
|
76 #endif // INCLUDE_NMT |
|
77 |
66 #endif // SHARE_VM_SERVICES_NMT_DCMD_HPP |
78 #endif // SHARE_VM_SERVICES_NMT_DCMD_HPP |