From: John L. <mov...@us...> - 2002-06-04 16:47:11
|
Update of /cvsroot/oprofile/oprofile/libop++ In directory usw-pr-cvs1:/tmp/cvs-serv18227/libop++ Added Files: .cvsignore Makefile.in op_print_event.cpp op_print_event.h Log Message: More refactoring (start libop++) --- NEW FILE: .cvsignore --- Makefile .deps --- NEW FILE: Makefile.in --- include ../make.common HEADERS=op_print_event.h SOURCES=op_print_event.cpp OBJECTS=op_print_event.o TARGET=libop++.a all: $(TARGET) install: uninstall: clean: rm -rf .deps $(OBJECTS) $(TARGET) $(TARGET): $(OBJECTS) $(AR) cr $@ $^ include ../make.deps --- NEW FILE: op_print_event.cpp --- /** * @file op_print_event.cpp * Output a header describing a perf counter event * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author John Levon <mo...@co...> * @author Philippe Elie <ph...@wa...> */ #include "op_print_event.h" #include "op_events_desc.h" #include <iostream> #include <iomanip> using std::ostream; using std::endl; using std::setw; using std::setfill; void op_print_event(ostream & out, int counter_nr, op_cpu cpu_type, u8 type, u8 um, u32 count) { char * typenamep; char * typedescp; char * umdescp; op_get_event_desc(cpu_type, type, um, &typenamep, &typedescp, &umdescp); out << "Counter " << counter_nr << " counted " << typenamep << " events (" << typedescp << ")"; if (cpu_type != CPU_RTC) { out << " with a unit mask of 0x" << hex << setw(2) << setfill('0') << unsigned(um) << " (" << (umdescp ? umdescp : "Not set") << ")"; } out << " count " << dec << count << endl; } --- NEW FILE: op_print_event.h --- /** * @file op_print_event.h * Output a header describing a perf counter event * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author John Levon <mo...@co...> * @author Philippe Elie <ph...@wa...> */ #ifndef OP_PRINT_EVENT_H #define OP_PRINT_EVENT_H #include <iosfwd> #include "op_types.h" #include "op_interface.h" /** * Output a description of the given event paramters * to the stream. */ void op_print_event(std::ostream & out, int counter_nr, op_cpu cpu_type, u8 type, u8 um, u32 count); #endif // OP_PRINT_EVENT |