mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Comment out disk profiler setup
This commit is contained in:
@ -330,7 +330,7 @@ read_symbols (BinFile *bf)
|
|||||||
|
|
||||||
symbol.address = bfd_asymbol_value (bfd_symbols[i]) - load_address;
|
symbol.address = bfd_asymbol_value (bfd_symbols[i]) - load_address;
|
||||||
name = demangle (bfd, bfd_asymbol_name (bfd_symbols[i]));
|
name = demangle (bfd, bfd_asymbol_name (bfd_symbols[i]));
|
||||||
symbol.name = g_strdup (name);
|
symbol.name = g_strdup_printf ("%s (%s)", name, bf->filename);
|
||||||
free (name);
|
free (name);
|
||||||
|
|
||||||
g_array_append_vals (symbols, &symbol, 1);
|
g_array_append_vals (symbols, &symbol, 1);
|
||||||
@ -418,6 +418,10 @@ bin_file_lookup_symbol (BinFile *bf,
|
|||||||
*/
|
*/
|
||||||
if (strcmp (result->name, "call_gmon_start") == 0)
|
if (strcmp (result->name, "call_gmon_start") == 0)
|
||||||
return &(bf->undefined);
|
return &(bf->undefined);
|
||||||
|
else if (strncmp (result->name, "__do_global_ctors_aux", strlen ("__do_global_ctors_aux")) == 0)
|
||||||
|
{
|
||||||
|
g_print ("ctors: %p, pos: %p\n", address, result->address);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ generate_stack_trace (struct task_struct *task,
|
|||||||
|
|
||||||
frame = (StackFrame *)regs->ebp;
|
frame = (StackFrame *)regs->ebp;
|
||||||
|
|
||||||
while (frame && i < SYSPROF_MAX_ADDRESSES &&
|
while (frame && i < SYSPROF_MAX_ADDRESSES - 1 &&
|
||||||
(long)frame < (long)START_OF_STACK &&
|
(long)frame < (long)START_OF_STACK &&
|
||||||
(long)frame >= regs->esp)
|
(long)frame >= regs->esp)
|
||||||
{
|
{
|
||||||
@ -155,18 +155,23 @@ hijacked_nopage (struct vm_area_struct * area,
|
|||||||
|
|
||||||
result = filemap_nopage (area, address, unused);
|
result = filemap_nopage (area, address, unused);
|
||||||
|
|
||||||
if (current && current->pid != 0 && disk)
|
if (current && disk)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
generate_stack_trace (current, head);
|
generate_stack_trace (current, head);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
memset (head, 0, sizeof (SysprofStackTrace));
|
memset (head, 0, sizeof (SysprofStackTrace));
|
||||||
|
|
||||||
head->pid = current->pid;
|
head->pid = current->pid;
|
||||||
head->addresses[0] = (void *)address;
|
head->addresses[0] = (void *)address;
|
||||||
head->truncated = 0;
|
head->truncated = 0;
|
||||||
head->n_addresses = 1;
|
head->n_addresses = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
memmove (&(head->addresses[1]), &(head->addresses[0]),
|
||||||
|
head->n_addresses * 4);
|
||||||
|
head->n_addresses++;
|
||||||
|
head->addresses[0] = address;
|
||||||
|
|
||||||
if (area->vm_file)
|
if (area->vm_file)
|
||||||
{
|
{
|
||||||
@ -332,12 +337,14 @@ on_timer_interrupt (void *data)
|
|||||||
|
|
||||||
if (exiting)
|
if (exiting)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
if (!cpu_profiler)
|
if (!cpu_profiler)
|
||||||
{
|
{
|
||||||
restore_mmaps();
|
restore_mmaps();
|
||||||
|
|
||||||
clean_hijacked_nopages ();
|
clean_hijacked_nopages ();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
wake_up (&wait_for_exit);
|
wake_up (&wait_for_exit);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -418,6 +425,7 @@ init_module (void)
|
|||||||
trace_proc_file->proc_fops->poll = procfile_poll;
|
trace_proc_file->proc_fops->poll = procfile_poll;
|
||||||
trace_proc_file->size = sizeof (SysprofStackTrace);
|
trace_proc_file->size = sizeof (SysprofStackTrace);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (!cpu_profiler)
|
if (!cpu_profiler)
|
||||||
{
|
{
|
||||||
hijack_mmaps ();
|
hijack_mmaps ();
|
||||||
@ -427,6 +435,7 @@ init_module (void)
|
|||||||
hijack_nopages (task);
|
hijack_nopages (task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
queue_task(&timer_task, &tq_timer);
|
queue_task(&timer_task, &tq_timer);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user