# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Users\User\Documents\NetBeansProjects\ProfilingDemo_1\common.h +++ C:\Program Files\TortoiseHg\cnd-main\cnd.makeproject\samples_src\profiling\common.h @@ -35,7 +35,6 @@ #endif #include -#include // Tracing typedef enum { @@ -88,8 +87,6 @@ int cpucount(); void mem2str(char* buf, long bytes); -struct timeval globalstarttime; -struct timeval globalcurrtime; // Check available pthread features #include # This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Users\User\Documents\NetBeansProjects\ProfilingDemo_1\mutex.c +++ C:\Program Files\TortoiseHg\cnd-main\cnd.makeproject\samples_src\profiling\mutex.c @@ -109,9 +109,6 @@ for (i = 0; i < work_count; ++i) { work_explain(&works[i]); } - - print_run_time(); - PAUSE("Press [Enter] to start...\n"); estimate_usage(work_count, works, seconds); @@ -137,8 +134,5 @@ TRACE("Freeing memory used for thread descriptors\n", work_count * sizeof(pthread_t)); free(t); - - get_running_time(&globalcurrtime); - TRACE("\nFinish time is %ld seconds.\n\n", globalcurrtime); PRINT("\n"); } # This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Users\User\Documents\NetBeansProjects\ProfilingDemo_1\main.c +++ C:\Program Files\TortoiseHg\cnd-main\cnd.makeproject\samples_src\profiling\main.c @@ -41,7 +41,6 @@ { 0, cpu_sys, mem_none, 0 } }; - int main(int argc, char** argv) { int i, work_count = MAX(cpucount(), 2); @@ -54,8 +53,6 @@ msg_levels = msg_explain | msg_trace; - gettimeofday(&globalstarttime,0); - sequential_demo(work_count, works, 10); parallel_demo(work_count, works, 10); # This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Users\User\Documents\NetBeansProjects\ProfilingDemo_1\common.c +++ C:\Program Files\TortoiseHg\cnd-main\cnd.makeproject\samples_src\profiling\common.c @@ -56,16 +56,6 @@ TRACE("work %d: Done sleeping\n", work_id); } - void get_running_time(struct timeval* a) { - gettimeofday(a, 0); - a->tv_sec -= globalstarttime.tv_sec; -} - - void print_run_time () { - get_running_time(&globalcurrtime); - TRACE("\nProgram works %ld seconds \n\n", globalcurrtime); - } - static void work_run_usrcpu(int work_id, long micros) { TRACE("work %d: Starting mathematical calculations...\n", work_id); long i = 0, j = 0; # This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Users\User\Documents\NetBeansProjects\ProfilingDemo_1\sequential.c +++ C:\Program Files\TortoiseHg\cnd-main\cnd.makeproject\samples_src\profiling\sequential.c @@ -36,9 +36,6 @@ int i; for (i = 0; i < work_count; ++i) { work_explain(&works[i]); - - print_run_time(); - PAUSE("Press [Enter] to start this work...\n"); REF("Estimated resource usage for the following %d seconds\n", seconds_per_work); REF("CPU usage:\n"); # This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Users\User\Documents\NetBeansProjects\ProfilingDemo_1\parallel.c +++ C:\Program Files\TortoiseHg\cnd-main\cnd.makeproject\samples_src\profiling\parallel.c @@ -33,7 +33,6 @@ #include #include "parallel.h" - static void estimate_usage(int work_count, work_t* works, int seconds) { int usrcpu = usrcpu_usage(work_count, works); int syscpu = syscpu_usage(work_count, works); @@ -70,9 +69,6 @@ for (i = 0; i < work_count; ++i) { work_explain(&works[i]); } - - print_run_time(); - PAUSE("Press [Enter] to start...\n"); estimate_usage(work_count, works, seconds_per_work);