Commit Graph

47 Commits

Author SHA1 Message Date
f1cbdbf27c Add support for looking up kernel symbols from /proc/kallsyms
2007-09-16  Soren Sandmann <sandmann@daimi.au.dk>

	* process.c (process_lookup_kernel_symbol): Add support for
	looking up kernel symbols from /proc/kallsyms

	* sysprof-text.c (dump_data): Print note that the file is being
	saved.

	* module/sysprof-module.[ch] (timer_notify): Send a copy of the
	kernel stack to userspace.

	* collector.c: Do kernel symbol lookups.
	

svn path=/trunk/; revision=372
2007-09-17 01:43:07 +00:00
ca78960214 Free the undefined symbol
2007-03-02  Soren Sandman <sandmann@daimi.au.dk>

	* process.c (free_process): Free the undefined symbol



svn path=/trunk/; revision=358
2007-03-02 06:27:05 +00:00
aaa145ea9b Make a copy of the vdso bytes to make valgrind a little quieter.
2007-03-02  Soren Sandmann <sandmann@daimi.au.dk>

	* process.c (process_get_vdso_bytes): Make a copy of the vdso
	bytes to make valgrind a little quieter.

	* binparser.c: Note to self: Save the file, *then* commit.
	

svn path=/trunk/; revision=357
2007-03-02 06:21:37 +00:00
4ba672ee9f Set inode for vdso to 0.
2006-11-23  Soren Sandmann <sandmann@daimi.au.dk>

        * process.c (read_maps): Set inode for vdso to 0.

        * binfile.c (read_inode): Return -1 on error, 0 on vdso
        (bin_file_new): Only read the inode if the file actually exists
        and is an elf file.
        (bin_file_check_inode): Return FALSE if there is no file.
2006-11-23 08:03:02 +00:00
9af533a11f Declare bin_parser_free();
2006-11-19   Soren Sandmann <sandmann@redhat.com>

        * binparser.h: Declare bin_parser_free();

        * elfparser.c (elf_parser_get_crc32): Use madvise(DONT_NEED) on
        the file.

        * process.c (struct Process): Remove do_offset.
2006-11-19 22:48:28 +00:00
9a1ed3d336 Increase the max number of addresses to 1021, reorganise SysprofMmapArea
2006-10-26  Soren Sandmann <sandmann@daimi.au.dk>

        * module/sysprof-module.h (struct SysprofStackTrace): Increase the
        max number of addresses to 1021, reorganise SysprofMmapArea to
        make the traces naturally page aligned.

        * TODO: Update
2006-11-02 06:54:12 +00:00
d78e744422 Make the pointer array static to improve cache behavior and reduce calls
2006-10-25  Soren Sandmann <sandmann@daimi.au.dk>

        * profile.c (add_trace_to_tree): Make the pointer array static to
        improve cache behavior and reduce calls to malloc().

        * process.c (lookup_kernel_symbol): Remove obsolete comment.
2006-10-26 05:13:16 +00:00
c6978f660b +2006-10-25 Soren Sandmann <sandmann@daimi.au.dk> + + * process.c
+2006-10-25  Soren Sandmann <sandmann@daimi.au.dk>
+
+       * process.c (free_maps): Take a pointer to a variable that
+
+       * process.c: Stop coalescing processes with the same cmdline.
+
+       * TODO: updates.
+
2006-10-25 04:47:06 +00:00
a715b55029 replace PAGE_SIZE macro with this function.
2006-10-24  Soren Sandmann <sandmann@daimi.au.dk>

	* process.c (page_size): replace PAGE_SIZE macro with this function.

	* binfile.c: Remove obsolete comment.
2006-10-25 02:02:44 +00:00
c02712dc85 Use an array instead of list of maps.
2006-10-24  Soren Sandmann <sandmann@daimi.au.dk>

	* process.c (struct Process): Use an array instead of list of
	maps.
2006-10-24 04:00:59 +00:00
df07f71539 Make this function return a list of immediate callers again.
2006-10-09  Soren Sandmann <sandmann@daimi.au.dk>

	* profile.c (profile_list_callers): Make this function return a
	list of immediate callers again.

	* sysprof.c (build_gui): Change label back to "Callers"

	* process.c (get_kernel_symbols): Only attempt to read the kernel
	symbols once.
