Commit 183ee73e authored by julien.delange's avatar julien.delange

Add -perf option to enable gprof with polyorbhic




git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@608 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 3272dc31
......@@ -44,6 +44,7 @@ with Ocarina.Backends.Messages;
with Ocarina.Backends.C_Tree.Nutils;
with Ocarina.Backends.C_Tree.Nodes;
with Ocarina.Backends.C_Values;
with Ocarina.Backends.PO_HI_C;
with Ocarina.Backends.PO_HI_C.Runtime;
with Ocarina.Backends.C_Common.Mapping;
......@@ -349,7 +350,12 @@ package body Ocarina.Backends.PO_HI_C.Main is
-- all other task. In fact, no task will terminate, so this function
-- will only switch the main task to the sleep state all the time.
N := CTU.Make_Call_Profile (RE (RE_Wait_For_Tasks));
if not PO_HI_C.Use_Performance_Analysis then
N := CTU.Make_Call_Profile (RE (RE_Wait_For_Tasks));
else
N := CTU.Make_Call_Profile (RE (RE_Wait_End_Of_Instrumentation));
end if;
Append_Node_To_List (N, CTN.Statements (Main_Function));
N := CTU.Make_Return_Statement (RE (RE_Main_Return));
......
......@@ -132,6 +132,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Simulink_Find_Var, -- __po_hi_simulink_find_var
RE_Simulink_Find_Parameter, -- __po_hi_simulink_find_parameter
RE_Simulink_Update, -- __po_hi_simulink_update
RE_Wait_End_Of_Instrumentation, -- __po_hi_wait_end_of_instrumentation
RE_Wait_For_Tasks, -- __po_hi_wait_for_tasks
RE_Default_Priority, -- __PO_HI_DEFAULT_PRIORITY
......@@ -278,6 +279,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Simulink_Find_Signal => RH_PO_HI_Simulink,
RE_Simulink_Find_Parameter => RH_PO_HI_Simulink,
RE_Simulink_Update => RH_PO_HI_Simulink,
RE_Wait_End_Of_Instrumentation => RH_PO_HI_Main,
RE_Wait_For_Tasks => RH_PO_HI_Task,
-- Runtime types associations
......
......@@ -84,6 +84,7 @@ package body Ocarina.Backends.PO_HI_C is
Compile_Generated_Sources : Boolean := False;
Remove_Generated_Sources : Boolean := False;
Add_Performance_Analysis : Boolean := False;
Do_Regression_Test : Boolean := False;
Do_Coverage_Test : Boolean := False;
Generated_Sources_Directory : Name_Id := No_Name;
......@@ -172,6 +173,11 @@ package body Ocarina.Backends.PO_HI_C is
Write_Line ("no");
end if;
if Add_Performance_Analysis then
Write_Str ("USE_GPROF = yes");
Write_Eol;
end if;
if Use_Simulink then
Write_Str ("SIMULINK_DIR = ");
Write_Name (Simulink_Directory);
......@@ -321,7 +327,7 @@ package body Ocarina.Backends.PO_HI_C is
Generated_Sources_Directory := Get_String_Name (".");
Initialize_Option_Scan;
loop
case Getopt ("* b z ec er o:") is
case Getopt ("* b z ec er o: perf") is
when ASCII.NUL =>
exit;
......@@ -331,6 +337,11 @@ package body Ocarina.Backends.PO_HI_C is
when 'z' =>
Remove_Generated_Sources := True;
when 'p' =>
if Full_Switch = "perf" then
Add_Performance_Analysis := True;
end if;
when 'e' =>
Compile_Generated_Sources := True;
if Full_Switch = "ec" then
......@@ -366,6 +377,15 @@ package body Ocarina.Backends.PO_HI_C is
Ocarina.Backends.PO_HI_C.Runtime.Reset;
end Reset;
------------------------------
-- Use_Performance_Analysis --
------------------------------
function Use_Performance_Analysis return Boolean is
begin
return Add_Performance_Analysis;
end Use_Performance_Analysis;
---------------------------------
-- Visit_Architecture_Instance --
---------------------------------
......
......@@ -49,6 +49,9 @@ package Ocarina.Backends.PO_HI_C is
procedure Reset;
-- Reset the internal units of the PO_HI_C generator
function Use_Performance_Analysis return Boolean;
-- Specify if we use performance analysis or not.
private
C_Root : Node_Id;
-- The root of the C trees
......
......@@ -284,6 +284,8 @@ package body Ocarina.Backends is
begin
Write_Line (" -g Generate code from the AADL instance tree");
Ocarina.Backends.Write_Backends (7);
Write_Line (" -perf Enable profiling with gprof (PolyORB-HI-C only)");
Ocarina.Backends.Write_Backends (7);
Write_Line
(" -arinc653 Generate code for ARINC653 API (POK backend only)");
Write_Line (" -b Generate and build code from the AADL model");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment