Commit Graph

270 Commits

Author SHA1 Message Date
e255c00a6d Use PAGE_SIZE - 1 instead of 4096.
2006-10-23  Soren Sandmann <sandmann@daimi.au.dk>

	* module/sysprof-module.c (init_module): Use PAGE_SIZE - 1 instead
	of 4096.
2006-10-23 13:02:40 +00:00
4dd37d092c Communicate traces to userspace through shared memory instead of copying.
2006-10-22  Soren Sandmann <sandmann@daimi.au.dk>

	Communicate traces to userspace through shared memory instead of
	copying.

	* module/sysprof-module.c: Store the traces in a SysprofMmapArea.
	(sysprof_mmap): Implement this method.
	(sysprof_nopage): Implement this.
	(sysprof_read): Just reset the tail pointer and return zero.

	* module/sysprof-module.h (struct SysprofMmapArea): New
	structure.

	* collector.c (collector_stop): Unmap the device
	(in_dead_period): New function
	(on_read): Read the traces out of mmap()ed area instead of reading
	them. Call read() to prevent poll() from firing.
	(struct Collector): New members map_area and current.

	* Makefile.am (insert-module): Prefix modprobe with /sbin

	* collector.c (open_fd): mmap() the sysprof device.
2006-10-23 03:46:25 +00:00
5eb19d00fa Skip nodes that don't have a parent.
2006-10-11  Soren Sandmann <sandmann@daimi.au.dk>

	* profile.c (profile_list_callers): Skip nodes that don't have a
	parent.
2006-10-12 03:45:21 +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
4050648b0e Don't include bfd.h
2006-10-08   Soren Sandmann <sandmann@daimi.au.dk>

	* binfile.c: Don't include bfd.h
2006-10-09 02:25:46 +00:00
a6145207ca New function to support --version option
2006-10-08  Soren Sandmann <sandmann@redhat.com>

	* sysprof.c (process_options): New function to support --version option
2006-10-08 22:05:47 +00:00
0cf636d8fe Add a cache of the text section.
2006-10-08  Soren Sandmann  <sandmann@redhat.com>

	* elfparser.c (struct ElfParser): Add a cache of the text section.

	* binparser.c (struct BinParser): Add a cache of a bin record to
	get rid of malloc()/free() overhead.

	* elfparser.c (struct ElfSym): Cache the size of the symbol
2006-10-08 20:14:25 +00:00
86810e63a5 Remove now unused load-address heuristic
2006-10-08  Soren Sandmann <sandmann@redhat.com>

	* elfparser.c: Remove now unused load-address heuristic

	* comment out debug spew
2006-10-08 18:50:10 +00:00
a91a19887a Use "SHT_DYNSYM" for ".dynsym".
2006-10-08  Soren Sandmann <sandmann@redhat.com>

	* elfparser.c (read_symbols): Use "SHT_DYNSYM" for ".dynsym".
2006-10-08 18:09:17 +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
6a7178f612 Remove old commented out code Add commented out code accessing entire
2006-08-27  Soren Sandmann <sandmann@redhat.com>

        * binparser.c: Remove old commented out code
        * module/sysprof-module.c: Add commented out code accessing entire
        stack.

2006-08-27  Soren Sandmann  <sandmann@redhat.com>

        * module/Makefile ($(MODULE).o): Add dependency on sysprof-module.h

        * elfparser.c (elf_parser_get_eh_frame): Add this function.
        Remove some commented out code.
2006-09-23 03:09:24 +00:00
8f4d731788 Revert accidental commit 2006-09-23 00:57:20 +00:00
b7cf5d34b8 Remove old commented out code
2006-08-27  Soren Sandmann <sandmann@redhat.com>

	* binparser.c: Remove old commented out code

2006-08-27  Soren Sandmann  <sandmann@redhat.com>

	* module/Makefile ($(MODULE).o): Add dependency on sysprof-module.h

	* elfparser.c (elf_parser_get_eh_frame): Add this function.
	Remove some commented out code.
2006-09-23 00:54:01 +00:00
2c04f6e200 Formatting fixes in header files 2006-08-26 23:10:10 +00:00
e44c9a0167 Update to new API
2006-08-26  Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c: Update to new API

	* binparser.h: Delete commented out declarations. Add new
	functions.

	* binparser.c: Delete ParserFrame, replace with one current
	offset.
	(convert_uint): Make static
	(bin_parser_get_uint): Delete this function
	(bin_parser_get_string): Change this function to use current
	offset instead of frame offset.
	(bin_parser_goto): New function
	(bin_parser_align): New function
	(bin_parser_get_uint32): New function
	(bin_parser_begin): Delete this function
	(bin_parser_end): Delete this function
	(bin_parser_index): Delete this function
	(bin_record_get_string_indirect): Make this function use _goto()
	instead of _begin()/_end()
	(bin_parser_get_offset): Make this function return current offset