2006-10-11 05:37:24 +00:00
6475029375 +2006-10-09 Soren Sandmann <sandmann@redhat.com>
+
+       * binfile.c (bin_file_get_inode): Remove this function
+
+       * binfile.c (bin_file_check_inode): New function. Only print inode
+       warning once per BinFile.
+
+       * process.c (process_get_vdso_bytes): Remove debug spew
+
2006-10-10 00:52:44 +00:00
b54b0809b6 New function.
2006-10-09  Soren Sandmann  <ssp@localhost.localdomain>

	* process.c (process_get_vdso_bytes): New function.

	* elfparser.c (parser_new_from_data): export this function as
	elf_parser_new_from_data().

	* binfile.c (read_inode): Don't stat if filename is
	'[vdso]'. Instead just return -1;
	(bin_file_new): Use elf_parser_new_from_data() when the file is
	[vdso].

	* process.c (read_maps): Change the offset of the vdso map to 0
	and the inode to -1.

	* elfparser.c (elf_parser_lookup_symbol): Remove unused 'size'
	variable.

	* binfile.c (find_separate_debug_file): Deal with cycles in the
	debuglink graph.

	* configure.ac: Set version to 1.1.0. Print warning about HEAD.
2006-10-09 21:32:24 +00:00
c27e5debc5 Support _debuglink recursions.
2006-10-08  Soren Sandmann <sandmann@daimi.au.dk>

	* binfile.c (find_separate_debug_file): Support _debuglink
	recursions.

	* elfparser.c: Check that the sections have valid types before
	using them.
2006-10-08 17:45:09 +00:00
29a4acaa94 Delete debug spew 2006-10-08 04:07:18 +00:00
52274fadd6 Deal with address offsets. Address lookup is now:
2006-10-07  Soren Sandmann  <sandmann@daimi.au.dk>

	Deal with address offsets. Address lookup is now:

	- First convert the address to an offset into the file
	- Then convert to an offset into the text segment
	- Then add the load address of the text segment (found in the
	debug binary)
	- Then finally lookup the result in the symbol table.

	* elfparser.c (elf_parser_get_text_offset): New function

	* elfparser.c (elf_parser_lookup_symbol): Treat addresses as
	offsets into the text segment.

	* binfile.c (bin_file_new): Store the offset of the text section
	of the actual binary (not the debug one)

	(bin_file_lookup_symbol): Subtract text_offset before passing
	address to elf parser.

	* module/sysprof-module.c: Remove include of linux/config.h
2006-10-08 04:03:02 +00:00
a1bddd8d9f Pass map->bin_file to bin_symbol_get_name.
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* process.c (process_lookup_symbol): Pass map->bin_file to
	bin_symbol_get_name.

	* binfile.h (bin_symbol_get_name): Add BinFile parameter

	* elfparser.c (elf_demangle): Use options DMGL_PARAMS | DMGL_ANSI

	* TODO: Updates

	* binfile.c: Rewrite this file to use ElfParser instead of libbfd.

	* configure.ac: Drop dependencies on libbfd and libiberty.
2006-08-21 06:00:57 +00:00
a880ee7f60 Make process_lookup_symbol() return a string. Delete
2006-08-20  Soren Sandmann  <sandmann@daimi.au.dk>

	* process.h: Make process_lookup_symbol() return a string. Delete
	process_lookup_symbol_with_filename().

	* process.c (struct Process): Make "undefined" a string
	(lookup_kernel_symbol): Return a string
	(process_lookup_symbol): Return a string, not a symbol

	* collector.c (unique_dup): Take a string instead of a
	Symbol.
	(lookup_symbol): Make sym a string instead of a Symbol.

	* binfile.c (bin_symbol_get_name): New function.

	* binfile.[ch] (struct BinSymbol): Rename Symbol to BinSymbol and
	make it an opaque structure.

	* binfile.[ch]: Remove unused symbol operations
