--- /Users/luca/Downloads/profiler/profiler_api.inc
+++ profiler_api.inc
@@ -70,7 +70,7 @@
     // We flush caches at the beginning to ensure that any necessary module
     // tasks, such as Features component rebuilding, is complete before the
     // remaining tasks are run.
-    drupal_flush_all_caches();
+    _drupal_flush_all_caches();
 
     // Run any component installations
     profiler_install_components($config);
@@ -91,7 +91,7 @@
     module_rebuild_cache(); // Detects the newly added bootstrap modules
     node_access_rebuild();
     drupal_get_schema('system', TRUE); // Clear schema DB cache
-    drupal_flush_all_caches();
+    _drupal_flush_all_caches();
 
     // Finish
     profiler_install_configure($config);
@@ -402,3 +402,30 @@
     user_save($account, array('roles' => $formatted));
   }
 }
+
+/**
+ * Flush all cached data on the site.
+ *
+ * Empties cache tables, rebuilds the menu cache and theme registries, and
+ * invokes a hook so that other modules' cache data can be cleared as well.
+ */
+function _drupal_flush_all_caches() {
+  // Change query-strings on css/js files to enforce reload for all users.
+  _drupal_flush_css_js();
+
+  drupal_clear_css_cache();
+  drupal_clear_js_cache();
+
+  _system_theme_data();
+
+  drupal_rebuild_theme_registry();
+  menu_rebuild();
+  node_types_rebuild();
+  // Don't clear cache_form - in-progress form submissions may break.
+  // Ordered so clearing the page cache will always be the last action.
+  $core = array('cache', 'cache_block', 'cache_filter', 'cache_page');
+  $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
+  foreach ($cache_tables as $table) {
+    cache_clear_all('*', $table, TRUE);
+  }
+}
