head	1.5;
access;
symbols
	v1_2_1:1.5
	oprofile-0_5_4-branch-sf-snapshot:1.1
	sf-snapshot:1.5
	oprofile-0_5_4-branch:1.1.0.2
	oprofile-0_5_4-branchpoint:1.1;
locks; strict;
comment	@# @;


1.5
date	2005.04.14.18.42.34;	author kseitz;	state Exp;
branches;
next	1.4;

1.4
date	2005.02.05.02.10.17;	author jhandcock;	state Exp;
branches;
next	1.3;

1.3
date	2005.02.03.07.12.09;	author jhandcock;	state Exp;
branches;
next	1.2;

1.2
date	2004.10.13.07.24.35;	author jhandcock;	state Exp;
branches;
next	1.1;

1.1
date	2004.10.13.06.14.54;	author jhandcock;	state Exp;
branches;
next	;


desc
@@


1.5
log
@        * Makefile: Don't link against elfutils.
        * build.xml: Likewise.

        * samplefile.h (get_name): Should return image name if we have
        a samplefile.

        * samplefile.cc (_get_info_from_filename): Fix typo "=" to
        "+=" for image name.

        * profileimage.cc (operator<<): Hack for --separate=none
        weirdness (see comments).
        (get_samples): Remove.
        * profileimage.h (get_samples): Remove.

        * oprofiledb.h (_is_kernel): New variable.
        * oprofiledb.cc (oprofile_db): Initialize _is_kernel;
        (_open_db): Note _is_kernel from the header.
        (_get_samples_callback): Pass _is_kernel to lookup_vma.
        * stable.h (lookup_vma): Add new is_kernel parameter. See comments.
        (_text_offset): New variable.
        * stable.cc (lookup_vma): Add is_kernel parameter. If from kernel,
        the vma is unchanged. If it is from user space, the vma must
        be adjusted by the start address and the offset to the first
        text section.
        (_open_bfd): Get rid of the ELF load address stuff. Don't seem to
        need it anymore.
        Loop through sections to find the offset to the first section
        marked as containing code.
        Note start address.
@
text
@# Makefile for Eclipse Oprofile wrapper library
# Written by Keith Seitz  <keiths@@redhat.com>
#
# Copyright (c) 2004, Red Hat, Inc.

CFLAGS += -g -Wall
CXXFLAGS = $(CFLAGS)

OPROFILE_LIBS = -lop -lodb -loputil++ -loputil
BFD_LIBRARY = -lbfd
LIBIBERTY = -liberty
OTHER_LIBS = $(BFD_LIBRARY) 
EXTRA_LIBS = $(OPROFILE_LIBS) $(OTHER_LIBS) $(LIBIBERTY)

OPXML = 		opxml
OPXML_OBJS =		opxml.o
OPROFILE_LIB_OBJS =	stable.o oprofiledb.o symbol.o sample.o \
			session.o samplefile.o imageheader.o opinfo.o \
			xmlfmt.o xmlbuf.o xmltag.o \
			sevent.o profileimage.o


all: $(OPXML)

$(OPXML): $(OPROFILE_LIB_OBJS) $(OPXML_OBJS)
		$(CXX) -o $(OPXML) $(OPXML_OBJS) $(OPROFILE_LIB_OBJS) \
		$(EXTRA_LIBS)

clean:
	$(RM) $(OPROFILE_LIB_OBJS) $(OPXML) $(OPXML_OBJS) *~



# Dependencies
opxml.o: oxmlstream.h opinfo.h session.h sample.h sevent.h opxml.cc

imageheader.o: xmlfmt.h imageheader.h imageheader.cc
imageheader.h: samplefile.h

opinfo.o: opinfo.h opinfo.cc
opinfo.h: 

oprofiledb.o: oprofiledb.h sample.h stable.h oprofiledb.cc
oprofiledb.h: xmlbuf.h xmlfmt.h

oxmlstream.h: xmlbuf.h xmlfmt.h

profileimage.o: xmlfmt.h profileimage.h profileimage.cc
profileimage.h: samplefile.h

sample.o: xmlfmt.h sample.h sample.cc
sample.h: symbol.h

samplefile.o: sample.h stable.h xmlfmt.h samplefile.h samplefile.cc
samplefile.h: oprofiledb.h

session.o: sevent.h opinfo.h xmlfmt.h session.h session.cc
session.h: samplefile.h

sevent.o: session.h xmlfmt.h sevent.h sevent.cc
sevent.h: profileimage.h

stable.o: stable.h symbol.h stable.cc
stable.h: 

symbol.o: xmlfmt.h symbol.h symbol.cc
symbol.h: 

xmlbuf.o: xmltag.h xmlbuf.h xmlbuf.cc
xmlbuf.h: 

xmlfmt.o: xmlbuf.h xmlfmt.h xmlfmt.cc
xmlfmt.h: 

xmltag.o: xmltag.h xmltag.cc
xmltag.h:

@