2006-08-21 02:33:38 +00:00
ebb7728768 Check that the inodes match.
Fri Mar  3 22:28:03 2006  Soeren Sandmann  <sandmann@redhat.com>

        * process.c (process_lookup_symbol): Check that the inodes match.

        * binfile.c (read_symbols): Read the inode of the file

        * binfile.c (read_symbols): Close the bfd if the symbol table
        could not be read.
2006-03-04 03:28:26 +00:00
c65bfcc114 Also make offset a gulong (Samuel Mimram)
Wed Jan 11 20:31:11 2006  Søren Sandmann  <sandmann@redhat.com>

       * process.c (read_maps): Also make offset a gulong (Samuel Mimram)
2006-01-12 01:32:06 +00:00
5baa137e21 Use gulong for addresses. Bug reported by Martin Reddy.
Mon Jan  9 00:59:21 2006  Soeren Sandmann  <sandmann@redhat.com>

        * process.c (read_maps): Use gulong for addresses. Bug reported by
        Martin Reddy.
2006-01-09 05:59:44 +00:00
5a8582b041 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
2006-01-08 08:22:47 +00:00
ecfcee7ab1 Remove unused pages_present() function
Tue Nov 22 23:38:09 2005  Soeren Sandmann  <sandmann@redhat.com>

        * module/sysprof-module.c: Remove unused pages_present() function
2005-11-23 04:26:36 +00:00
7414ddd5db Add some experimental (and unused) code to look up kernel symbols.
2005-11-13  Soeren Sandmann  <sandmann@redhat.com>

        * process.c: Add some experimental (and unused) code to look up
        kernel symbols.
2005-11-14 02:44:15 +00:00
cf761a2a70 Add copyright statement.
2005-11-04  Soren Sandmann  <sandmann@redhat.com>

        * collector.[ch]: Add copyright statement.

        * collector.c (on_read): Handle time getting set backwards.

        * collector.c: Remove unused empty_filedescriptor() function.
2005-11-05 04:58:16 +00:00
c778a1b1ec Add "total" field.
Mon Oct 31 23:41:33 2005  Soeren Sandmann  <sandmann@redhat.com>

        * stackstash.h (struct StackNode): Add "total" field.

        * stackstash.c (stack_stash_add_trace): Keep track of the
        aggregate size.

        * profile.c (profile_get_size): Sum the totals of the siblings
        instead of all the children.

        * profile.c (build_object_list): Correctly compute obj->self

        * profile.c (profile_load): Don't ignore the node->total field.

        * profile.c (serialize_call_tree): Save node->total instead of the
        computed total

        * profile.c (compute_total): Use n->total instead of computing it
        from scratch.

        * profile.c: Remove unused sum_children() function.

        * TODO: Updates

        * process.c (process_get_from_pid): Plug leak.
2005-11-01 04:37:16 +00:00
dff4affaab Merge stackstash-reorg branch into HEAD
2005-10-30  Soren Sandmann <sandmann@redhat.com>

	* Merge stackstash-reorg branch into HEAD
2005-10-30 20:14:31 +00:00
bce3b1fea6 If the address is 0x01, treat as kernel, regardless of whether we have a
Tue Sep 27 01:33:33 2005  Soeren Sandmann  <sandmann@redhat.com>

	* process.c (process_lookup_symbol): If the address is 0x01, treat
	as kernel, regardless of whether we have a map for that address or
	not.

	* module/sysprof-module.c (timer_notify): Take a stack trace of
	the current process, even when we are in kernel mode. This way we
	can assign kernel activity to individual user space stacktraces.

	* TODO: updates.
