mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Resurrect this function.
Sun Jan 8 03:22:22 2006 Soeren Sandmann <sandmann@redhat.com> * process.c (process_flush_caches): Resurrect this function. * collector.c (collector_reset): Call it from here
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
0559ad82e7
commit
5a8582b041
@ -1,3 +1,9 @@
|
||||
Sun Jan 8 03:22:22 2006 Soeren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* process.c (process_flush_caches): Resurrect this function.
|
||||
|
||||
* collector.c (collector_reset): Call it from here
|
||||
|
||||
Sun Jan 8 02:19:34 2006 Soeren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* TODO: update
|
||||
|
||||
@ -240,6 +240,8 @@ collector_reset (Collector *collector)
|
||||
{
|
||||
if (collector->stash)
|
||||
stack_stash_free (collector->stash);
|
||||
|
||||
process_flush_caches();
|
||||
|
||||
collector->stash = stack_stash_new ();
|
||||
collector->n_samples = 0;
|
||||
|
||||
40
process.c
40
process.c
@ -200,6 +200,44 @@ process_free_maps (Process *process)
|
||||
g_list_free (process->maps);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
free_process (gpointer key, gpointer value, gpointer data)
|
||||
{
|
||||
char *cmdline = key;
|
||||
Process *process = value;
|
||||
|
||||
#if 0
|
||||
g_print ("freeing: %p\n", process);
|
||||
memset (process, '\0', sizeof (Process));
|
||||
#endif
|
||||
g_free (process->cmdline);
|
||||
#if 0
|
||||
process->cmdline = "You are using free()'d memory";
|
||||
#endif
|
||||
process_free_maps (process);
|
||||
g_list_free (process->bad_pages);
|
||||
g_free (cmdline);
|
||||
|
||||
g_free (process);
|
||||
}
|
||||
|
||||
void
|
||||
process_flush_caches (void)
|
||||
{
|
||||
if (!processes_by_cmdline)
|
||||
return;
|
||||
|
||||
g_hash_table_foreach (processes_by_cmdline, free_process, NULL);
|
||||
|
||||
g_hash_table_destroy (processes_by_cmdline);
|
||||
g_hash_table_destroy (processes_by_pid);
|
||||
|
||||
processes_by_cmdline = NULL;
|
||||
processes_by_pid = NULL;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
process_has_page (Process *process, gulong addr)
|
||||
{
|
||||
@ -343,6 +381,8 @@ process_get_from_pid (int pid)
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
Reference in New Issue
Block a user