1.4
log
@	* Makefile: Update dependencies and remove util.h and util.cc.
	* build.xml: Remove util.cc from build objects.
	* utl.h: Remove.
	* util.cc: Remove.
	* imageheader.h (imageheader): Take samplefile* parameter for constructor.
	(get_cpu_type): Rename to ...
	(get_cpu): ... this. Returns a string instead of OProfile's internal type.
	(get_event): Return string instead of u32.
	(get_count): Likewise.
	(get_unit_mask): Likewise.
	(get_cpu_speed): Remove dependency on OProfile internal data. For now,
	always returns zero until we can get a safer way to obtain this information.
	(_header): Remove variable.
	(_sfile): New variable.
	* imageheader.cc (imageheader): Now takes samplefile* as parameter.
	(operator<<): Use imageheader::get_cpu.
	* opinfo.h: Remove "optional" configury for older versions of OProfile. That
	dream is gone.
	(get_cpu_frequency): Remove. This would never make sense if we could do this
	analyze files from a remote system.
	* opinfo.cc: Remove "optional" configury, too.
	(get_cpu_frequency): Likewise.
	(operation<<): Make num-counters a single line. Now matches spec.
	Don't output old defaults or frequency.
	* oprofiledb.h (get_header): Remove.
	* oprofiledb.cc (get_header): Likewise.
	* profileimage.cc (get_count): Return samplefile::get_sample_count instead
	of get_count, which has been hijacked for another use.
	(get_header): Pass samplefile to imageheader.
	* samplefile.h (samplefile): Constructor now takes string filename.
	(has_samplefile): Get rid of _parsed_filename.
	(is_dependency): Likewise.
	(get_sample_count): "New" method.
	(get_sample_file_name): Get rid of _parsed_filename.
	(get_image): Likewise.
	(get_lib_image): Likewise.
	(get_name): Likewise.
	(get_event): Likewise.
	(get_count): HIJACKED! Returns the reset count used in the file. Use get_sample_count
	for previous behavior.
	(get_unit_mask): New method.
	(get_tgid): Likewise.
	(get_tid): Likewise.
	(get_cpu): Likewise.
	(get_callgraph): Likewise.
	(get_header): Remove.
	(get_sample_file_list): "New" static method. Used to be in util.cc.
	(event_for_filename): New static method.
	(_tokenize): New private method.
	(_get_info_from_filename): New private method.
	(_parsed_filename): Bye bye.
	(_filename, _image, _lib_image, _event, _count, _unit_mask, _tgid, _tid,
	_cpu, _callgraph): New variables.
	* samplefile.cc (samplefile): Now takes filename as parameter.
	Call _get_info_from_filename to initialize state.
	(_get_info_from_filename): New method.
	(event_for_filename): New method.
	(is_dependency): Move to header.
	(get_image): Ditto.
	(get_lib_image): Ditto.
	(get_name): Ditto.
	(get_count): Ditto -- and rename get_sample_count.
	(get_event): Ditto the move part.
	(get_header): Remove.
	(~samplefile): Whack all the _parsed_filename stuff.
	(get_sample_file_list): Make it part of this class and public.
	* session.h: Remove op_cpu_type.h.
	* session.cc (get_event): No more parsed_filename. Use samplefile::event_for_filename
	and pass the filename to samplefile.
	(get_events): Likewise.
	* sevent.h (sessionevent): Don't pass event name as reference.
	* sevent.cc (sessionevent): Likewise.
	Pass empty string to profileimage instead of NULL for "fake" images.
	* util.h: Remove.
	* util.cc: Likewise.
@
text
@d12 1
a12 2
LIBELF = -lelf
OTHER_LIBS = $(BFD_LIBRARY) $(LIBELF)
@


1.3
log
@        * stable.cc (_open_bfd): Get rid of BFD for ELF file inspection.
        Use the gelf interface provided by libelf.
        * Makefile: Link against libelf.
        * build.xml: Likewise.
        * elf/internal.h: Remove.
        * elf/common.h: Remove.
@
text
@d20 1
a20 1
			xmlfmt.o xmlbuf.o xmltag.o util.o \
d39 1
a39 1
imageheader.h:
d56 1
a56 1
samplefile.h: oprofiledb.h util.h
a68 3

util.o: util.h util.cc
util.h: 
@


1.2
log
@Add OProfile-0.8 patches
@
text
@d6 1
a6 1
CFLAGS += -g -Wall 
d12 2
a13 1
OTHER_LIBS = $(BFD_LIBRARY)
@


1.1
log
@Initial contribution
@
text
@d4 1
a4 1
# Copyright (c) 2003, Red Hat, Inc.
d6 1
a6 1
CFLAGS += -g -Wall
d18 3
a20 2
			session.o samplefile.o sfheader.o opinfo.o \
			xmlfmt.o xmlbuf.o xmltag.o util.o
d35 1
a35 1
tst.o:  session.h samplefile.h tst.cc
d37 5
a41 1
opxml.o: oxmlstream.h opinfo.h session.h samplefile.h opxml.cc
d44 3
d48 2
a49 1
stable.o: stable.h symbol.h stable.cc
d51 2
a52 1
symbol.o: symbol.h symbol.cc
d54 2
a55 1
sample.o: symbol.h sample.h sample.cc
d57 2
a58 1
session.o: session.h samplefile.h util.h session.cc
d60 2
a61 1
samplefile.o: samplefile.h sfheader.h stable.h xmlfmt.h sample.h oprofiledb.h util.h samplefile.cc
d63 2
a64 1
sfheader.o: xmlfmt.h sfheader.h sfheader.cc
d66 2
a67 1
opinfo.o: opinfo.h opinfo.cc
d69 2
a70 1
xmlfmt.o: xmlbuf.h xmlfmt.h xmlfmt.cc
d73 4
d79 1
@