2006-08-26 23:01:07 +00:00
54862afc74 Add new struct BinRecord. Comment out functions related to formats. Add
2006-08-26  Soren Sandmann <sandmann@daimi.au.dk>

	* binparser.[ch]: Add new struct BinRecord. Comment out functions
	related to formats. Add new functions to get fields out of
	BinRecords.

	* elfparser.c: Update to new API.
2006-08-26 22:44:12 +00:00
b569c3a34c Add new bin_record() functions Implement them.
2006-08-26  Soren Sandmann <sandmann@daimi.au.dk>

	* binparser.h: Add new bin_record() functions
	* binparser.c: Implement them.
2006-08-26 16:44:17 +00:00
62c86a1951 Demangle instead of strdup.
2006-08-22  Soren Sandmann <sandmann@daimi.au.dk>

	* collector.c (unique_dup): Demangle instead of strdup.
2006-08-26 16:27:00 +00:00
4a145a21bc Rename elf_sym_get_* to elf_parser_get_sym_* and make these functions take
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* elfparser.[ch]
	(elf_parser_get_sym_name): Rename elf_sym_get_* to
	elf_parser_get_sym_* and make these functions take a parser.
	(parser_from_sym): Delete this function.
	(elf_parser_new): Don't add to all_elf_parsers
	(elf_parser_free): Don't remove from all_elf_parsers
	(elf_parser_new): Rename to parser_new_from_file()
	(elf_parser_new_from_file): Rename to elf_parser_new

	* binfile.c: Update for new elfparser API

	* TODO: updates
2006-08-22 04:19:08 +00:00
bb616fd754 Add ref_count and filename (bin_files): Add map from filenames to BinFiles
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* binfile.c (struct BinFile): Add ref_count and filename
	(bin_files): Add map from filenames to BinFiles
	(bin_file_new): First look for BinFile in the cache.
	(bin_file_free): If refcount reaches 0, remove BinFile from cache.

	* TODO: Updates
2006-08-22 03:26:57 +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
ad09fd10cb Update
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* TODO: Update

	* elfparser.c (elf_parser_lookup_symbol): Change sense of size
	check.
2006-08-21 05:00:53 +00:00
858d1fab58 Initialize crc to 0xffffffff and invert it before returning.
2006-08-20  Soren Sandmann <sandmann@redhat.com>

	* elfparser.c (elf_parser_get_crc32): Initialize crc to 0xffffffff
	and invert it before returning.

	* elfparser.h: Declare elf_parser_get_debug_link()
2006-08-21 04:12:12 +00:00
66a28bd501 Comment out debug spew. (elf_parser_lookup_symbol): Add check that address
2006-08-20  Soren Sandmann  <sandmann@daimi.au.dk>

	* elfparser.c (elf_parser_get_load_address): Comment out debug spew.
	(elf_parser_lookup_symbol): Add check that address is actually
	within the bounds of the found function.
2006-08-21 03:34:44 +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
7d8f3c232d New function
2006-08-20  Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c (elf_parser_new_from_file): New function
2006-08-21 01:30:54 +00:00
1b72901c4d New function
2006-08-20   Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c (elf_parser_get_debug_link): New function

	* elfparser.c: Delete SymbolTable typedef

	* binparser.[ch] (bin_parser_get_data): New function
	(bin_parser_get_length): New function

	* elfparser.[ch] (elf_parser_get_crc32): New function

	* TODO: Updates

	* elfparser.c (elf_parser_lookup_symbol): Offset passed in
	addresses by the load address.

	* elfparser.c (elf_parser_get_load_address): New function to
	compute the load address of the beginning of the file.
2006-08-21 00:18:10 +00:00
49e1fabe46 Read the name out of the file instead of out of the struct.
2006-08-20  Soren Sandmann  <sandmann@redhat.com>

	* elfparser.c (elf_sym_get_name): Read the name out of the file
	instead of out of the struct.

	* elfparser.c (struct ElfSym): Store an offset instead of the
	name.

	* elfparser.c (all_elf_parsers): Keep track of all elf parsers
	created.
