Commit Graph

61 Commits

Author SHA1 Message Date
395f527c83 Don't compute CRC32s that we know will fail.
If two files both have build-ids and those build-ids don't match,
there is no point computing the CRCs.
2011-01-27 17:00:02 -05:00
73922a0af9 Eliminate some compiler warnings 2010-04-23 11:56:14 -04:00
a33678df26 Update TODO 2009-09-14 04:59:28 -04:00
0ceaff7a66 Move bin file cache to state object 2009-09-08 03:03:18 -04:00
604d07600a Simplify vdso reading in binfile.c 2009-09-08 03:03:17 -04:00
b8364e2847 Don't compile process.[ch] anymore 2009-09-08 03:03:14 -04:00
aacafe90f1 +Mon Jun 2 01:14:17 2008 Søren Sandmann <sandmann@redhat.com>
+
+	* binfile.c (get_debug_binaries): Remove left-over #if 0
+


svn path=/trunk/; revision=432
2008-06-02 05:14:56 +00:00
edb974bcc8 Simplify loop.
Mon Jun  2 01:10:38 2008  Søren Sandmann  <sandmann@redhat.com>

	* binfile.c (get_debug_binaries): Simplify loop.


svn path=/trunk/; revision=431
2008-06-02 05:13:32 +00:00
10c747aa40 Actually recurse on the debuglink.
Mon Jun  2 00:58:17 2008  Søren Sandmann  <sandmann@redhat.com>

	* binfile.c (get_debug_binaries): Actually recurse on the
	debuglink. 


svn path=/trunk/; revision=430
2008-06-02 04:59:01 +00:00
355818bf5b Plug leak
Mon Jun  2 00:56:00 2008  Søren Sandmann  <sandmann@redhat.com>

	* binfile.c (get_debug_binaries): Plug leak



svn path=/trunk/; revision=429
2008-06-02 04:56:32 +00:00
7cd38113c8 Keep a list of elf files for each binary file. In some cases, notably
Mon Jun  2 00:51:46 2008  Søren Sandmann  <sandmann@redhat.com>

	* binfile.c (get_debug_binaries): Keep a list of elf files for
	each binary file. In some cases, notably glibc on Fedora, the
	debug binary does not contain a symbol table, but the original
	file does.


svn path=/trunk/; revision=428
2008-06-02 04:54:15 +00:00
282783bf2b Fix bug where the build id name was generated incorrectly.
2008-05-07  Soren Sandmann Pedersen  <sandmann@daimi.au.dk>

	* binfile.c (get_build_id_file): Fix bug where the build id name
	was generated incorrectly. 

	Make a copy of the debug name, not the input name.


svn path=/trunk/; revision=418
2008-05-08 00:17:13 +00:00
f49c3b5d2e More build-id work
svn path=/trunk/; revision=411
2008-04-21 20:12:36 +00:00
90d1fa1de5 Initial build id support
svn path=/trunk/; revision=410
2008-04-20 20:58:11 +00:00
b98db05f9b Add commented out code to reject callback.
2008-02-17  Soren Sandmann  <sandmann@redhat.com>

	* collector.c (lookup_symbol): Add commented out code to reject
	callback.

	* elfparser.c (struct ElfParser): Store the filename if any
	(elf_parser_get_sym_address): Subtract the load address, so the
	result will be an offset into the text section.

	* process.[ch] (process_lookup_symbol): Add an offset out-argument
	
	* binfile.[ch] (bin_symbol_get_address): New function

	* TODO: updates



svn path=/trunk/; revision=397
2008-02-17 23:31:19 +00:00
64d220e346 Use hash table instead of list.
2007-11-20  Soren Sandmann <sandmann@daimi.au.dk>

        * binfile.c (find_separate_debug_file): Use hash table instead of
        list. 



