mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Use getpagesize()
Sat Apr 30 16:57:23 2005 Soeren Sandmann <sandmann@redhat.com> * process.c (PAGE_SIZE): Use getpagesize() * TODO: More updates
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
914d8bf668
commit
6906804784
@ -1,3 +1,9 @@
|
|||||||
|
Sat Apr 30 16:57:23 2005 Soeren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* process.c (PAGE_SIZE): Use getpagesize()
|
||||||
|
|
||||||
|
* TODO: More updates
|
||||||
|
|
||||||
Sat Apr 30 15:44:12 2005 Søren Sandmann <sandmann@redhat.com>
|
Sat Apr 30 15:44:12 2005 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
* TODO: Updates
|
* TODO: Updates
|
||||||
|
|||||||
62
TODO
62
TODO
@ -27,14 +27,63 @@ Before 1.0:
|
|||||||
(ask for sucess/failure-stories in 0.9.x releases)
|
(ask for sucess/failure-stories in 0.9.x releases)
|
||||||
- auto*?
|
- auto*?
|
||||||
- .desktop file
|
- .desktop file
|
||||||
- translation should be hooked up
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Before 1.2:
|
Before 1.2:
|
||||||
|
|
||||||
|
- translation should be hooked up
|
||||||
|
- Fixing the oops in kernels < 2.6.11
|
||||||
|
|
||||||
|
- Make the process waiting in poll() responsible for extracting
|
||||||
|
the backtrace. Give a copy of the entire stack rather than doing
|
||||||
|
the walk inside the kernel. That would allow us to do more complex
|
||||||
|
algorithms in userspace.
|
||||||
|
|
||||||
|
New model:
|
||||||
|
- Two arrays,
|
||||||
|
one of actual scanned stacks
|
||||||
|
one of tasks that need to be scanned
|
||||||
|
One wait queue,
|
||||||
|
wait for data
|
||||||
|
|
||||||
|
- in read() wait for stack data:
|
||||||
|
scan_tasks()
|
||||||
|
if (!stack_data)
|
||||||
|
return -EWOULDBLOCK;
|
||||||
|
|
||||||
|
in poll()
|
||||||
|
while (!stack data) {
|
||||||
|
wait_for_data();
|
||||||
|
scan_tasks();
|
||||||
|
}
|
||||||
|
return READABLE;
|
||||||
|
|
||||||
|
scan_tasks() is a function that converts waiting
|
||||||
|
tasks into data, and wakes them up.
|
||||||
|
|
||||||
|
- in timer interrupt:
|
||||||
|
|
||||||
|
if (someone waiting in poll() &&
|
||||||
|
current && current != that_someone &&
|
||||||
|
current is runnable)
|
||||||
|
{
|
||||||
|
stop current;
|
||||||
|
add current to queue;
|
||||||
|
wake wait_for_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
This way, we will have a real userspace process
|
||||||
|
that can take the page faults.
|
||||||
|
|
||||||
|
- Find out how gdb does backtraces; they may have a better way. Also
|
||||||
|
find out what dwarf2 is and how to use it. Look into libunwind.
|
||||||
|
It seems gdb is capable of doing backtraces of code that neither has
|
||||||
|
a framepointer nor has debug info. It appears gdb uses the contents
|
||||||
|
of the ".eh_frame" section. There is also an ".eh_frame_hdr" section.
|
||||||
|
|
||||||
|
http://www.linuxbase.org/spec/booksets/LSB-Embedded/LSB-Embedded/ehframe.html
|
||||||
|
|
||||||
|
look in dwarf2-frame.[ch] in the gdb distribution.
|
||||||
|
|
||||||
- Make busy cursors more intelligent
|
- Make busy cursors more intelligent
|
||||||
- when you click something in the main list and we don't respond
|
- when you click something in the main list and we don't respond
|
||||||
within 50ms (or perhaps when we expect to not be able to do
|
within 50ms (or perhaps when we expect to not be able to do
|
||||||
@ -106,9 +155,6 @@ Before 1.2:
|
|||||||
- possibly add dependency on glib 2.8 if it is released at that point.
|
- possibly add dependency on glib 2.8 if it is released at that point.
|
||||||
(g_file_replace())
|
(g_file_replace())
|
||||||
|
|
||||||
- Find out how gdb does backtraces; they may have a better way. Also
|
|
||||||
find out what dwarf2 is and how to use it.
|
|
||||||
|
|
||||||
|
|
||||||
Later:
|
Later:
|
||||||
|
|
||||||
|
|||||||
@ -24,12 +24,12 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
#include "binfile.h"
|
#include "binfile.h"
|
||||||
|
|
||||||
/* FIXME: this should be done with getpagesize() */
|
#define PAGE_SIZE (getpagesize())
|
||||||
#define PAGE_SIZE 4096
|
|
||||||
|
|
||||||
static GHashTable *processes_by_cmdline;
|
static GHashTable *processes_by_cmdline;
|
||||||
static GHashTable *processes_by_pid;
|
static GHashTable *processes_by_pid;
|
||||||
|
|||||||
2
sfile.c
2
sfile.c
@ -862,7 +862,7 @@ handle_begin_element (GMarkupParseContext *parse_context,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: is there really a reason to add begin/end instructions for values? */
|
/* FIXME - not10: is there really a reason to add begin/end instructions for values? */
|
||||||
instruction.name = g_strdup (element_name);
|
instruction.name = g_strdup (element_name);
|
||||||
instruction.kind = BEGIN;
|
instruction.kind = BEGIN;
|
||||||
g_array_append_val (build->instructions, instruction);
|
g_array_append_val (build->instructions, instruction);
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
#include "profile.h"
|
#include "profile.h"
|
||||||
#include "treeviewutils.h"
|
#include "treeviewutils.h"
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME - not10 */
|
||||||
#define _(a) a
|
#define _(a) a
|
||||||
|
|
||||||
#define APPLICATION_NAME "System Profiler"
|
#define APPLICATION_NAME "System Profiler"
|
||||||
@ -83,7 +83,7 @@ struct Application
|
|||||||
int timeout_id;
|
int timeout_id;
|
||||||
int generating_profile;
|
int generating_profile;
|
||||||
|
|
||||||
gboolean profile_from_file; /* FIXME: This is a kludge. Figure out how
|
gboolean profile_from_file; /* FIXME - not10: This is a kludge. Figure out how
|
||||||
* to maintain the application model properly
|
* to maintain the application model properly
|
||||||
*
|
*
|
||||||
* The fundamental issue is that the state of
|
* The fundamental issue is that the state of
|
||||||
@ -199,7 +199,7 @@ update_sensitivity (Application *app)
|
|||||||
sensitive_start_button);
|
sensitive_start_button);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* FIXME: gtk+ doesn't handle changes in sensitivity in response
|
/* FIXME - not10: gtk+ doesn't handle changes in sensitivity in response
|
||||||
* to a click on the same button very well
|
* to a click on the same button very well
|
||||||
*/
|
*/
|
||||||
gtk_widget_set_sensitive (GTK_WIDGET (app->reset_button),
|
gtk_widget_set_sensitive (GTK_WIDGET (app->reset_button),
|
||||||
|
|||||||
Reference in New Issue
Block a user