forked from icl-utk-edu/papi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLogP420.txt
1140 lines (851 loc) · 44.6 KB
/
ChangeLogP420.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2011-10-25
* doc/: Makefile, doxygen_procedure.txt: Update doxygen_procedure
to note that we need a recent version of doxygen.
* man/: man1/avail.c.1, man1/clockres.c.1, man1/command_flags_t.1,
man1/command_line.c.1, man1/component.c.1, man1/cost.c.1,
man1/decode.c.1, man1/error_codes.c.1, man1/event_chooser.c.1,
man1/mem_info.c.1, man1/native_avail.c.1, man1/options_t.1,
man1/papi_avail.1, man1/papi_clockres.1,
man1/papi_command_line.1, man1/papi_component_avail.1,
man1/papi_cost.1, man1/papi_decode.1, man1/papi_error_codes.1,
man1/papi_event_chooser.1, man1/papi_mem_info.1,
man1/papi_multiplex_cost.1, man1/papi_native_avail.1, man3/CDI.3,
man3/HighLevelInfo.3, man3/PAPIF.3, man3/PAPIF_accum.3,
man3/PAPIF_accum_counters.3, man3/PAPIF_add_event.3,
man3/PAPIF_add_events.3, man3/PAPIF_assign_eventset_component.3,
man3/PAPIF_cleanup_eventset.3, man3/PAPIF_create_eventset.3,
man3/PAPIF_destroy_eventset.3, man3/PAPIF_enum_event.3,
man3/PAPIF_event_code_to_name.3, man3/PAPIF_event_name_to_code.3,
man3/PAPIF_flips.3, man3/PAPIF_flops.3,
man3/PAPIF_get_clockrate.3, man3/PAPIF_get_dmem_info.3,
man3/PAPIF_get_domain.3, man3/PAPIF_get_event_info.3,
man3/PAPIF_get_exe_info.3, man3/PAPIF_get_granularity.3,
man3/PAPIF_get_hardware_info.3, man3/PAPIF_get_multiplex.3,
man3/PAPIF_get_preload.3, man3/PAPIF_get_real_cyc.3,
man3/PAPIF_get_real_nsec.3, man3/PAPIF_get_real_usec.3,
man3/PAPIF_get_virt_cyc.3, man3/PAPIF_get_virt_usec.3,
man3/PAPIF_ipc.3, man3/PAPIF_is_initialized.3,
man3/PAPIF_library_init.3, man3/PAPIF_lock.3,
man3/PAPIF_multiplex_init.3, man3/PAPIF_num_cmp_hwctrs.3,
man3/PAPIF_num_counters.3, man3/PAPIF_num_events.3,
man3/PAPIF_num_hwctrs.3, man3/PAPIF_perror.3,
man3/PAPIF_query_event.3, man3/PAPIF_read.3,
man3/PAPIF_read_ts.3, man3/PAPIF_register_thread.3,
man3/PAPIF_remove_event.3, man3/PAPIF_remove_events.3,
man3/PAPIF_reset.3, man3/PAPIF_set_cmp_domain.3,
man3/PAPIF_set_cmp_granularity.3, man3/PAPIF_set_debug.3,
man3/PAPIF_set_domain.3, man3/PAPIF_set_event_domain.3,
man3/PAPIF_set_granularity.3, man3/PAPIF_set_inherit.3,
man3/PAPIF_set_multiplex.3, man3/PAPIF_shutdown.3,
man3/PAPIF_start.3, man3/PAPIF_start_counters.3,
man3/PAPIF_state.3, man3/PAPIF_stop.3,
man3/PAPIF_stop_counters.3, man3/PAPIF_thread_id.3,
man3/PAPIF_thread_init.3, man3/PAPIF_unlock.3,
man3/PAPIF_unregister_thread.3, man3/PAPIF_write.3,
man3/PAPI_accum.3, man3/PAPI_accum_counters.3,
man3/PAPI_add_event.3, man3/PAPI_add_events.3,
man3/PAPI_addr_range_option_t.3, man3/PAPI_address_map_t.3,
man3/PAPI_all_thr_spec_t.3,
man3/PAPI_assign_eventset_component.3, man3/PAPI_attach.3,
man3/PAPI_attach_option_t.3, man3/PAPI_cleanup_eventset.3,
man3/PAPI_component_info_t.3, man3/PAPI_cpu_option_t.3,
man3/PAPI_create_eventset.3, man3/PAPI_debug_option_t.3,
man3/PAPI_descr_error.3, man3/PAPI_destroy_eventset.3,
man3/PAPI_detach.3, man3/PAPI_dmem_info_t.3,
man3/PAPI_domain_option_t.3, man3/PAPI_enum_event.3,
man3/PAPI_event_code_to_name.3, man3/PAPI_event_info_t.3,
man3/PAPI_event_name_to_code.3, man3/PAPI_exe_info_t.3,
man3/PAPI_flips.3, man3/PAPI_flops.3, man3/PAPI_get_cmp_opt.3,
man3/PAPI_get_component_info.3, man3/PAPI_get_dmem_info.3,
man3/PAPI_get_event_info.3, man3/PAPI_get_executable_info.3,
man3/PAPI_get_hardware_info.3, man3/PAPI_get_multiplex.3,
man3/PAPI_get_opt.3, man3/PAPI_get_overflow_event_index.3,
man3/PAPI_get_real_cyc.3, man3/PAPI_get_real_nsec.3,
man3/PAPI_get_real_usec.3, man3/PAPI_get_shared_lib_info.3,
man3/PAPI_get_thr_specific.3, man3/PAPI_get_virt_cyc.3,
man3/PAPI_get_virt_nsec.3, man3/PAPI_get_virt_usec.3,
man3/PAPI_granularity_option_t.3, man3/PAPI_hw_info_t.3,
man3/PAPI_inherit_option_t.3, man3/PAPI_ipc.3,
man3/PAPI_is_initialized.3, man3/PAPI_itimer_option_t.3,
man3/PAPI_library_init.3, man3/PAPI_list_events.3,
man3/PAPI_list_threads.3, man3/PAPI_lock.3,
man3/PAPI_mh_cache_info_t.3, man3/PAPI_mh_info_t.3,
man3/PAPI_mh_level_t.3, man3/PAPI_mh_tlb_info_t.3,
man3/PAPI_mpx_info_t.3, man3/PAPI_multiplex_init.3,
man3/PAPI_multiplex_option_t.3, man3/PAPI_num_cmp_hwctrs.3,
man3/PAPI_num_components.3, man3/PAPI_num_counters.3,
man3/PAPI_num_events.3, man3/PAPI_num_hwctrs.3,
man3/PAPI_option_t.3, man3/PAPI_overflow.3, man3/PAPI_perror.3,
man3/PAPI_preload_info_t.3, man3/PAPI_profil.3,
man3/PAPI_query_event.3, man3/PAPI_read.3,
man3/PAPI_read_counters.3, man3/PAPI_read_ts.3,
man3/PAPI_register_thread.3, man3/PAPI_remove_event.3,
man3/PAPI_remove_events.3, man3/PAPI_reset.3,
man3/PAPI_set_cmp_domain.3, man3/PAPI_set_cmp_granularity.3,
man3/PAPI_set_debug.3, man3/PAPI_set_domain.3,
man3/PAPI_set_granularity.3, man3/PAPI_set_multiplex.3,
man3/PAPI_set_opt.3, man3/PAPI_set_thr_specific.3,
man3/PAPI_shlib_info_t.3, man3/PAPI_shutdown.3,
man3/PAPI_sprofil.3, man3/PAPI_sprofil_t.3, man3/PAPI_start.3,
man3/PAPI_start_counters.3, man3/PAPI_state.3, man3/PAPI_stop.3,
man3/PAPI_stop_counters.3, man3/PAPI_strerror.3,
man3/PAPI_thread_id.3, man3/PAPI_thread_init.3,
man3/PAPI_unlock.3, man3/PAPI_unregister_thread.3,
man3/PAPI_write.3, man3/high_api.3, man3/low_api.3,
man3/papi_data_structures.3, man3/papi_vector_t.3,
man3/ret_codes.3: Update doxygen generated man-pages for the
pending release.
In the future, we need to use a newer version of doxygen to
generate the pages (1.7 +) because locally installed verions
appear to have a bug.
* src/ctests/nmi_watchdog.c: The nmi_watchdog test should report a
Warning if nmi_watchdog is enabled not an error. (Since we do
work around it, even if performance is likely impacted).
* src/ctests/: Makefile, nmi_watchdog.c: I think the nmi_watchdog
stuff is going to cause us problems down the road.
Thus add a test that will tell users about the issue.
* src/perf_events.c: The nmi_watchdog workaround is needed for
multiplexing too.
The kernel devs don't seem eager to fix this. Until they do,
we'll have to fall back to software multiplexing on recent
kernels that have nmi_watchdog enabled (most vendor kernels).
* src/multiplex.c: Yesterday's coverity fix to make sure the
cleanup and destroy rerturn values were checked ended up
over-writing "retval" in a way that broke the sdsc4-mpx test.
Fix things so that doesn't happen.
* src/: papi.c, perf_events.c, ctests/overflow_allcounters.c: Some
changes for perf_event MIPS support
+ Add __mips__ cases to the format_group, schedulability, and
broken multiplexing bug workarounds, as even new Linux mips
kernels have these bugs + fix overflow_allcounters to work
properly if the MHz value is zero. + Add some debugging to
PAPI_overflow() so that errors are more obvious than just
returning PAPI_EINVAL, which made the previous item a pain to
track down.
* man/: footer.htm, header.htm, manServer_papi.pl, papiman.bat,
html/papi.html, html/papi_accum.html,
html/papi_accum_counters.html, html/papi_add_event.html,
html/papi_add_events.html,
html/papi_assign_eventset_component.html, html/papi_attach.html,
html/papi_avail.html, html/papi_cleanup_eventset.html,
html/papi_clockres.html, html/papi_command_line.html,
html/papi_cost.html, html/papi_create_eventset.html,
html/papi_decode.html, html/papi_destroy_eventset.html,
html/papi_detach.html, html/papi_encode_events.html,
html/papi_enum_event.html, html/papi_event_chooser.html,
html/papi_event_code_to_name.html,
html/papi_event_name_to_code.html, html/papi_flips.html,
html/papi_flops.html, html/papi_get_component_info.html,
html/papi_get_dmem_info.html, html/papi_get_event_info.html,
html/papi_get_executable_info.html,
html/papi_get_hardware_info.html, html/papi_get_multiplex.html,
html/papi_get_opt.html, html/papi_get_overflow_event_index.html,
html/papi_get_real_cyc.html, html/papi_get_real_usec.html,
html/papi_get_shared_lib_info.html,
html/papi_get_substrate_info.html,
html/papi_get_thr_specific.html, html/papi_get_virt_cyc.html,
html/papi_get_virt_usec.html, html/papi_help.html,
html/papi_ipc.html, html/papi_is_initialized.html,
html/papi_library_init.html, html/papi_list_events.html,
html/papi_list_threads.html, html/papi_lock.html,
html/papi_mem_info.html, html/papi_multiplex_init.html,
html/papi_native.html, html/papi_native_avail.html,
html/papi_num_cmp_hwctrs.html, html/papi_num_components.html,
html/papi_num_counters.html, html/papi_num_events.html,
html/papi_num_hwctrs.html, html/papi_overflow.html,
html/papi_perror.html, html/papi_presets.html,
html/papi_profil.html, html/papi_query_event.html,
html/papi_read.html, html/papi_read_counters.html,
html/papi_register_thread.html, html/papi_remove_event.html,
html/papi_remove_events.html, html/papi_reset.html,
html/papi_set_cmp_domain.html,
html/papi_set_cmp_granularity.html, html/papi_set_debug.html,
html/papi_set_domain.html, html/papi_set_event_info.html,
html/papi_set_granularity.html, html/papi_set_multiplex.html,
html/papi_set_opt.html, html/papi_set_thr_specific.html,
html/papi_shutdown.html, html/papi_sprofil.html,
html/papi_start.html, html/papi_start_counters.html,
html/papi_state.html, html/papi_stop.html,
html/papi_stop_counters.html, html/papi_strerror.html,
html/papi_thread_id.html, html/papi_thread_init.html,
html/papi_unlock.html, html/papi_unregister_thread.html,
html/papi_write.html, html/papif.html,
html/papif_get_clockrate.html, html/papif_get_domain.html,
html/papif_get_exe_info.html, html/papif_get_granularity.html,
html/papif_get_preload.html, html/papif_set_event_domain.html,
images/cssigoff.gif, images/cssigon.gif, images/headertop.jpg,
images/line.gif, images/logobottom.jpg, images/logoleft.jpg,
images/menubg.jpg, images/menubg95.jpg, images/rd.jpg,
images/spinbg.jpg, images/spinlogo.gif, images/stable.gif,
images/stripes2.jpg, images/trans.gif, images/utsigoff.gif,
images/utsigon.gif, images/white.jpg: Remove the old html
documentation and assorted helper files.
* src/components/coretemp/linux-coretemp.c: Fix a possible
directory stream leak in the coretemp component.
reported by coverity checker.
* src/ctests/calibrate.c: Properly free the arrays in calibrate,
introduced by yesterdays coverity fix.
Patch by Will Cohen
2011-10-24
* src/components/coretemp/linux-coretemp.c: Fix coretemp to not
fail if /sys/class/hwmon doesn't exist.
* src/components/coretemp/linux-coretemp.c: Patch coretemp to only
free the initialized data in shutdown_substrate (once per
PAPI_init) rather than shutdown (once per thread).
This was causing double free errors.
Patch from Will Cohen
* src/utils/multiplex_cost.c: Fix various calls to PAPI_start() and
PAPI_stop() in multiplex_cost that didn't check the return value.
Took care to try to avoid changing timing measurements. Noticed
by coverity checker.
* src/utils/cost.c: In one case, cost was not checking the return
of PAPI_start()/PAPI_stop(). This change makes it does so, while
being careful not to interfere with the timing that is going on.
* src/ctests/: pthrtough.c, pthrtough2.c: pthrtough and pthrtough2
were not checking the return value for pthread_attr_setscope().
Reported by coverity checker.
* src/ctests/multiplex1_pthreads.c: multiplex1_pthreads was not
checking the return from PAPI_library_init() as flagged by
coverity checker.
* src/ctests/inherit.c: inherit.c wasn't checking the result of the
waitpid() call, as reported by coverity checker.
* src/ctests/clockres_pthreads.c: Check the return of
pthread_create().
Reported by coverity checker.
* src/papi_libpfm4_events.c: Fix an actual bug (reported as
deadcode by coverity) where _papi_hwd_ntv_code_to_descr was
appending extraneous ", masks:" strings into an event
description.
None of our utils/ctests exercise this function, which is
probably why the bug wasn't noticed.
* src/: multiplex.c, papi.c: Fix cases where PAPI_*() functions
were called without checking the return for an error.
Reported by coverity.
* doc/Doxyfile.utils: Update version to 4.2.0 for pending release.
* src/multiplex.c: Fix some code that could potentially dereference
a null pointer.
Found by the coverity checker.
* src/papi_vector.c: Remove a dead code case as reported by
coverity. Shouldn't break anything as I can't find anywhere that
vector_print_table() is actually called.
* release_procedure.txt: Update release_procedure to reflect
another file that needs a version number bump. (Doxyfile.utils)
* src/ctests/calibrate.c: Fix some weird code that was sharing a
memory allocation for both double and floats. This was really
ugly and made the coverity checker sad.
Patch provided by Will Cohen.
* src/testlib/test_utils.c: Fix a signed/unsigned comparison bug I
introduced.
* src/components/coretemp/tests/coretemp_basic.c: Fix the test so
it correctly iterates all of the components.
* src/components/coretemp/: linux-coretemp.c, tests/Makefile,
tests/coretemp_basic.c: Fix a potential memory leak in coretemp
(flagged by coverity).
Also added a test case for coretemp so I can actually test if
these changes are breaking anything.
* src/solaris-ultra.c: Remove const decleration from get_virt_* in
solaris substrate. Vince removed this from papi_vector.h back in
June.
* src/testlib/test_utils.c: Improce the add_two_events() code in
the test library. Before it was possible to overrun a buffer if
none of the potential predefined events were available.
Noticed by the coverity checker.
* papi.spec, doc/Doxyfile, doc/Doxyfile-everything, src/configure,
src/papi.h, src/Makefile.in, src/configure.in: Update version to
4.2.0 for pending release.
2011-10-21
* src/: Makefile.inc, configure, configure.in, papi.c, papi.h,
papi_internal.c, papi_user_events.c, papi_user_events.h: Merge in
the user events code , protected by a configure option. (
--with-user-events )
* src/testlib/test_utils.c: We now ensure that test_fail() always
exits. There was some code around that tracked the number of
times test_fail() was called. Remove that, as I think it was
confusing the coverity checker and causing a huge number of false
positives for NULL pointer dereferences.
* src/components/acpi/linux-acpi.c: Some minor cleanups to the acpi
component. It was choking a bit if ACPI didn't provide thermal
information, and also fix a few coverity bugs involving not
checking the result of a dup() call.
* src/testlib/test_utils.c: Another problem with negative numbers,
this time one could potentially be passed to a malloc call.
noticed by coverity
* src/ctests/overflow_pthreads.c: We were indexing an array with a
returned value that could be negative on failure. Add a check to
avoid that.
We're also indexing a per-thread array with an EventSet number,
which sounds suspect, should probably investigate that further.
* src/perf_events.c: perf_events.c was setting variables to -1 and
then potentially using them to index arrays or call close() on
them.
This adds checks to avoid that.
Noticed by the coverity checker.
* src/components/lustre/linux-lustre.h: Include stdint.h and
ctype.h; needed for uint64_t and isspace() respectivly.
* src/components/coretemp/linux-coretemp.c: Fix problem where we
try to manipulate a NULL directory entry.
This fixes a segfault on a Nehalem machine we have here that has
a /sys/class/hwmon/hwmon0 directory without a "device"
subdirectory.
* src/components/coretemp/linux-coretemp.c: We were opening a file
but not checking for failure before reading from it.
Flagged by the coverity checker.
* src/components/coretemp/linux-coretemp.c: Both gcc and coverity
were complaining about using an uninitialized pointer. This
makes sure it's not dereferenced if not initialized.
* src/ctests/prof_utils.c: Stop doing unnecessary pointer math in a
print statement.
This was flagged as a problem by the coverity tool.
* src/components/coretemp/linux-coretemp.c: Fix some wrong buffer
sizes in the coretemp component.
Patch from Will Cohen
* src/ctests/sdsc.c: add some extra debug info for sdsc test
failures.
* src/papi_hl.c: Add comment to PAPI_num_counters() documentation
about use of PAPI_num_cmp_hwctrs() for component counters.
2011-10-19
* src/papi.c: Correct documentation errors for PAPI_strerror.
* src/: configure, configure.in: Under a no-cpu-counters build,
still build all of the utils. We probably want to rethink some
of the cost util details.
2011-10-11
* src/run_tests.sh: Remove an unneeded call to "cat". For some
reason it was printing pointless warnings that needlessly
cluttered the buildbot logs.
* src/ctests/: Makefile, multiplex1.c: -lpapi should never be a
dependency. -I.. is missing in makefile
You should be able to cd ctests and do: make <test> or make
multiplex.
Also, added the read after start multiplex case for multiplex1.
This triggers bugs in perf_events systems.
2011-10-10
* src/: papi.c, papi_internal.c, threads.c: The multiplex1_pthreads
test was reporting a memory leak.
This is because the test was calling PAPI_unregister_thread()
without destroying its EventSets.
This added change adds code that at unregister_thread time will
destroy any events belonging to that thread.
This works on all the current ctests but I should check some of
the various corner cases not currently tested.
2011-10-07
* src/libpfm4/: config.mk, lib/pfmlib_amd64.c, lib/pfmlib_common.c,
lib/pfmlib_intel_x86.c, lib/events/intel_nhm_events.h,
lib/events/intel_wsm_events.h: Merge the "conflicts" from the
libpfm4 merge
* src/: threads.c, threads.h: Fix the MEMORY LEAK errors involving
the attach ctests (as seen on buildbot)
These came about when proper multiattach support was added. A
"fake" thread structure is created for each attached process.
These fake thread structures were not being cleaned up at
shutdown, hence the leak.
This fix adds support so at thread shutdown, if we have any
"fake" threads that we created, also shut them down too.
This was tricky, especially dealing with the circular-linked list
the thread info structs are in. This fix seems to work without
negatively affecting the pthread cases.
ctests/multiplex1_pthreads still reports MEMORY LEAK but that
seems to be an eventset issue, not a thread issue, so will be
investigated separately.
2011-10-06
* src/: papi.h, papi_fwrappers.c: Add Fortran reference to doxygen
main page.
2011-10-05
* src/: papi.c, papi_internal.c, perf_events.c: There has been some
ongoing speculation about what would happen if you enabled
Multiplexing and Overflow at the same time.
It turns out (at least on perf_events) that if you have kernel
multiplexing, the results are what you expect. You get
overflows, but less than in the non-multiplexing case because the
overflow counter isn't being run all the time.
The results for software multiplexing involved a segfault. This
is because in the software multiplexing case the primary EventSet
is a fiction; a set of shadow EventSets are created behind the
scene, and these are the ones used. Therefore when you enable
overflow, the overflow event is attempted to be enabled on the
fictious main EventSet. There are no native events mapped for
it, so overflow tries to access native event array index "-1"
which causes bad things to happen.
This change avoids the issue by catching the "-1" case and
failing accordingly. We should probably decide if we want to
catch the oflo/mpx combination earlier and outright ban it.
I also went through a lot of the code involved adding comments,
as it was really hard following what was going on. This involved
the infamously dense "_papi_hwi_remap_event_position()" function
too.
* src/papi.h: Moved cpu and inherit bits to end of structure for
compat across all 4.x lines. Found by Will Cohen.
As it turns out, I ended up reviewing the CPU_ATTACH changes; I
had not done so before. This functionality actually belongs in
PAPI_set_granularity. A CPU is a natural unit of granularity of
counting, and that value was speced in papi.h a long time ago.
Right thing to do here is leave the current attach stuff but make
it work as part of set_granularity.
Consider that a TODO for 4.3.
2011-10-04
* doc/: Doxyfile, Doxyfile-everything: Enable macro expansion in
the doxygen preprocessor step.
Doxygen was not creating docs for the fortran functions and I
believe it is because it was silently choking on our clever
preprocessor abuse; this fixes? that. However, its worth taking
a critical eye to the generated pages again.
* src/: papi.c, papi_fwrappers.c, papi_hl.c: make "* #include" into
"* \#include" so doxygen doesn't treat it as a command.
* src/papi_fwrappers.c: Added all doxygen stubs to the PAPIF group.
2011-10-03
* src/ctests/ipc.c: My previous "fix" for the array bounds issue in
ipc.c had multiple embarassing bugs.
Thanks to Will Cohen for noticing. Things should be better now.
* src/: Rules.perfctr-pfm, Rules.pfm_pe: Additionally remove the
now extraneous papi_libpfm_preset definition from the other Rules
files too.
* src/: Makefile.inc, Rules.pfm4_pe: The change to make the preset
code generic accidentally ended up defining the build rules for
the file in duplicate places. This fixes that.
2011-09-30
* src/: linux-common.c, utils/decode.c: Fix two unused variable
warnings.
* src/ctests/second.c: We were allocating the "values" array but
never freeing it.
* src/ctests/: sdsc2.c, sdsc4.c: The SDSC tests could walk off the
end of an array.
* src/ctests/overflow_twoevents.c: We could potentially access
outside an array boundary in overflow_twoevents.
* src/ctests/ipc.c: ipc was also abusing array boundaries.
* src/ctests/flops.c: The flops.c ctest was abusing the notion of C
arrays, by writing INDEX*INDEX values to mresult[0][i], I suppose
"knowing" that this would fill in the whole array. Fix things to
use an additional iterator.
* src/ctests/byte_profile.c: The coverity checker rightly points
out that the last argument to strncat should be buffersize-1.
* src/ctests/: exeinfo.c, shlib.c: Coverity flagged that there were
some tests that had no effect. In particular the are tests that
the pointers are non-null. However, they are arrays rather than
pointers. This patch make it clear that arrays are being used in
the code.
Patch from Will Cohen at redhat
* src/ctests/clockcore.c: This is a relatively minor patch that
ensures that all the allocated memory is initialized to zero
before it is used. Coverity might not be smart enough to
determine whether the test actually wrote into all the locations
because of the case statement. This is make it easier for
coverity to determine that the memory has been initialized.
Path from Will Cohen at redhat.
* src/multiplex.c: Coverity scan showed that MPX_cleanup() function
was blindly accessing a value through a pointer and then checking
to see that the pointer was null. This patch makes sure that the
pointer is checked before it is used.
Patch from Will Cohen at redhat.
* src/ctests/: pthrtough.c, pthrtough2.c: Coverity found that the
sizeof argument for pthrtough2.c and pthrtough.c was using
sizeof(pthread *) rather than sizeof(pthread). This patch fixes
that problem.
Patch from Will Cohen at redhat
* src/papi_internal.c: This change moves the setting for default
domain to be enforced at eventset add time, rather than eventset
creation time.
This fixes some problems seen when multiplexing.
The patch was provided by Phil Mucci.
* src/pmapi-ppc64.h: One more file that is no longer needed.
* src/: configure, configure.in, perfctr.c, pmapi-ppc64_events.c,
ppc64_events.c: Clean up the now not-needed pmapi-ppc64_events.c
file.
* src/: Makefile.inc, aix.c, aix.h, configure, configure.in,
papi_libpfm_presets.c: Finalize the merge of the preset code.
* src/aix.c: Fix a missing include.
* src/: aix.c, configure, configure.in: Move more code to its
proper place.
* src/: aix.c, configure, configure.in, pmapi-ppc64.c,
pmapi-ppc64_events.c, ppc64_events.c: Move the
ppc64_setup_native_table() routines out of the preset code.
This is complicated, as there are two very similar routines
setup_ppc64_native_table() used by AIX/pmapi and
ppc64_setup_native_table() used by perfctr
These could probably be merged too, but this is definitely not
the time.
* src/: aix.c, papi_libpfm_presets.c, pmapi-ppc64_events.c: move
pmapi_find_full_event to be _aix_ntv_name_to_code() as it
probably always should have been.
* src/: papi_libpfm_presets.c, papi_setup_presets.h,
pmapi-ppc64_events.c: Make papi_libpfm_presets more generic by
calling _papi_hwi_native_name_to_code() rather than a
substrate-specific call.
* src/: aix.c, papi_libpfm_presets.c, pmapi-ppc64_events.c: I was
mainly doing this to aid debugging, but now the
papi_libpfm_presets.c file and pmapi-ppc64_events.c file are
close enough to being identical I might try to merge them.
2011-09-29
* src/: papi_libpfm_presets.c, pmapi-ppc64_events.c,
ppc64_events.h: The files are almost the same now.
* src/: papi_libpfm_presets.c, pmapi-ppc64_events.c: More making
these files the same, including some memory leak fixes that made
it to the former but not the latter.
* src/: papi_libpfm_presets.c, pmapi-ppc64_events.c: Tracking down
problems on AIX can be a bit of a pain because
papi_libpfm_presets.c and pmapi-ppc64_events.c are almost (but
not quite) the same. This change makes the files more similar,
mostly by cleaning up whitespace and normalizing comments and
debugging statements between the two.
* src/pmapi-ppc64_events.c: Ugh, obvious typo in that last commit.
* src/pmapi-ppc64_events.c: In ppc64_setup_gps() the current code
sometimes walks off the end of the group array and trashes
unrelated memory.
Until we work out the proper fix, this prints an error message
and stops the loop before memory is corrupted.
* src/papi_data.h: No one seems to remember the last time this file
was used, so let's remove it.
2011-09-28
* src/Makefile.inc: Remove the "u" option to the "ar" command that
links libpapi.a, as it was breaking the build on MIPS.
This *shouldn't* break anything, but messing around with "ar"
options can be potentially dangerous. I'll double-check the
non-Linux builds.
* src/libpfm4/lib/: Makefile, pfmlib_mips_priv.h,
events/intel_nhm_events.h, events/intel_wsm_events.h: Fix up the
"collisions" from the libpfm4 import
2011-09-26
* src/Makefile.inc: We would like to use parallel make on packages
to speed things up. However, when this was tried with papi the
"make -j4" failed
(https://bugzilla.redhat.com/show_bug.cgi?id=740909). I took a
look through the code and found that some of dependencies were
not quite right. Turns out that $(papiLIBS) is substituted during
the configure, but it isn't available for the actual make.
Attached is the patch that ensures that the $(LIBS) are built
before utils and tests.
Patch from Will Cohen <wcohen at redhat.com>
* src/run_tests.sh: Modify run_tests.sh so that you can set the
VALGRIND command externally via environment variable without
having to edit run_tests.sh itself.
Also adds Date and cpuinfo information to the beginning of
run_tests.sh results. This can help when run run_tests.sh output
is passed around when debugging a problem.
Patch from Phil Mucci
* src/: configure, configure.in: If we have no Fortran compiler
available, then our current build system tries to build the
Fortran examples with an empty compiler string which just
generates strange errors.
This patch changes F77 to be "echo" which at least avoids the
errors. The proper fix is probably just not to build the Fortran
samples if no compiler is available.
Patch from Phil Mucci
* src/papi_libpfm4_events.c: The build on power6 was warning in a
DEBUG statement because sizeof() returns an int rather than a
long. So use a cast to avoid this.
* src/perf_events.c: The move to use pid_t for pid values caused
warnings on a --with-debug build due to the lack of a way to
print a pid_t value without a cast.
This fix adds the proper casts.
2011-09-23
* src/papi_libpfm4_events.c: Rename the "perfmon_idx" structure
field the more evocative "libpfm4_idx" value.
Patch from Phil Mucci
* src/ctests/all_native_events.c: Fix problem where we were passing
a pointer to an EventSet rather than the actual EventSet number
to PAPI_cleanup_eventset().
Also include some of the cleanups from Phil Mucci's MIPS tree.
* src/: perf_events.c, perf_events.h: Make the perf_event ctl
structure have more explicit data types.
Patch from Philip Mucci
* src/: cycle.h, linux-common.c, linux-context.h, linux-lock.h,
linux-timer.c, mb.h, papi.h: Add bare minimal MIPS74k support,
enough to compile.
Patch from Philip Mucci
* src/papi_events.csv: Add MIPS 74k pre-defined events
Patch by Philip Mucci
2011-09-22
* src/ctests/all_native_events.c: Heike's cleanup_eventset work
allows the calling of PAPI_cleanup_eventset with cuda, so
uncomment the eventset cleanup code in all_native_events.
* src/papi.h: Update papi.h to properly detect if being built with
a C99 compiler.
* src/papi_events.csv: Update PAPI_FP_INS event name on amd_fam14h
as it was changed in the most recent libpfm4 merge
* src/libpfm4/: README, config.mk, docs/Makefile,
docs/man3/pfm_get_event_info.3, examples/Makefile,
examples/showevtinfo.c, include/Makefile,
include/perfmon/perf_event.h, lib/Makefile, lib/pfmlib_common.c,
lib/pfmlib_gen_mips64_priv.h, lib/pfmlib_mips.c,
lib/pfmlib_mips_74k.c, lib/pfmlib_mips_perf_event.c,
lib/pfmlib_mips_priv.h, lib/pfmlib_perf_event_pmu.c,
lib/pfmlib_priv.h, lib/events/intel_atom_events.h,
lib/events/intel_core_events.h, lib/events/intel_nhm_events.h,
lib/events/intel_snb_events.h, lib/events/intel_wsm_events.h: Fix
the "conflicts" from the libpfm4 git import
* src/libpfm4/: docs/man3/libpfm_mips_74k.3, tests/validate_arm.c,
tests/validate_mips.c: Initial revision
2011-09-21
* src/multiplex.c: Fix problem where we were freeing a
singly-linked list in a for loop, possibly free()ing the
allocation before dereferencing ->next
Problem reported by coverity tool, via Will Cohen
* src/utils/cost.c: Fixed uninitialized data problem in papi_cost
Problem reported by coverity tool, via Will Cohen
* src/papi_internal.c: Fix problem where we were copying around
chunks of memory that were not initialized yet.
Problem reported by coverity tool, via Will Cohen
* src/multiplex.c: Fix two cases where we were dereferencing a
pointer without checking for NULL.
Problem reported by coverity tool, via Will Cohen
* src/linux-memory.c: We were opening files but not properly
closing them if we returned early with an error condition.
Problem reported by coverity tool, via Will Cohen
* src/linux-common.c: The coverity tool noticed that we allocate
and populate a cpu node info structure, but we never pass any
info on this structure outside of the cpu detection routine, in
effect leaking the allocation.
For now just comment out this code as it is not used by anyone.
Problem reported by coverity tool, via Will Cohen
* src/: papi.c, papi_libpfm3_events.c, perfctr-x86.c: The coverity
checker was reporting we forgot to fclose() /proc/cpuinfo in
papi.c
The bigger question, is why were we unconditionally trying to
open /proc/cpuinfo in generic code in papi.c anyway?
Turns out it was to set the event masks properly for itanium and
p4.
The platform code sets CPU vendor and family for us though, so if
we just make the event mask code use those values then we don't
have to open cpuinfo. This also means that non-Linux users with
the misfortune of running on a P4 might actually work too.
* src/: papi_internal.c, papi_libpfm_presets.c: In various places
we were using MAX_COUNTER_TERMS (defined by substrate) rather
than PAPI_MAX_COUNTER_TERMS (a papi predefined event define).
This could cause buffer overruns.
This fixes things, though really we shouldn't have such similar
names for different defines.
Problem reported by coverity tool, via Will Cohen
* src/multiplex.c: Avoid case where we could have been
dereferencing a NULL pointer in MPX_stop()
Reported by coverity tool, via Will Cohen
* src/papi.c: Fix problem where thread and cpu could be
dereferenced as NULL in PAPI_start()
Reported by coverity tool, via Will Cohen
* src/papi_events.csv: Update the AMD Family 14h (Bobcat)
pre-defined events.
It turns out they are different enough from 10h that they need
their own category.
In going through the Fam14h BKDG it turns out that Bobcat has a
really nice set of events available, especially for
Floating-Point/SSE but also memory bandwidth.
With this change, all of the ctests pass on a Bobcat machine.
* src/: configure, configure.in: Recent Ubuntu versions use the ld
flag --as-needed by default.
This breaks the PAPI configure step for the libdl check, as the
--as-needed flag enforces the rule that libraries (in this case
-ldl) must come after the object files on the command line, not
before.
The fix for this is easy, the libdl check was wrongly sticking
-ldl in LDFLAGS rather than in LIBS. Putting it in LIBS makes
things work as expected.
You can see here:
http://www.gentoo.org/proj/en/qa/asneeded.xml
For more info on this issue than you probably ever want to know.
2011-09-19
* src/: ctests/Makefile, ftests/Makefile, utils/Makefile: When
building testlib dependencies from ctests/ ftests/ and utils/
call $(MAKE) and not make, this should fix aix.
2011-09-14
* src/: aix.c, freebsd.c, linux-bgp.c, papi_vector.c,
perf_events.c, perfctr-ppc64.c, perfctr-x86.c, perfmon-ia64.c,
perfmon.c, solaris-niagara2.c, solaris-ultra.c,
components/acpi/linux-acpi.c,
components/coretemp/linux-coretemp.c,
components/coretemp_freebsd/coretemp_freebsd.c,
components/example/example.c,
components/infiniband/linux-infiniband.c,
components/lmsensors/linux-lmsensors.c,
components/lustre/linux-lustre.c, components/mx/linux-mx.c,
components/net/linux-net.c, win2k/substrate/win32.c,
win2k/substrate/winpmc-p3.c: Change initialization of function
pointer cleanup_eventset() from vec_int_dummy to vec_int_ok_dummy
so that it returns PAPI_OK by default. Roll back initialization
for every substrate. AGAIN, keep an eye on builtbot.
* src/libpfm4/lib/: pfmlib_mips.c, pfmlib_mips_74k.c,
pfmlib_mips_perf_event.c, pfmlib_mips_priv.h,
events/mips_74k_events.h: Merged with HEAD, still passing all
tests
2011-09-13
* src/papi_libpfm4_events.c: The libpfm4 code was doing a full call
to pfm_get_os_event_encoding() during every call to
update_control_state().
This is unnecessary, as we can call pfm_get_os_event_encoding()
once at event creation time and cache the results. There's no
need to call it each update_control_state(), as that is called
during PAPI_start() and thus relatively time critical.
* src/run_tests.sh: Missed a $
* src/: run_tests.sh, components/example/tests/HelloWorld.c: Update
run_tests.sh to run component tests, and update the example test
to act more like a ctest.
* src/components/example/example.c: Fix warnings generated by the
example component.
* src/: Makefile.inc, components/Makefile_comp_tests,
ctests/Makefile, ctests/do_loops.c, ctests/dummy.c,
ctests/papi_test.h, ctests/test_utils.c, ctests/test_utils.h,
ftests/Makefile, testlib/Makefile, testlib/do_loops.c,
testlib/dummy.c, testlib/papi_test.h, testlib/test_utils.c,
testlib/test_utils.h, utils/Makefile: ctests, ftests, utils, and
the component tests were all using some files in ctests.
These weren't being built when --with-no-cpu-counters was
enabled, so the PAPI build was breaking when that was enabled as
well as a component.
Move the shared files to their own directory, testlib Then update
all the users to look in the right place.
After this commit you might need to do a "cvs -d update" to make
sure you get the new subdirectory.
* src/: configure, configure.in: When compiling with
--with-no-cpu-counters configure would report the platform as
linux-perfctr-x86. This changes it to report as
linux-no-counters
2011-09-12
* src/: aix.c, freebsd.c, linux-bgp.c, perf_events.c,
perfctr-ppc64.c, perfctr-x86.c, perfmon-ia64.c, perfmon.c,
solaris-niagara2.c, solaris-ultra.c,
components/acpi/linux-acpi.c,
components/coretemp/linux-coretemp.c,
components/coretemp_freebsd/coretemp_freebsd.c,
components/example/example.c,
components/infiniband/linux-infiniband.c,
components/lmsensors/linux-lmsensors.c,
components/lustre/linux-lustre.c, components/mx/linux-mx.c,
components/net/linux-net.c, win2k/substrate/win32.c,
win2k/substrate/winpmc-p3.c: Initialize new function pointer
cleanup_eventset() for every substrate. Keep an eye on builtbot.
* src/components/cuda/: linux-cuda.c, linux-cuda.h: Cannot override
void* definitions from PAPI framework layer (e.g.
hwd_control_state_t) with typedefs to conform to PAPI Component
layer code if this technique has already been used in another
substrate (e.g. perfctr-x86). Or short: #undef and typedef can't
be done twice.
* src/perf_events.c: Fix bug caused by forgetting to drop the
stream name when converting a fprintf() into a SUBDBG()
* src/papi_libpfm_presets.c: Patch from William Cohen fixing a
potential problem found by a static analysis tool where we could
possibly pass a NULL pointer to free_notes().
* src/papi_libpfm_presets.c: Some memory leak fixes made to libpfm3
papi_pfm_events.c by Robert Richter were lost when the
libpfm4/libpfm4 presets merge was done.
This re-applies these fixes.
2011-09-10
* src/run_tests.sh: Cleaned up old comment regarding CUDA pre-4.0
when it was not possible to access a GPU from multiple CPU
threads.
* src/: papi.c, papi_protos.h, papi_vector.c, papi_vector.h,
components/README, components/cuda/linux-cuda.c,
components/cuda/linux-cuda.h: Deleted function pointer
destroy_eventset from the PAPI vector table, and added
cleanup_eventset instead. PAPI_destroy_eventset() requires an
empty EventSet. Hence, usually PAPI_cleanup_eventset() is called
before PAPI_destroy_eventset(); which also sets the CompIdx to
-1. This means, PAPI_destroy_eventset() won't have any knowledge
about components. However, in order to disable CUDA eventGroups
and to free perfmon hardware on the GPU, knowledge about the CUDA
component index is required. Hence, I replaced
CUDA_destroy_eventset() with CUDA_cleanup_eventset() in the CUDA
component. NOTE: Please make sure you call
PAPI_cleanup_eventset() before calling PAPI_shutdown().
2011-09-09
* src/: papi_protos.h, papi_vector.c, papi_vector.h,
components/cuda/linux-cuda.c, components/cuda/linux-cuda.h: CUDA
component is now thread-safe. Starting in CUDA 4.0, multiple CPU
threads can access the same CUDA context. This is a much easier
programming model then pre-4.0 as threads - using the same CUDA
context - can share memory, data, etc. Note, it's possible to
create a different CUDA context for each thread, but then we are
likely running into a limitation that only one context can be
profiled at a time.