2005-09-27 05:35:19 +00:00
ee53bcffd4 Complain if we can't find /lib/modules/uname -r/build/Makefile.
Tue Aug 30 16:57:33 2005  Søren Sandmann  <sandmann@redhat.com>

	* configure.ac: Complain if we can't find /lib/modules/`uname
	-r`/build/Makefile.

	* process.c (process_lookup_symbol): Take an address of 0x1 to
	mean "in kernel".

	* module/sysprof-module.c (timer_notify): When reporting in-kernel
	time, give the current pid instead of -1.

	* TODO: updates
2005-08-30 20:58:18 +00:00
509d5f07ed Fix some warnings.
Mon Aug 15 20:39:11 2005  Soeren Sandmann  <sandmann@redhat.com>

        * binfile.c, process.c, profile.c: Fix some warnings.
2005-08-16 00:40:26 +00:00
f3b78b7944 Cache BinFiles by filename.
Sat Jul  9 23:20:39 2005  Soeren Sandmann  <sandmann@redhat.com>

	* binfile.c (bin_file_new): Cache BinFiles by filename.

	* stackstash.c (stack_stash_free): Plug leak

	* process.c (process_free_maps): Plug leak

	* module/Makefile (install): Check that depmod exists before
	running it.
2005-07-10 03:28:35 +00:00
18abd9e1e6 Updates
Sat Jun 18 22:45:04 2005  Søren Sandmann  <sandmann@redhat.com>

	* TODO: Updates

	* configure.ac: Check for Linux 2.6.11

	* process.c (get_pidname): Present pid=-1 as [kernel].

	* module/sysprof-module.c: Use register_timer_hook() instead of
	a kernel timer. Set trace.pid to -1 if interrupt happens in
	kernel.
2005-06-19 02:46:19 +00:00
6906804784 Use getpagesize()
Sat Apr 30 16:57:23 2005  Soeren Sandmann  <sandmann@redhat.com>

	* process.c (PAGE_SIZE): Use getpagesize()

	* TODO: More updates
2005-04-30 20:59:01 +00:00
b3c466debf Remove debug spew
Sat Apr  9 17:04:50 2005  Søren Sandmann  <sandmann@redhat.com>

	* Makefile: Remove debug spew

	* *: Add copyright notices
2005-04-09 21:17:24 +00:00
bda89efc68 Put back the weird loop, and stop pretending I understand this. This time
Tue Apr  5 23:01:02 2005  Søren Sandmann  <sandmann@redhat.com>

	* binfile.c (read_symbols): Put back the weird loop, and stop
	pretending I understand this. This time use SEC_ALLOC instead of
	SEC_LOAD.
2005-04-06 03:04:34 +00:00
88c3bbb880 Add commented out debug spew.
Tue Apr  5 20:13:44 2005  Søren Sandmann  <sandmann@redhat.com>

	* process.c (process_ensure_map): Add commented out debug spew.

	* process.c (process_lookup_symbol): Remove all should_offset()
	function and all references to it.

	* binfile.c (bin_file_lookup_symbol): Document that address must
	be in file coordinates.

	* binfile.c (read_symbols): Remove misguided code that tried to
	guess the load address of the file. Instead, do all computations
	in "file coordinates". Also fix a memory leak. Add commented out
	debug spew.

	* binfile.c (separate_debug_file_exists): Fix signedness
2005-04-06 00:16:12 +00:00
39162c394a Walk all threads, not just all processes.
Thu Mar 31 19:51:51 2005  Søren Sandmann  <sandmann@redhat.com>

        * sysprof-module.c (do_generate): Walk all threads, not just all
        processes.

        * TODO: Add disk profiling ideas
2005-04-01 00:58:48 +00:00
de4b3c076d Experiment with a file-format-description format.
Wed Mar  2 23:39:50 2005  Soeren Sandmann  <sandmann@redhat.com>

	* profile.[ch], sfile.[ch]: Experiment with a
	file-format-description format.

	* sysprof.c: Add commented out code using /proc/ based
	timeout.
2005-03-03 04:44:28 +00:00
c5b66034c5 *** empty log message *** 2004-11-23 00:10:55 +00:00
7f02ecd503 *** empty log message *** 2004-11-21 23:33:56 +00:00
d71d00ab0b *** empty log message *** 2004-11-12 18:30:01 +00:00
1fa465fb26 *** empty log message *** 2004-11-04 15:25:39 +00:00
e6a160f291 *** empty log message *** 2004-11-02 17:40:28 +00:00
9140810664 *** empty log message *** 2004-11-01 01:21:49 +00:00
649512d961 better disk profiling 2004-04-29 17:29:09 +00:00
7e5c6cbca4 support prelinked binaries 2004-04-28 15:08:22 +00:00
43dddf31ac Initial revision 2004-04-27 11:08:55 +00:00