2006-08-20 06:26:54 +00:00
6c7afad3ff New file, made out of files from libiberty in binutils.
2006-08-20  Soren Sandmann  <sandmann@redhat.com>

	* Makefile.am, demangle.c: New file, made out of files from
	libiberty in binutils.

	* binfile.c: Use the new sysprof_cplus_demangle() function

	* elfparser.[ch]: Add code to lookup symbols. Add demangling
	function

	* testelf.c: Various tests
2006-08-20 04:32:12 +00:00
8967b3148c Many cleanups.
2006-08-19  Soren Sandmann  <sandmann@redhat.com>

	* elfparser.c: Many cleanups.
2006-08-19 23:56:18 +00:00
d3c6a66101 Pass the correct pointer.
2006-08-16  Søren Sandmann  <ssp@localhost.localdomain>

	* elfparser.c (check_symbol): Pass the correct pointer.
2006-08-16 17:25:03 +00:00
1f4dd13cd3 Really add this file.
2006-08-16  Soren Sandmann  <sandmann@redhat.com>

	* testelf.c: Really add this file.
2006-08-16 17:21:54 +00:00
2bc2e3658d Add beginning of an ELF parser.
2006-08-15  Soren Sandmann  <sandmann@redhat.com>

	Add beginning of an ELF parser.

	* binparser.[ch]: New files
	* elfparser.[ch]: New files
	* testelf.c: New file
	* Makefile.am (testelf_SOURCES): Add new testelf program.
2006-08-16 03:31:10 +00:00
bde3d8a537 Some formatting fixes.
Sat Aug 12 16:40:38 2006  Søren Sandmann  <sandmann@redhat.com>

	* module/sysprof-module.c: Some formatting fixes.
2006-08-12 20:40:58 +00:00
c2f754dfb6 Make n_samples per-cpu. Add an atomic variable in_timer_notify and use it
Sat Aug 12 16:13:05 2006  Søren Sandmann  <sandmann@redhat.com>

	* module/sysprof-module.c: Make n_samples per-cpu. Add an atomic
	variable in_timer_notify and use it to lock out simultaneous timer
	interrupts.

	* stackstash.c (decorate_node): Make decorate_node() static

	* TODO
2006-08-12 20:15:52 +00:00
060fd343a8 Updates
Fri Aug 11 11:41:15 2006  Søren Sandmann  <sandmann@redhat.com>

	* TODO: Updates
2006-08-11 15:41:46 +00:00
2bc1d6f280 Incomplete ChangeLog entry 2006-08-09 03:06:04 +00:00
f06e272ea7 Make the load_file() idle low priority to avoid weird toolbar flash.
2006-08-08  Soren Sandmann  <ssp@localhost.localdomain>

	* sysprof.c (main): Make the load_file() idle low priority to
	avoid weird toolbar flash.

	* TODO: updates.
2006-08-09 03:05:34 +00:00
23d3a36a4a small cleanup 2006-07-31 18:52:12 +00:00
d43cdf3c14 Add a destroy notifier to StackStash
2006-07-31  Soren Sandmann <sandmann@redhat.com>

	* stackstash.[ch]: Add a destroy notifier to StackStash

	* collector.c (collector_create_profile): Pass g_free as destroy
	notifier.

	* collector.c (collector_reset): Pass NULL as destroy notifier

	* profile.c (profile_load): Pass g_free here.

	* profile.c (struct Profile): Remove unused "Node" typedef

	* collector.c (resolve_symbols): Free the array here.

	* TODO: various updates.
2006-07-31 04:50:34 +00:00
5efd06051c Simplify this file a bit, and make it not rely on atomic pointer writes.
2006-07-30  Soren Sandmann <sandmann@redhat.com>

	* signal-handler.c: Simplify this file a bit, and make it not rely
	on atomic pointer writes.
2006-07-31 02:12:23 +00:00
144e440ff2 we need at least glib 2.6.0 for the gstdio.h functions
2006-07-18  Bastien Nocera  <hadess@hadess.net>

	* configure.ac: we need at least glib 2.6.0 for the gstdio.h functions
2006-07-18 16:32:05 +00:00
c22c846759 Update TODO 2006-06-09 21:55:45 +00:00
054e6702bb file announce-1.0.3 was initially added on branch sysprof-1-0. 2006-06-09 03:08:38 +00:00
14cfcec7f9 Update TODO 2006-06-07 16:18:44 +00:00
24ed3d06ca Updates
2006-06-05  Soren Sandmann <sandmann@redhat.com>

	* TODO: Updates
2006-06-05 22:38:30 +00:00