From: Philippe E. <ph...@us...> - 2002-11-08 23:40:35
|
Update of /cvsroot/oprofile/oprofile/pp In directory usw-pr-cvs1:/tmp/cvs-serv6227/pp Modified Files: samples_file.cpp Log Message: check than samples files version match expected version fixing #635759 cheers, Phil Index: samples_file.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/samples_file.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- samples_file.cpp 12 Oct 2002 16:10:09 -0000 1.21 +++ samples_file.cpp 8 Nov 2002 23:40:32 -0000 1.22 @@ -10,7 +10,7 @@ */ #include "op_file.h" - +#include "op_config.h" #include "op_events.h" #include "op_events_desc.h" #include "op_print_event.h" @@ -32,6 +32,14 @@ : start_offset(0) { db_open(&db_tree, filename.c_str(), DB_RDONLY, sizeof(struct opd_header)); + + opd_header const & head = header(); + if (head.version != OPD_VERSION) { + cerr << "oprofpp: samples files version mismatch, are you " + "running a daemon and post-profile tools with version " + "mismatch ?" << endl; + exit(EXIT_FAILURE); + } } samples_file_t::~samples_file_t() |