-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
2023-09-04 Fabrice Le Fessant <[email protected]> and Emilien Lemaire <[email protected]> | ||
|
||
* parser.y: generate `cob_prof_section/paragraph_enter/exit` calls when | ||
needed | ||
* parser.y: generate `cob_prof_{enter/exit}_{section/paragraph}` calls | ||
when needed | ||
This comment has been minimized.
Sorry, something went wrong. |
||
* flag.def: add `-fprof` to enable profiling | ||
* codegen.c: handle profiling code generation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1071,10 +1071,6 @@ AT_DATA([XXX], [ | |
this test should include a second program which is CALLed two times | ||
and has a different code path and therefore profiling depending on a | ||
"mode" parameter passed | ||
|
||
one test is missing that involves multiple COBOL programs, maybe a | ||
module profcob1 (started by cobcrun, doing CALL "SYSTEM" USING | ||
"profcob2" (of a compiled executable)) | ||
]) | ||
AT_DATA([prog.cob], [ | ||
IDENTIFICATION DIVISION. | ||
|
@@ -1109,8 +1105,9 @@ AT_CHECK([COB_PROF_ENABLE=1 COB_PROF_FILE=prof.csv ./prog], [0], [], | |
[File prof.csv generated | ||
]) | ||
|
||
#note: The time here is actually the number of times the procedure has been run, to avoid | ||
# any indeterminism in the running time of the procedure. | ||
# note: The time here is actually the number of times the procedure has | ||
This comment has been minimized.
Sorry, something went wrong.
GitMensch
Collaborator
|
||
# been run, to avoid any indeterminism in the running time of the | ||
# procedure. | ||
|
||
AT_CHECK([cat prof.csv], [0], | ||
[program-id,section,paragraph,entry,location,kind,time-ns,time,ncalls | ||
|
@@ -1196,25 +1193,24 @@ AT_DATA([prog.cob], [ | |
IDENTIFICATION DIVISION. | ||
PROGRAM-ID. prog. | ||
PROCEDURE DIVISION. | ||
MAIN SECTION. | ||
DISPLAY "HELLO WORLD". | ||
CALL "entry". | ||
GOBACK. | ||
ENTRY "entry". | ||
CALL "inside-program". | ||
FIN SECTION. | ||
PROGRAM-ID. inside-program. | ||
DATA DIVISION. | ||
WORKING-STORAGE SECTION. | ||
01 COUNTER PIC 9(4). | ||
PROCEDURE DIVISION. | ||
MOVE 5000 TO COUNTER. | ||
MAIN SECTION. | ||
MOVE 100 TO COUNTER. | ||
INSIDE SECTION. | ||
PERFORM ITER. | ||
EXIT SECTION. | ||
ITER. | ||
IF COUNTER = 0 | ||
DISPLAY "end iter". | ||
DISPLAY "end iter" | ||
EXIT PARAGRAPH. | ||
SUBTRACT 1 FROM COUNTER. | ||
PERFORM INSIDE. | ||
|
@@ -1225,24 +1221,25 @@ AT_CAPTURE_FILE([prof.csv]) | |
|
||
AT_CHECK([$COMPILE -fprof -x prog.cob]) | ||
|
||
AT_CHECK([COB_PROF_ENABLE=1 COB_PROF_FILE=prof.csv ./prog], [0], [HELLO WORLD | ||
AT_CHECK([COB_PROF_ENABLE=1 COB_PROF_FILE=prof.csv ./prog], [0], | ||
[HELLO WORLD | ||
end iter | ||
], | ||
[File prof.csv generated | ||
]) | ||
|
||
AT_CHECK([cat prof.csv], [0], | ||
[program-id,section,paragraph,entry,location,kind,time-ns,time,ncalls | ||
inside__program,,,,prog.cob:12,PROGRAM,7000000,0.007 s,1 | ||
inside__program,MAIN SECTION,,,prog.cob:17,SECTION,1000000,0.001 s,1 | ||
inside__program,MAIN SECTION,MAIN PARAGRAPH,,prog.cob:17,PARAGRAPH,1000000,0.001 s,1 | ||
inside__program,INSIDE,,,prog.cob:18,SECTION,4000000,0.004 s,1 | ||
inside__program,INSIDE,MAIN PARAGRAPH,,prog.cob:18,PARAGRAPH,3000000,0.003 s,1 | ||
inside__program,INSIDE,ITER,,prog.cob:21,PARAGRAPH,1000000,0.001 s,1 | ||
prog,,,,prog.cob:0,PROGRAM,15000000,0.015 s,2 | ||
prog,MAIN,,,prog.cob:5,SECTION,13000000,0.013 s,1 | ||
prog,MAIN,MAIN PARAGRAPH,,prog.cob:5,PARAGRAPH,13000000,0.013 s,2 | ||
prog,MAIN,MAIN PARAGRAPH,entry,prog.cob:5,ENTRY,0,0.000 s,1 | ||
prog,FIN,,,prog.cob:11,SECTION,0,0.000 s,1 | ||
inside__program,,,,prog.cob:10,PROGRAM,407000000,0.407 s,1 | ||
inside__program,MAIN,,,prog.cob:15,SECTION,1000000,0.001 s,1 | ||
inside__program,MAIN,MAIN PARAGRAPH,,prog.cob:15,PARAGRAPH,1000000,0.001 s,1 | ||
inside__program,INSIDE,,,prog.cob:17,SECTION,804000000,0.804 s,101 | ||
inside__program,INSIDE,MAIN PARAGRAPH,,prog.cob:17,PARAGRAPH,403000000,0.403 s,101 | ||
inside__program,INSIDE,ITER,,prog.cob:20,PARAGRAPH,401000000,0.401 s,101 | ||
prog,,,,prog.cob:0,PROGRAM,415000000,0.415 s,2 | ||
prog,MAIN SECTION,,,prog.cob:5,SECTION,413000000,0.413 s,1 | ||
prog,MAIN SECTION,MAIN PARAGRAPH,,prog.cob:5,PARAGRAPH,413000000,0.413 s,2 | ||
prog,MAIN SECTION,MAIN PARAGRAPH,entry,prog.cob:5,ENTRY,0,0.000 s,1 | ||
]) | ||
|
||
AT_CLEANUP | ||
|
From the GNU Coding Standards:
(I've post-fixed the places where I did when reading that the first time)