svn path=/trunk/; revision=395
2007-11-20 23:50:21 +00:00
a7b39cf517 Don't discard weak symbols.
2007-10-22  Soren Sandmann <sandmann@daimi.au.dk>

	* elfparser.c (read_table): Don't discard weak symbols.

	* elfparser.c (elf_parser_lookup_symbol): If the symbol has
	unknown size, don't check that the address is in range.


svn path=/trunk/; revision=381
2007-10-22 04:41:27 +00:00
7b821752f9 New function. Only warn once about bad CRC's.
Mon Mar  5 16:55:39 2007  Søren Sandmann  <sandmann@redhat.com>

        * binfile.c (already_warned): New function. Only warn once about
        bad CRC's.


svn path=/trunk/; revision=361
2007-03-05 21:53:57 +00:00
c541052c19 Update copyright notices
Fri Feb  9 16:53:29 2007  Søren Sandmann  <sandmann@redhat.com>

	* Update copyright notices



svn path=/trunk/; revision=350
2007-02-09 21:59:15 +00:00
c1025c6b44 Don't store the size of the symbol. (elf_parser_lookup_symbol): Look it up
Fri Feb  9 16:16:34 2007  Søren Sandmann  <sandmann@redhat.com>

       * elfparser.c (struct ElfSym): Don't store the size of the symbol.
       (elf_parser_lookup_symbol): Look it up here instaed.

       * binfile.c (bin_file_free): Use pre-decrement instead of
       post-decrement.
       (bin_file_check_inode): Clarify the warning a little


svn path=/trunk/; revision=349
2007-02-09 21:30:01 +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
3b559da623 Start with "/usr", not "usr". Pointed out by Tim Rowley.
Thu Nov  9 17:31:17 2006  Søren Sandmann  <sandmann@redhat.com>

        * binfile.c (get_debug_file): Start with "/usr", not
        "usr". Pointed out by Tim Rowley.

        * binparser.c (bin_parser_align): Pass byte_width on instead of
        hardcoding 4.
2006-11-09 22:32:22 +00:00
ea0690817c Look in the correct directory for debug info files. (Tim Rowley)
Thu Nov  9 16:47:35 2006  Søren Sandmann  <sandmann@redhat.com>

        Look in the correct directory for debug info files. (Tim Rowley)

        * binfile.c (N_TRIES): Add this instead of hardcoding '3'

        * binfile.c (get_debug_file): Also look in "/usr/lib/debug", in
        addition to "$(libdir)/debug".

        * binfile.c: Comment out the debug spew.
2006-11-09 21:56:28 +00:00
5e91fe1818 Add debug spew.
Thu Nov  9 16:17:11 2006  Søren Sandmann  <sandmann@redhat.com>

        * binfile.c: Add debug spew.
2006-11-09 21:17:59 +00:00
442a9b4f3c Die immediately if the output file is a directory.
Thu Nov  9 16:01:47 2006  Søren Sandmann  <sandmann@redhat.com>

        * sysprof-text.c (main): Die immediately if the output file is a
        directory.

        * autogen.sh (DIE): Also work when automake-1.9 is installed.
2006-11-09 21:02:31 +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
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
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
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
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
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
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
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
22d05ac014 Updates
Sun Sep  4 19:38:51 2005  Soeren Sandmann  <sandmann@redhat.com>

	* TODO: Updates
2005-09-04 23:38:40 +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
775a1e3c5d Various minor clean-ups
Sun Jul 10 10:51:52 2005  Soeren Sandmann  <sandmann@redhat.com>

        * binfile.c: Various minor clean-ups
2005-07-10 14:52:41 +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
a2499b571f +Thu Jun 9 13:28:33 2005 Søren Sandmann <sandmann@redhat.com>
+
+       * TODO: Updates
+
2005-06-10 01:11:53 +00:00
c427b88352 Implement this function
Sat May  7 13:57:17 2005  Søren Sandmann  <sandmann@redhat.com>

	* sfile.c (sfile_output_free): Implement this function

	* sfile.c (sfile_input_free): Implement this function
2005-05-07 17:57:59 +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