1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
756 // Constant Types
757 static PerfStringConstant* create_string_constant(CounterNS ns,
758 const char* name,
759 const char *s, TRAPS);
760
761 static PerfLongConstant* create_long_constant(CounterNS ns,
762 const char* name,
763 PerfData::Units u,
764 jlong val, TRAPS);
765
766
767 // Variable Types
768 static PerfStringVariable* create_string_variable(CounterNS ns,
769 const char* name,
770 int max_length,
771 const char *s, TRAPS);
772
773 static PerfStringVariable* create_string_variable(CounterNS ns,
774 const char* name,
775 const char *s, TRAPS) {
776 return create_string_variable(ns, name, 0, s, CHECK_NULL);
777 };
778
779 static PerfLongVariable* create_long_variable(CounterNS ns,
780 const char* name,
781 PerfData::Units u,
782 jlong ival, TRAPS);
783
784 static PerfLongVariable* create_long_variable(CounterNS ns,
785 const char* name,
786 PerfData::Units u, TRAPS) {
787 return create_long_variable(ns, name, u, (jlong)0, CHECK_NULL);
788 };
789
790 static PerfLongVariable* create_long_variable(CounterNS, const char* name,
791 PerfData::Units u,
792 jlong* sp, TRAPS);
793
794 static PerfLongVariable* create_long_variable(CounterNS ns,
795 const char* name,
796 PerfData::Units u,
797 PerfLongSampleHelper* sh,
798 TRAPS);
799
800
801 // Counter Types
802 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
803 PerfData::Units u,
804 jlong ival, TRAPS);
805
806 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
807 PerfData::Units u, TRAPS) {
808 return create_long_counter(ns, name, u, (jlong)0, CHECK_NULL);
809 };
810
811 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
812 PerfData::Units u, jlong* sp,
813 TRAPS);
814
815 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
816 PerfData::Units u,
817 PerfLongSampleHelper* sh,
818 TRAPS);
819
820
821 // these creation methods are provided for ease of use. These allow
822 // Long performance data types to be created with a shorthand syntax.
823
824 static PerfConstant* create_constant(CounterNS ns, const char* name,
825 PerfData::Units u, jlong val, TRAPS) {
826 return create_long_constant(ns, name, u, val, CHECK_NULL);
827 }
828
829 static PerfVariable* create_variable(CounterNS ns, const char* name,
830 PerfData::Units u, jlong ival, TRAPS) {
831 return create_long_variable(ns, name, u, ival, CHECK_NULL);
832 }
833
834 static PerfVariable* create_variable(CounterNS ns, const char* name,
835 PerfData::Units u, TRAPS) {
836 return create_long_variable(ns, name, u, (jlong)0, CHECK_NULL);
837 }
838
839 static PerfVariable* create_variable(CounterNS ns, const char* name,
840 PerfData::Units u, jlong* sp, TRAPS) {
841 return create_long_variable(ns, name, u, sp, CHECK_NULL);
842 }
843
844 static PerfVariable* create_variable(CounterNS ns, const char* name,
845 PerfData::Units u,
846 PerfSampleHelper* sh, TRAPS) {
847 return create_long_variable(ns, name, u, sh, CHECK_NULL);
848 }
849
850 static PerfCounter* create_counter(CounterNS ns, const char* name,
851 PerfData::Units u, jlong ival, TRAPS) {
852 return create_long_counter(ns, name, u, ival, CHECK_NULL);
853 }
854
855 static PerfCounter* create_counter(CounterNS ns, const char* name,
856 PerfData::Units u, TRAPS) {
857 return create_long_counter(ns, name, u, (jlong)0, CHECK_NULL);
858 }
859
860 static PerfCounter* create_counter(CounterNS ns, const char* name,
861 PerfData::Units u, jlong* sp, TRAPS) {
862 return create_long_counter(ns, name, u, sp, CHECK_NULL);
863 }
864
865 static PerfCounter* create_counter(CounterNS ns, const char* name,
866 PerfData::Units u,
867 PerfSampleHelper* sh, TRAPS) {
868 return create_long_counter(ns, name, u, sh, CHECK_NULL);
869 }
870
871 static void destroy();
872 };
873
874 // Useful macros to create the performance counters
875 #define NEWPERFTICKCOUNTER(counter, counter_ns, counter_name) \
876 {counter = PerfDataManager::create_counter(counter_ns, counter_name, \
877 PerfData::U_Ticks,CHECK);}
878
879 #define NEWPERFEVENTCOUNTER(counter, counter_ns, counter_name) \
880 {counter = PerfDataManager::create_counter(counter_ns, counter_name, \
881 PerfData::U_Events,CHECK);}
882
883 #define NEWPERFBYTECOUNTER(counter, counter_ns, counter_name) \
884 {counter = PerfDataManager::create_counter(counter_ns, counter_name, \
885 PerfData::U_Bytes,CHECK);}
886
887 // Utility Classes
888
|
1 /*
2 * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
756 // Constant Types
757 static PerfStringConstant* create_string_constant(CounterNS ns,
758 const char* name,
759 const char *s, TRAPS);
760
761 static PerfLongConstant* create_long_constant(CounterNS ns,
762 const char* name,
763 PerfData::Units u,
764 jlong val, TRAPS);
765
766
767 // Variable Types
768 static PerfStringVariable* create_string_variable(CounterNS ns,
769 const char* name,
770 int max_length,
771 const char *s, TRAPS);
772
773 static PerfStringVariable* create_string_variable(CounterNS ns,
774 const char* name,
775 const char *s, TRAPS) {
776 return create_string_variable(ns, name, 0, s, THREAD);
777 };
778
779 static PerfLongVariable* create_long_variable(CounterNS ns,
780 const char* name,
781 PerfData::Units u,
782 jlong ival, TRAPS);
783
784 static PerfLongVariable* create_long_variable(CounterNS ns,
785 const char* name,
786 PerfData::Units u, TRAPS) {
787 return create_long_variable(ns, name, u, (jlong)0, THREAD);
788 };
789
790 static PerfLongVariable* create_long_variable(CounterNS, const char* name,
791 PerfData::Units u,
792 jlong* sp, TRAPS);
793
794 static PerfLongVariable* create_long_variable(CounterNS ns,
795 const char* name,
796 PerfData::Units u,
797 PerfLongSampleHelper* sh,
798 TRAPS);
799
800
801 // Counter Types
802 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
803 PerfData::Units u,
804 jlong ival, TRAPS);
805
806 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
807 PerfData::Units u, TRAPS) {
808 return create_long_counter(ns, name, u, (jlong)0, THREAD);
809 };
810
811 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
812 PerfData::Units u, jlong* sp,
813 TRAPS);
814
815 static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
816 PerfData::Units u,
817 PerfLongSampleHelper* sh,
818 TRAPS);
819
820
821 // these creation methods are provided for ease of use. These allow
822 // Long performance data types to be created with a shorthand syntax.
823
824 static PerfConstant* create_constant(CounterNS ns, const char* name,
825 PerfData::Units u, jlong val, TRAPS) {
826 return create_long_constant(ns, name, u, val, THREAD);
827 }
828
829 static PerfVariable* create_variable(CounterNS ns, const char* name,
830 PerfData::Units u, jlong ival, TRAPS) {
831 return create_long_variable(ns, name, u, ival, THREAD);
832 }
833
834 static PerfVariable* create_variable(CounterNS ns, const char* name,
835 PerfData::Units u, TRAPS) {
836 return create_long_variable(ns, name, u, (jlong)0, THREAD);
837 }
838
839 static PerfVariable* create_variable(CounterNS ns, const char* name,
840 PerfData::Units u, jlong* sp, TRAPS) {
841 return create_long_variable(ns, name, u, sp, THREAD);
842 }
843
844 static PerfVariable* create_variable(CounterNS ns, const char* name,
845 PerfData::Units u,
846 PerfSampleHelper* sh, TRAPS) {
847 return create_long_variable(ns, name, u, sh, THREAD);
848 }
849
850 static PerfCounter* create_counter(CounterNS ns, const char* name,
851 PerfData::Units u, jlong ival, TRAPS) {
852 return create_long_counter(ns, name, u, ival, THREAD);
853 }
854
855 static PerfCounter* create_counter(CounterNS ns, const char* name,
856 PerfData::Units u, TRAPS) {
857 return create_long_counter(ns, name, u, (jlong)0, THREAD);
858 }
859
860 static PerfCounter* create_counter(CounterNS ns, const char* name,
861 PerfData::Units u, jlong* sp, TRAPS) {
862 return create_long_counter(ns, name, u, sp, THREAD);
863 }
864
865 static PerfCounter* create_counter(CounterNS ns, const char* name,
866 PerfData::Units u,
867 PerfSampleHelper* sh, TRAPS) {
868 return create_long_counter(ns, name, u, sh, THREAD);
869 }
870
871 static void destroy();
872 };
873
874 // Useful macros to create the performance counters
875 #define NEWPERFTICKCOUNTER(counter, counter_ns, counter_name) \
876 {counter = PerfDataManager::create_counter(counter_ns, counter_name, \
877 PerfData::U_Ticks,CHECK);}
878
879 #define NEWPERFEVENTCOUNTER(counter, counter_ns, counter_name) \
880 {counter = PerfDataManager::create_counter(counter_ns, counter_name, \
881 PerfData::U_Events,CHECK);}
882
883 #define NEWPERFBYTECOUNTER(counter, counter_ns, counter_name) \
884 {counter = PerfDataManager::create_counter(counter_ns, counter_name, \
885 PerfData::U_Bytes,CHECK);}
886
887 // Utility Classes
888
|