From dfdc4478ff3b3b96a9729871a8a10c491e25e304 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 5 Mar 2026 14:20:12 -0500 Subject: [PATCH 03/30] FIXME: undo 'FIXME: WIP on sysprof' --- gcc/ggc-common.cc | 35 ----------------------------------- gcc/ggc-page.cc | 6 ------ gcc/passes.cc | 11 ----------- gcc/timevar.cc | 24 ------------------------ gcc/timevar.h | 9 --------- 5 files changed, 85 deletions(-) diff --git a/gcc/ggc-common.cc b/gcc/ggc-common.cc index 880bf611393..6d3dca78f03 100644 --- a/gcc/ggc-common.cc +++ b/gcc/ggc-common.cc @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "hosthooks.h" #include "plugin.h" #include "options.h" -#include /* When true, protect the contents of the identifier hash table. */ bool ggc_protect_identifiers = true; @@ -1124,8 +1123,6 @@ ggc_min_heapsize_heuristic (void) } #endif -static void init_ggc_counters (); - void init_ggc_heuristics (void) { @@ -1133,8 +1130,6 @@ init_ggc_heuristics (void) param_ggc_min_expand = ggc_min_expand_heuristic (); param_ggc_min_heapsize = ggc_min_heapsize_heuristic (); #endif - - init_ggc_counters (); } /* GGC memory usage. */ @@ -1276,36 +1271,6 @@ public: /* GCC memory description. */ static mem_alloc_description ggc_mem_desc; -static void -init_counter (SysprofCaptureCounter *c, - const char *category, - const char *name, - const char *description) -{ - memset (c, 0, sizeof (*c)); - strncpy (c->category, category, sizeof (c->category)); - strncpy (c->name, name, sizeof (c->name)); - strncpy (c->description, description, sizeof (c->description)); - // FIXME -} - -static void -init_ggc_counters () -{ - sysprof_collector_init (); - - SysprofCaptureCounter counters[6] = {}; - - init_counter (&counters[0], "GGC", "alloated", "FIXME"); - init_counter (&counters[1], "GGC", "times", "FIXME"); - init_counter (&counters[2], "GGC", "peak", "FIXME"); - init_counter (&counters[3], "GGC", "freed", "FIXME"); - init_counter (&counters[4], "GGC", "collected", "FIXME"); - init_counter (&counters[5], "GGC", "overhead", "FIXME"); - - sysprof_collector_define_counters (counters, 6); -} - /* Dump per-site memory statistics. */ void diff --git a/gcc/ggc-page.cc b/gcc/ggc-page.cc index e10c073dd5c..e3cccc9d079 100644 --- a/gcc/ggc-page.cc +++ b/gcc/ggc-page.cc @@ -1534,12 +1534,6 @@ ggc_internal_alloc (size_t size, void (*f)(void *), size_t s, size_t n (fmt_size_t) size, (fmt_size_t) object_size, result, (void *) entry); -#if 0 - SysprofCaptureCounterValue counters[6]; - sysprof_collector_set_counters (const unsigned int *counters_ids, - counters, 6); -#endif - return result; } diff --git a/gcc/passes.cc b/gcc/passes.cc index eb9dd12c24d..9ec37eeb2a9 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -67,9 +67,6 @@ along with GCC; see the file COPYING3. If not see #include "topics/pass-events.h" #include "channels.h" -// FIXME: -#include - /* Reserved TODOs */ #define TODO_verify_il (1u << 31) @@ -2655,17 +2652,9 @@ execute_one_pass (opt_pass *pass) do_per_function (verify_curr_properties, (void *)(size_t)pass->properties_required); - SysprofTimeStamp ts = SYSPROF_CAPTURE_CURRENT_TIME; - /* Do it! */ todo_after = pass->execute (cfun); - sysprof_collector_mark (ts, - SYSPROF_CAPTURE_CURRENT_TIME - ts, - "GCC Passes", - pass->name, - current_function_name ()); - if (todo_after & TODO_discard_function) { /* Stop timevar. */ diff --git a/gcc/timevar.cc b/gcc/timevar.cc index 5c66c94f3f1..2b2dd9386af 100644 --- a/gcc/timevar.cc +++ b/gcc/timevar.cc @@ -263,22 +263,6 @@ timer::push (timevar_id_t timevar) push_internal (tv); } -void -timer::timevar_def::sysprof_mark_start () -{ - this->sysprof_start_time = SYSPROF_CAPTURE_CURRENT_TIME; -} - -void -timer::timevar_def::sysprof_mark_end () -{ - sysprof_collector_mark (this->sysprof_start_time, - SYSPROF_CAPTURE_CURRENT_TIME - this->sysprof_start_time, - "GCC Timers", - this->name, - nullptr); // current_function_name ()); -} - /* Push TV onto the timing stack, either one of the builtin ones for a timevar_id_t, or one provided by client code to libgccjit. */ @@ -307,7 +291,6 @@ timer::push_internal (struct timevar_def *tv) /* Reset the start time; from now on, time is attributed to TIMEVAR. */ m_start_time = now; - tv->sysprof_mark_start (); /* See if we have a previously-allocated stack instance. If so, take it off the list. If not, malloc a new one. */ @@ -374,8 +357,6 @@ timer::pop_internal () element just exposed on the stack. */ m_start_time = now; - popped->timevar->sysprof_mark_end (); - /* Don't delete the stack element; instead, add it to the list of unused elements for later use. */ popped->next = m_unused_stack_instances; @@ -411,7 +392,6 @@ timer::start (timevar_id_t timevar) tv->standalone = 1; get_time (&tv->start_time); - tv->sysprof_mark_start (); } /* Stop timing TIMEVAR. Time elapsed since timevar_start was called @@ -440,8 +420,6 @@ timer::stop (timevar_id_t timevar) get_time (&now); timevar_accumulate (&tv->elapsed, &tv->start_time, &now); - - tv->sysprof_mark_end (); } @@ -478,7 +456,6 @@ timer::cond_start (timevar_id_t timevar) tv->standalone = 1; get_time (&tv->start_time); - tv->sysprof_mark_start (); return false; /* The timevar was not already running. */ } @@ -511,7 +488,6 @@ timer::cond_stop (timevar_id_t timevar) tv->standalone = 0; /* Enable a restart. */ get_time (&now); - tv->sysprof_mark_end (); timevar_accumulate (&tv->elapsed, &tv->start_time, &now); } diff --git a/gcc/timevar.h b/gcc/timevar.h index 6f9e7d6828a..1e7503d43ba 100644 --- a/gcc/timevar.h +++ b/gcc/timevar.h @@ -21,9 +21,6 @@ #ifndef GCC_TIMEVAR_H #define GCC_TIMEVAR_H -// FIXME: -#include - namespace json { class value; } /* Timing variables are used to measure elapsed time in various @@ -137,9 +134,6 @@ class timer /* Private type: a timing variable. */ struct timevar_def { - void sysprof_mark_start (); - void sysprof_mark_end (); - std::unique_ptr make_json () const; /* Elapsed time for this variable. */ @@ -149,9 +143,6 @@ class timer using timevar_start, this contains the start time. */ struct timevar_time_def start_time; - // FIXME - SysprofTimeStamp sysprof_start_time; - /* The name of this timing variable. */ const char *name; -- 2.49.0