1
- /* Copyright (c) 2008, 2015 , Oracle and/or its affiliates. All rights reserved.
1
+ /* Copyright (c) 2008, 2016 , Oracle and/or its affiliates. All rights reserved.
2
2
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License as published by
@@ -730,23 +730,27 @@ void test_init_disabled()
730
730
socket_class_A= find_socket_class (socket_key_A);
731
731
ok (socket_class_A != NULL , " socket class A" );
732
732
733
- /* Pretend thread T-1 is running, and disabled, with thread_instrumentation */
733
+ /*
734
+ Pretend thread T-1 is running, and disabled, with thread_instrumentation.
735
+ Disabled instruments are still created so they can be enabled later.
736
+ */
737
+
734
738
/* ------------------------------------------------------------------------ */
735
739
736
740
psi->set_thread (thread_1);
737
741
setup_thread (thread_1, false );
738
742
739
- /* disabled M-A + disabled T-1: no instrumentation */
743
+ /* disabled M-A + disabled T-1: instrumentation */
740
744
741
745
mutex_class_A->m_enabled = false ;
742
746
mutex_A1= psi->init_mutex (mutex_key_A, NULL );
743
- ok (mutex_A1 == NULL , " mutex_A1 not instrumented" );
747
+ ok (mutex_A1 != NULL , " mutex_A1 disabled, instrumented" );
744
748
745
749
/* enabled M-A + disabled T-1: instrumentation (for later) */
746
750
747
751
mutex_class_A->m_enabled = true ;
748
752
mutex_A1= psi->init_mutex (mutex_key_A, NULL );
749
- ok (mutex_A1 != NULL , " mutex_A1 instrumented" );
753
+ ok (mutex_A1 != NULL , " mutex_A1 enabled, instrumented" );
750
754
751
755
/* broken key + disabled T-1: no instrumentation */
752
756
@@ -760,13 +764,13 @@ void test_init_disabled()
760
764
761
765
rwlock_class_A->m_enabled = false ;
762
766
rwlock_A1= psi->init_rwlock (rwlock_key_A, NULL );
763
- ok (rwlock_A1 == NULL , " rwlock_A1 not instrumented" );
767
+ ok (rwlock_A1 != NULL , " rwlock_A1 disabled, instrumented" );
764
768
765
769
/* enabled RW-A + disabled T-1: instrumentation (for later) */
766
770
767
771
rwlock_class_A->m_enabled = true ;
768
772
rwlock_A1= psi->init_rwlock (rwlock_key_A, NULL );
769
- ok (rwlock_A1 != NULL , " rwlock_A1 instrumented" );
773
+ ok (rwlock_A1 != NULL , " rwlock_A1 enabled, instrumented" );
770
774
771
775
/* broken key + disabled T-1: no instrumentation */
772
776
@@ -780,13 +784,13 @@ void test_init_disabled()
780
784
781
785
cond_class_A->m_enabled = false ;
782
786
cond_A1= psi->init_cond (cond_key_A, NULL );
783
- ok (cond_A1 == NULL , " cond_A1 not instrumented" );
787
+ ok (cond_A1 != NULL , " cond_A1 disabled, instrumented" );
784
788
785
789
/* enabled C-A + disabled T-1: instrumentation (for later) */
786
790
787
791
cond_class_A->m_enabled = true ;
788
792
cond_A1= psi->init_cond (cond_key_A, NULL );
789
- ok (cond_A1 != NULL , " cond_A1 instrumented" );
793
+ ok (cond_A1 != NULL , " cond_A1 enabled, instrumented" );
790
794
791
795
/* broken key + disabled T-1: no instrumentation */
792
796
@@ -815,22 +819,22 @@ void test_init_disabled()
815
819
file_class_A->m_enabled = true ;
816
820
psi->create_file (0 , " foo" , (File) 12 );
817
821
file_A1= lookup_file_by_name (" foo" );
818
- ok (file_A1 == NULL , " not instrumented" );
822
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
819
823
psi->create_file (99 , " foo" , (File) 12 );
820
824
file_A1= lookup_file_by_name (" foo" );
821
- ok (file_A1 == NULL , " not instrumented" );
825
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
822
826
823
827
/* disabled S-A + disabled T-1: no instrumentation */
824
828
825
829
socket_class_A->m_enabled = false ;
826
830
socket_A1= psi->init_socket (socket_key_A, NULL , NULL , 0 );
827
- ok (socket_A1 == NULL , " socket_A1 not instrumented" );
831
+ ok (socket_A1 != NULL , " socket_A1 disabled, instrumented" );
828
832
829
833
/* enabled S-A + disabled T-1: instrumentation (for later) */
830
834
831
835
socket_class_A->m_enabled = true ;
832
836
socket_A1= psi->init_socket (socket_key_A, NULL , NULL , 0 );
833
- ok (socket_A1 != NULL , " socket_A1 instrumented" );
837
+ ok (socket_A1 != NULL , " socket_A1 enabled, instrumented" );
834
838
835
839
/* broken key + disabled T-1: no instrumentation */
836
840
@@ -849,85 +853,85 @@ void test_init_disabled()
849
853
850
854
mutex_class_A->m_enabled = false ;
851
855
mutex_A1= psi->init_mutex (mutex_key_A, NULL );
852
- ok (mutex_A1 == NULL , " not instrumented" );
856
+ ok (mutex_A1 != NULL , " mutex_A1 disabled, instrumented" );
853
857
854
858
/* enabled M-A + enabled T-1: instrumentation */
855
859
856
860
mutex_class_A->m_enabled = true ;
857
861
mutex_A1= psi->init_mutex (mutex_key_A, NULL );
858
- ok (mutex_A1 != NULL , " instrumented" );
862
+ ok (mutex_A1 != NULL , " mutex_A1 enabled, instrumented" );
859
863
psi->destroy_mutex (mutex_A1);
860
864
861
865
/* broken key + enabled T-1: no instrumentation */
862
866
863
867
mutex_class_A->m_enabled = true ;
864
868
mutex_A1= psi->init_mutex (0 , NULL );
865
- ok (mutex_A1 == NULL , " not instrumented" );
869
+ ok (mutex_A1 == NULL , " mutex_A1 not instrumented" );
866
870
mutex_A1= psi->init_mutex (99 , NULL );
867
- ok (mutex_A1 == NULL , " not instrumented" );
871
+ ok (mutex_A1 == NULL , " mutex_A1 not instrumented" );
868
872
869
873
/* disabled RW-A + enabled T-1: no instrumentation */
870
874
871
875
rwlock_class_A->m_enabled = false ;
872
876
rwlock_A1= psi->init_rwlock (rwlock_key_A, NULL );
873
- ok (rwlock_A1 == NULL , " not instrumented" );
877
+ ok (rwlock_A1 != NULL , " rwlock_A1 disabled, instrumented" );
874
878
875
879
/* enabled RW-A + enabled T-1: instrumentation */
876
880
877
881
rwlock_class_A->m_enabled = true ;
878
882
rwlock_A1= psi->init_rwlock (rwlock_key_A, NULL );
879
- ok (rwlock_A1 != NULL , " instrumented" );
883
+ ok (rwlock_A1 != NULL , " rwlock_A1 enabled, instrumented" );
880
884
psi->destroy_rwlock (rwlock_A1);
881
885
882
886
/* broken key + enabled T-1: no instrumentation */
883
887
884
888
rwlock_class_A->m_enabled = true ;
885
889
rwlock_A1= psi->init_rwlock (0 , NULL );
886
- ok (rwlock_A1 == NULL , " not instrumented" );
890
+ ok (rwlock_A1 == NULL , " rwlock_A1 not instrumented" );
887
891
rwlock_A1= psi->init_rwlock (99 , NULL );
888
- ok (rwlock_A1 == NULL , " not instrumented" );
892
+ ok (rwlock_A1 == NULL , " rwlock_A1 not instrumented" );
889
893
890
894
/* disabled C-A + enabled T-1: no instrumentation */
891
895
892
896
cond_class_A->m_enabled = false ;
893
897
cond_A1= psi->init_cond (cond_key_A, NULL );
894
- ok (cond_A1 == NULL , " not instrumented" );
898
+ ok (cond_A1 != NULL , " cond_A1 disabled, instrumented" );
895
899
896
900
/* enabled C-A + enabled T-1: instrumentation */
897
901
898
902
cond_class_A->m_enabled = true ;
899
903
cond_A1= psi->init_cond (cond_key_A, NULL );
900
- ok (cond_A1 != NULL , " instrumented" );
904
+ ok (cond_A1 != NULL , " cond_A1 enabled, instrumented" );
901
905
psi->destroy_cond (cond_A1);
902
906
903
907
/* broken key + enabled T-1: no instrumentation */
904
908
905
909
cond_class_A->m_enabled = true ;
906
910
cond_A1= psi->init_cond (0 , NULL );
907
- ok (cond_A1 == NULL , " not instrumented" );
911
+ ok (cond_A1 == NULL , " cond_A1 not instrumented" );
908
912
cond_A1= psi->init_cond (99 , NULL );
909
- ok (cond_A1 == NULL , " not instrumented" );
913
+ ok (cond_A1 == NULL , " cond_A1 not instrumented" );
910
914
911
915
/* disabled F-A + enabled T-1: no instrumentation */
912
916
913
917
file_class_A->m_enabled = false ;
914
918
psi->create_file (file_key_A, " foo" , (File) 12 );
915
919
file_A1= lookup_file_by_name (" foo" );
916
- ok (file_A1 == NULL , " not instrumented" );
920
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
917
921
918
922
/* enabled F-A + open failed + enabled T-1: no instrumentation */
919
923
920
924
file_class_A->m_enabled = true ;
921
925
psi->create_file (file_key_A, " foo" , (File) -1 );
922
926
file_A1= lookup_file_by_name (" foo" );
923
- ok (file_A1 == NULL , " not instrumented" );
927
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
924
928
925
929
/* enabled F-A + out-of-descriptors + enabled T-1: no instrumentation */
926
930
927
931
file_class_A->m_enabled = true ;
928
932
psi->create_file (file_key_A, " foo" , (File) 65000 );
929
933
file_A1= lookup_file_by_name (" foo" );
930
- ok (file_A1 == NULL , " not instrumented" );
934
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
931
935
ok (file_handle_lost == 1 , " lost a file handle" );
932
936
file_handle_lost= 0 ;
933
937
@@ -951,22 +955,22 @@ void test_init_disabled()
951
955
/* disabled S-A + enabled T-1: no instrumentation */
952
956
953
957
socket_class_A->m_enabled = false ;
954
- ok (socket_A1 == NULL , " not instrumented" );
958
+ ok (socket_A1 == NULL , " socket_A1 not instrumented" );
955
959
956
960
/* enabled S-A + enabled T-1: instrumentation */
957
961
958
962
socket_class_A->m_enabled = true ;
959
963
socket_A1= psi->init_socket (socket_key_A, NULL , NULL , 0 );
960
- ok (socket_A1 != NULL , " instrumented" );
964
+ ok (socket_A1 != NULL , " socket_A1 instrumented" );
961
965
psi->destroy_socket (socket_A1);
962
966
963
967
/* broken key + enabled T-1: no instrumentation */
964
968
965
969
socket_class_A->m_enabled = true ;
966
970
socket_A1= psi->init_socket (0 , NULL , NULL , 0 );
967
- ok (socket_A1 == NULL , " not instrumented" );
971
+ ok (socket_A1 == NULL , " socket_A1 not instrumented" );
968
972
socket_A1= psi->init_socket (99 , NULL , NULL , 0 );
969
- ok (socket_A1 == NULL , " not instrumented" );
973
+ ok (socket_A1 == NULL , " socket_A1 not instrumented" );
970
974
971
975
/* Pretend the running thread is not instrumented */
972
976
/* ---------------------------------------------- */
@@ -977,13 +981,13 @@ void test_init_disabled()
977
981
978
982
mutex_class_A->m_enabled = false ;
979
983
mutex_A1= psi->init_mutex (mutex_key_A, NULL );
980
- ok (mutex_A1 == NULL , " mutex_A1 not instrumented" );
984
+ ok (mutex_A1 != NULL , " mutex_A1 disabled, instrumented" );
981
985
982
986
/* enabled M-A + unknown thread: instrumentation (for later) */
983
987
984
988
mutex_class_A->m_enabled = true ;
985
989
mutex_A1= psi->init_mutex (mutex_key_A, NULL );
986
- ok (mutex_A1 != NULL , " mutex_A1 instrumented" );
990
+ ok (mutex_A1 != NULL , " mutex_A1 enabled, instrumented" );
987
991
988
992
/* broken key + unknown thread: no instrumentation */
989
993
@@ -997,13 +1001,13 @@ void test_init_disabled()
997
1001
998
1002
rwlock_class_A->m_enabled = false ;
999
1003
rwlock_A1= psi->init_rwlock (rwlock_key_A, NULL );
1000
- ok (rwlock_A1 == NULL , " rwlock_A1 not instrumented" );
1004
+ ok (rwlock_A1 != NULL , " rwlock_A1 disabled, instrumented" );
1001
1005
1002
1006
/* enabled RW-A + unknown thread: instrumentation (for later) */
1003
1007
1004
1008
rwlock_class_A->m_enabled = true ;
1005
1009
rwlock_A1= psi->init_rwlock (rwlock_key_A, NULL );
1006
- ok (rwlock_A1 != NULL , " rwlock_A1 instrumented" );
1010
+ ok (rwlock_A1 != NULL , " rwlock_A1 enabled, instrumented" );
1007
1011
1008
1012
/* broken key + unknown thread: no instrumentation */
1009
1013
@@ -1017,13 +1021,13 @@ void test_init_disabled()
1017
1021
1018
1022
cond_class_A->m_enabled = false ;
1019
1023
cond_A1= psi->init_cond (cond_key_A, NULL );
1020
- ok (cond_A1 == NULL , " cond_A1 not instrumented" );
1024
+ ok (cond_A1 != NULL , " cond_A1 disabled, instrumented" );
1021
1025
1022
1026
/* enabled C-A + unknown thread: instrumentation (for later) */
1023
1027
1024
1028
cond_class_A->m_enabled = true ;
1025
1029
cond_A1= psi->init_cond (cond_key_A, NULL );
1026
- ok (cond_A1 != NULL , " cond_A1 instrumented" );
1030
+ ok (cond_A1 != NULL , " cond_A1 enabled, instrumented" );
1027
1031
1028
1032
/* broken key + unknown thread: no instrumentation */
1029
1033
@@ -1038,14 +1042,14 @@ void test_init_disabled()
1038
1042
file_class_A->m_enabled = false ;
1039
1043
psi->create_file (file_key_A, " foo" , (File) 12 );
1040
1044
file_A1= lookup_file_by_name (" foo" );
1041
- ok (file_A1 == NULL , " not instrumented" );
1045
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
1042
1046
1043
1047
/* enabled F-A + unknown thread: no instrumentation */
1044
1048
1045
1049
file_class_A->m_enabled = true ;
1046
1050
psi->create_file (file_key_A, " foo" , (File) 12 );
1047
1051
file_A1= lookup_file_by_name (" foo" );
1048
- ok (file_A1 == NULL , " not instrumented" );
1052
+ ok (file_A1 == NULL , " file_A1 not instrumented" );
1049
1053
1050
1054
/* broken key + unknown thread: no instrumentation */
1051
1055
@@ -1061,13 +1065,13 @@ void test_init_disabled()
1061
1065
1062
1066
socket_class_A->m_enabled = false ;
1063
1067
socket_A1= psi->init_socket (socket_key_A, NULL , NULL , 0 );
1064
- ok (socket_A1 == NULL , " socket_A1 not instrumented" );
1068
+ ok (socket_A1 != NULL , " socket_A1 disabled, instrumented" );
1065
1069
1066
1070
/* enabled S-A + unknown thread: instrumentation (for later) */
1067
1071
1068
1072
socket_class_A->m_enabled = true ;
1069
1073
socket_A1= psi->init_socket (socket_key_A, NULL , NULL , 0 );
1070
- ok (socket_A1 != NULL , " socket_A1 instrumented" );
1074
+ ok (socket_A1 != NULL , " socket_A1 enabled, instrumented" );
1071
1075
1072
1076
/* broken key + unknown thread: no instrumentation */
1073
1077
0 commit comments