-- $Id: report.adb,v 1.1 2008/11/20 18:49:43 baker Exp baker $ -- ??? This is a temporary version, with reduced capability. with Tasks; with Stats; with Text_IO; use Text_IO; package body Report is File : File_Type; procedure Put_Task_Name (T : Task_Ref) is begin Put (File, " " & Name (T)); end Put_Task_Name; procedure Put_Header is begin For_Every_Task (Put_Task_Name); end Put_Header; procedure Open (Filename_Root : String) is begin -- open or create the output file begin create (File, out_file, Filename_Root & ".out"); exception when others=> open (File, out_file, Filename_Root & ".out"); end; Put_Header; end Open; procedure Close is begin Close (File); end Close; procedure Put_One ( procedure Put is begin end Put; procedure Query_Tasks (Report : Object) is S : State renames Report.State; procedure Query_One_Task (Task_Ref : Tasks.Object_Ref) is use Ada.Tags; use Events; P, T : Integer; begin if Task_Ref'Tag = Aperiodic_Tasks.Object'Tag then T := Maximum_Response_Time (Task_Ref); P := Period (Task_Ref); --- ... working here ... else raise Program_Error; end if; end Query_One_Task; procedure Query_All_Tasks is new Task_Sets.For_All (Query_One_Task); begin Query_All_Tasks (S.Tasks); end Query_Tasks; procedure Chk (I: IATS; R: Runs; L: Loads; M: Float) is -- check for average response times that are better than M/M/1 begin for S in Sizes.Servers loop if Avg (S)(R)(L)0.0 then put (Tex, " & "); put (Tex, Integer (F), 5); put (Tex, " & $\PM$ "); put (Tex, Integer (Z99*SD (S)(R)(L)/Sqrt (float (Comptd (S)(R)(L)))), 3); -- put (Tex, Integer (3.0*SD (S)(R)(L)/Sqrt (float (Comptd (S)(R)(L)))), 3); else put (Tex, " & \overload & \overload "); end if; end Put_Tex; procedure Put_Plot (F: Float) is begin if F <= 0.0 then put (Plot, "99999.999"); else put (Plot, F, 4, 3, 0); end if; put (Plot, " "); end Put_Plot; procedure Put is begin --- output to LaTex table file put_line (Tex, "\\ "); for J in Loads loop begin put (Tex, float (U (R))/100.0, 1, 2, 0); put (Tex, " & "); put (Tex, Util (Sizes.BGS)(R)(J), 1, 2, 0); for S in Sizes.Servers loop Put_Tex (S, R, J); end loop; put (Tex, "\\"); new_line (Tex); exception when others=> put_line (Tex, "exception in output"); end; end loop; put_line (Tex, "\\"); --- output to Gnuplot data file for J in Loads loop declare T: constant Float := Avg (Sizes.BGS)(R)(J); IAT: constant Float := Interarrival_Time_Data (I); AL: constant Float := Util (Sizes.BGS)(R)(J); M: constant Float := -- M/M/1, for full server AL*IAT/ (1.0-AL); -- M/M/1, relative to server capacity = -- S: constant Float := float (EDF_Size (R)(Sizes.PLS)); -- M: constant Float := S*AL*IAT/ (S-AL*float (Server_Period)); begin Chk (I, R, J, M); put_Plot (AL); -- 1 put_Plot (T); -- 2 put_Plot (Avg (Sizes.PLS)(R)(J)); -- 3 put_Plot (Avg (Sizes.DDS)(R)(J)); -- 4 put_Plot (Avg (Sizes.DSS)(R)(J)); -- 5 put_Plot (Avg (Sizes.DXS)(R)(J)); -- 6 put_Plot (M); -- 7 put_Plot (Avg (Sizes.PLS)(R)(J)/T); -- 8 put_Plot (Avg (Sizes.DDS)(R)(J)/T); -- 9 put_Plot (Avg (Sizes.DSS)(R)(J)/T); -- 10 put_Plot (Avg (Sizes.DXS)(R)(J)/T); -- 11 put_Plot (M/T); -- 12 end; new_line (Plot); end loop; procedure Run (Filename_Root : String) is begin Open (); declare S : Stats.Data := Aperiodic_Tasks (K).Get_Stats; begin -- just the basics, for now Put ("Max_Response_Time = "); Put (Integer (S.Max_Response_Time)); New_Line; Put ("Total_Response_Time = "); Put (Integer (S.Total_Response_Time)); New_Line; Put ("Job_Count = "); Put (Integer (S.Job_Count)); New_Line; Put ("Missed_Deadlines = "); Put (Integer (S.Max_Missed_Deadlines)); New_Line; end; end loop; Close; begin end Run; end Put; end Report;